aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/mcp3422.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-08-22iio:adc: drop assign iio_info.driver_module and iio_trigger_ops.ownerJonathan Cameron1-1/+0
The equivalent of both of these are now done via macro magic when the relevant register calls are made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-07-02iio: adc: mcp3422: Checking for error on probeAngelo Compagnucci1-1/+3
Some part of the configuration are not touched after the probe and if something goes wrong on writing the initial one, the chip will misbehave. Adding an error checking ensures that the inital configuration will be written correctly. Moreover ensures that a sensible configuration will be saved in driver data and used subsequently as intended. Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Reported-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-07-02iio: adc: mcp3422: Changing initial channelAngelo Compagnucci1-1/+1
Initial channel should be the first available channel on all configurations, so changing to channel 0 available on all supported chips. Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Reported-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: adc: add missing of_node references to iio_devMatt Ranostay1-0/+1
Adding missing indio_dev->dev.of_node references to allow iio consumers to access the device channels. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-04-16iio: adc: mcp3422: remove spaces before commaSlawomir Stepien1-3/+3
This fixes the error reported by checkpatch.pl: ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: Slawomir Stepien <sst@poczta.fm> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-27iio: convert to common i2c_check_functionality() return valueMatt Ranostay1-1/+1
Previously most drivers that used a i2c_check_functionality() check condition required various error codes on failure. This patchset converts to a standard of -EOPNOTSUPP Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-02iio: adc: mcp3422: Add support for MCP3425Akinobu Mita1-2/+5
The MCP3425 is a single channel up to 16-bit A/D converter which has features: - On-Board Programmable Gain Amplifier (PGA): - Gains of 1, 2, 4 or 8 - Programmable Data Rate Options: - 15 SPS (16 bits), 60 SPS (14 bits), 240 SPS (12 bits) The mcp3422 driver also supports the MCP3421 which is a single channel. So we can support MCP3425 with a little changes to mcp3422 driver. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com> Cc: Peter Meerwald <pmeerw@pmeerw.net> Cc: linux-iio@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-12-02iio: adc: mcp3422: Add mcp3421 supportSascha Hauer1-0/+9
The mcp3421 is the single channel variant of the mcp342x family. Support is straight forward, only the channels array has to be added for this chip. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-07-11iio: Drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-04iio:adc:mcp3422 Fix incorrect scales tableAngelo Compagnucci1-13/+4
This patch fixes uncorrect order of mcp3422_scales table, the values was erroneously transposed. It removes also an unused array and a wrong comment. Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Cc: Stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-03-16Add support for Microchip Technology's MCP3426/7/8 ADCAngelo Compagnucci1-5/+28
This patch extends previous mcp3422 driver to support missing members of the family, mcp3426/7/8. Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-12-02Merge v3.13-rc2 into staging-nextGreg Kroah-Hartman1-4/+4
we want these fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-24iio: adc: mcp3422: Use devm_iio_device_registerSachin Kamat1-8/+1
devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-05iio: Fix sign extension table in mcp3422 driverPeter Meerwald1-4/+4
the index argument to sign_extend32() gives the bit position (from 0) to the sign bit so e.g. if the measurement has 16-bit resolution, we need to pass 15; a measurement of 0x8000 should be reported as -32768, not 32768 Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-10-18iio: adc: mcp3422: Include linux/of.h headerSachin Kamat1-0/+1
'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-07iio: adc: Add driver for Microchip MCP3422/3/4 high resolution ADCAngelo Compagnucci1-0/+409
Sysfs access to all channels. Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>