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)
pull/10/head
Luwei Zhou 2014-03-06 15:47:47 +08:00 committed by Jason Liu
parent bae235b0fe
commit 0a84a721c0
1 changed files with 8 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/*
* Freescale Vybrid vf610 ADC driver
*
* Copyright 2013 Freescale Semiconductor, Inc.
* Copyright 2013-2015 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -819,6 +819,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) {
@ -877,13 +878,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) {