Skip to content

Commit

Permalink
iio: adc: ad4170: Initial support for AD4190
Browse files Browse the repository at this point in the history
Initial support for AD4190. Same functionality as AD4170 but displays
different name.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
  • Loading branch information
machschmitt committed Dec 6, 2024
1 parent 3128e54 commit 0f466c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/iio/adc/ad4170.c
Original file line number Diff line number Diff line change
Expand Up @@ -2132,6 +2132,7 @@ static int ad4170_probe(struct spi_device *spi)
struct device *dev = &spi->dev;
struct iio_dev *indio_dev;
struct ad4170_state *st;
const char *compat;
int ret;

indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
Expand All @@ -2142,7 +2143,11 @@ static int ad4170_probe(struct spi_device *spi)
mutex_init(&st->lock);
st->spi = spi;

indio_dev->name = AD4170_NAME;
ret = device_property_read_string(dev, "compatible", &compat);
if (ret)
return dev_err_probe(dev, ret, "Failed read device name\n");

indio_dev->name = compat;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &ad4170_info;

Expand Down Expand Up @@ -2206,6 +2211,7 @@ static int ad4170_probe(struct spi_device *spi)
static const struct of_device_id ad4170_of_match[] = {
{
.compatible = "adi,ad4170",
.compatible = "adi,ad4190",
},
{ }
};
Expand Down

0 comments on commit 0f466c9

Please sign in to comment.