summaryrefslogtreecommitdiff
path: root/drivers/hwmon/mcp3021.c
AgeCommit message (Collapse)AuthorFilesLines
2015-07-01hwmon: (mcp3021) Fix broken output scalingStevens, Nick1-13/+1
The mcp3021 scaling code is dividing the VDD (full-scale) value in millivolts by the A2D resolution to obtain the scaling factor. When VDD is 3300mV (the standard value) and the resolution is 12-bit (4096 divisions), the result is a scale factor of 3300/4096, which is always one. Effectively, the raw A2D reading is always being returned because no scaling is applied. This patch fixes the issue and simplifies the register-to-volts calculation, removing the unneeded "output_scale" struct member. Signed-off-by: Nick Stevens <Nick.Stevens@digi.com> Cc: stable@vger.kernel.org # v3.10+ [Guenter Roeck: Dropped unnecessary value check] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-08-12hwmon: use dev_get_platdata()Jingoo Han1-3/+4
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-09-24hwmon: (mcp3021) Add MCP3221 supportSven Schuchmann1-3/+18
This Patch adds support for mcp3221 chip to the mcp3021 driver. Signed-off-by: Sven Schuchmann <schuchmann@schleissheimer.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-09-24hwmon: (mcp3021) Prepare MCP3021 driver to support other chipsSven Schuchmann1-7/+26
This Patch is to prepare the MCP3021 driver to support other chips like the MCP3221. The hard defined chip data is now stored within the data struct of each chip. Signed-off-by: Sven Schuchmann <schuchmann@schleissheimer.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-09-24hwmon: (mcp3021) Convert to use devm_ functionsGuenter Roeck1-10/+5
Convert to use devm_ functions to reduce code size and simplify the code. Cc: Mingkai Hu <Mingkai.hu@freescale.com> Cc: Xie Xiaobo <X.Xie@freescale.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-03-23hwmon: Add MCP3021 ADC driverXie Xiaobo1-0/+171
Add I2C driver for MCP3021 that is an ADC chip from Microchip. The MCP3021 is a successive approximation A/D converter (ADC) with 10-bit resolution. The driver export the value of Vin to sysfs, the voltage unit is mV. Through the sysfs interface, lm-sensors tool can also display Vin voltage. Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com> Signed-off-by: Xie Xiaobo <X.Xie@freescale.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>