History log of /linux-master/drivers/hwmon/asc7621.c
Revision Date Author Comments
# 1975d167 05-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

hwmon: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230505131718.1210071-1-u.kleine-koenig@pengutronix.de
[groeck: Added missing change in pmbus/acbel-fsg032.c]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# f2f394db 18-Aug-2022 Wolfram Sang <wsa+renesas@sang-engineering.com>

hwmon: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220818210014.6769-1-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# ed5c2f5f 15-Aug-2022 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

i2c: Make remove callback return void

The value returned by an i2c driver's remove function is mostly ignored.
(Only an error message is printed if the value is non-zero that the
error is ignored.)

So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.

Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com>
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/*
Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5
Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio
Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860
Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b
Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes
Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power
Acked-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>


# 952a11ca 24-Sep-2021 Paul Fertser <fercerpav@gmail.com>

hwmon: cleanup non-bool "valid" data fields

We have bool so use it consistently in all the drivers.

The following Coccinelle script was used:

@@
identifier T;
type t = { char, int };
@@
struct T {
...
- t valid;
+ bool valid;
...
}

@@
identifier v;
@@
(
- v->valid = 0
+ v->valid = false
|
- v->valid = 1
+ v->valid = true
)

followed by sed to fixup the comments:
sed '/bool valid;/{s/!=0/true/;s/zero/false/}'

Few whitespace changes were fixed manually. All modified drivers were
compile-tested.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Link: https://lore.kernel.org/r/20210924195202.27917-1-fercerpav@gmail.com
[groeck: Fixed up 'u8 valid' to 'boool valid' in atxp1.c]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 7dedb79d 13-Aug-2020 Stephen Kitt <steve@sk2.org>

hwmon: (asc7621) use simple i2c probe

This driver doesn't use the id information provided by the old i2c
probe function, so it can trivially be converted to the simple
("probe_new") form.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20200813162544.1516647-1-steve@sk2.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 74ba9207 20-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
675 mass ave cambridge ma 02139 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 441 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a3bdc5b5 18-Oct-2017 Colin Ian King <colin.king@canonical.com>

hwmon: (asc7621) remove redundant assignment to newval

The setting of newval to zero is redundant as the following if/else
stanzas will always update newval to a new value. Remove the
redundant setting, cleans up clang build warning:

drivers/hwmon/asc7621.c:582:2: warning: Value stored to 'newval' is
never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 69301258 30-Aug-2017 Colin Ian King <colin.king@canonical.com>

hwmon: (asc7621) make several arrays static const

Don't populate the arrays on the stack, instead make them static.
Makes the object code smaller by over 950 bytes:

Before:
text data bss dec hex filename
26144 18768 352 45264 b0d0 drivers/hwmon/asc7621.o

After:
text data bss dec hex filename
25029 18928 352 44309 ad15 drivers/hwmon/asc7621.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 7a7176aa 15-Jul-2014 Axel Lin <axel.lin@ingics.com>

hwmon: (asc7621) Make map tables const

Map tables are never changed, so it is safe to make them const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: George Joseph <george.joseph@fairview5.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 6cf0a91e 04-Apr-2014 Jean Delvare <jdelvare@suse.de>

hwmon: Avoid initializing the same field twice

All hwmon drivers allocate their data structure with some form of
kzalloc, so setting data fields to zero explicitly is a waste of time.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>


# a0393713 29-Mar-2013 Guenter Roeck <linux@roeck-us.net>

hwmon: Remove unnecessary semicolons

Semicolons after closing } of conditional blocks are not needed
and can be removed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <khali@linux-fr.org>


# 088ce2ac 13-Mar-2013 Guenter Roeck <linux@roeck-us.net>

hwmon: Fix CamelCase checkpatch warnings

Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 2a844c14 09-Jan-2013 Guenter Roeck <linux@roeck-us.net>

hwmon: Replace SENSORS_LIMIT with clamp_val

SENSORS_LIMIT and the generic clamp_val have the same functionality,
and clamp_val is more efficient.

This patch reduces text size by 9052 bytes and bss size by 11624 bytes
for x86_64 builds.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: George Joseph <george.joseph@fairview5.com>
Acked-by: Jean Delvare <khali@linux-fr.org>


# 35bb95a1 02-Jun-2012 Guenter Roeck <linux@roeck-us.net>

hwmon: (asc7621) Convert to use devm_ functions

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

Cc: George Joseph <george.joseph@fairview5.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: George Joseph <george.joseph@fairview5.com>


# 3c56b066 19-Jan-2012 Guenter Roeck <linux@roeck-us.net>

hwmon: (asc7621) Fix multi-line comments

Cc: George Joseph <george.joseph@fairview5.com>
Acked-by: George Joseph <george.joseph@fairview5.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 179c4fdb 04-Jan-2012 Frans Meulenbroeks <fransmeulenbroeks@gmail.com>

hwmon: replaced strict_str* with kstr*

replaced strict_strtol with kstrtol and
replaced strict_strtuol with kstrtuol

This satisfies checkpatch -f
Compile tested only: no warnings or errors given

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>


# 918ee91c 28-Oct-2010 Jean Delvare <khali@linux-fr.org>

hwmon: I2C addresses are constant

We can mark normal_i2c const. Almost all drivers do that already, so
fix the 3 remaining ones before they are used as (bad) examples for
new drivers.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: George Joseph <george.joseph@fairview5.com>
Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>


# 28cbd461 14-Aug-2010 Jean Delvare <khali@linux-fr.org>

hwmon: (asc7621) Clean up and improve detect function

* The dev variable is never used.
* Detect functions only need to set info->type, not client->name.
* Include the device address in the log message.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: George Joseph <george.joseph@fairview5.com>
Cc: Ken Milmore <ken.milmore@googlemail.com>


# fbae3fb1 03-Jun-2010 Wolfram Sang <wsa@kernel.org>

i2c: Remove all i2c_set_clientdata(client, NULL) in drivers

I2C drivers can use the clientdata-pointer to point to private data. As I2C
devices are not really unregistered, but merely detached from their driver, it
used to be the drivers obligation to clear this pointer during remove() or a
failed probe(). As a couple of drivers forgot to do this, it was agreed that it
was cleaner if the i2c-core does this clearance when appropriate, as there is
no guarantee for the lifetime of the clientdata-pointer after remove() anyhow.
This feature was added to the core with commit
e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers.

As there is no need anymore to clear the clientdata-pointer, remove all current
occurrences in the drivers to simplify the code and prevent confusion.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Richard Purdie <rpurdie@linux.intel.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jean Delvare <khali@linux-fr.org>


# d1bf8cf6 11-May-2010 Ken Milmore <ken.milmore@googlemail.com>

hwmon: (asc7621) Bug fixes

* Allow fan minimum RPM to be set to zero without triggering alarms.
* Fix voltage scaling arithmetic and correct scale factors.
* Correct fan1-fan4 alarm bit shifts.
* Correct register address for temp3_smoothing_enable.
* Read the alarm registers with high priority.

Signed-off-by: Ken Milmore <ken.milmore@googlemail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>


# d58de038 05-Mar-2010 George Joseph <george.joseph@fairview5.com>

hwmon: Driver for Andigilog aSC7621 family monitoring chips

Hwmon driver for Andigilog aSC7621 family monitoring chips.

Signed-off-by: George Joseph <george.joseph@fairview5.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>