Skip to content

iio: adc: ltc2309: add support for LTC2305#3171

Open
cjones-adi wants to merge 3 commits intoanalogdevicesinc:mainfrom
cjones-adi:dev/ltc2305
Open

iio: adc: ltc2309: add support for LTC2305#3171
cjones-adi wants to merge 3 commits intoanalogdevicesinc:mainfrom
cjones-adi:dev/ltc2305

Conversation

@cjones-adi
Copy link

PR Description

The LTC2305 is a 2-channel, 12-bit, fast ADC with an I2C interface, compatible with the LTC2309 (which has 8 channels).

This patch adds support for the LTC2305 by introducing a chip_info structure to handle the different channel configurations between the two variants. The LTC2305 exposes 2 single-ended channels and 2 differential combinations.

Also updates the device tree bindings to include the lltc,ltc2305 compatible string and documents it in the Kconfig.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

Copy link
Collaborator

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! no changes necessary to the patch series
Can you submit upstream using the b4 tool? You have to add a cover letter that is pretty much the pull request description.
https://analogdevicesinc.github.io/linux/contribute.html

please base on top of the current jic23/iio/testing or tag Linux 7.0-rc1

If you have issues, don't hesitate to ask for help

Copy link
Collaborator

@nunojsa nunojsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments. You can take them and send it upstream as mentioned

Say yes here to build support for Linear Technology LTC2309, a low
noise, low power, 8-channel, 12-bit SAR ADC
Say yes here to build support for Linear Technology LTC2305 and
LTC2309, low noise, low power, 2-/8-channel, 12-bit SAR ADCs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just go with LTC2309 and similar low noise, low power SAR ADCs. Like this it does not scale too much

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've revised as advised. I also applied same change in the title of the affected yaml file.


MODULE_AUTHOR("Liam Beguin <liambeguin@gmail.com>");
MODULE_DESCRIPTION("Linear Technology LTC2309 ADC");
MODULE_DESCRIPTION("Linear Technology LTC2305/LTC2309 ADC");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've revised as advised.

.num_channels = ARRAY_SIZE(ltc2305_channels),
.read_delay_us = 2,
},
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferred way in IIO is to have a variable per chip. Not an array. Also adding the chip_info struct could (and should) be a preparatory patch.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted and thanks. Added the preparatory patch and separated the array into their own variables.


chip_info = i2c_get_match_data(client);
if (!chip_info)
return -ENODEV;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no way for the above to happen. If I'm not mistake last decision on this was to not do any error check.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted and done. Thanks.

This is a preparatory patch that introduces a chip_info structure
to the LTC2309 driver to facilitate adding support for additional
chip variants with different channel configurations and timing
requirements.

The chip_info structure contains chip-specific data including
the channel specifications, number of channels, and read delay
timing. This change does not modify the existing LTC2309
functionality.

Signed-off-by: Carlos Jones <carlosjr.jones@analog.com>
Add support for the LTC2305 2-channel, 12-bit ADC to the existing
LTC2497 device tree bindings. The LTC2305 is compatible with the
LTC2309 driver implementation.

Signed-off-by: Carlos Jones <carlosjr.jones@analog.com>
The LTC2305 is a 2-channel, 12-bit, fast ADC with an I2C interface,
compatible with the LTC2309 (which has 8 channels).

This patch adds support for the LTC2305 by using the chip_info
structure to handle the different channel configurations between the
two variants. The LTC2305 exposes 2 single-ended channels and 2
differential combinations.

The LTC2305 requires a 1.6μs delay between I2C write and read
operations, which is implemented using chip-specific timing to avoid
affecting existing LTC2309 functionality.

Signed-off-by: Carlos Jones <carlosjr.jones@analog.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants