Re: [PATCH v4 2/2] hwmon: pmbus: max20730: adjust the vout reading given voltage divider

2020-10-04 Thread Chu Lin
On Sun, Oct 4, 2020 at 8:43 AM Guenter Roeck wrote: > > On Sun, Oct 04, 2020 at 03:14:45AM +0000, Chu Lin wrote: > > Problem: > > We use voltage dividers so that the voltage presented at the voltage > > sense pins is confusing. We might need to convert these reading

[PATCH v4 1/2] dt-bindings: hwmon: max20730: adding device tree doc for max20730

2020-10-03 Thread Chu Lin
max20730 Integrated, Step-Down Switching Regulator with PMBus Signed-off-by: Chu Lin --- ChangeLog v1 -> v2 hwmon: pmbus: max20730: - Don't do anything to the ret if an error is returned from pmbus_read_word - avoid overflow when doing multiplication ChangeLog v2 -> v3 dt-bi

[PATCH v4 0/2] hwmon: pmbus: max20730: adjust the vout base on

2020-10-03 Thread Chu Lin
t in vout-voltage-divider - Add additionalProperties: false hwmon: pmbus: max20730: - No change Chu Lin (2): dt-bindings: hwmon: max20730: adding device tree doc for max20730 hwmon: pmbus: max20730: adjust the vout reading given voltage divider .../bindings/hwmon/maxim,max20730.yaml

[PATCH v4 2/2] hwmon: pmbus: max20730: adjust the vout reading given voltage divider

2020-10-03 Thread Chu Lin
meaningful reading. Testing: max20730 with voltage divider Signed-off-by: Chu Lin --- ChangeLog v1 -> v2 hwmon: pmbus: max20730: - Don't do anything to the ret if an error is returned from pmbus_read_word - avoid overflow when doing multiplication ChangeLog v2 -> v3 dt-bindings:

[PATCH v3 1/2] dt-bindings: hwmon: max20730: adding device tree doc for max20730

2020-09-24 Thread Chu Lin
max20730 Integrated, Step-Down Switching Regulator with PMBus Signed-off-by: Chu Lin --- .../bindings/hwmon/maxim,max20730.yaml| 63 +++ 1 file changed, 63 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/maxim,max20730.yaml diff --git

[PATCH v3 2/2] hwmon: pmbus: max20730: adjust the vout reading given voltage divider

2020-09-24 Thread Chu Lin
meaningful reading. Testing: max20730 with voltage divider Signed-off-by: Chu Lin --- drivers/hwmon/pmbus/max20730.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/hwmon/pmbus/max20730.c b/drivers/hwmon/pmbus/max20730.c index a151a2b588a5..fbf2f1e6c969 100644

[PATCH v3 0/2] hwmon: pmbus: max20730: adjust the vout base on

2020-09-24 Thread Chu Lin
gt; v3 - Provide the binding documentation in yaml format Chu Lin (2): dt-bindings: hwmon: max20730: adding device tree doc for max20730 hwmon: pmbus: max20730: adjust the vout reading given voltage divider .../bindings/hwmon/maxim,max20730.yaml| 63 +++ drivers/hwmon

[PATCH v2] hwmon: pmbus: max20730: adjust the vout reading given voltage divider

2020-09-10 Thread Chu Lin
meaningful reading. Testing: max20730 with voltage divider Signed-off-by: Chu Lin --- ChangeLog v1 -> v2 - Don't do anything to the ret if an error is returned from pmbus_read_word - avoid overflow when doing multiplication drivers/hwmon/pmbus/max20730.c | 18 ++ 1 f

Re: [PATCH] hwmon: pmbus: max20730: adjust the vout reading given voltage divider

2020-09-10 Thread Chu Lin
The same patch got sent twice. Please, discard this one. Thanks, Chu On Thu, Sep 10, 2020 at 10:09 AM Chu Lin wrote: > > Problem: > We use voltage dividers so that the voltage presented at the voltage > sense pins is confusing. We might need to convert these readings to more

[PATCH] hwmon: pmbus: max20730: adjust the vout reading given voltage divider

2020-09-10 Thread Chu Lin
meaningful reading. Testing: max20730 with voltage divider Signed-off-by: Chu Lin --- drivers/hwmon/pmbus/max20730.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/hwmon/pmbus/max20730.c b/drivers/hwmon/pmbus/max20730.c index c0bb05487e0e..4b56810fa894 100644

[PATCH] hwmon: pmbus: max20730: adjust the vout reading given voltage divider

2020-09-10 Thread Chu Lin
meaningful reading. Testing: max20730 with voltage divider Signed-off-by: Chu Lin --- drivers/hwmon/pmbus/max20730.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/hwmon/pmbus/max20730.c b/drivers/hwmon/pmbus/max20730.c index c0bb05487e0e..4b56810fa894 100644

[PATCH] dt-bindings: hwmon: max20730: adding device tree doc for max20730

2020-09-10 Thread Chu Lin
Testing: make dt_binding_check Signed-off-by: Chu Lin --- .../devicetree/bindings/hwmon/max20730.txt| 23 +++ MAINTAINERS | 1 + 2 files changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/max20730.txt

[PATCH v3] hwmon: adm1272: Enable temperature sampling for adm1272 adm1278

2020-07-20 Thread Chu Lin
). Probe the driver and make sure tempX shows up in hwmon Signed-off-by: Chu Lin --- ChangeLog v1->v2: - Rename adm1272-adm1278-temp1-en to analog-temperature1-enable ChangeLog v2->v3: - Rename analog-temperature1-enable analog,temp1-enable drivers/hwmon/pmbus/adm1275.

[PATCH v3] dt-bindings: hwmon: adm1272: add analog,temp1-enable binding

2020-07-20 Thread Chu Lin
this in a better way by reading the dt. Solution: Introducing device tree binding analog,temp1-enable. If the flag is set, flip the temp1_en control bit on probing. Testing: make dt_binding_check Signed-off-by: Chu Lin --- ChangeLog v1->v2: - Rename adm1272-adm1278-temp1-en to analog-temperatu

[PATCH v2] hwmon: adm1272: Enable temperature sampling for adm1272 adm1278

2020-07-20 Thread Chu Lin
-enable set 3). Probe the driver and make sure tempX shows up in hwmon Signed-off-by: Chu Lin --- drivers/hwmon/pmbus/adm1275.c | 36 +-- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c index

[PATCH v2] dt-bindings: hwmon: adm1272: add analog-temperature1-enable binding

2020-07-20 Thread Chu Lin
this in a better way by reading the dt. Solution: Introducing device tree binding analog-temperature1-enable. If the flag is set, flip the temp1_en control bit on probing. Testing: make dt_binding_check Signed-off-by: Chu Lin --- ChangeLog v1->v2: - Rename adm1272-adm1278-temp1-en to ana

Re: [PATCH] dt-bindings: hwmon: adm1272: add adm1272-adm1275-temp1-en binding

2020-07-19 Thread Chu Lin
On Sun, Jul 19, 2020 at 3:22 PM Guenter Roeck wrote: > > On Fri, Jul 10, 2020 at 12:42:58AM +0000, Chu Lin wrote: > > Problem: > > adm1272 and adm1278 supports temperature sampling. The > > current way of enabling it requires the user manually unbind the device &

Re: [PATCH] dt-bindings: hwmon: adm1272: add adm1272-adm1275-temp1-en binding

2020-07-13 Thread Chu Lin
Adding Rob to the review list. On Thu, Jul 9, 2020 at 5:43 PM Chu Lin wrote: > > Problem: > adm1272 and adm1278 supports temperature sampling. The > current way of enabling it requires the user manually unbind the device > from the driver, flip the temperature sampl

[PATCH] hwmon: adm1272: Enable temperature sampling for adm1272 adm1278

2020-07-09 Thread Chu Lin
set 3). Probe the driver and make sure tempX shows up in hwmon Signed-off-by: Chu Lin --- drivers/hwmon/pmbus/adm1275.c | 36 +-- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c index

[PATCH] dt-bindings: hwmon: adm1272: add adm1272-adm1275-temp1-en binding

2020-07-09 Thread Chu Lin
this in a better way by reading the dt. Solution: Introducing device tree binding adm1272-adm1278-temp1-en. If the flag is set, flip the temp1_en control bit on probing. Testing: make dt_binding_check Signed-off-by: Chu Lin --- Documentation/devicetree/bindings/hwmon/adm1275.txt | 3 +++ 1 file

[PATCH v2] hwmon: adm1275: Make sure we are reading enough data for different chips

2020-07-08 Thread Chu Lin
-by: Chu Lin --- ChangeLog v1 -> v2 - Rename config_read_fn_ptr to config_read_fn - Move config_read_fn to the first line as it is the longest variable declaration - Include adm1293 and adm1294 - Remove the inline comment as I think the purpose is obvious drivers/hwmon/pmbus/adm1275.c |

Re: [PATCH] hwmon: adm1275: Make sure we are reading enough data for different chips

2020-07-08 Thread Chu Lin
On Wed, Jul 8, 2020 at 5:33 PM Guenter Roeck wrote: > > On 7/8/20 4:53 PM, Chu Lin wrote: > > Issue: > > When binding adm1272 to the adm1275 driver, PEC error is reported. > > See blow: > > s/blow/below/ > > Also, unless I am missing something, the er

[PATCH] hwmon: adm1275: Make sure we are reading enough data for different chips

2020-07-08 Thread Chu Lin
. The driver should not assume everything is 8bits wide and read only 8bits from it. Solution: if it is adm1272 or adm1278, use i2c_read_word. Else, use i2c_read_byte Signed-off-by: Chu Lin --- drivers/hwmon/pmbus/adm1275.c | 24 1 file changed, 16 insertions(+), 8

[PATCH v4] hwmon:max6697: Allow max6581 to create tempX_offset

2020-07-07 Thread Chu Lin
emp2_offset cat temp2_input 4875 echo 1 > temp2_offset cat temp2_input 47125 echo -2000 > temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- ChangeLog v3 -> v4: - Check if a particular channel is disabled/enabled before flipp

[PATCH v3 0/1] hwmon:max6697: Allow max6581 to create tempX_offset

2020-07-06 Thread Chu Lin
> temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- ChangeLog v2 -> v3: - Use reverse christmas tree order convension - Fix the type issue where comparision is always true - Change the line limit to 100 char instead of

[PATCH v3 1/1] hwmon:max6697: Allows max6581 to create tempX_offset attributes

2020-07-06 Thread Chu Lin
emp2_offset cat temp2_input 4875 echo 1 > temp2_offset cat temp2_input 47125 echo -2000 > temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- drivers/hwmon/max6697.c | 92 +++-- 1 file chan

Re: [PATCH v3 2/2] hwmon:max6697: fixing the type issue where the comparison is always true

2020-07-06 Thread Chu Lin
On Mon, Jul 6, 2020 at 5:54 PM Guenter Roeck wrote: > > On 7/6/20 5:22 PM, Chu Lin wrote: > > - Use reverse christmas tree order convension > > - fix the type issue where comparision is always true > > - Change the line limit to 100 char instead of 80 char > >

[PATCH v3 2/2] hwmon:max6697: fixing the type issue where the comparison is always true

2020-07-06 Thread Chu Lin
- Use reverse christmas tree order convension - fix the type issue where comparision is always true - Change the line limit to 100 char instead of 80 char Reported-by: kernel test robot Signed-off-by: Chu Lin --- drivers/hwmon/max6697.c | 26 +- 1 file changed, 9

[PATCH v3 1/2] hwmon:max6697: Allow max6581 to create tempX_offset

2020-07-06 Thread Chu Lin
--- drivers/hwmon/max6697.c | 100 ++-- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c index 64122eb38060..8c814c544116 100644 --- a/drivers/hwmon/max6697.c +++ b/drivers/hwmon/max6697.c @@ -57,6

[PATCH v3 0/2] hwmon:max6697: Allow max6581 to create tempX_offset

2020-07-06 Thread Chu Lin
> temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- ChangeLog v2 -> v3: - Use reverse christmas tree order convension - fix the type issue where comparision is always true - Change the line limit to 100 char instead of

Re: [PATCH v2 1/1] hwmon:max6697: Allow max6581 to create tempX_offset

2020-07-06 Thread Chu Lin
On Mon, Jul 6, 2020 at 3:10 PM Chu Lin wrote: > > --- > drivers/hwmon/max6697.c | 100 ++-- > 1 file changed, 96 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c > index 64122eb38060

[PATCH v2 1/1] hwmon:max6697: Allow max6581 to create tempX_offset

2020-07-06 Thread Chu Lin
--- drivers/hwmon/max6697.c | 100 ++-- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c index 64122eb38060..8c814c544116 100644 --- a/drivers/hwmon/max6697.c +++ b/drivers/hwmon/max6697.c @@ -57,6

[PATCH v2 0/1] hwmon:max6697: Allow max6581 to create tempX_offset

2020-07-06 Thread Chu Lin
> temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- ChangeLog v1 -> v2: - Simplify the offset reg raw value to milli ceisus conversion - Substitute the temp1_offset with dummy attr - Avoid using double negative in the

[PATCH] hwmon:max6697: Allow max6581 to create tempX_offset

2020-07-06 Thread Chu Lin
> temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- drivers/hwmon/max6697.c | 100 ++-- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6

Re: [PATCH] hwmon:max6697: Allow max6581 to create tempX_offset attributes

2020-07-02 Thread Chu Lin
On Wed, Jul 1, 2020 at 10:14 PM Guenter Roeck wrote: > > On Thu, Jul 02, 2020 at 01:42:23AM +0000, Chu Lin wrote: > > Per max6581, reg 4d and reg 4e is used for temperature read offset. > > This patch will let the user specify the temperature read offset for > > max65

[PATCH] hwmon:max6697: Allow max6581 to create tempX_offset attributes

2020-07-01 Thread Chu Lin
; temp2_offset cat temp2_input 47125 echo -2000 > temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- drivers/hwmon/max6697.c | 129 ++-- 1 file changed, 125 insertions(+), 4 deletions(-) diff --git a/d

[PATCH] hwmon:max6697: Allow max6581 to set temperature read offset

2020-07-01 Thread Chu Lin
; temp2_offset cat temp2_input 47125 echo -2000 > temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- drivers/hwmon/max6697.c | 129 ++-- 1 file changed, 125 insertions(+), 4 deletions(-) diff --git a/d

[PATCH] hwmon:max6697: Allow max6581 to set temperature read offset

2020-07-01 Thread Chu Lin
; temp2_offset cat temp2_input 47125 echo -2000 > temp2_offset cat temp2_input 34875 echo -0 > temp2_offset cat temp2_input 37000 Signed-off-by: Chu Lin --- drivers/hwmon/max6697.c | 131 ++-- 1 file changed, 126 insertions(+), 5 deletions(-) diff --git a/d

[PATCH] hwmon:max6697: Allow max6581 to set temperature read offset

2020-06-30 Thread Chu Lin
0x4d 0x4e 0x6F Signed-off-by: Chu Lin --- drivers/hwmon/max6697.c | 19 +-- include/linux/platform_data/max6697.h | 4 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c index 743752a2467a..16c0f0

[PATCH] hwmon:max6697: Make sure the OVERT mask is set correctly

2020-06-23 Thread Chu Lin
: https://datasheets.maximintegrated.com/en/ds/MAX6581.pdf https://datasheets.maximintegrated.com/en/ds/MAX6697.pdf https://datasheets.maximintegrated.com/en/ds/MAX6699.pdf Signed-off-by: Chu Lin --- drivers/hwmon/max6697.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git