Re: [PATCH v3 2/3] fpga: dfl: fme: add thermal management support

2019-06-05 Thread Guenter Roeck
On Mon, May 27, 2019 at 02:06:55PM +0800, Wu Hao wrote: > This patch adds support to thermal management private feature for DFL > FPGA Management Engine (FME). This private feature driver registers > a hwmon for thermal/temperature monitoring (hwmon temp1_input). > If hardware automatic throttling

Re: [PATCH v2 2/2] hwmon: (pmbus) Add Infineon IRPS5401 driver

2019-06-05 Thread Guenter Roeck
On Wed, Jun 05, 2019 at 01:49:01PM -0600, Robert Hancock wrote: > Add a driver to support the Infineon IRPS5401 PMIC. This chip has 5 > pages corresponding to 4 switching outputs and one linear (LDO) output. > The switching and LDO outputs have slightly different supported > parameters. >

Re: [PATCH v2 1/2] hwmon: (pmbus) Treat parameters as paged if on multiple pages

2019-06-05 Thread Guenter Roeck
On Wed, Jun 05, 2019 at 01:49:00PM -0600, Robert Hancock wrote: > Some chips have attributes which exist on more than one page but the > attribute is not presently marked as paged. This causes the attributes > to be generated with the same label, which makes it impossible for > userspace to tell

Re: [PATCH 2/2] hwmon: Add ads1000/ads1100 voltage ADCs driver

2019-06-05 Thread Guenter Roeck
On Mon, Jun 03, 2019 at 12:11:17PM +0100, Jonathan Cameron wrote: > On Thu, 30 May 2019 05:55:10 -0700 > Guenter Roeck wrote: > > > Hi, > > > > On Wed, May 15, 2019 at 01:58:09AM +0300, Serge Semin wrote: > > > These are simple Texas Instruments ADC workin

Re: [PATCH] hwmon: (nct7904) Add extra sysfs support for fan, voltage and temperature.

2019-06-05 Thread Guenter Roeck
On Fri, May 31, 2019 at 10:22:54AM +, amy.s...@advantech.com.tw wrote: > From: "amy.shih" > > This patch do 2 jobs as described in below: > > 1. NCT-7904D also supports reading of channel limitation registers > and SMI status registers for fan, voltage and temperature monitoring, > add

Re: [PATCH v2 2/2] adm1275: support PMBUS_VIRT_*_SAMPLES

2019-06-05 Thread Guenter Roeck
On Wed, May 29, 2019 at 02:36:21PM +, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: > The device supports setting the number of samples for averaging the > measurements. There are two separate settings - PWR_AVG for averaging > PIN and VI_AVG for averaging VIN/VAUX/IOUT, both being part of >

Re: [PATCHv2 2/2] hwmon: core: fix potential memory leak in *hwmon_device_register*

2019-06-05 Thread Guenter Roeck
actually this is wrong. hwdev is freed indirectly with the device_unregister() call. See commit 74e3512731bd ("hwmon: (core) Fix double-free in __hwmon_device_register()"). It may make sense to add a respective comment to the code, though. Guenter > Cc: Jean Delvare > Cc: Guenter

Re: [PATCHv2 2/2] hwmon: core: fix potential memory leak in *hwmon_device_register*

2019-06-05 Thread Guenter Roeck
ice_register jumps to ida_remove, leaving > the locally allocated hwdev pointer. > > This patch fixes the leak by jumping to a new label that > will first unregister hdev and then fall into the kfree of hwdev > to finally remove the idas and propagate the error code. > > Cc:

Re: [PATCH v2 1/2] pmbus: (core) mutex_lock write in pmbus_set_samples

2019-06-05 Thread Guenter Roeck
On Wed, May 29, 2019 at 02:33:52PM +, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: > update_lock is a mutex intended to protect write operations. It was not > taken, however, when _pmbus_write_word_data is called from > pmbus_set_samples() function which may cause problems especially when >

Re: [PATCH 1/3] hwmon: (pmbus) Add paged support for VIN, IIN, PIN parameters

2019-06-05 Thread Guenter Roeck
On Wed, Jun 05, 2019 at 01:22:21PM -0600, Robert Hancock wrote: > On 2019-06-05 12:27 p.m., Guenter Roeck wrote: > >>> To reduce risk due to potentially mis-detecting support on other chips, > >>> it may be better to add a separate backend driver for this chip. This >

Re: [PATCH 1/3] hwmon: (pmbus) Add paged support for VIN, IIN, PIN parameters

2019-06-05 Thread Guenter Roeck
On Wed, Jun 05, 2019 at 11:14:46AM -0600, Robert Hancock wrote: > On 2019-06-05 10:48 a.m., Guenter Roeck wrote: > > On Wed, Jun 05, 2019 at 10:17:12AM -0600, Robert Hancock wrote: > >> Previously the VIN, IIN and PIN parameters were marked as non-paged, > >&

Re: [PATCH 1/3] hwmon: (pmbus) Add paged support for VIN, IIN, PIN parameters

2019-06-05 Thread Guenter Roeck
On Wed, Jun 05, 2019 at 10:17:12AM -0600, Robert Hancock wrote: > Previously the VIN, IIN and PIN parameters were marked as non-paged, > however on the IRPS5401 these parameters are present on multiple pages. > Add the paged flag for these parameters so they can be detected properly > on such

Re: [PATCH] hwmon: pmbus: protect read-modify-write with lock

2019-06-03 Thread Guenter Roeck
On Mon, Jun 03, 2019 at 01:11:45PM +, Sverdlin, Alexander (Nokia - DE/Ulm) wrote: > Hi! > > On 30/05/2019 08:45, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: > > The operation done in the pmbus_update_fan() function is a > > read-modify-write operation but it lacks any kind of lock

Re: [PATCH 3/3] drivers: hwmon: i5k_amb: remove unnecessary #ifdef MODULE

2019-06-01 Thread Guenter Roeck
On Sat, Jun 01, 2019 at 04:01:40PM +0200, Enrico Weigelt, metux IT consult wrote: > The MODULE_DEVICE_TABLE() macro already checks for MODULE defined, > so the extra check here is not necessary. > > Signed-off-by: Enrico Weigelt > --- > drivers/hwmon/i5k_amb.c | 2 -- > 1 file changed, 2

Re: [PATCH] hwmon: pmbus: protect read-modify-write with lock

2019-05-30 Thread Guenter Roeck
Hi, On Thu, May 30, 2019 at 06:45:48AM +, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: > The operation done in the pmbus_update_fan() function is a > read-modify-write operation but it lacks any kind of lock protection > which may cause problems if run more than once simultaneously. This >

Re: [PATCH 2/2] hwmon: Add ads1000/ads1100 voltage ADCs driver

2019-05-30 Thread Guenter Roeck
Hi, On Wed, May 15, 2019 at 01:58:09AM +0300, Serge Semin wrote: > These are simple Texas Instruments ADC working over i2c-interface with > just one differential input and with configurable 12-16 bits resolution. > Sample rate is fixed to 128 for ads1000 and can vary from 8 to 128 for > ads1100.

Re: [PATCH] adm1275: support PMBUS_VIRT_*_SAMPLES

2019-05-29 Thread Guenter Roeck
On 5/29/19 5:53 AM, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: On Wed, May 29, 2019 at 05:17:47AM -0700, Guenter Roeck wrote: On 5/29/19 12:11 AM, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: On Tue, May 28, 2019 at 12:46:52PM -0700, Guenter Roeck wrote: On Fri, May 24, 2019 at 12:49

Re: [PATCH] adm1275: support PMBUS_VIRT_*_SAMPLES

2019-05-29 Thread Guenter Roeck
On 5/29/19 12:11 AM, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: On Tue, May 28, 2019 at 12:46:52PM -0700, Guenter Roeck wrote: On Fri, May 24, 2019 at 12:49:13PM +, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: The device supports setting the number of samples for averaging

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

2019-05-28 Thread Guenter Roeck
On Wed, May 15, 2019 at 03:15:08PM +1200, Chris Packham wrote: > Add the SPDX-License-Identifier to the top of the file and remove the > old license boilerplate. > > Signed-off-by: Chris Packham Applied to hwmon-next. Thanks, Guenter > --- > > Notes: > I've gone with GPL-2.0+ because

Re: [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO()

2019-05-28 Thread Guenter Roeck
On Tue, May 28, 2019 at 08:15:41PM +0200, Marek Vasut wrote: > The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood > of errors, and makes the code easier to read. > > Signed-off-by: Marek Vasut > Cc: Andrew Lunn > Cc: Florian Fainelli > Cc: Gue

Re: [PATCH] adm1275: support PMBUS_VIRT_*_SAMPLES

2019-05-28 Thread Guenter Roeck
On Fri, May 24, 2019 at 12:49:13PM +, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote: > The device supports setting the number of samples for averaging the > measurements. There are two separate settings - PWR_AVG for averaging > PIN and VI_AVG for averaging VIN/VAUX/IOUT, both being part of >

Re: [PATCH 1/2] hwmon: core: add thermal sensors only if dev->of_node is present

2019-05-28 Thread Guenter Roeck
l register with hwmon, but not with > the thermal subsystem. If all the hwmon part bits are in place, > the registration will succeed. > Makes sense. I'd apply it as-is, but it would be better if you resend it to the list to give others a chance to comment. Thanks, Guenter > Cc: Jean

Re: [PATCH 2/2] hwmon: core: fix potential memory leak in *hwmon_device_register*

2019-05-28 Thread Guenter Roeck
nd propagate the error code. > > Cc: Jean Delvare > Cc: Guenter Roeck > Cc: linux-hwmon@vger.kernel.org > Cc: linux-ker...@vger.kernel.org > Signed-off-by: Eduardo Valentin > --- > drivers/hwmon/hwmon.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) &

Re: [PATCH] hwmon: (smsc47m1) fix outside array bounds warnings

2019-05-28 Thread Guenter Roeck
On 5/27/19 8:09 PM, Masahiro Yamada wrote: On Tue, May 28, 2019 at 10:25 AM Guenter Roeck wrote: On 5/22/19 8:08 AM, Jean Delvare wrote: Hi Masahiro, On Tue, 21 May 2019 13:44:56 +0900, Masahiro Yamada wrote: Kbuild test robot reports outside array bounds warnings: CC [M] drivers

Re: [PATCH] hwmon: (smsc47m1) fix outside array bounds warnings

2019-05-27 Thread Guenter Roeck
On 5/22/19 8:08 AM, Jean Delvare wrote: Hi Masahiro, On Tue, 21 May 2019 13:44:56 +0900, Masahiro Yamada wrote: Kbuild test robot reports outside array bounds warnings: CC [M] drivers/hwmon/smsc47m1.o drivers/hwmon/smsc47m1.c: In function 'fan_div_store': drivers/hwmon/smsc47m1.c:370:49:

Re: [PATCH V5] net: phy: tja11xx: Add TJA11xx PHY driver

2019-05-27 Thread Guenter Roeck
On 5/17/19 4:51 PM, Marek Vasut wrote: Add driver for the NXP TJA1100 and TJA1101 PHYs. These PHYs are special BroadRReach 100BaseT1 PHYs used in automotive. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Guenter Roeck Cc: Heiner Kallweit Cc: Jean Delvare Cc: linux

Re: [PATCH v5 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-14 Thread Guenter Roeck
On Tue, May 14, 2019 at 09:44:02AM -0700, Florian Fainelli wrote: > On 5/14/19 9:37 AM, Sudeep Holla wrote: > > On Wed, May 08, 2019 at 11:46:35AM -0700, Florian Fainelli wrote: > >> If the SCMI firmware implementation is reporting values in a scale that > >> is different from the HWMON units, we

Re: [PATCH 1/6] thermal: Introduce devm_thermal_of_cooling_device_register

2019-05-11 Thread Guenter Roeck
Hi Eduardo, On 5/11/19 12:04 PM, Eduardo Valentin wrote: Hello Guenter, On Thu, Apr 18, 2019 at 12:58:15PM -0700, Guenter Roeck wrote: thermal_of_cooling_device_register() and thermal_cooling_device_register() are typically called from driver probe functions

Re: [PATCH v5 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-08 Thread Guenter Roeck
lorian Fainelli Reviewed-by: Guenter Roeck Question is which tree this series should go through. I am fine with arm. Thanks, Guenter > --- > drivers/hwmon/scmi-hwmon.c | 45 ++ > 1 file changed, 45 insertions(+) > > diff --git a/drivers/hwmon/scm

Re: [PATCH] hwmon (occ): Switch power average to between poll responses

2019-05-08 Thread Guenter Roeck
On Tue, May 07, 2019 at 02:35:51PM -0500, Eddie James wrote: > The average power reported in the hwmon OCC driver is not useful > because the time it represents is too short. Instead, store the > previous power accumulator reported by the OCC and average it with the > latest accumulator to obtain

Re: [PATCH v4 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-08 Thread Guenter Roeck
Hi Florian, On Wed, May 08, 2019 at 10:00:35AM -0700, Florian Fainelli wrote: > If the SCMI firmware implementation is reporting values in a scale that > is different from the HWMON units, we need to scale up or down the value > according to how far appart they are. > > Signed-off-by: Florian

Re: [PATCH v3 0/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-08 Thread Guenter Roeck
On Wed, May 08, 2019 at 09:26:10AM -0700, Florian Fainelli wrote: > On 5/8/19 4:35 AM, Sudeep Holla wrote: > > On Tue, May 07, 2019 at 04:09:15PM -0700, Florian Fainelli wrote: > >> Hi Sudeep, Guenter, > >> > >> This patch series adds support for scaling SCMI sensor values read from > >> firmware.

Re: [PATCH v3 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Guenter Roeck
On 5/7/19 4:09 PM, Florian Fainelli wrote: If the SCMI firmware implementation is reporting values in a scale that is different from the HWMON units, we need to scale up or down the value according to how far appart they are. Signed-off-by: Florian Fainelli --- drivers/hwmon/scmi-hwmon.c |

Re: [PATCH v2 1/3] kernel: Provide a __pow10() function

2019-05-07 Thread Guenter Roeck
On 5/7/19 2:49 PM, Florian Fainelli wrote: On 5/7/19 2:06 PM, Guenter Roeck wrote: On Tue, May 07, 2019 at 12:35:02PM -0700, Florian Fainelli wrote: Provide a simple macro that can return the value of 10 raised to a positive integer. We are going to use this in order to scale units from

Re: [PATCH v2 3/3] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Guenter Roeck
On Tue, May 07, 2019 at 12:35:04PM -0700, Florian Fainelli wrote: > If the SCMI firmware implementation is reporting values in a scale that > is different from the HWMON units, we need to scale up or down the value > according to how far appart they are. > > Signed-off-by: Florian Fainelli > ---

Re: [PATCH v2 1/3] kernel: Provide a __pow10() function

2019-05-07 Thread Guenter Roeck
On Tue, May 07, 2019 at 12:35:02PM -0700, Florian Fainelli wrote: > Provide a simple macro that can return the value of 10 raised to a > positive integer. We are going to use this in order to scale units from > firmware to HWMON. > > Signed-off-by: Florian Fainelli > --- >

Re: [PATCH v2 15/18] fpga: dfl: fme: add thermal management support

2019-05-07 Thread Guenter Roeck
On Tue, May 07, 2019 at 01:20:52PM -0500, Alan Tull wrote: > On Mon, Apr 29, 2019 at 4:13 AM Wu Hao wrote: > > + The hwmon people > > > > > This patch adds support to thermal management private feature for DFL > > FPGA Management Engine (FME). This private feature driver registers > > a hwmon

Re: [PATCH v2 16/18] fpga: dfl: fme: add power management support

2019-05-07 Thread Guenter Roeck
On Tue, May 07, 2019 at 01:23:33PM -0500, Alan Tull wrote: > On Mon, Apr 29, 2019 at 4:13 AM Wu Hao wrote: > > + hwmon folks > > > > > This patch adds support for power management private feature under > > FPGA Management Engine (FME). This private feature driver registers > > a hwmon for power

Re: [PATCH 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Guenter Roeck
Hi Florian, On Tue, May 07, 2019 at 10:44:00AM -0700, Florian Fainelli wrote: > On 5/7/19 6:55 AM, Guenter Roeck wrote: > > Hi Florian, > > > > On 5/6/19 3:41 PM, Florian Fainelli wrote: > >> If the SCMI firmware implementation is reporting values in a scale that &g

Re: [PATCH 2/2] hwmon: scmi: Scale values to target desired HWMON units

2019-05-07 Thread Guenter Roeck
Hi Florian, On 5/6/19 3:41 PM, Florian Fainelli wrote: If the SCMI firmware implementation is reporting values in a scale that is different from the HWMON units, we need to scale up or down the value according to how far appart they are. Signed-off-by: Florian Fainelli ---

Re: [PATCH 1/2] firmware: arm_scmi: Fetch and store sensor scale

2019-05-07 Thread Guenter Roeck
On 5/6/19 3:41 PM, Florian Fainelli wrote: In preparation for dealing with scales within the SCMI HWMON driver, fetch and store the sensor unit scale into the scmi_sensor_info structure. Signed-off-by: Florian Fainelli --- drivers/firmware/arm_scmi/sensors.c | 7 ++-

[GIT PULL] hwmon updates for hwmon-for-v5.2

2019-05-06 Thread Guenter Roeck
static sensors hwmon: lochnagar: Add device tree binding document Eddie James (3): hwmon: (occ) Store error condition for rate-limited polls hwmon: (occ) Prevent sysfs error attribute from returning error hwmon: (occ) Add more details to Kconfig help text Guenter Roeck (71

Re: [PATCH v4 0/2] Support for TMP75B temperature sensor

2019-05-03 Thread Guenter Roeck
On Fri, May 03, 2019 at 05:14:59PM +0100, Iker Perez wrote: > From: Iker Perez del Palomar Sustatxa > > This patch series adds support for the TMP75 temperature sensor to the > lm75.c driver. Although the TMP75B has a configurable conversion rate, > this series just sets it to the default rate

Re: [PATCH 1/6] thermal: Introduce devm_thermal_of_cooling_device_register

2019-05-01 Thread Guenter Roeck
On Thu, Apr 18, 2019 at 12:58:15PM -0700, Guenter Roeck wrote: > thermal_of_cooling_device_register() and thermal_cooling_device_register() > are typically called from driver probe functions, and > thermal_cooling_device_unregister() is called from remove functions. This > makes bo

Re: [PATCH] hwmon: Convert to hwmon_device_register_with_info()

2019-04-30 Thread Guenter Roeck
On 4/30/19 3:29 PM, Alakesh Haloi wrote: Booting linux on bare metal instance type causes this warning: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info(). This patch fixes this call to deprecated function in acpi_power_meter.c Changing

Re: [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt

2019-04-30 Thread Guenter Roeck
On Tue, Apr 30, 2019 at 09:57:19AM -0700, Guenter Roeck wrote: > On Tue, Apr 30, 2019 at 03:46:09PM +0100, Iker Perez wrote: > > From: Iker Perez del Palomar Sustatxa > > > There should be some description / rationale for the patch here. > ... and, if it is a separate pat

Re: [PATCH v3 2/2] dt-bindings: hwmon: Add tmp75b to lm75.txt

2019-04-30 Thread Guenter Roeck
On Tue, Apr 30, 2019 at 03:46:09PM +0100, Iker Perez wrote: > From: Iker Perez del Palomar Sustatxa > There should be some description / rationale for the patch here. > Signed-off-by: Iker Perez del Palomar Sustatxa > --- > Documentation/devicetree/bindings/hwmon/lm75.txt | 1 + > 1 file

Re: [PATCH v3 0/2] Version Log

2019-04-30 Thread Guenter Roeck
On Tue, Apr 30, 2019 at 03:46:07PM +0100, Iker Perez wrote: > From: Iker Perez del Palomar Sustatxa > > Changes from V2: > - Correct bad style: > - Bad assigment, missing spaces before and >after "=". > - Divide in two lines longer than 80 characters. > - Separate dt-bindings

Re: [PATCH] hwmon: (lm75) Add support for TMP75B

2019-04-26 Thread Guenter Roeck
On 4/26/19 12:42 AM, Iker Perez del Palomar wrote: The TMP75B has a different control register, supports 12-bit resolution and the default conversion rate is 37 Hz. dt-bindings: hwmon: Add tmp75b to lm75.txt Signed-off-by: Iker Perez del Palomar Sustatxa This patch is corrupted (line wraps

Re: Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B

2019-04-24 Thread Guenter Roeck
On Wed, Apr 24, 2019 at 03:10:38PM +0100, Iker Perez del Palomar wrote: > Hi, > > > Thank you for the review, I will submitted fixed soon. I have one question > before doing it though, after running scrips/chechpatch.sh I obtain the next > message: > > WARNING: DT compatible string "ti,tmp75b"

Re: [PATCH 07/11] hwmon: (max6650) Convert to use devm_hwmon_device_register_with_info

2019-04-24 Thread Guenter Roeck
On Tue, Apr 23, 2019 at 06:33:07AM -0700, Guenter Roeck wrote: > Convert driver to use devm_hwmon_device_register_with_info to simplify > the code and to reduce its size. > To keep everyone up to date, I have made the changes indicated below to the patch. Thanks to 0day and Jul

Re: [hwmon:hwmon-playground 130/134] drivers/hwmon/max6650.c:632:4-10: preceding lock on line 616 (fwd)

2019-04-23 Thread Guenter Roeck
test robot > To: kbu...@01.org > Cc: Julia Lawall > Subject: [hwmon:hwmon-playground 130/134] drivers/hwmon/max6650.c:632:4-10: > preceding lock on line 616 > > CC: kbuild-...@01.org > CC: linux-hwmon@vger.kernel.org > TO: Guenter Roeck > > tree: >

Re: [PATCH 02/11] hwmon: (max6650) Introduce pwm_to_dac and dac_to_pwm

2019-04-23 Thread Guenter Roeck
On Tue, Apr 23, 2019 at 11:23:00AM -0400, Jean-Francois Dagenais wrote: > > > > On Apr 23, 2019, at 09:33, Guenter Roeck wrote: > > > > - > > + dac = pwm_to_dac(pwm, data->config & MAX6650_CFG_V12); > > + err = i2c_smbus_write_byte_data(clie

Re: [PATCH 11/11] hwmon: (max6650) Fix minor formatting issues

2019-04-23 Thread Guenter Roeck
On Tue, Apr 23, 2019 at 10:38:58AM -0400, Jean-Francois Dagenais wrote: > Wow, you sure had fun over the weekend! ;) > > max6650 looked like it needed some love, nice work. > > I am keen to try it out. We are in the integration stage of our board so it's > a > good time to adopt such changes.

Re: Fwd: [PATCH 1/2] hwmon: (lm75) Add support for TMP75B

2019-04-23 Thread Guenter Roeck
On 4/23/19 3:11 AM, Iker Perez del Palomar wrote: The TMP75B has a different control register, supports 12-bit resolution and the default conversion rate is 37 Hz. Signed-off-by: Iker Perez del Palomar Sustatxa This patch is corrupted. It replaces tabs with spaces, and there are line wraps.

Re: [PATCH next 07/25] hwmon: s3c: Use dev_get_drvdata()

2019-04-23 Thread Guenter Roeck
On Tue, Apr 23, 2019 at 03:50:02PM +0800, Kefeng Wang wrote: > Using dev_get_drvdata directly. > > Cc: Jean Delvare > Cc: Guenter Roeck > Cc: linux-hwmon@vger.kernel.org > Signed-off-by: Kefeng Wang Applied to hwmon-next. Thanks, Guenter > --- > drivers/hwmon/s3c-hw

[PATCH 01/11] hwmon: (max6650) Use devm_add_action to unregister thermal device

2019-04-23 Thread Guenter Roeck
Use devm_add_action to unregister the thermal cooling device. This lets us drop the remove function. At the same time, use 'dev' variable in probe function consistently. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 27 --- 1

[PATCH 04/11] hwmon: (max6650) Declare valid as boolean

2019-04-23 Thread Guenter Roeck
Declare valid as boolean to match its use case. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index ac05cc5627d7..8fa888b57efa 100644

[PATCH 06/11] hwmon: (max6650) Simplify alarm handling

2019-04-23 Thread Guenter Roeck
unconditional i2c read operations. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index cf051f3acf26..c02694d70eee 100644 --- a/drivers/hwmon

[PATCH 03/11] hwmon: (max6650) Improve error handling in max6650_init_client

2019-04-23 Thread Guenter Roeck
Do not overwrite errors reported from i2c functions, and don't ignore any errors. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 43 --- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/drivers/hwmon

[PATCH 11/11] hwmon: (max6650) Fix minor formatting issues

2019-04-23 Thread Guenter Roeck
CHECK: struct mutex definition without comment CHECK: Alignment should match open parenthesis Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon

[PATCH 07/11] hwmon: (max6650) Convert to use devm_hwmon_device_register_with_info

2019-04-23 Thread Guenter Roeck
Convert driver to use devm_hwmon_device_register_with_info to simplify the code and to reduce its size. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 505 +++- 1 file changed, 244 insertions(+), 261 deletions

[PATCH 09/11] hwmon: (max6650) Improve error handling in max6650_update_device

2019-04-23 Thread Guenter Roeck
Pass errors from i2c_smbus_read_byte_data() back to the caller of max6650_update_device(). Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 31 --- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon

[PATCH 10/11] hwmon: (max6650) Use SPDX license identifier

2019-04-23 Thread Guenter Roeck
Replace boilerplace license text with SPDX license identifier. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index

[PATCH 02/11] hwmon: (max6650) Introduce pwm_to_dac and dac_to_pwm

2019-04-23 Thread Guenter Roeck
Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 53 - 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index 6cce199dab6a..b6b8f8edc1b0 100644 --- a/drivers/hwmon/max6650.c

[PATCH 08/11] hwmon: (max6650) Read non-volatile registers only once

2019-04-23 Thread Guenter Roeck
Only tachometer and alarm status registers are modified by the chip. All other registers only need to be read only once, and reading them repeatedly does not add any value. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 23 +++ 1 file

[PATCH 05/11] hwmon: (max6650) Cache alarm_en register

2019-04-23 Thread Guenter Roeck
The alarm_en register is read each time the is_visible function is called. Since it is a configuration register, this is completely unnecessary. Read it once and cache its value. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 12 +--- 1 file

Re: [PATCH] hwmon: (max6650) Drop call to thermal_cdev_update

2019-04-23 Thread Guenter Roeck
On 4/23/19 5:42 AM, Jean-Francois Dagenais wrote: On Apr 23, 2019, at 08:36, Guenter Roeck wrote: The call to thermal_cdev_update() causes any fan connected to the chip to stop immediately. If the thermal subsystem is not set up to actually handle the chip as cooling device, the remains

Re: [PATCH v5] hwmon: max6650: add thermal cooling device capability

2019-04-23 Thread Guenter Roeck
On 4/23/19 5:45 AM, Jean-Francois Dagenais wrote: On Apr 22, 2019, at 09:40, Guenter Roeck wrote: On a system which has CONFIG_THERMAL enabled but does not really utilize it, the call to thermal_cdev_update() will result in the fan being stopped immediately since max6650_set_cur_state

[PATCH] hwmon: (max6650) Drop call to thermal_cdev_update

2019-04-23 Thread Guenter Roeck
that thermal_cdev_update() should only be called from thermal governors, not from thermal cooling device drivers. Drop the call. Cc: Jean-Francois Dagenais Signed-off-by: Guenter Roeck --- drivers/hwmon/max6650.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon

Re: [PATCH] docs: hwmon: remove the extension from .rst files

2019-04-22 Thread Guenter Roeck
On Mon, Apr 22, 2019 at 08:14:55AM -0300, Mauro Carvalho Chehab wrote: > On almost all places, we're including ReST files without the > extension. > > Let's remove the extension here as well, in order to use just > one standard. > > Suggested-by: Jani Nikula > Signed-off-by: Mauro

Re: [PATCH v2 48/79] docs: driver-model: convert docs to ReST and rename to *.rst

2019-04-22 Thread Guenter Roeck
/driver-model/index.rst | 26 ++ > .../{overview.txt => overview.rst}| 37 +- > .../{platform.txt => platform.rst}| 30 +- > .../driver-model/{porting.txt => porting.rst} | 333 +- > Documentation/eisa.txt | 4 +- > Documentation/hwmon/submitting-patches.rst| 2 +- For hwmon: Acked-by: Guenter Roeck

Re: [PATCH] docs: hwmon: convert three docs to ReST format

2019-04-22 Thread Guenter Roeck
On Mon, Apr 22, 2019 at 02:39:37PM -0300, Mauro Carvalho Chehab wrote: > Those three new drivers were missed on the initial conversion > to ReST format. So: > > - Rename them to .rst; > - Add them to the hwmon index.rst index; > - add some blank lines at the "Supported systems:" part, in >

Re: SCMI sensor reads unit scaling

2019-04-22 Thread Guenter Roeck
On Mon, Apr 22, 2019 at 11:31:18AM -0700, Florian Fainelli wrote: > On 4/20/19 10:31 AM, Guenter Roeck wrote: > > On 4/20/19 9:43 AM, Florian Fainelli wrote: > >> Hi Sudeep, Guenter, > >> > >> The current SCMI hwmon support does not seem to make use of t

Re: [PATCH] docs: hwmon: remove the extension from .rst files

2019-04-22 Thread Guenter Roeck
On Mon, Apr 22, 2019 at 08:14:55AM -0300, Mauro Carvalho Chehab wrote: > On almost all places, we're including ReST files without the > extension. > > Let's remove the extension here as well, in order to use just > one standard. > > Suggested-by: Jani Nikula > Signed-off-by: Mauro

Re: SCMI sensor reads unit scaling

2019-04-20 Thread Guenter Roeck
On 4/20/19 9:43 AM, Florian Fainelli wrote: Hi Sudeep, Guenter, The current SCMI hwmon support does not seem to make use of the sensor scale/unit as defined in the sensor replies (or the update scale for that matter). I came up with the patch below which gets the job done, but I am worried

Re: [PATCH v2] hwmon: max6650: add thermal cooling device capability

2019-04-18 Thread Guenter Roeck
On Thu, Apr 18, 2019 at 05:33:13PM -0400, Jean-Francois Dagenais wrote: > > > On Apr 18, 2019, at 16:50, Guenter Roeck wrote: > > > >> normally without any errors, yet the thermal-zone I defined, which is > >> there to > >> prevent my system from bur

Re: [PATCH v3] hwmon: max6650: add thermal cooling device capability

2019-04-18 Thread Guenter Roeck
On Thu, Apr 18, 2019 at 04:45:00PM -0400, Jean-Francois Dagenais wrote: > > > On Apr 18, 2019, at 16:13, Guenter Roeck wrote: > > > >> + if (IS_ERR(data->cooling_dev)) { > >> + err = PTR_ERR(data->cooling_dev); > >> + dev_err(&

Re: [PATCH v2] hwmon: max6650: add thermal cooling device capability

2019-04-18 Thread Guenter Roeck
On Thu, Apr 18, 2019 at 04:39:35PM -0400, Jean-Francois Dagenais wrote: > > > > On Apr 18, 2019, at 16:12, Guenter Roeck wrote: > > > > That explains why the other drivers don't generate an error message. > > You might want to reconsider the dev_err() above; it

Re: [PATCH v3] hwmon: max6650: add thermal cooling device capability

2019-04-18 Thread Guenter Roeck
On Thu, Apr 18, 2019 at 04:04:52PM -0400, Jean-Francois Dagenais wrote: > This allows max6650 devices to be referenced in dts as a cooling device. > > The pwm value seems duplicated in cooling_dev_state but since pwm goes > through rounding logic into data->dac, it is modified and messes with >

Re: [PATCH v2] hwmon: max6650: add thermal cooling device capability

2019-04-18 Thread Guenter Roeck
On Thu, Apr 18, 2019 at 03:54:32PM -0400, Jean-Francois Dagenais wrote: > > > > On Apr 18, 2019, at 14:06, Guenter Roeck wrote: > > > > On Thu, Apr 18, 2019 at 02:02:48PM -0400, Jean-Francois Dagenais wrote: > >> > >>> On

[PATCH 4/6] hwmon: (mlxreg-fan) Use devm_thermal_of_cooling_device_register

2019-04-18 Thread Guenter Roeck
Call devm_thermal_of_cooling_device_register() to register the cooling device. Also introduce struct device *dev = >dev; to make the code easier to read. Signed-off-by: Guenter Roeck --- drivers/hwmon/mlxreg-fan.c | 31 ++- 1 file changed, 10 insertions(+),

[PATCH 5/6] hwmon: (npcm750-pwm-fan) Use devm_thermal_of_cooling_device_register

2019-04-18 Thread Guenter Roeck
Use devm_thermal_of_cooling_device_register() to register the cooling device. As a side effect, this fixes a driver bug: thermal_cooling_device_unregister() was not called on device removal. Fixes: f1fd4a4db777 ("hwmon: Add NPCM7xx PWM and Fan driver") Cc: Tomer Maimon Signed-off-b

[PATCH 1/6] thermal: Introduce devm_thermal_of_cooling_device_register

2019-04-18 Thread Guenter Roeck
->of_node. Don't introduce a device managed remove function since it is not needed at this point. Signed-off-by: Guenter Roeck --- drivers/thermal/thermal_core.c | 49 ++ include/linux/thermal.h| 5 + 2 files changed, 54 insertions(+) diff --

[PATCH 2/6] hwmon: (aspeed-pwm-tacho) Use devm_thermal_of_cooling_device_register

2019-04-18 Thread Guenter Roeck
el Stanley Signed-off-by: Guenter Roeck --- drivers/hwmon/aspeed-pwm-tacho.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c index c4dd6301e7c8..0daf0b32aa4a 100644 --- a/drivers/hwmon/aspeed-pwm-tac

[PATCH 6/6] hwmon: (pwm-fan) Use devm_thermal_of_cooling_device_register

2019-04-18 Thread Guenter Roeck
-by: Guenter Roeck --- drivers/hwmon/pwm-fan.c | 73 - 1 file changed, 29 insertions(+), 44 deletions(-) diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c index 167221c7628a..0243ba70107e 100644 --- a/drivers/hwmon/pwm-fan.c +++ b

[PATCH 0/6] thermal: Introduce devm_thermal_of_cooling_device_register

2019-04-18 Thread Guenter Roeck
thermal_of_cooling_device_register() and thermal_cooling_device_register() are typically called from driver probe functions, and thermal_cooling_device_unregister() is called from remove functions. This makes both a perfect candidate for device managed functions. Introduce

Re: [PATCH v2] hwmon: max6650: add thermal cooling device capability

2019-04-18 Thread Guenter Roeck
On Thu, Apr 18, 2019 at 02:02:48PM -0400, Jean-Francois Dagenais wrote: > > > On Apr 18, 2019, at 13:38, Guenter Roeck wrote: > > > >> +#if IS_ENABLED(CONFIG_THERMAL) > > > > This will result in missing symbols if THERMAL is built as module > > and th

Re: [PATCH v2] hwmon: max6650: add thermal cooling device capability

2019-04-18 Thread Guenter Roeck
On Thu, Apr 18, 2019 at 12:48:13PM -0400, Jean-Francois Dagenais wrote: > This allows max6650 devices to be referenced in dts as a cooling device. > > The pwm value seems duplicated in cooling_dev_state but since pwm goes > through rounding logic into data->dac, it is modified and messes with >

Re: [PATCH v2 2/2] hwmon: (ina3221) Add voltage conversion time settings

2019-04-18 Thread Guenter Roeck
On Wed, Apr 17, 2019 at 04:12:10PM -0700, Nicolin Chen wrote: > The CONFIG register has two 3-bit fields for conversion time > settings of Bus-voltage and Shunt-voltage, respectively. The > conversion settings, along with averaging mode, allow users > to optimize available timing requirement. > >

Re: [PATCH v2 1/2] hwmon: (ina3221) Do not read-back to cache reg_config

2019-04-18 Thread Guenter Roeck
On Wed, Apr 17, 2019 at 04:12:09PM -0700, Nicolin Chen wrote: > Reading back the CONFIG register increases an extra I2C > transaction. This's not necessary and could be replaced > with a local variable caching the register settings. > > So this patch replaces two readback regmap_read() calls >

Re: [PATCH v3 21/21] docs: hwmon: Add an index file and rename docs to *.rst

2019-04-18 Thread Guenter Roeck
On 4/18/19 2:44 AM, Mauro Carvalho Chehab wrote: Em Wed, 17 Apr 2019 10:47:28 -0700 Guenter Roeck escreveu: On Wed, Apr 17, 2019 at 10:43:37AM -0700, Guenter Roeck wrote: On Wed, Apr 17, 2019 at 02:22:15PM -0300, Mauro Carvalho Chehab wrote: Em Wed, 17 Apr 2019 14:13:52 -0300 Mauro Carvalho

Re: [PATCH] hwmon: (ina3221) Add voltage conversion time settings

2019-04-17 Thread Guenter Roeck
On Wed, Apr 17, 2019 at 12:48:18PM -0700, Nicolin Chen wrote: > On Wed, Apr 17, 2019 at 11:39:49AM -0700, Nicolin Chen wrote: > > > > Thinking about it ... does it even make sense to cache reg_config twice, > > > or would it be better to just update the local copy and use regmap_write() > > > to

Re: [PATCH v2 1/1] hwmon (occ): Add temp sensor value check

2019-04-17 Thread Guenter Roeck
On Wed, Apr 17, 2019 at 01:35:41PM -0500, Eddie James wrote: > > On 4/17/19 1:03 PM, Alexander Amelkin wrote: > >From: Alexander Soldatov > > > >The occ driver supports two formats for the temp sensor value. > > > >The OCC firmware for P8 supports only the first format, for which > >no range

Re: [PATCH v3 21/21] docs: hwmon: Add an index file and rename docs to *.rst

2019-04-17 Thread Guenter Roeck
On Wed, Apr 17, 2019 at 10:43:37AM -0700, Guenter Roeck wrote: > On Wed, Apr 17, 2019 at 02:22:15PM -0300, Mauro Carvalho Chehab wrote: > > Em Wed, 17 Apr 2019 14:13:52 -0300 > > Mauro Carvalho Chehab escreveu: > > > > > Em Wed, 17 Apr 2019 09:47:41 -0700

Re: [PATCH v3 21/21] docs: hwmon: Add an index file and rename docs to *.rst

2019-04-17 Thread Guenter Roeck
On Wed, Apr 17, 2019 at 09:47:41AM -0700, Guenter Roeck wrote: > On Wed, Apr 17, 2019 at 06:46:29AM -0300, Mauro Carvalho Chehab wrote: > > Now that all files were converted to ReST format, rename them > > and add an index. > > > > Signed-off-by: Mauro Carvalho Chehab

Re: [PATCH v3 21/21] docs: hwmon: Add an index file and rename docs to *.rst

2019-04-17 Thread Guenter Roeck
On Wed, Apr 17, 2019 at 06:46:29AM -0300, Mauro Carvalho Chehab wrote: > Now that all files were converted to ReST format, rename them > and add an index. > > Signed-off-by: Mauro Carvalho Chehab > Acked-by: Liviu Dudau I applied all patches except this one, which fails due to a conflict in

Re: [PATCH 1/4] hwmon: (pmbus) add support for output voltage registers

2019-04-17 Thread Guenter Roeck
On Tue, Apr 16, 2019 at 06:57:18PM -0700, Ruslan Babayev wrote: > Hi Guenter, > > Thanks for taking the time to review these patches. Please see my > comments inline. > > Guenter Roeck writes: > > > On Tue, Apr 16, 2019 at 11:36:16AM -0700, Ruslan Babayev

Re: [PATCH] hwmon: (ina3221) Add voltage conversion time settings

2019-04-17 Thread Guenter Roeck
On 4/17/19 6:46 AM, Guenter Roeck wrote: On 4/16/19 4:55 PM, Nicolin Chen wrote: The CONFIG register has two 3-bit fields for conversion time settings of Bus-voltage and Shunt-voltage, respectively. The conversion settings, along with averaging mode, allow users to optimize available timing

Re: [PATCH] hwmon: (ina3221) Add voltage conversion time settings

2019-04-17 Thread Guenter Roeck
On 4/16/19 4:55 PM, Nicolin Chen wrote: The CONFIG register has two 3-bit fields for conversion time settings of Bus-voltage and Shunt-voltage, respectively. The conversion settings, along with averaging mode, allow users to optimize available timing requirement. This patch adds an

<    1   2   3   4   5   6   7   8   9   10   >