16 Apr, 2019
1 commit
-
If CONFIG_OF is not enabled, the following build warning is observed.
drivers/hwmon/adt7475.c:171:34: warning:
‘adt7475_of_match’ defined but not usedMark adt7475_of_match as __maybe_unused to fix the problem.
Signed-off-by: Guenter Roeck
17 Dec, 2018
1 commit
-
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code,
to improve readbility, and to reduce the chance of inconsistencies.Also replace any remaining S_ in the driver with octal values.
The conversion was done automatically with coccinelle. The semantic patches
and the scripts used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches/hwmon/.This patch does not introduce functional changes. It was verified by
compiling the old and new files and comparing text and data sizes.Signed-off-by: Guenter Roeck
27 Aug, 2018
2 commits
-
The adt7475_read_word() function was meant to return negative error
codes on failure.Signed-off-by: Dan Carpenter
Reviewed-by: Tokunori Ikegami
Signed-off-by: Guenter Roeck -
The adt7475_update_device() function returns error pointers. The
problem is that in show_pwmfreq() we dereference it before the check.
And then in pwm_use_point2_pwm_at_crit_show() there isn't a check at
all. I don't know if it's required, but it silences a static checker
warning and it's doesn't hurt anything to check.Signed-off-by: Dan Carpenter
Reviewed-by: Tokunori Ikegami
Signed-off-by: Guenter Roeck
11 Aug, 2018
4 commits
-
Change update device function to return an error pointer if needed,
and report the error to user space.Signed-off-by: Tokunori Ikegami
Cc: Guenter Roeck
Cc: Chris Packham
[groeck: Clarified/updated description]
Signed-off-by: Guenter Roeck -
I2C SMBus sometimes returns error codes.
In the error case, measurement values are updated incorrectly.
The sensor application then generates warning log messages and SNMP traps.
To prevent this, add error handling into the update functions.Signed-off-by: Tokunori Ikegami
Cc: Guenter Roeck
Cc: Chris Packham
[groeck: Update description]
Signed-off-by: Guenter Roeck -
Currently the valid variable is of type char, but it is used as boolean.
So let's change it to bool.Signed-off-by: Tokunori Ikegami
Cc: Guenter Roeck
Cc: Chris Packham
[groeck: Update description]
Signed-off-by: Guenter Roeck -
The update function reads both measurement and limit values.
Those parts can be split so split them for a maintainability.Signed-off-by: Tokunori Ikegami
Cc: Guenter Roeck
Cc: Chris Packham
[groeck: Clarify description]
Signed-off-by: Guenter Roeck
13 Aug, 2017
1 commit
-
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by work with const
attribute_group. So mark the non-const structs as const.File size before:
text data bss dec hex filename
10055 7032 0 17087 42bf drivers/hwmon/adt7475.oFile size After adding 'const':
text data bss dec hex filename
10567 6520 0 17087 42bf drivers/hwmon/adt7475.oSigned-off-by: Arvind Yadav
Signed-off-by: Guenter Roeck
12 Jun, 2017
4 commits
-
When enabled temperature smoothing allows ramping the fan speed over a
configurable period of time instead of jumping to the new speed
instantaneously.Signed-off-by: Chris Packham
Signed-off-by: Guenter Roeck -
Systems using 4-wire fans usually require high frequency (22.5kHz)
output on the pwm. Add 22500 as a valid option in the pwmfreq_table. In
high frequency mode the low-order bit are ignored so they can safely be
set to 0.Signed-off-by: Chris Packham
Signed-off-by: Guenter Roeck -
By default adt7475 will stop the fans (pwm duty cycle 0%) when the
temperature drops past Tmin - hysteresis. Some systems want to keep the
fans moving even when the temperature drops so add new sysfs attributes
that configure the enhanced acoustics min 1-3 which allows the fans to
run at the minimum configure pwm duty cycle.Signed-off-by: Chris Packham
Signed-off-by: Guenter Roeck -
The adt7475 has had find_nearest() since it's creation in 2009. Since
then find_closest() has been introduced and several drivers have been
updated to use it. Update the adt7475 to use find_closest() and remove
the now unused find_nearest().Signed-off-by: Chris Packham
Signed-off-by: Guenter Roeck
22 Apr, 2017
1 commit
-
The ADT7475 and ADT7476 have the STRT bit cleared by default[1]. Before any
monitoring activities the STRT bit needs to be set. Logically this needs
to happen before any of the sensors are read so the probe() function
seems the best place for it.[1] - https://www.onsemi.com/pub/Collateral/ADT7475-D.PDF
Signed-off-by: Chris Packham
Signed-off-by: Guenter Roeck
02 Apr, 2017
1 commit
-
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:.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
Signed-off-by: Guenter Roeck
03 Jan, 2017
1 commit
-
Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for
read/write attributes. This simplifies the source code, improves
readbility, and reduces the chance of inconsistencies.The conversion was done automatically using coccinelle. It was validated
by compiling both the old and the new source code and comparing its text,
data, and bss size.Signed-off-by: Julia Lawall
[groeck: Updated description]
Signed-off-by: Guenter Roeck
30 Jan, 2014
1 commit
-
Signed-off-by: Jean Delvare
26 Jan, 2013
1 commit
-
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
Acked-by: George Joseph
Acked-by: Jean Delvare
10 Oct, 2012
1 commit
-
Many hwmon drivers use jiffies but omit the inclusion of the header
file. Fix that, and also fix one driver which was including the header
file but didn't need it.Signed-off-by: Jean Delvare
Acked-by: Guenter Roeck
Acked-by: Luca Tettamanti
Cc: Marc Hulsman
Cc: Rudolf Marek
22 Jul, 2012
1 commit
-
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Jean Delvare
Signed-off-by: Guenter Roeck
Acked-by: Jean Delvare
19 Mar, 2012
3 commits
-
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
Cc: Corentin Labbe
Cc: Dirk Eibach
Cc: "Mark M. Hoffman"
Cc: Steve Glendinning
Cc: Riku Voipio
Cc: Guillaume Ligneul
Cc: David George
Cc: "Hans J. Koch"
Cc: Marc Hulsman
Cc: Rudolf Marek
Signed-off-by: Guenter Roeck -
Cc: Jean Delvare
Acked-by: Jean Delvare
Signed-off-by: Guenter Roeck -
fixed:
WARNING: static const char * array should probably be static const char * const
+ static const char *names[] = {Signed-off-by: Frans Meulenbroeks
Signed-off-by: Guenter Roeck
06 Jan, 2012
1 commit
-
replaced strict_strtol with kstrtol and
replaced strict_strtuol with kstrtuolThis satisfies checkpatch -f
Compile tested only: no warnings or errors givenSigned-off-by: Frans Meulenbroeks
Signed-off-by: Guenter Roeck
29 Oct, 2010
1 commit
-
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
Cc: George Joseph
Reviewed-by: Guenter Roeck
15 Dec, 2009
3 commits
-
These macros simply declare an enum, so drivers might as well declare
it themselves. This puts an end to the arbitrary limit of 8 chip types
per i2c driver.Signed-off-by: Jean Delvare
Tested-by: Wolfram Sang -
Struct i2c_client_address_data only contains one field at this point,
which makes its usefulness questionable. Get rid of it and pass simple
address lists around instead.Signed-off-by: Jean Delvare
Tested-by: Wolfram Sang -
The "kind" parameter always has value -1, and nobody is using it any
longer, so we can remove it.Signed-off-by: Jean Delvare
Tested-by: Wolfram Sang
10 Dec, 2009
12 commits
-
The ADT7476 has 5 dedicated pins for VID input, and the +12V input can
optionally be used as a 6th VID pin. Add support for VID input.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
Add support for the Analog Devices ADT7476 chip. This chip is largely
compatible with the ADT7473 and ADT7475, with additional features.
In particular, it has 5 voltage inputs instead of 2, and VID input
pins.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
It is possible to bypass the voltage attenuators on the +2.5V, Vccp,
+5V and +12V voltage monitoring inputs. This is useful to connect
other voltage channels than the ones the monitoring chip was
originally designed for. When this feature is enabled, we must not
include the scaling factors in our computations.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
Print the device name and revision at probe time, as well as a list of
all optional features which are available.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
The TACH4 pin can be used for other functions, so fan4 may not always
be available. Likewise, the PWM2 pin can be used for ALERT output, in
which case pwm2 is not availableFor the ADT7490, the +2.5 Vin pin may also be used for other
functions, in which case in0 is not available.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
Move sysfs files removal to a separate function. The code is common to
the device probing error path and the standard device removal path. As
it will grow with future driver development, this avoids code
duplication.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
Add support for the Analog Devices ADT7490 chip. This chip is largely
compatible with the ADT7473 and ADT7475, with additional features.
In particular, it has 6 voltage inputs instead of 2.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
Check the value of register 0x3f as part of the device detection, to
make it more robust.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
adt7475_attr_group is used internally only and can thus be marked
static.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
Rework the handling of voltage inputs to make it possible and easy to
support more inputs. This will be needed for the upcoming ADT7490
support.Signed-off-by: Jean Delvare
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
Implement the non-standard pwm_use_point2_pwm_at_crit sysfs attribute
as the adt7473 driver did.Signed-off-by: Jean Delvare
Cc: "Mark M. Hoffman"
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong" -
Add support for the ADT7473 to the adt7475 driver, and mark the
adt7473 driver for removal. The ADT7473 and ADT7475 chips are almost
the same chip and essentially compatible, so there's no point in
having separate drivers for them.Signed-off-by: Jean Delvare
Cc: "Mark M. Hoffman"
Cc: Hans de Goede
Cc: Jordan Crouse
Cc: "Darrick J. Wong"