public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Constantine Shulyupin <const@makelinux.com>
Cc: jdelvare@suse.de, lm-sensors@lm-sensors.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fix nct7802_temp_is_visible
Date: Thu, 25 Jun 2015 10:18:35 -0700	[thread overview]
Message-ID: <20150625171835.GA5009@roeck-us.net> (raw)
In-Reply-To: <CAE7jHC95bpZfqDyFOsh-Do3vvrsVDcWVEpSicLx5arzS9c6qKg@mail.gmail.com>

Hi Constantine,

On Thu, Jun 25, 2015 at 08:10:36PM +0300, Constantine Shulyupin wrote:
> Hi Guenter,
> 

Please don't top-post.

> Excerpt from datasheet:
> 7.2.32 Mode Selection Register
> RTD3_MD : 00=Closed , 01=Reserved , 10=Thermistor mode , 11=Voltage sense
> 
> As I understand the datasheel value 11b is valid too and the resister
> should be visible. It is legit to hide registers on 00=Closed and
> optionally on 01=Reserved (RTD3_MD only).
> 
mode=11b configures the sensor to voltage mode, and the voltage is then
reported with inX_input. Why do you think it should be reported as
temperature ? How do you propose to translate the reported voltage
to a temperature value ?

> I suppose condition RTD3_MD == 01b can be uncounted because is it reserved
> should not be used. temp3_* registers should be visible when RTD3_MD is 10b
> or 11b and hidden when RTD3_MD == 0 and optionally when RTD3_MD == 1
> 
> Therefore I propose to hide temp3_* when RTD3_MD != 0:
>  if (index >= 18 && index < 27 && !(reg & 0x30)  /* RD3 */
> 
> or when RTD3_MD == 0 or RTD3_MD == 1:
>  if (index >= 18 && index < 27 && (reg & 0x30) <= 0x10)  /* RD3 */
> 
> Do you agree?

No - see above. You don't explain why you want voltages reported as
temperatures, and you don't explain the proposed transition function
from voltages to temperatures, or the rationale for it.

What error are trying to fix, actually ? Do you have a temperature sensor
connectecd to the chip which reports a temperature as voltage and
needs a translation function from voltage to temperature ? Can you
provide a link to the datasheet for that sensor, and details on how it is
connected to the chip ?

Thanks,
Guenter

      parent reply	other threads:[~2015-06-25 17:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24 22:47 [PATCH] fix nct7802_temp_is_visible Constantine Shulyupin
2015-06-25  0:00 ` Guenter Roeck
     [not found]   ` <CAE7jHC95bpZfqDyFOsh-Do3vvrsVDcWVEpSicLx5arzS9c6qKg@mail.gmail.com>
2015-06-25 17:18     ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150625171835.GA5009@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=const@makelinux.com \
    --cc=jdelvare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox