Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1220722

Re: [PATCH v3] Documentation: add Device tree bindings for hwmon/nct7802

From Constantine Shulyupin <const@makelinux.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3] Documentation: add Device tree bindings for hwmon/nct7802
Date 2015-09-08 14:10 +0200
Message-ID <q6pSN-3LC-1@gated-at.bofh.it> (permalink)
References <q6deV-2in-3@gated-at.bofh.it> <q6nxF-ij-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> Add add Device tree bindings for registers
>> which are not covered by hwmon ABI and are required to
>> configure specific HW.
>
> This doesn't really answer my question [1] of why you need these.
>
> We generally don't encode register values unless there's no other way to
> describe the device. Why can we not describe the physical properties of
> the device that make these values necessary?
>
....
> That said, as above I don't believe that these properties make sense
> as they are. I think this needs properties that describe the HW, rather
> than exposing the intricacies of the programming interface.
....
> Thanks,
> Mark.
>
> [1] http://lkml.kernel.org/r/20150907123531.GA11540@leverpostej
>

Sources of the driver:

Let's see to register MODE.
Excerpt from datasheet:

7.2.32 Mode Selection Register
Location : Index 22h
Type : Read/Write
Power on default value : 7Fh
BIT; NAME; FUNC.:
0,1 RTD1_MD : 00=Closed , 01=Current mode , 10=Thermistor mode ,
11=Voltage sense
2,3 RTD2_MD : 00=Closed , 01=Current mode , 10=Thermistor mode ,
11=Voltage sense
4,5 RTD3_MD : 00=Closed , 01=Reserved , 10=Thermistor mode , 11=Voltage sense
6 EnLTD : 1 indicates the LTD function enabled

The register defines sensors types (Closed, Current mode, Thermistor
mode, Voltage sense).
Essential sensors will not work properly with wrong configuration.
It is board or platform depended configuration. It should be
configured on boot only.
Usually hwmon drivers are managed with utility lm-sensors via
Documentation/hwmon/sysfs-interface. By design sensor type should be
defined by platform data and lm-sensors only displays it.

Also MODE registers defines visibility temperature and input attributes:

https://git.kernel.org/cgit/linux/kernel/git/mpe/linux-next.git/tree/drivers/hwmon/nct7802.c#n532

https://git.kernel.org/cgit/linux/kernel/git/mpe/linux-next.git/tree/drivers/hwmon/nct7802.c#n641

Mark, does above answers your question?
What do you propose?

-- 
Thanks
Constantine
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3] Documentation: add Device tree bindings for hwmon/nct7802 Constantine Shulyupin <const@MakeLinux.com> - 2015-09-08 00:40 +0200
  Re: [PATCH v3] Documentation: add Device tree bindings for  hwmon/nct7802 Mark Rutland <mark.rutland@arm.com> - 2015-09-08 11:40 +0200
    Re: [PATCH v3] Documentation: add Device tree bindings for hwmon/nct7802 Constantine Shulyupin <const@makelinux.com> - 2015-09-08 14:10 +0200
      Re: [PATCH v3] Documentation: add Device tree bindings for  hwmon/nct7802 Mark Rutland <mark.rutland@arm.com> - 2015-09-08 14:50 +0200
        Re: [PATCH v3] Documentation: add Device tree bindings for hwmon/nct7802 Constantine Shulyupin <const@makelinux.com> - 2015-09-08 15:50 +0200

csiph-web