mbox series

[0/8] Add support for ADT7481 in lm90

Message ID 20220520093243.2523749-1-sst@poczta.fm (mailing list archive)
Headers show
Series Add support for ADT7481 in lm90 | expand

Message

Slawomir Stepien May 20, 2022, 9:32 a.m. UTC
From: Slawomir Stepien <slawomir.stepien@nokia.com>

This patch series adds support for ADT7481 in lm90.c driver and extends the
device-tree options for it.

The ADT7481 is quite similar to MAX6696 (already supported in lm90) so a lot of
code is reused.

One major problem in fitting the ADT7481 in lm90.c is the chip detection.
However it seems that the chip has been designed and produced with correct
values at locations: 0xfe (manufactured id) and 0xff (chip id), but this is not
documented in the datasheet.

$ i2cdump -y -f -r 254-255 1 0x4c
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
f0:                                           41 62                  Ab

The device-tree changes allow to: set the extended temperature range mode and
set the label and offset for specific channel.

Note: previous "attempts" for adding ADT7481 in lm90 where here: [1][2].

[1] https://www.spinics.net/lists/lm-sensors/msg25066.html
[2] https://marc.info/?l=lm-sensors&m=137786448326215&w=2

Slawomir Stepien (8):
      dt-bindings: hwmon: Add support for ADT7481 in lm90
      dt-bindings: hwmon: Add 'extended-range-enable' property support in lm90
      dt-bindings: hwmon: Allow specifying channels for lm90
      hwmon: (lm90) add support for ADT7481
      hwmon: (lm90) define maximum number of channels that are supported
      hwmon: (lm90) enable the extended temperature range
      hwmon: (lm90) read the channel's label from device-tree
      hwmon: (lm90) read the channel's offset from device-tree

 .../devicetree/bindings/hwmon/national,lm90.yaml          |  42 ++++
 Documentation/hwmon/lm90.rst                              |  12 +-
 drivers/hwmon/Kconfig                                     |  15 +-
 drivers/hwmon/lm90.c                                      | 251 ++++++++++++++++++++----
 4 files changed, 271 insertions(+), 49 deletions(-)

Comments

Guenter Roeck May 20, 2022, 1:45 p.m. UTC | #1
On 5/20/22 02:32, Slawomir Stepien wrote:
> From: Slawomir Stepien <slawomir.stepien@nokia.com>
> 
> This patch series adds support for ADT7481 in lm90.c driver and extends the
> device-tree options for it.
> 
> The ADT7481 is quite similar to MAX6696 (already supported in lm90) so a lot of
> code is reused.
> 
> One major problem in fitting the ADT7481 in lm90.c is the chip detection.
> However it seems that the chip has been designed and produced with correct
> values at locations: 0xfe (manufactured id) and 0xff (chip id), but this is not
> documented in the datasheet.
> 

Before we go too far along this route, would you mind using my own patch series
as base to implement the devicetree changes ? I had prepared an extensive
patch series a while ago, adding not only support for ADT7481 but for
several other chips as well, I just never got around to sending it out.

Thanks,
Guenter

> $ i2cdump -y -f -r 254-255 1 0x4c
> No size specified (using byte-data access)
>       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
> f0:                                           41 62                  Ab
> 
> The device-tree changes allow to: set the extended temperature range mode and
> set the label and offset for specific channel.
> 
> Note: previous "attempts" for adding ADT7481 in lm90 where here: [1][2].
> 
> [1] https://www.spinics.net/lists/lm-sensors/msg25066.html
> [2] https://marc.info/?l=lm-sensors&m=137786448326215&w=2
> 
> Slawomir Stepien (8):
>        dt-bindings: hwmon: Add support for ADT7481 in lm90
>        dt-bindings: hwmon: Add 'extended-range-enable' property support in lm90
>        dt-bindings: hwmon: Allow specifying channels for lm90
>        hwmon: (lm90) add support for ADT7481
>        hwmon: (lm90) define maximum number of channels that are supported
>        hwmon: (lm90) enable the extended temperature range
>        hwmon: (lm90) read the channel's label from device-tree
>        hwmon: (lm90) read the channel's offset from device-tree
> 
>   .../devicetree/bindings/hwmon/national,lm90.yaml          |  42 ++++
>   Documentation/hwmon/lm90.rst                              |  12 +-
>   drivers/hwmon/Kconfig                                     |  15 +-
>   drivers/hwmon/lm90.c                                      | 251 ++++++++++++++++++++----
>   4 files changed, 271 insertions(+), 49 deletions(-)
> 
>
Guenter Roeck May 20, 2022, 4:01 p.m. UTC | #2
On 5/20/22 06:45, Guenter Roeck wrote:
> On 5/20/22 02:32, Slawomir Stepien wrote:
>> From: Slawomir Stepien <slawomir.stepien@nokia.com>
>>
>> This patch series adds support for ADT7481 in lm90.c driver and extends the
>> device-tree options for it.
>>
>> The ADT7481 is quite similar to MAX6696 (already supported in lm90) so a lot of
>> code is reused.
>>
>> One major problem in fitting the ADT7481 in lm90.c is the chip detection.
>> However it seems that the chip has been designed and produced with correct
>> values at locations: 0xfe (manufactured id) and 0xff (chip id), but this is not
>> documented in the datasheet.
>>
> 
> Before we go too far along this route, would you mind using my own patch series
> as base to implement the devicetree changes ? I had prepared an extensive
> patch series a while ago, adding not only support for ADT7481 but for
> several other chips as well, I just never got around to sending it out.
> 

I made my lm90 patch series available in branch hwmon-lm90 of
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git

The patches in this series were module tested and tested on real hardware
with the test scripts at git@github.com:groeck/module-tests.git;
look for scripts/lm90-real.sh and scripts/lm90.sh.

Guenter
Slawomir Stepien May 22, 2022, 2:52 p.m. UTC | #3
On maj 20, 2022 09:01, Guenter Roeck wrote:
> On 5/20/22 06:45, Guenter Roeck wrote:
> > On 5/20/22 02:32, Slawomir Stepien wrote:
> > > From: Slawomir Stepien <slawomir.stepien@nokia.com>
> > > 
> > > This patch series adds support for ADT7481 in lm90.c driver and extends the
> > > device-tree options for it.
> > > 
> > > The ADT7481 is quite similar to MAX6696 (already supported in lm90) so a lot of
> > > code is reused.
> > > 
> > > One major problem in fitting the ADT7481 in lm90.c is the chip detection.
> > > However it seems that the chip has been designed and produced with correct
> > > values at locations: 0xfe (manufactured id) and 0xff (chip id), but this is not
> > > documented in the datasheet.
> > > 
> > 
> > Before we go too far along this route, would you mind using my own patch series
> > as base to implement the devicetree changes ? I had prepared an extensive
> > patch series a while ago, adding not only support for ADT7481 but for
> > several other chips as well, I just never got around to sending it out.
> > 
> 
> I made my lm90 patch series available in branch hwmon-lm90 of
> git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
> 
> The patches in this series were module tested and tested on real hardware
> with the test scripts at git@github.com:groeck/module-tests.git;
> look for scripts/lm90-real.sh and scripts/lm90.sh.

I will test that out.

If I would be happy with that branch, should I rebase all my changes based on that branch and send
the patches to the lists?
Guenter Roeck May 22, 2022, 3 p.m. UTC | #4
On 5/22/22 07:52, Slawomir Stepien wrote:
> On maj 20, 2022 09:01, Guenter Roeck wrote:
>> On 5/20/22 06:45, Guenter Roeck wrote:
>>> On 5/20/22 02:32, Slawomir Stepien wrote:
>>>> From: Slawomir Stepien <slawomir.stepien@nokia.com>
>>>>
>>>> This patch series adds support for ADT7481 in lm90.c driver and extends the
>>>> device-tree options for it.
>>>>
>>>> The ADT7481 is quite similar to MAX6696 (already supported in lm90) so a lot of
>>>> code is reused.
>>>>
>>>> One major problem in fitting the ADT7481 in lm90.c is the chip detection.
>>>> However it seems that the chip has been designed and produced with correct
>>>> values at locations: 0xfe (manufactured id) and 0xff (chip id), but this is not
>>>> documented in the datasheet.
>>>>
>>>
>>> Before we go too far along this route, would you mind using my own patch series
>>> as base to implement the devicetree changes ? I had prepared an extensive
>>> patch series a while ago, adding not only support for ADT7481 but for
>>> several other chips as well, I just never got around to sending it out.
>>>
>>
>> I made my lm90 patch series available in branch hwmon-lm90 of
>> git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
>>
>> The patches in this series were module tested and tested on real hardware
>> with the test scripts at git@github.com:groeck/module-tests.git;
>> look for scripts/lm90-real.sh and scripts/lm90.sh.
> 
> I will test that out.
> 
> If I would be happy with that branch, should I rebase all my changes based on that branch and send
> the patches to the lists?
> 

Yes, please, only I'll need to send my series first. With the commit
window coming up, I'll do that after I sent my pull request.

Thanks,
Guenter