Skip to content

Commit 0f466c9

Browse files
committed
iio: adc: ad4170: Initial support for AD4190
Initial support for AD4190. Same functionality as AD4170 but displays different name. Signed-off-by: Marcelo Schmitt <[email protected]>
1 parent 3128e54 commit 0f466c9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/iio/adc/ad4170.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -2132,6 +2132,7 @@ static int ad4170_probe(struct spi_device *spi)
21322132
struct device *dev = &spi->dev;
21332133
struct iio_dev *indio_dev;
21342134
struct ad4170_state *st;
2135+
const char *compat;
21352136
int ret;
21362137

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

2145-
indio_dev->name = AD4170_NAME;
2146+
ret = device_property_read_string(dev, "compatible", &compat);
2147+
if (ret)
2148+
return dev_err_probe(dev, ret, "Failed read device name\n");
2149+
2150+
indio_dev->name = compat;
21462151
indio_dev->modes = INDIO_DIRECT_MODE;
21472152
indio_dev->info = &ad4170_info;
21482153

@@ -2206,6 +2211,7 @@ static int ad4170_probe(struct spi_device *spi)
22062211
static const struct of_device_id ad4170_of_match[] = {
22072212
{
22082213
.compatible = "adi,ad4170",
2214+
.compatible = "adi,ad4190",
22092215
},
22102216
{ }
22112217
};

0 commit comments

Comments
 (0)