History log of /linux-master/drivers/hwmon/gsc-hwmon.c
Revision Date Author Comments
# a6d80df4 06-Jun-2023 Tim Harvey <tharvey@gateworks.com>

hwmon: (gsc-hwmon) fix fan pwm temperature scaling

The GSC fan pwm temperature register is in centidegrees celcius but the
Linux hwmon convention is to use milidegrees celcius. Fix the scaling.

Fixes: 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://lore.kernel.org/r/20230606153004.1448086-1-tharvey@gateworks.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 59882c7f 20-Nov-2022 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

hwmon: (gsc-hwmon) Switch to flexible array to simplify code

Using flexible array is more straight forward. It
- saves 1 pointer in the 'gsc_hwmon_platform_data' structure
- saves an indirection when using this array
- saves some LoC and avoids some always spurious pointer arithmetic

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/61a23e1d642397cfcecc4ac3bb0ab485d257987d.1668936855.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 7f62cf78 16-Sep-2022 Liang He <windhl@126.com>

hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API

In gsc_hwmon_get_devtree_pdata(), we should call of_node_get() before
the of_find_compatible_node() which will automatically call
of_node_put() for the 'from' argument.

Fixes: 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")
Signed-off-by: Liang He <windhl@126.com>
Co-developed-by: Mengda Chen <chenmengda2009@163.com>
Signed-off-by: Mengda Chen <chenmengda2009@163.com>
Link: https://lore.kernel.org/r/20220916154708.3084515-1-chenmengda2009@163.com
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# b674bcb1 16-Jun-2022 Liang He <windhl@126.com>

hwmon: (gsc-hwmon) Add missing of_node_put()

In gsc_hwmon_get_devtree_pdata(), of_find_compatible_node() will return
a node pointer with refcount incremented. We should use of_node_put() in
fail path or when it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220616114024.3985770-1-windhl@126.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 7497d4a6 27-Aug-2020 Tim Harvey <tharvey@gateworks.com>

hwmon: (gsc-hwmon) add fan sensor

Add a fan sensor to report RPM's from a fan tach input.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# c1ae18d3 27-Aug-2020 Tim Harvey <tharvey@gateworks.com>

hwmon: (gsc-hwmon) Scale temperature to millidegrees

The GSC registers report temperature in decidegrees celcius so we
need to scale it to represent the hwmon sysfs API of millidegrees.

Cc: stable@vger.kernel.org
Fixes: 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://lore.kernel.org/r/1598548824-16898-1-git-send-email-tharvey@gateworks.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# a4872f7a 09-Jun-2020 Tim Harvey <tharvey@gateworks.com>

hwmon: (gsc) add 16bit pre-scaled voltage mode

add a 16-bit pre-scaled voltage mode to adc and clarify that existing
pre-scaled mode is 24bit.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/1591714640-10332-3-git-send-email-tharvey@gateworks.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 3bce5377 15-May-2020 Tim Harvey <tharvey@gateworks.com>

hwmon: Add Gateworks System Controller support

The Gateworks System Controller has a hwmon sub-component that exposes
up to 16 ADC's, some of which are temperature sensors, others which are
voltage inputs. The ADC configuration (register mapping and name) is
configured via device-tree and varies board to board.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>