diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2013-11-05 17:44:09 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2013-11-05 17:44:09 +0100 |
commit | ec0f9c52c0cf3ed7318fbaa3e6e2fc80c9433034 (patch) | |
tree | 31a87bbf5c02d82ef069abdb1d04a9bf18bf279a /drivers | |
parent | e5cb84471bc3d38ef5d8070abbdf0bc0ceb9d2bf (diff) |
mvf_adc: support all 32 channels
Enable support for all 32 ADC channels, even the internal one. This
is needed to read out the internal temperature since the sensor is
at channel 26.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/mvf_adc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/misc/mvf_adc.c b/drivers/misc/mvf_adc.c index f65e82fbbb64..5935d507451a 100644 --- a/drivers/misc/mvf_adc.c +++ b/drivers/misc/mvf_adc.c @@ -70,7 +70,7 @@ struct data { bool flag; }; -struct data data_array[7]; +struct data data_array[32]; #define adc_dbg(_adc, msg...) dev_dbg(&(_adc)->pdev->dev, msg) @@ -548,9 +548,11 @@ static long adc_ioctl(struct file *file, unsigned int cmd, return -ENOTTY; if (copy_from_user(&feature, (struct adc_feature *)argp, - sizeof(feature))) { + sizeof(feature))) return -EFAULT; - } + + if (feature.channel > 31) + return -EINVAL; switch (cmd) { case ADC_INIT: |