[PATCH] hwmon: (tc654) Update to use SPDX-License-Identifier

2019-05-14 Thread Chris Packham
Add the SPDX-License-Identifier to the top of the file and remove the old license boilerplate. Signed-off-by: Chris Packham --- Notes: I've gone with GPL-2.0+ because that matches the old text. As the author I don't mind switching to GPL-2.0 if people want that. drivers/hwmon/tc654.c

Re: [PATCH v2 1/2] dt-bindings: hwmon: add binding documentation for adt7475

2018-11-19 Thread Chris Packham
On 20/11/18 10:40 AM, Rob Herring wrote: > On Sun, Nov 18, 2018 at 4:56 PM Guenter Roeck wrote: >> >> On 11/17/18 7:29 AM, Rob Herring wrote: >>> On Fri, Nov 09, 2018 at 11:56:06AM +1300, Chris Packham wrote: >>>> With the addition of the invert-pwm property th

Re: [PATCH v2 1/2] dt-bindings: hwmon: add binding documentation for adt7475

2018-11-11 Thread Chris Packham
On 9/11/18 11:56 AM, Chris Packham wrote: > With the addition of the invert-pwm property the adt7475 needs its own > binding documentation rather being captured under trivial-devices.txt. > > Signed-off-by: Chris Packham > --- > Changes in v2: > - use pwm-polarity attiribu

[PATCH v2 2/2] hwmon: (adt7475): add support for inverting the pwm output

2018-11-08 Thread Chris Packham
Add a "invert-pwm" device-tree property to allow hardware designs to use inverted logic on the PWM output. We intentionally preserve the invert PWM output bit if the property is not found to allow for bootloaders/bios which may have configured this earlier. Signed-off-by: Chr

[PATCH v2 0/2] hwmon: (adt7475): inverted PWM output

2018-11-08 Thread Chris Packham
. Chris Packham (2): dt-bindings: hwmon: add binding documentation for adt7475 hwmon: (adt7475): add support for inverting the pwm output .../devicetree/bindings/hwmon/adt7475.txt | 24 .../devicetree/bindings/trivial-devices.txt | 4 --- drivers/hwmon/adt7475.c

[PATCH v2 1/2] dt-bindings: hwmon: add binding documentation for adt7475

2018-11-08 Thread Chris Packham
With the addition of the invert-pwm property the adt7475 needs its own binding documentation rather being captured under trivial-devices.txt. Signed-off-by: Chris Packham --- Changes in v2: - use pwm-polarity attiribute to indicate normal or inverted polarity. .../devicetree/bindings/hwmon

Re: [PATCH 1/2] dt-bindings: hwmon: add binding documentation for adt7475

2018-11-08 Thread Chris Packham
On 7/11/18 6:08 PM, Guenter Roeck wrote: > On 11/6/18 8:27 PM, Chris Packham wrote: >> On 7/11/18 5:24 PM, Guenter Roeck wrote: >>> On 11/6/18 8:00 PM, Chris Packham wrote: >>>> With the addition of the invert-pwm property the adt7475 needs its own >>>> b

Re: [PATCH 1/2] dt-bindings: hwmon: add binding documentation for adt7475

2018-11-06 Thread Chris Packham
On 7/11/18 5:24 PM, Guenter Roeck wrote: > On 11/6/18 8:00 PM, Chris Packham wrote: >> With the addition of the invert-pwm property the adt7475 needs its own >> binding documentation rather being captured under trivial-devices.txt. >> >> Signed-off-by: Chris Packham

[PATCH 1/2] dt-bindings: hwmon: add binding documentation for adt7475

2018-11-06 Thread Chris Packham
With the addition of the invert-pwm property the adt7475 needs its own binding documentation rather being captured under trivial-devices.txt. Signed-off-by: Chris Packham --- .../devicetree/bindings/hwmon/adt7475.txt | 22 +++ .../devicetree/bindings/trivial-devices.txt

[PATCH 2/2] hwmon: (adt7475): add support for inverting the pwm output

2018-11-06 Thread Chris Packham
Add a "invert-pwm" device-tree property to allow hardware designs to use inverted logic on the PWM output. We intentionally preserve the invert PWM output bit if the property is not found to allow for bootloaders/bios which may have configured this earlier. Signed-off-by: Chr

[PATCH 0/2] hwmon: (adt7475): inverted PWM output

2018-11-06 Thread Chris Packham
. Chris Packham (2): dt-bindings: hwmon: add binding documentation for adt7475 hwmon: (adt7475): add support for inverting the pwm output .../devicetree/bindings/hwmon/adt7475.txt | 22 +++ .../devicetree/bindings/trivial-devices.txt | 4 drivers/hwmon/adt7475.c

Re: [PATCH v4 2/3] hwmon: (adt7475) temperature smoothing

2017-05-16 Thread Chris Packham
> https://github.com/0day-ci/linux/commits/Chris-Packham/hwmon-adt7475-fan-stall-prevention/20170515-093530 > base: > https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git > hwmon-next > config: x86_64-rhel (attached as .config) > compiler: gcc-6 (

Re: [PATCH v4 3/3] hwmon: (adt7475) add high frequency support

2017-05-15 Thread Chris Packham
On 16/05/17 01:26, Guenter Roeck wrote: > On 05/14/2017 06:30 PM, Chris Packham wrote: >> 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 ar

[PATCH v4 1/3] hwmon: (adt7475) fan stall prevention

2017-05-14 Thread Chris Packham
at the minimum configure pwm duty cycle. Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- Changes in v2: - use pwmN_stall_dis as the attribute name. I think this describes the purpose pretty well. I went with a new attribute instead of overloading pwmN_auto_point1_pwm so this d

[PATCH v4 2/3] hwmon: (adt7475) temperature smoothing

2017-05-14 Thread Chris Packham
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 <chris.pack...@alliedtelesis.co.nz> --- Changes in v2: - use a single tempN_smoothing attribute Changes

[PATCH v4 0/3] (adt7475) small enhancements

2017-05-14 Thread Chris Packham
This is a series of small enhancements to the adt7475 driver. We're using an adt7476 chip in several network switches and generally speaking the requirement for this type of equipment is to keep the fan moving so that we know it is working when we need it. Chris Packham (3): hwmon: (adt7475

Re: [PATCH v3 3/4] hwmon: (adt7475) temperature smoothing

2017-05-14 Thread Chris Packham
On 15/05/17 03:40, Guenter Roeck wrote: > On 05/10/2017 08:45 PM, Chris Packham wrote: >> When enabled temperature smoothing allows ramping the fan speed over a >> configurable period of time instead of jumping to the new speed >> instantaneously. >> >> Signed-

Re: [PATCH v3 2/4] hwmon: (adt7475) fan stall prevention

2017-05-14 Thread Chris Packham
On 15/05/17 02:54, Guenter Roeck wrote: > On 05/10/2017 08:45 PM, Chris Packham wrote: >> 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 d

Re: [PATCH v3 4/4] hwmon: (adt7475) add high frequency support

2017-05-11 Thread Chris Packham
On 11/05/17 15:45, Chris Packham wrote: > 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. > > Si

[PATCH v3 2/4] hwmon: (adt7475) fan stall prevention

2017-05-10 Thread Chris Packham
at the minimum configure pwm duty cycle. Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- Changes in v2: - use pwmN_stall_dis as the attribute name. I think this describes the purpose pretty well. I went with a new attribute instead of overloading pwmN_auto_point1_pwm so this d

[PATCH v3 4/4] hwmon: (adt7475) add high frequency support

2017-05-10 Thread Chris Packham
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 <chris.pack...@alliedtelesis.co.nz> --- C

[PATCH v3 3/4] hwmon: (adt7475) temperature smoothing

2017-05-10 Thread Chris Packham
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 <chris.pack...@alliedtelesis.co.nz> --- Changes in v2: - use a single tempN_smoothing attribute Changes

[PATCH v3 1/4] hwmon: (adt7475) replace find_nearest() with find_closest()

2017-05-10 Thread Chris Packham
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 <chris.p

[PATCH v3 0/4] hwmon: (adt7475) small enhancements

2017-05-10 Thread Chris Packham
. The desire to keep the fans running is understood but the attribute/implementation are being debated. I think the others stand on their own merits. Chris Packham (4): hwmon: (adt7475) replace find_nearest() with find_closest() hwmon: (adt7475) fan stall prevention hwmon: (adt7475

Re: [RFC PATCH v2 3/3] hwmon: (adt7475) temperature smoothing

2017-05-03 Thread Chris Packham
On 04/05/17 04:30, Guenter Roeck wrote: > On Wed, May 03, 2017 at 12:40:09PM +1200, Chris Packham wrote: >> When enabled temperature smoothing allows ramping the fan speed over a >> configurable period of time instead of jumping to the new speed >> instantaneously. >&

Re: [RFC PATCH v2 2/3] hwmon: (adt7475) fan stall prevention

2017-05-03 Thread Chris Packham
On 04/05/17 04:10, Guenter Roeck wrote: > On Wed, May 03, 2017 at 12:40:08PM +1200, Chris Packham wrote: >> 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

Re: [RFC PATCH v2 3/3] hwmon: (adt7475) temperature smoothing

2017-05-03 Thread Chris Packham
On 03/05/17 12:40, Chris Packham wrote: > 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 <chris.pack...@alliedtelesis.co.nz> > ---

[RFC PATCH v2 3/3] hwmon: (adt7475) temperature smoothing

2017-05-02 Thread Chris Packham
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 <chris.pack...@alliedtelesis.co.nz> --- Changes in v2: - use a single tempN_smoothing attribute Documen

[RFC PATCH v2 2/3] hwmon: (adt7475) fan stall prevention

2017-05-02 Thread Chris Packham
at the minimum configure pwm duty cycle. Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- Changes in v2: - use pwmN_stall_dis as the attribute name. I think this describes the purpose pretty well. I went with a new attribute instead of overloading pwmN_auto_point1_pwm so this d

[RFC PATCH v2 0/3] hwmon: (adt7475) small enhancements

2017-05-02 Thread Chris Packham
This is a series of small enhancements to the adt7475 driver. We're using an adt7476 chip in several network switches and generally speaking the requirement for this type of equipment is to keep the fan moving so that we know it is working when we need it. Chris Packham (3): hwmon: (adt7475

[RFC PATCH v2 1/3] hwmon: (adt7475) replace find_nearest() with find_closest()

2017-05-02 Thread Chris Packham
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 <chris.p

[PATCH 2/3] hwmon: (adt7475) fan stall prevention

2017-05-01 Thread Chris Packham
at the minimum configure pwm duty cycle. Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- pwmN_min is a horrible name but I really can't think of anything better. I'm biased a little because that is essentially the name of the bits in the datasheet. I'm open to suggestions. Documen

[RFC PATCH 3/3] hwmon: (adt7475) temperature smoothing

2017-05-01 Thread Chris Packham
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 <chris.pack...@alliedtelesis.co.nz> --- Documentation/hwmon/adt7475 | 5 ++ drivers/hwmon/adt7475.c

[RFC PATCH 1/3] hwmon: (adt7475) replace find_nearest() with find_closest()

2017-05-01 Thread Chris Packham
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 <chris.p

[RFC PATCH 0/3] hwmon: (adt7475) small enhancements

2017-05-01 Thread Chris Packham
This is a series of small enhancements to the adt7475 driver. We're using an adt7476 chip in several network switches and generally speaking the requirement for this type of equipment is to keep the fan moving so that we know it is working when we need it. Chris Packham (3): hwmon: (adt7475

Re: Enabling enhanced acoustics on adt7475

2017-05-01 Thread Chris Packham
On 02/05/17 07:16, Guenter Roeck wrote: > On Mon, May 01, 2017 at 08:45:14AM +0000, Chris Packham wrote: >> Hi, >> >> I'm looking at adding code to configure the enhanced acoustics on the >> ADT7475 and compatible devices. >> >> I'm wondering if I should be

[PATCH] hwmon: (adt7475) set start bit in probe

2017-04-21 Thread Chris Packham
/ADT7475-D.PDF Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- drivers/hwmon/adt7475.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index fcfa48222145..c803e3c5fcd4 100644 --- a/drivers/hwmon/adt7475.c

[PATCH v5 2/2] lm87: Allow channel data to be set from dts file

2017-03-30 Thread Chris Packham
ithout the channel variable set correctly, some of the sensors will not be initialized correctly. For example temp3 sensor sysfs entries. This implements the schema agreed with the device tree binding document. Signed-off-by: Mahoda Ratnayaka <mahoda.ratnay...@alliedtelesis.co.nz> Tested-by: C

[PATCH v5 1/2] Documentation: dtb: lm87: Add hwmon binding documentation

2017-03-30 Thread Chris Packham
From: Mahoda Ratnayaka <mahoda.ratnay...@alliedtelesis.co.nz> This patch adds lm87 hwmon device tree node documentation. Signed-off-by: Mahoda Ratnayaka <mahoda.ratnay...@alliedtelesis.co.nz> Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> Acked-by:

[PATCH] docs: hwmon: Fix typo "Microship" should be "Microchip"

2017-02-21 Thread Chris Packham
Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- Documentation/hwmon/tc654 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/hwmon/tc654 b/Documentation/hwmon/tc654 index 91a2843f5f98..47636a8077b4 100644 --- a/Documentation/hwmon/tc654

Re: [PATCHv4] hwmon: Add tc654 driver

2016-10-12 Thread Chris Packham
On 10/13/2016 02:03 AM, Guenter Roeck wrote: > On Tue, Oct 11, 2016 at 10:26:31AM +1300, Chris Packham wrote: >> > Add support for the tc654 and tc655 fan controllers from Microchip. >> > >> > http://ww1.microchip.com/downloads/en/DeviceDoc/20001734C.pdf >>

[PATCHv4] hwmon: Add tc654 driver

2016-10-10 Thread Chris Packham
Add support for the tc654 and tc655 fan controllers from Microchip. http://ww1.microchip.com/downloads/en/DeviceDoc/20001734C.pdf Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- Changes in v4: - tab-align values in #defines - ensure locking in set_pwm covers updating

Re: [PATCHv3] hwmon: Add tc654 driver

2016-10-10 Thread Chris Packham
On 10/11/2016 02:22 AM, Guenter Roeck wrote: >> +if (val) >> > + data->config |= TC654_REG_CONFIG_DUTYC; >> > + else >> > + data->config &= ~TC654_REG_CONFIG_DUTYC; > I just realized that this won't work as intended. Problem is that you > only fill data->config when reading

adm9240 error handling (was Re: [PATCHv1] hwmon: adm9240: handle temperature readings below 0)

2016-10-04 Thread Chris Packham
Hi Guenter, On 10/05/2016 11:10 AM, Guenter Roeck wrote: > On Tue, Oct 04, 2016 at 09:09:10PM +0000, Chris Packham wrote: >> >>> >>> Of course, all that doesn't solve the real problem in this driver, which is >>> that it ignores error codes from the smbus fun

[PATCHv2] hwmon: adm9240: handle temperature readings below 0

2016-10-04 Thread Chris Packham
of a signed 16-bit value. When presenting this in sysfs the value is shifted and scaled appropriately. Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- Changes in v2: - Simplify as per feedback from Guenter. - Re-word commit message. drivers/hwmon/adm9240.c | 4 ++-- 1 file c

Re: [PATCHv1] hwmon: adm9240: handle temperature readings below 0

2016-10-04 Thread Chris Packham
On 10/05/2016 09:54 AM, Guenter Roeck wrote: > On Tue, Oct 04, 2016 at 05:08:00PM +1300, Chris Packham wrote: >> 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 means

[PATCHv1] hwmon: adm9240: handle temperature readings below 0

2016-10-03 Thread Chris Packham
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 means we can't rely on sign-extension to handle negative values. Signed-off-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- d

Re: [PATCH] hwmon: adt7470: Allow faster removal

2016-09-01 Thread Chris Packham
Hi Guenter, Jean, On 09/02/2016 12:12 AM, Guenter Roeck wrote: > On 08/31/2016 10:17 PM, Joshua Scott wrote: >> adt7470_remove will wait for the update thread to complete before >> returning. This has a worst-case time of up to the user-configurable >> auto_update_interval. >> >> Break this delay