History log of /drivers/hwmon/ads1015.c
Revision Date Author Comments
8e35762fd5f2b074cff3e5c176c80008c70cc8f3 05-Aug-2014 Axel Lin <axel.lin@ingics.com> hwmon: (ads1015) Use of_property_read_u32 at appropriate places

Simplify the code a bit and also improve readability.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
e981429557cbe10c780fab1c1a237cb832757652 05-Aug-2014 Axel Lin <axel.lin@ingics.com> hwmon: (ads1015) Fix out-of-bounds array access

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 <axel.lin@ingics.com>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
56de1377ad92f72ee4e5cb0faf7a9b6048fdf0bf 30-Jul-2014 Axel Lin <axel.lin@ingics.com> hwmon: (ads1015) Fix off-by-one for valid channel index checking

Current code uses channel as array index, so the valid channel value is
0 .. ADS1015_CHANNELS - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
60c1f31fc5dfdbef388f47739e14c3cd85ad17e2 01-Aug-2013 Evgeniy Dushistov <dushistov@mail.ru> hwmon: (ads1015) Add support for ADS1115

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 <dushistov@mail.ru>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
57457e314eefc7bce93854918a234e4ac9a52922 02-Jun-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (ads1015) Convert to use devm_ functions

Convert to use devm_ functions to reduce code size and simplify the code.

Cc: Dirk Eibach <eibach@gdsys.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1196573fe493aeeb826468157313ee84ffbc59f3 09-Apr-2012 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (ads1015) Fix build warning

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 <guenter.roeck@ericsson.com>
Cc: Dirk Eibach <eibach@gdsys.de>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
f0967eea80ec2a19a4fe1ad27e3ff1b22c79a3c7 20-Jan-2012 Axel Lin <axel.lin@gmail.com> hwmon: convert drivers/hwmon/* to use module_i2c_driver()

This patch converts the drivers in drivers/hwmon/* to use the
module_i2c_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
Cc: David George <david.george@ska.ac.za>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
363434b5dc352464ac7601547891e5fc9105f124 22-Feb-2012 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (ads1015) Fix file leak in probe function

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 <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Cc: Dirk Eibach <eibach@gdsys.de>
Acked-by: Jean Delvare <khali@linux-fr.org>
90f4102ce59226954edbe960b2434d8b3da5f086 04-Nov-2011 Jean Delvare <khali@linux-fr.org> hwmon: Use i2c_smbus_{read,write}_word_swapped

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 <khali@linux-fr.org>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
c0046867f34bb81ec3f237ebbc5241ae678b8379 21-Mar-2011 Dirk Eibach <eibach@gdsys.de> hwmon: (ads1015) Make gain and datarate configurable

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 <eibach@gdsys.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
fdf241a8ed93236915c70717a4b6dfb856274496 21-Mar-2011 Jean Delvare <khali@linux-fr.org> hwmon: (ads1015) Drop dynamic attribute group

It is cheaper to handle attributes individually.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Dirk Eibach <eibach@gdsys.de>
8c22a8f57516275afcd81c84f3724ac08cf6aa7b 21-Mar-2011 Dirk Eibach <eibach@gdsys.de> hwmon: Add support for Texas Instruments ADS1015

Signed-off-by: Dirk Eibach <eibach@gdsys.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>