Current code uses data_rate as array index in ads1015_read_adc() and uses pga
as array index in ads1015_reg_to_mv, so we must make sure both data_rate and
pga settings are in valid value range.
Return -EINVAL if the setting is out-of-range.
Signed-off-by: Axel Lin <[email protected]>
Cc: [email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Current code uses channel as array index, so the valid channel value is
0 .. ADS1015_CHANNELS - 1.
Signed-off-by: Axel Lin <[email protected]>
Cc: [email protected]
Signed-off-by: Guenter Roeck <[email protected]>
This patch adds support for ads1115 device to ads1015 driver.
Based on work of Emiliano Carnati <carnatiatebneuro.com>.
Tested on ARM CPU based board.
Signed-off-by: Evgeniy A. Dushistov <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Dirk Eibach <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
The following build warning is seen in some configurations.
drivers/hwmon/ads1015.c: In function 'show_in':
drivers/hwmon/ads1015.c:129: warning: 'in' may be used uninitialized in this function
Fix by separating the register read function from the code converting the result
into mV.
Signed-off-by: Guenter Roeck <[email protected]>
Cc: Dirk Eibach <[email protected]>
Reviewed-by: Robert Coulson <[email protected]>
An error while creating sysfs attribute files in the driver's probe function
results in an error abort, but already created files are not removed. This patch
fixes the problem.
Signed-off-by: Guenter Roeck <[email protected]>
Cc: [email protected] # 3.0+
Cc: Dirk Eibach <[email protected]>
Acked-by: Jean Delvare <[email protected]>
Make use of the new i2c_smbus_{read,write}_word_swapped functions.
This makes the driver code more compact and readable. It also ensures
proper error handling.
Signed-off-by: Jean Delvare <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Acked-by: Guenter Roeck <[email protected]>
Cc: Dirk Eibach <[email protected]>
Cc: "Mark M. Hoffman" <[email protected]>
Cc: Guillaume Ligneul <[email protected]>
Configuration for ads1015 gain and datarate is possible via
devicetree or platform data.
This is a followup patch to previous ads1015 patches on Jean Delvares
tree.
Signed-off-by: Dirk Eibach <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>