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
1 commit
-
As kind is now hard-coded to -1, there is room for code clean-ups.
Signed-off-by: Jean Delvare
15 Sep, 2009
1 commit
-
The Winbond/Nuvoton WPCD377I is the reduced version of a Super-I/O
which emulates the National Semiconductor LM96000 hardware monitoring
chips, but without the hardware monitoring part. Instead of plain
disabling the emulation, the vendor left the emulated chip visible,
but all monitored values are always zero. This is rather confusing for
the users. So detect this case and refuse to bind to such fake chips.This fixes lm-sensors ticket #2182:
http://www.lm-sensors.org/ticket/2182Signed-off-by: Jean Delvare
11 Mar, 2009
2 commits
-
The adt7468 chip supports VRM10 sensors just like the adt7463; add a
missing check for it.Signed-off-by: Darrick J. Wong
Cc: Jean Delvare
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The verstep check in the lm85 driver fails because the upper nibble of
the version register is 0x7, not 0x6, on the adt7468 chip. Probing of
all adt7468s was broken by 69fc1feba2d5856ff74dedb6ae9d8c490210825c
("hwmon: (lm85) Rework the device detection"), and this patch fixes
that. Also add in a missing i2c_device_id that accidentally got dropped
from the original patch.Signed-off-by: Darrick J. Wong
Cc: Jean Delvare
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Nov, 2008
1 commit
-
The adt7468 is a follow-on to the adt7463, so plumb in adt7468 support
along the same code paths.Signed-off-by: Darrick J. Wong
Cc: Jean Delvare
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Oct, 2008
7 commits
-
Label names ERROR1 and ERROR3 aren't exactly explicit. Change them for
better names that indicate what we are up to.Signed-off-by: Jean Delvare
Acked-by: Herbert Poetzl -
Function RANGE_TO_REG can easily be simplified. Credits go to Herbert
Poetzl for indirectly suggesting this to me. I tested that the new
implementation returns the same result as the original implementation
for all input values.Signed-off-by: Jean Delvare
Acked-by: Herbert Poetzl -
The new-style lm85 driver implements the optional detect() callback
to cover the use cases of the legacy driver.Signed-off-by: Jean Delvare
Acked-by: Herbert Poetzl -
The Analog Devices and SMSC devices supported by the lm85 driver do
not have the same PWM frequency table as the National Semiconductor
devices. Add support for per-device frequency tables.Signed-off-by: Jean Delvare
Acked-by: Herbert Poetzl -
The LM85 and compatible chips only support 8 arbitrary PWM frequencies.
The algorithm to pick one of them based on the user input is not
optimum. Improve it to always pick the closest supported frequency.Signed-off-by: Jean Delvare
Acked-by: Herbert Poetzl -
Implement the standard PWM frequency interface: pwm[1-*]_freq in
units of 1 Hz, instead of the non-standard pwm[1-*]_auto_pwm_freq
in units of 0.1 Hz. The old naming was not only non-standard, it was
also confusing, because it suggested that the frequency value only
applied in automatic fan speed mode, which isn't true.Signed-off-by: Jean Delvare
Acked-by: Herbert Poetzl -
Rework the device detection to make it clearer and faster in the
general case (when a known device is found.)Signed-off-by: Jean Delvare
Acked-by: Herbert Poetzl
01 Aug, 2008
5 commits
-
Clean up and simplify the device initialization function:
* Degrade error messages to warnings - what they really are.
* Stop warning about VxI mode, we don't really care.
* Drop comment about lack of limit initialization - that's the standard
way, all hardware monitoring drivers do that.
* Only read the configuration register once.
* Only write back to the configuration register if needed.
* Don't attempt to clear the lock bit, it locks itself to 1.
* Move the function to before it's called, so that we no longer need to
forware declare it.Signed-off-by: Jean Delvare
Signed-off-by: Mark M. Hoffman -
Misc cleanups to the lm85 hardware monitoring driver:
* Mark constant arrays as const.
* Remove useless masks.
* Have lm85_write_value return void - nobody is checking the returned
value anyway and in some cases it was plain wrong.
* Remove useless initializations.
* Rename new_client to client in lm85_detect.
* Replace cascaded if/else with a switch/case in lm85_detect.
* Group similar loops in lm85_update_device.
* Remove legacy comments.Signed-off-by: Jean Delvare
Acked-by: Juerg Haefliger
Signed-off-by: Mark M. Hoffman -
In set_pwm_auto_pwm_minctl, we write cached register bits back to the
chip. This is a bad idea as we have no guarantee that the cache is
up-to-date. Better read a fresh register value from the chip, it's
safer and in fact it is also more simple.Signed-off-by: Jean Delvare
Acked-by: Juerg Haefliger
Signed-off-by: Mark M. Hoffman -
Drop a lot of useless register defines, conversion macros, data structure
members and update code. All these register values were read from the
device but nothing is done out of them, so this is all dead code in
practice.Signed-off-by: Jean Delvare
Acked-by: Juerg Haefliger
Signed-off-by: Mark M. Hoffman -
Fix most style issues reported by checkpatch, including:
* Trailing, missing and extra whitespace
* Extra parentheses, curly braces and semi-colons
* Broken indentation
* Lines too longI verified that the generated code is the same before and after
these changes.Signed-off-by: Jean Delvare
Acked-by: Juerg Haefliger
Signed-off-by: Mark M. Hoffman
19 Jun, 2008
1 commit
-
Function RANGE_TO_REG() is broken. For a requested range of 2000 (2
degrees C), it will return an index value of 15, i.e. 80.0 degrees C,
instead of the expected index value of 0. All other values are handled
properly, just 2000 isn't.The bug was introduced back in November 2004 by this patch:
http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commit;h=1c28d80f1992240373099d863e4996cdd5d646d0While this can be fixed easily with the current code, I'd rather
rewrite the whole function in a way which is more obviously correct.Signed-off-by: Jean Delvare
Cc: Justin Thiessen
Signed-off-by: Mark M. Hoffman
19 Feb, 2008
1 commit
-
Signed-off-by: Mark M. Hoffman
08 Feb, 2008
4 commits
-
What was true of reading the VRM value is also true of writing it: not
being a register value, it doesn't need hardware access, so we don't
need a reference to the i2c client. This allows for a minor code
cleanup. As gcc appears to be smart enough to simplify the generated
code by itself, this cleanup only affects the source code, the
generated binaries are unchanged.Signed-off-by: Jean Delvare
Signed-off-by: Mark M. Hoffman -
Many I2C hwmon drivers define a driver ID but no other code references
these, meaning that they are useless. Discard them, along with a few
IDs which are defined but never used at all.Signed-off-by: Jean Delvare
Signed-off-by: Mark M. Hoffman -
Make the pwmN_enable files writable. This makes it possible to use
standard fan speed control tools (pwmconfig, fancontrol) with the lm85
driver.I left the non-standard pwmN_auto_channels files in place, as they
give additional control for the automatic mode, and some users might
be used to them by now.Signed-off-by: Jean Delvare
Signed-off-by: Mark M. Hoffman -
The values returned by the lm85 driver in pwmN_enable sysfs files do
not match the standard. Fix that.Signed-off-by: Jean Delvare
Signed-off-by: Mark M. Hoffman
10 Oct, 2007
7 commits
-
The VRM value is not read from chip registers, so there's no need
to update the device data cache before exporting the VRM value to
user-space.Signed-off-by: Jean Delvare
Acked-by: Hans de Goede
Signed-off-by: Mark M. Hoffman -
Trying to set the fan min limit to 0 currently writes 0 to the
register, which is an invalid value. It's read back as -1 and the
alarm flag is raised. Instead we should write 0xffff (maximum
value), which reads back as 0 and no alarm flag is raised.Signed-off-by: Jean Delvare
Acked-by: Juerg Haefliger
Signed-off-by: Mark M. Hoffman -
The way the lm85 driver currently handles the additional resolution
bits some chips have for the voltage and temperature measurements is
quite complex. This is my attempt to make it simpler.Signed-off-by: Jean Delvare
Acked-by: Juerg Haefliger
Signed-off-by: Mark M. Hoffman -
The future libsensors needs these individual alarm and fault files.
Also delete old and unused alarm defines.
Signed-off-by: Jean Delvare
Acked-by: Juerg Haefliger
Signed-off-by: Mark M. Hoffman -
The SMSC EMC6D100 supports 3 additional voltage channels. The lm85
driver reads the register values for these, but doesn't create the
corresponding sysfs files, so the user can't read the values nor write
the limits. Create the missing sysfs files.Signed-off-by: Jean Delvare
Acked-by: Juerg Haefliger
Signed-off-by: Mark M. Hoffman -
This lets us get rid of macro-generated functions and shrinks the
driver size by about 10%. I used a new style suggested by Mark M.
Hoffman to retrieve the channel number. Instead of:struct sensor_device_attribute *sda = to_sensor_dev_attr(attr);
int nr = sda->index;I do:
int nr = to_sensor_dev_attr(attr)->index;
This looks better, and even allows the compiler to do some minor
optimizations.Signed-off-by: Jean Delvare
Acked-by: Krzysztof Helt
Signed-off-by: Mark M. Hoffman -
Convert from class_device to device for hwmon_device_register/unregister
Signed-off-by: Tony Jones
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: Kay Sievers
Signed-off-by: Mark M. Hoffman
15 Feb, 2007
2 commits
-
Cleanup a bogus legacy comment that has been replicated to many
hardware monitoring drivers.Signed-off-by: Jean Delvare
-
Signed-off-by: Jean Delvare
29 Sep, 2006
1 commit
-
hwmon: Fix unchecked return status, batch 2
Fix up some hwmon drivers so that they no longer ignore return status
from device_create_file().Signed-off-by: Mark M. Hoffman
Signed-off-by: Jean Delvare
Signed-off-by: Greg Kroah-Hartman
24 Mar, 2006
2 commits
-
"register" is a reserved keyword so using it as a parameter name
can confuse some compilers, most notably ICC.The patch below just renames all occurences to reg which fits the actual
function declarations.Signed-off-by: Darren Jenkins
Signed-off-by: Jean Delvare
Signed-off-by: Greg Kroah-Hartman -
convert drivers/hwmon/*.c semaphore use to mutexes.
the conversion was generated via scripts, and the result was validated
automatically via a script as well.all affected hwmon drivers were build-tested.
Signed-off-by: Ingo Molnar
Signed-off-by: Jean Delvare
Signed-off-by: Greg Kroah-Hartman
06 Jan, 2006
2 commits
-
Now that i2c_add_driver() doesn't need the module owner to be set by
hand, we can delete it from the drivers. This patch catches all of the
drivers that I found in the current tree (if a driver sets the .owner by
hand, it's not a problem, just not needed.)Signed-off-by: Greg Kroah-Hartman
Cc: Jean Delvare -
We should use the i2c_driver.driver's .name and .owner fields
instead of the i2c_driver's ones.This patch updates the hwmon drivers.
Signed-off-by: Laurent Riffard
Signed-off-by: Jean Delvare
Signed-off-by: Greg Kroah-Hartman