24 Sep, 2020
1 commit
-
As part of the ongoing i2c transition to the simple probe
("probe_new"), this patch uses i2c_match_id to retrieve the
driver_data for the probed device. The id parameter is thus no longer
necessary and the simple probe can be used instead.Signed-off-by: Stephen Kitt
Link: https://lore.kernel.org/r/20200821160159.591293-1-steve@sk2.org
Signed-off-by: Guenter Roeck
24 May, 2019
1 commit
-
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 usaextracted 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
Reviewed-by: Michael Ellerman (powerpc)
Reviewed-by: Richard Fontana
Reviewed-by: Allison Randal
Reviewed-by: Kate Stewart
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
Signed-off-by: Greg Kroah-Hartman
14 Oct, 2013
1 commit
-
The f75375s driver crashes the kernel if it detects an an internal
implementation error. While the detected conditions suggest that
there is a bug in the code, the condition is not fatal.
Replace BUG() with WARN().Cc: Riku Voipio
Signed-off-by: Guenter Roeck
12 Aug, 2013
1 commit
-
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.Signed-off-by: Jingoo Han
Signed-off-by: Guenter Roeck
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
24 Sep, 2012
1 commit
-
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Riku Voipio
Signed-off-by: Guenter Roeck
02 Apr, 2012
1 commit
-
In some configurations, BUG() does not result in an endless loop but returns to
the caller. This results in the following compiler warning:drivers/hwmon/f75375s.c: In function 'duty_mode_enabled':
drivers/hwmon/f75375s.c:280: warning: control reaches end of non-void function
drivers/hwmon/f75375s.c: In function 'auto_mode_enabled':
drivers/hwmon/f75375s.c:295: warning: control reaches end of non-void functionFix the warning by returning something sensible after BUG().
Cc: Nikolaus Schulz
Cc: Riku Voipio
Signed-off-by: Guenter Roeck
Acked-by: Jean Delvare
Signed-off-by: Guenter Roeck
19 Mar, 2012
1 commit
-
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
03 Mar, 2012
2 commits
-
It makes no sense to attempt to manually configure the fan in auto mode,
or set the duty cycle directly in closed loop mode. The corresponding
registers are then read-only. If the user tries it nonetheless, error out
with EINVAL instead of silently doing nothing.Signed-off-by: Nikolaus Schulz
[guenter.roeck@ericsson.com: Minor formatting cleanup]
Signed-off-by: Guenter Roeck -
The F75387 supports automatic fan control using either PWM duty cycle or
RPM speed values. Make the driver detect the latter mode, and expose the
different modes in sysfs as per pwm_enable, so that the user can switch
between them.The interpretation of the pwm_enable attribute for the F75387 is adjusted
to be a superset of those values used for similar Fintek chips which do
not support automatic duty mode, with 2 mapping to automatic speed mode,
and moving automatic duty mode to the new value 4.Toggling the duty mode via pwm_enable is currently denied for the F75387,
as the chip then simply reinterprets the fan configuration register values
according to the new mode, switching between RPM and PWM units, which
makes this a dangerous operation.This patch introduces a new pwm mode into the driver. This is necessary
because the new mode (automatic pwm mode, 4) may already be enabled by the
BIOS, and the driver should not break existing functionality. This was seen
on at least one board.Signed-off-by: Nikolaus Schulz
Signed-off-by: Guenter Roeck
29 Feb, 2012
2 commits
-
Signed-off-by: Nikolaus Schulz
Signed-off-by: Guenter Roeck -
For the F75387, the register holding the current PWM duty cycle value is
r/o; changing it requires writing to the fan expect register instead.Signed-off-by: Nikolaus Schulz
[guenter.roeck@ericsson.com: Simplified function parameters]
Signed-off-by: Guenter Roeck
23 Feb, 2012
1 commit
-
By hwmon sysfs interface convention, setting pwm_enable to zero sets a fan
to full speed. In the f75375s driver, this need be done by enabling
manual fan control, plus duty mode for the F875387 chip, and then setting
the maximum duty cycle. Fix a bug where the two necessary register writes
were swapped, effectively discarding the setting to full-speed.Signed-off-by: Nikolaus Schulz
Cc: Riku Voipio
Signed-off-by: Guenter Roeck
10 Feb, 2012
1 commit
-
Treat pwmX as a measured value, not as a (mostly static) limit value, so
that it is updated more frequently from the device register.Signed-off-by: Nikolaus Schulz
Signed-off-by: Guenter Roeck
09 Feb, 2012
3 commits
-
In order to extract the high byte of the 16-bit word, shift the word to
the right, not to the left.Signed-off-by: Nikolaus Schulz
Cc: stable@kernel.org # 2.6.32+
Signed-off-by: Guenter Roeck -
Unlike the other chips supported by this driver, the F75387 stores the
pwm_mode in register F75375_REG_FAN_TIMER, not F75375_REG_CONFIG1.Signed-off-by: Nikolaus Schulz
Signed-off-by: Guenter Roeck -
In order to enable temperature mode aka automatic mode for the F75373 and
F75375 chips, the two FANx_MODE bits in the fan configuration register
need be set to 01, not 10.Signed-off-by: Nikolaus Schulz
Cc: stable@kernel.org # 2.6.32+
Signed-off-by: Guenter Roeck
06 Jan, 2012
6 commits
-
Fintek F75387SG/RG is mostly compatible to F75373/F75375. Add support for it
to the F75375S driver.Fan support for F75387SG/RG has been implemented but not tested.
Cc: Riku Voipio
Signed-off-by: Bjoern Gerhart
Signed-off-by: Guenter Roeck -
F75373 does not support DC (linear voltage) fan control mode, so don't let
the user set it.Cc: Riku Voipio
Reviewed-by: Bjoern Gerhart
Signed-off-by: Guenter Roeck -
pwmX_mode and pwmX_enable are not initialized if no platform data is provided to
the driver. Read chip configuration at driver initialization time and initialize
attributes to reflect chip configuration.Cc: Riku Voipio
Reviewed-by: Bjoern Gerhart
Signed-off-by: Guenter Roeck -
Accepted value range for PWM modes was 0..4, even though only 0..3 is
subsequently used. Limit permitted value range to 0..3 to avoid unpredictable
behavior.Cc: Riku Voipio
Reviewed-by: Bjoern Gerhart
Signed-off-by: Guenter Roeck -
The driver uses non-standard sysfs attribute names for maximum and target fan
speeds, even though standard attibute names for the same values do exist.
Replace non-standard attribute names with standard attribute names.Cc: Riku Voipio
Reviewed-by: Bjoern Gerhart
Signed-off-by: Guenter Roeck -
Clean up driver to follow current coding style.
Cc: Riku Voipio
Reviewed-by: Bjoern Gerhart
Signed-off-by: Guenter Roeck
25 Oct, 2010
1 commit
-
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
Update broken web addresses in arch directory.
Update broken web addresses in the kernel.
Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
Revert "Fix typo: configuation => configuration" partially
ida: document IDA_BITMAP_LONGS calculation
ext2: fix a typo on comment in ext2/inode.c
drivers/scsi: Remove unnecessary casts of private_data
drivers/s390: Remove unnecessary casts of private_data
net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
drivers/infiniband: Remove unnecessary casts of private_data
drivers/gpu/drm: Remove unnecessary casts of private_data
kernel/pm_qos_params.c: Remove unnecessary casts of private_data
fs/ecryptfs: Remove unnecessary casts of private_data
fs/seq_file.c: Remove unnecessary casts of private_data
arm: uengine.c: remove C99 comments
arm: scoop.c: remove C99 comments
Fix typo configue => configure in comments
Fix typo: configuation => configuration
Fix typo interrest[ing|ed] => interest[ing|ed]
Fix various typos of valid in comments
...Fix up trivial conflicts in:
drivers/char/ipmi/ipmi_si_intf.c
drivers/usb/gadget/rndis.c
net/irda/irnet/irnet_ppp.c
18 Oct, 2010
1 commit
-
The patch below updates broken web addresses in the kernel
Signed-off-by: Justin P. Mattock
Cc: Maciej W. Rozycki
Cc: Geert Uytterhoeven
Cc: Finn Thain
Cc: Randy Dunlap
Cc: Matt Turner
Cc: Dimitry Torokhov
Cc: Mike Frysinger
Acked-by: Ben Pfaff
Acked-by: Hans J. Koch
Reviewed-by: Finn Thain
Signed-off-by: Jiri Kosina
17 Sep, 2010
2 commits
-
All bits in the values read from registers to be used for the next
write were getting overwritten, avoid doing so to not mess with the
current configuration.Signed-off-by: Guillem Jover
Cc: Riku Voipio
Cc: stable@kernel.org
Signed-off-by: Jean Delvare -
The spec notes that fan0 and fan1 control mode bits are located in bits
7-6 and 5-4 respectively, but the FAN_CTRL_MODE macro was making the
bits shift by 5 instead of by 4.Signed-off-by: Guillem Jover
Cc: Riku Voipio
Cc: stable@kernel.org
Signed-off-by: Jean Delvare
03 Jun, 2010
1 commit
-
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
Acked-by: Mark Brown
Acked-by: Greg Kroah-Hartman
Acked-by: Richard Purdie
Acked-by: Dmitry Torokhov
Signed-off-by: Jean Delvare
30 Mar, 2010
1 commit
-
…it slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
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
Acked-by: Corentin Labbe
Cc: "Mark M. Hoffman"
Cc: Juerg Haefliger
Cc: Riku Voipio
Acked-by: "Hans J. Koch"
Cc: Rudolf Marek
30 Mar, 2009
1 commit
-
Update my email address.
Signed-off-by: Riku Voipio
Signed-off-by: Jiri Kosina
12 Mar, 2009
1 commit
-
f75375_probe calls i2c_get_clientdata to initialize the data pointer,
but there isn't yet any client data to get, and the value is never
used before the variable is assigned a new value seven lines later.The call doesn't hurt anything and wastes only a couple of cycles.
The reason to fix it is because this module serves as an example to
hackers writing new hwmon drivers, and this part of the example is
confusing.Signed-off-by: Andrew Klossner
Signed-off-by: Jean Delvare
17 Jul, 2008
1 commit
-
Drop the legacy f75375s i2c driver, and add a detect callback to the
new-style i2c driver to achieve the same functionality.Signed-off-by: Jean Delvare
Acked-by: Riku Voipio
30 Apr, 2008
2 commits
-
Based on earlier work by Jon Smirl and Jochen Friedrich.
Update most new-style i2c drivers to use standard module aliasing
instead of the old driver_name/type driver matching scheme. I've
left the video drivers apart (except for SoC camera drivers) as
they're a bit more diffcult to deal with, they'll have their own
patch later.Signed-off-by: Jean Delvare
Cc: Jon Smirl
Cc: Jochen Friedrich -
Based on earlier work by Jon Smirl and Jochen Friedrich.
This patch allows new-style i2c chip drivers to have alias names using
the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this
point, the old i2c driver binding scheme (driver_name/type) is still
supported.Signed-off-by: Jean Delvare
Cc: Jochen Friedrich
Cc: Jon Smirl
Cc: Kay Sievers
19 Feb, 2008
1 commit
-
Signed-off-by: Mark M. Hoffman
08 Nov, 2007
1 commit
-
Fix value check in set_pwm_mode(). Instead of checking for chip variant there,
make pwmX_mode sysfs nodes only writable on f75375 variant.Signed-off-by: Riku Voipio
Acked-by: Jean Delvare
Signed-off-by: Mark M. Hoffman