1
0
Fork 0

MLK-11476 iio: adc: Enable i.MX6SX adc driver.

Enable i.MX6SX adc driver. ADC driver will try getting ADC controller
channel number via device tree, because i.MX chip enable 4 channels
on each controller.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
(cherry picked from commit 14a6a98f64e26702b1c0ecfc7d58a45ee5752d54)
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
5.4-rM2-2.2.x-imx-squashed
Luwei Zhou 2014-03-06 15:47:47 +08:00 committed by Dong Aisheng
parent 219d54332a
commit 0ee9f9d5e3
1 changed files with 7 additions and 1 deletions

View File

@ -805,6 +805,7 @@ static int vf610_adc_probe(struct platform_device *pdev)
struct resource *mem;
int irq;
int ret;
u32 channels;
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct vf610_adc));
if (!indio_dev) {
@ -861,13 +862,18 @@ static int vf610_adc_probe(struct platform_device *pdev)
init_completion(&info->completion);
ret = of_property_read_u32(pdev->dev.of_node,
"num-channels", &channels);
if (ret)
channels = ARRAY_SIZE(vf610_adc_iio_channels);
indio_dev->name = dev_name(&pdev->dev);
indio_dev->dev.parent = &pdev->dev;
indio_dev->dev.of_node = pdev->dev.of_node;
indio_dev->info = &vf610_adc_iio_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = vf610_adc_iio_channels;
indio_dev->num_channels = ARRAY_SIZE(vf610_adc_iio_channels);
indio_dev->num_channels = (int)channels;
ret = clk_prepare_enable(info->clk);
if (ret) {