1
0
Fork 0
Commit Graph

8 Commits (redonkable)

Author SHA1 Message Date
Arvind Yadav 33d62d11c3 hwmon: (adc128d818) constify attribute_group structures.
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work with const
attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   2304	   2936	      0	   5240	   1478	drivers/hwmon/adc128d818.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   2344	   2872	      0	   5216	   1460	drivers/hwmon/adc128d818.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-08-13 08:24:38 -07:00
Javier Martinez Canillas d593e665f3 hwmon: (adc128d818) Add OF device ID table
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-02 07:01:53 -07:00
Alexander Koch c72eeabd0c hwmon: (adc128d818) Preserve operation mode
Preserve chip operation mode if no mode is specified via devicetree. This
enables operation when chip configuration is done by BIOS/ROMMON.

Signed-off-by: Alexander Koch <mail@alexanderkoch.net>
Acked-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10 09:15:00 -08:00
Alexander Koch 4e1796c892 hwmon: (adc128d818) Support operation modes 1-3
Add support for operation modes 1-3 of the ADC128D818 (see datasheet sec.
8.4.1). These differ in the number and type of the available input signals,
requiring the driver to selectively hide sysfs nodes according to the
operation mode configured via devicetree.

Signed-off-by: Alexander Koch <mail@alexanderkoch.net>
Acked-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10 09:11:41 -08:00
Alexander Koch a45923c27d hwmon: (adc128d818) Implement mode selection via dt
Implement operation mode selection using the optional 'ti,mode' devicetree
property (see [1]). The ADC128D818 supports four operation modes differing
in the number and type of input readings (see datasheet, sec. 8.4.1), of
which mode 0 is the default.

We only add handling of the 'ti,mode' property here, the driver still
supports nothing else than the default mode 0.

[1] Documentation/devicetree/bindings/hwmon/adc128d818.txt

Signed-off-by: Alexander Koch <mail@alexanderkoch.net>
Acked-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-10 09:09:18 -08:00
Rasmus Villemoes 2c3b1189fd hwmon: (adc128d818) Do proper sign extension
data->temp[index] has type s16. Because of C's promotion rules,
(data->temp[index] << 7) >> 7 is exactly the same as
data->temp[index]. The intention was to use bit 8 as a sign bit, so do
that using the existing API.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-01-25 21:24:00 -08:00
Guenter Roeck 7fe7381cbd hwmon: (adc128d818) Drop write support on inX_input attributes
Writes into input registers doesn't make sense, even more so since
the writes actually ended up writing into the maximum limit registers.
Drop it.

Cc: stable@vger.kernel.org
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-07-07 09:48:23 -07:00
Guenter Roeck b4c9c1a798 hwmon: Driver for TI ADC128D818
ADC128D818 is a System Monitor with Temperature Sensor. It is similar to LM80
and LM96080, but has 16 bit wide sensor registers and no fan speed monitoring.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03 08:01:04 -08:00