23 Feb, 2017
4 commits
-
Add PMIC 'MAX17135' module drivers to 4.1.y kernel. These are necessary
to supply power for E-ink panel display functions.Signed-off-by: Robby Cai
-
Add mma8451 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.
Signed-off-by: Luwei Zhou
Signed-off-by: Fugang Duan
(cherry picked from commit: 69e1811b92ed7b3dc2f1db0a9447a8570dd16231) -
Use global variable instead of macro "MAG3110_IRQ_USED" that is more
flexible.Signed-off-by: Fugang Duan
-
Add mag3110 driver support for i.MX6Q/DL/SX platform. The code derives from 3.10.y branch.
Signed-off-by: Luwei Zhou
Signed-off-by: Fugang Duan
(cherry picked from commit: dd027baab7652c62d26f1749f334099e4dbe61c9)
12 Jan, 2017
6 commits
-
commit e9572fdd13e299cfba03abbfd2786c84ac055249 upstream.
Since commit commit eb1c8f4325d5 ("hwmon: (lm90) Convert to use new hwmon
registration API") the temp1_max_alarm and temp1_crit_alarm attributes are
mapped to the same alarm bit. Fix the typo.Fixes: eb1c8f4325d5 ("hwmon: (lm90) Convert to use new hwmon registration API")
Signed-off-by: Micehael Walle
Signed-off-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
commit 4fccd4a1e8944033bcd7693ea4e8fb478cd2059a upstream.
Fix overflows seen when writing into fan speed limit attributes.
Also fix crash due to division by zero, seen when certain very
large values (such as 2147483648, or 0x80000000) are written
into fan speed limit attributes.Fixes: 594fbe713bf60 ("Add support for GMT G762/G763 PWM fan controllers")
Cc: Arnaud Ebalard
Reviewed-by: Jean Delvare
Signed-off-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
commit c0d04e9112ad59d73f23f3b0f6726c5e798dfcbf upstream.
Fix overflows seen when writing voltage and temperature limit attributes.
The value passed to DIV_ROUND_CLOSEST() needs to be clamped, and the
value parameter passed to nct7802_write_fan_min() is an unsigned long.Also, writing values larger than 2700000 into a fan limit attribute results
in writing 0 into the chip's limit registers. The exact behavior when
writing this value is unspecified. For consistency, report a limit of
1350000 if the chip register reads 0. This may be wrong, and the chip
behavior should be verified with the actual chip, but it is better than
reporting a value of 0 (which, when written, results in writing a value
of 0x1fff into the chip register).Fixes: 3434f3783580 ("hwmon: Driver for Nuvoton NCT7802Y")
Reviewed-by: Jean Delvare
Signed-off-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
commit e36ce99ee0815d7919a7b589bfb66f3de50b6bc7 upstream.
Module test reports:
temp1_max: Suspected overflow: [160000 vs. 0]
temp1_min: Suspected overflow: [160000 vs. 0]This is seen because the values passed when writing temperature limits
are unbound.Reviewed-by: Jean Delvare
Fixes: 6099469805c2 ("hwmon: Support for Dallas Semiconductor DS620")
Signed-off-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
commit 4538bfbf2d9f1fc48c07ac0cc0ee58716fe7fe96 upstream.
Converts the unsigned temperature values from the i2c read
to be sign extended as defined in the datasheet so that
negative temperatures are properly read.Fixes: 28e6274d8fa67 ("hwmon: (amc6821) Avoid forward declaration")
Signed-off-by: Jared Bents
Signed-off-by: Matt Weber
[groeck: Dropped unnecessary continuation line]
Signed-off-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman -
commit 13edb767aa609b6efb7c0c2b57fbd72a6ded0eed upstream.
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.Export the module alias information using the MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/hwmon/scpi-hwmon.ko | grep alias
$After this patch:
$ modinfo drivers/hwmon/scpi-hwmon.ko | grep alias
alias: of:N*T*Carm,scpi-sensorsC*
alias: of:N*T*Carm,scpi-sensorsSigned-off-by: Javier Martinez Canillas
Fixes: ea98b29a05e9c ("hwmon: Support sensors exported via ARM SCP interface")
Signed-off-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman
24 Oct, 2016
1 commit
-
If dev_kcalloc fails to allocate hw_dev->groups then the current
exit path is a direct return, causing a leak of resources such
as hwdev and ida is not removed. Fix this by exiting via the
free_hwmon exit path that performs the necessary resource cleanup.Signed-off-by: Colin Ian King
Signed-off-by: Guenter Roeck
18 Oct, 2016
2 commits
-
We should only dereference "data" after we check if it is an error
pointer.Fixes: 54187ff9d766 ('hwmon: (max31790) Convert to use new hwmon registration API')
Signed-off-by: Dan Carpenter
Signed-off-by: Guenter Roeck -
Unlike the temperature thresholds the temperature data is a 9-bit signed
value. This allows and additional 0.5 degrees of precision on the
reading but makes handling negative values slightly harder. In order to
have sign-extension applied correctly the 9-bit value is stored in the
upper bits of a signed 16-bit value. When presenting this in sysfs the
value is shifted and scaled appropriately.Signed-off-by: Chris Packham
Signed-off-by: Guenter Roeck
05 Oct, 2016
1 commit
-
…t/groeck/linux-staging
Pull hwmon updates from Guenter Roeck:
- New hwmon registration API, including ports of several drivers to the
new API- New hwmon driver for APM X-Gene SoC
- Added support for UCD90160, DPS-460, DPS-800, and SGD009 PMBUs chips
- Various cleanups, minor improvements, and fixes in several drivers
* tag 'hwmon-for-linus-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (54 commits)
hwmon: (nct6775) Add support for multiple virtual temperature sources
hwmon: (adt7470) No need for additional synchronization on kthread_stop()
hwmon: (lm95241) Update module description to include LM95231
hwmon: (lm95245) Select REGMAP_I2C
hwmon: (ibmpowernv) Fix label for cores numbers not threads
hwmon: (adt7470) Allow faster removal
hwmon: (adt7470) Add write support to alarm_mask
hwmon: (xgene) access mailbox as RAM
hwmon: (lm95245) Use new hwmon registration API
hwmon: (lm95241) Convert to use new hwmon registration API
hwmon: (jc42) Convert to use new hwmon registration API
hwmon: (max31790) Convert to use new hwmon registration API
hwmon: (nct7904) Convert to use new hwmon registration API
hwmon: (ltc4245) Convert to use new hwmon registration API
hwmon: (tmp421) Convert to use new hwmon registration API
hwmon: (tmp102) Convert to use new hwmon registration API
hwmon: (lm90) Convert to use new hwmon registration API
hwmon: (lm75) Convert to use new hwmon registration API
hwmon: (xgene) Fix crash when alarm occurs before driver probe
hwmon: (iio_hwmon) defer probe when no channel is found
...
19 Sep, 2016
2 commits
-
For virtual temperatures, the actual temperature values are written
by software, presumably by the BIOS. This functionality is (as of
right now) supported on NCT6791D, NCT6792D, and NCT6793D. On those chips,
the temperatures are written into registers 0xea..0xef on page 0.
This is known to be used on some Asus motherboards, where the actual
temperature source can be configured in the BIOS.Report the 'virtual' temperatures for all monotoring sources to address
this situation.Example for the resulting output (as seen with the 'sensors' command):
nct6791-isa-0290
Adapter: ISA adapter
...
Virtual_TEMP: +31.0°C
PECI Agent 0: +38.5°C
Virtual_TEMP: +32.0°C
...Signed-off-by: Guenter Roeck
-
The kthread_stop() waits for the thread to exit. There is no need for an
additional synchronization needed to join on the kthread.The completion was added by 89fac11cb3e7 ("adt7470: make automatic fan
control really work").Signed-off-by: Daniel Wagner
Cc: Darrick J. Wong
Cc: Jean Delvare
Cc: Guenter Roeck
Signed-off-by: Guenter Roeck
13 Sep, 2016
3 commits
-
This driver also supports LM95231.
Signed-off-by: Axel Lin
Signed-off-by: Guenter Roeck -
This driver now uses regmap APIs, so it needs to select REGMAP_I2C.
Signed-off-by: Axel Lin
Signed-off-by: Guenter Roeck -
Currently the label says "Core" but lists the thread numbers. This
ends up looking like this:
# cat /sys/class/hwmon/hwmon0/temp[1-4]_label
Core 0-7
Core 8-15
Core 16-23
Core 24-31This is misleading as it looks like it's cores 0-7 when it's actually
threads 0-7.This changes the print to just give the core number, so the output now
looks like this:
# cat /sys/class/hwmon/hwmon0/temp[1-4]_label
Core 0
Core 8
Core 16
Core 24Signed-off-by: Michael Neuling
Acked-by: Cédric Le Goater
Signed-off-by: Guenter Roeck
11 Sep, 2016
2 commits
-
adt7470_remove will wait for the update thread to complete before
returning. This had a worst-case time of up to the user-configurable
auto_update_interval.Replace msleep_interruptible with set_current_state and schedule_timeout
so that kthread_stop will interrupt the sleep.Signed-off-by: Joshua Scott
Signed-off-by: Guenter Roeck -
Add write support for the alarm_mask. A base of 0 is provided so that
either hex or decimal can be used. The hex format when reading alarm_mask
is unchanged.Signed-off-by: Joshua Scott
Signed-off-by: Guenter Roeck
10 Sep, 2016
1 commit
-
The newly added hwmon driver fails to build in an allmodconfig
kernel:ERROR: "memblock_is_memory" [drivers/hwmon/xgene-hwmon.ko] undefined!
According to comments in the code, the mailbox is a shared memory region,
not a set of MMIO registers, so we should use memremap() for mapping it
instead of ioremap or acpi_os_ioremap, and pointer dereferences instead
of readl/writel.The driver already uses plain kernel pointers, so it's a bit unusual
to work with functions that operate on __iomem pointers, and this
fixes that part too.I'm using READ_ONCE/WRITE_ONCE here to keep the existing behavior
regarding the ordering of the accesses from the CPU, but note that
there are no barriers (also unchanged from before).I'm also keeping the endianness behavior, though I'm unsure whether
the message data was supposed to be in LE32 format in the first
place, it's possible this was meant to be interpreted as a byte
stream instead.Signed-off-by: Arnd Bergmann
Acked-by: Hoan Tran
Tested-by: Hoan Tran
Signed-off-by: Guenter Roeck
09 Sep, 2016
18 commits
-
Simplify code and reduce code size by using the new hwmon
registration API.Other changes:
- Convert to use regmap, and drop local caching. This avoids reading
registers unnecessarily, and uses regmap for caching of non-volatile
registers.
- Add support for temp2_max, temp2_max_alarm, temp2_max_hyst, and
temp2_offset.
- Order include files alphabetically
- Drop FSF address
- Check errors from register read and write functions and report
to userspace.
- Accept negative hysteresis values. While unlikely, a maximum limit
_can_ be set to a value smaller than 31 degrees C, which makes negative
hysteresis values possible.Signed-off-by: Guenter Roeck
-
Simplify code and reduce code size by using the new hwmon
registration API.Signed-off-by: Guenter Roeck
-
Simplify code and reduce code size by using the new hwmon
registration API.Signed-off-by: Guenter Roeck
-
Simplify code and reduce code size by using the new hwmon
registration API.Signed-off-by: Guenter Roeck
-
Simplify code and reduce code size by using the new hwmon
registration API.Signed-off-by: Guenter Roeck
-
Simplify code and reduce code size by using the new hwmon
registration API.Signed-off-by: Guenter Roeck
-
Simplify code and reduce code size by using the new hwmon
registration API.Signed-off-by: Guenter Roeck
-
Simplify code and reduce code size by using the new hwmon
registration API.Signed-off-by: Guenter Roeck
-
Reduce driver complexity and size by converting it to
the new hwmon API.Signed-off-by: Guenter Roeck
-
Simplify code and reduce code size by using the new hwmon
registration API.Signed-off-by: Guenter Roeck
-
The system crashes during probing xgene-hwmon driver when temperature
alarm interrupt occurs before.
It's because
- xgene_hwmon_probe() requests mailbox channel which also enables
the mailbox interrupt.
- As temperature alarm interrupt is pending, ISR runs and crashes when
accesses into invalid resourse as unmapped PCC shared memory.This patch fixes this issue by saving this alarm message and scheduling a
bottom handler after xgene_hwmon_probe() finish.Signed-off-by: Hoan Tran
Reported-by: Itaru Kitayama
Signed-off-by: Guenter Roeck -
iio_channel_get_all returns -ENODEV when it cannot find either phandles and
properties in the Device Tree or channels whose consumer_dev_name matches
iio_hwmon in iio_map_list. The iio_map_list is filled in by iio drivers
which might be probed after iio_hwmon.It is better to defer the probe of iio_hwmon if such error is returned by
iio_channel_get_all in order to let a chance to iio drivers to expose
channels in iio_map_list.Signed-off-by: Quentin Schulz
Signed-off-by: Guenter Roeck -
The fan can be stopped by writing "3" to pwm1_enable in sysfs.
Add devicetree property for early initialization of the fan controller
to prevent overheating, for example when resetting the board while the
fan was completely turned off.Also improve error reporting, I2C failures were ignored while writing
new values.Signed-off-by: Mike Looijmans
Signed-off-by: Guenter Roeck -
Parse devicetree parameters for voltage and prescaler setting. This allows
using multiple max6550 devices with varying settings, and also makes it
possible to instantiate and configure the device using devicetree.Signed-off-by: Mike Looijmans
Signed-off-by: Guenter Roeck -
Remove the index comments at the end of it87_attributes_in. They
serve no purpose (as there is no reference to them in
it87_in_is_visible) and some of them were obviously wrong.Signed-off-by: Jean Delvare
Cc: Martin Blumenstingl
Cc: Guenter Roeck
Signed-off-by: Guenter Roeck -
The UCD90160 Power Supply Sequencer reuses the existing register layout,
so just an id addition was required.Signed-off-by: Matthew Weber
Signed-off-by: Ronak Desai
[groeck: Updated description, ordered alphabetically, added documentation]
Signed-off-by: Guenter Roeck -
The field "owner" is set by the core.
Thus delete an unneeded initialisation.Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Signed-off-by: Markus Elfring
Acked-by: Sudeep Holla
Signed-off-by: Guenter Roeck -
Signed-off-by: Thilo Cestonaro
Signed-off-by: Guenter Roeck