[PATCH] hwmon (occ): Fix division by zero issue

2019-07-10 Thread Lei YU
The code in occ_get_powr_avg() invokes div64_u64() without checking the divisor. In case the divisor is zero, kernel gets an "Division by zero in kernel" error. Check the divisor and make it return 0 if the divisor is 0. Signed-off-by: Lei YU Reviewed-by: Eddie James --- drivers

[PATCH] hwmon (occ): Fix extended status bits

2019-04-15 Thread Lei YU
The occ's extended status is checked and shown as sysfs attributes. But the code was incorrectly checking the "status" bits. Fix it by checking the "ext_status" bits. Signed-off-by: Lei YU --- drivers/hwmon/occ/sysfs.c | 8 1 file changed, 4 insertions(+), 4 d

Userspace matching of hwmon devices to hardware

2019-03-25 Thread Lei YU
is breaks the userspace's phosphor-hwmon. If we fix the issue by updating the configure files' path in userspace, it means the userspace only with the new 5.x kernel. So the question here is, it there a stable way for userspace to match a hwmon device? Thanks! -- BRs, Lei YU

Re: [PATCH] hwmon: (aspeed-pwm-tacho) Use 24MHz clock

2018-05-08 Thread Lei YU
On Wed, May 9, 2018 at 11:43 AM, Guenter Roeck wrote: > > I am not going to accept this change, period. This is not one, it is five > steps > backward. If "aspeed_set_clock_source(priv->regmap, 0)" changes the clock > speed, > or the clock source, read it later, and attach to the correct clock. If

Re: [PATCH] hwmon: (aspeed-pwm-tacho) Use 24MHz clock

2018-05-08 Thread Lei YU
On Tue, May 8, 2018 at 9:51 PM, Guenter Roeck wrote: > No mixed C/C++ comments in hwmon drivers. > >> aspeed_set_clock_source(priv->regmap, 0); >> + priv->clk_freq = 2400; >> > > > Are you saying that clk_get_rate() is wrong ? Anyway, if the DT is bad, it > should be fixed. Nope,

[PATCH] hwmon: (aspeed-pwm-tacho) Use 24MHz clock

2018-05-08 Thread Lei YU
The clock source for aspeed pwm is set to 24MHz, so use the hard-coded clock frequency instead of the one in device tree. Otherwise, in case of the clock specified in device tree is not 24MHz, the fan speed will be incorrect. Signed-off-by: Lei YU --- drivers/hwmon/aspeed-pwm-tacho.c | 7

Re: [PATCH] hwmon: (w83773g) Fix fault detection and reporting

2017-12-03 Thread Lei YU
Reviewed-by: Lei YU Thanks for catching this. On Mon, Dec 4, 2017 at 10:13 AM, Guenter Roeck wrote: > Smatch reports: > > drivers/hwmon/w83773g.c:105 > get_fault() warn: shift has higher precedence than mask > > Code analysis shows that the code is indeed wrong. >

[PATCH v4 1/3] DT: i2c: W83773G is a trivial device

2017-11-12 Thread Lei YU
Signed-off-by: Lei YU --- Documentation/devicetree/bindings/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/trivial-devices.txt b/Documentation/devicetree/bindings/trivial-devices.txt index af284fb..63ad2f1 100644 --- a/Documentation

[PATCH v4 0/3] Add W83773G hwmon sensor driver and doc

2017-11-12 Thread Lei YU
w API devm_hwmon_device_register_with_info() v4: - Fix review comments Lei YU (3): DT: i2c: W83773G is a trivial device drivers: hwmon: Add W83773G driver hwmon: (w83773g) Add documentation .../devicetree/bindings/trivial-devices.txt| 1 + Documentation/hwmon/w83773g

[PATCH v4 3/3] hwmon: (w83773g) Add documentation

2017-11-12 Thread Lei YU
Add documentation for the w83773g driver. Signed-off-by: Lei YU --- v2: - Add notes for offset and update_interval --- Documentation/hwmon/w83773g | 33 + 1 file changed, 33 insertions(+) create mode 100644 Documentation/hwmon/w83773g diff --git a

[PATCH v4 2/3] drivers: hwmon: Add W83773G driver

2017-11-12 Thread Lei YU
Nuvoton W83773G is a hardware monitor IC providing one local temperature and two remote temperature sensors. Signed-off-by: Lei YU --- v2: - Rewrite the driver using regmap - Add offset and update_interval v3: - Use devm_hwmon_device_register_with_info() with is_visible/read/write

Re: [PATCH v3 2/3] drivers: hwmon: Add W83773G driver

2017-11-12 Thread Lei YU
On Fri, Nov 10, 2017 at 10:49 PM, Guenter Roeck wrote: > On 11/08/2017 11:09 PM, Lei YU wrote: >> >> Nuvoton W83773G is a hardware monitor IC providing one local >> temperature and two remote temperature sensors. >> >> Signed-off-by: Lei YU > > > Nicely

Re: [PATCH v2 2/3] drivers: hwmon: Add W83773G driver

2017-11-09 Thread Lei YU
On Thu, Nov 9, 2017 at 1:59 AM, Guenter Roeck wrote: > On Wed, Nov 08, 2017 at 02:03:34PM +0800, Lei YU wrote: >> On Tue, Nov 7, 2017 at 10:33 PM, Guenter Roeck wrote: >> > On 11/07/2017 12:27 AM, Lei YU wrote: >> >> >> >> Nuvoton W83773G is

[PATCH v3 1/3] DT: i2c: W83773G is a trivial device

2017-11-08 Thread Lei YU
Signed-off-by: Lei YU --- Documentation/devicetree/bindings/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/trivial-devices.txt b/Documentation/devicetree/bindings/trivial-devices.txt index af284fb..63ad2f1 100644 --- a/Documentation

[PATCH v3 0/3] Add W83773G hwmon sensor driver and doc

2017-11-08 Thread Lei YU
w API devm_hwmon_device_register_with_info() Lei YU (3): DT: i2c: W83773G is a trivial device drivers: hwmon: Add W83773G driver hwmon: (w83773g) Add documentation .../devicetree/bindings/trivial-devices.txt| 1 + Documentation/hwmon/w83773g| 33 ++ drivers/hwmon/Kc

[PATCH v3 2/3] drivers: hwmon: Add W83773G driver

2017-11-08 Thread Lei YU
Nuvoton W83773G is a hardware monitor IC providing one local temperature and two remote temperature sensors. Signed-off-by: Lei YU --- v2: - Rewrite the driver using regmap - Add offset and update_interval v3: - Use devm_hwmon_device_register_with_info() with is_visible/read/write

[PATCH v3 3/3] hwmon: (w83773g) Add documentation

2017-11-08 Thread Lei YU
Add documentation for the w83773g driver. Signed-off-by: Lei YU --- v2: - Add notes for offset and update_interval --- Documentation/hwmon/w83773g | 33 + 1 file changed, 33 insertions(+) create mode 100644 Documentation/hwmon/w83773g diff --git a

Re: [PATCH v2 2/3] drivers: hwmon: Add W83773G driver

2017-11-07 Thread Lei YU
On Tue, Nov 7, 2017 at 10:33 PM, Guenter Roeck wrote: > On 11/07/2017 12:27 AM, Lei YU wrote: >> >> Nuvoton W83773G is a hardware monitor IC providing one local >> temperature and two remote temperature sensors. >> >> Signed-off-by: Lei YU >> --- >&g

[PATCH v2 1/3] DT: i2c: W83773G is a trivial device

2017-11-07 Thread Lei YU
Signed-off-by: Lei YU --- Documentation/devicetree/bindings/trivial-devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/trivial-devices.txt b/Documentation/devicetree/bindings/trivial-devices.txt index af284fb..63ad2f1 100644 --- a/Documentation

[PATCH v2 3/3] hwmon: (w83773g) Add documentation

2017-11-07 Thread Lei YU
Add documentation for the w83773g driver. Signed-off-by: Lei YU --- v2: - Add notes for offset and update_interval --- Documentation/hwmon/w83773g | 33 + 1 file changed, 33 insertions(+) create mode 100644 Documentation/hwmon/w83773g diff --git a

[PATCH v2 2/3] drivers: hwmon: Add W83773G driver

2017-11-07 Thread Lei YU
Nuvoton W83773G is a hardware monitor IC providing one local temperature and two remote temperature sensors. Signed-off-by: Lei YU --- v2: - Rewrite the driver using regmap - Add offset and update_interval --- drivers/hwmon/Kconfig | 10 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon

[PATCH v2 0/3] Add W83773G hwmon sensor driver and doc

2017-11-07 Thread Lei YU
Nuvoton W83773G is a hardware monitoring chip, which integrates two remote and one local temperature sensors. --- v2: - The driver is re-written as v1's comment, so the author is changed to me. - Added the device to trivial-devices.txt Lei YU (3): DT: i2c: W83773G is a trivial d

Re: [PATCH 1/2] drivers: hwmon: Add W83773G driver

2017-11-05 Thread Lei YU
Hi Guenter, Thanks a lot for the detailed review. I will try to fix all the comments and send v2 patch. On Sun, Nov 5, 2017 at 3:30 AM, Guenter Roeck wrote: > On 11/01/2017 11:33 PM, Lei YU wrote: >> >> Nuvoton W83773G is a hardware monitor IC providing one local >> tempe

Re: [PATCH 1/2] drivers: hwmon: Add W83773G driver

2017-11-03 Thread Lei YU
On Thu, Nov 2, 2017 at 10:04 PM, Guenter Roeck wrote: > On 11/01/2017 11:33 PM, Lei YU wrote: >> >> Nuvoton W83773G is a hardware monitor IC providing one local >> temperature and two remote temperature sensors. >> > This chip is pretty close to LM90. Have you explo

[PATCH 2/2] hwmon: (w83773g) Add documentation

2017-11-01 Thread Lei YU
Add documentation for the w83773g driver. Signed-off-by: Lei YU --- Documentation/hwmon/w83773g | 28 1 file changed, 28 insertions(+) create mode 100644 Documentation/hwmon/w83773g diff --git a/Documentation/hwmon/w83773g b/Documentation/hwmon/w83773g new file

[PATCH 0/2] Add W83773G hwmon sensor driver and doc

2017-11-01 Thread Lei YU
Nuvoton W83773G is a hardware monitoring chip, which integrates two remote and one local temperature sensors. Lei YU (2): drivers: hwmon: Add W83773G driver hwmon: (w83773g) Add documentation Documentation/hwmon/w83773g | 28 + drivers/hwmon/Kconfig | 11 ++ drivers/hwmon

[PATCH 1/2] drivers: hwmon: Add W83773G driver

2017-11-01 Thread Lei YU
Nuvoton W83773G is a hardware monitor IC providing one local temperature and two remote temperature sensors. Signed-off-by: Lei YU --- drivers/hwmon/Kconfig | 11 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/w83773g.c | 276 3 files