All of lore.kernel.org
 help / color / mirror / Atom feed
From: Donggeun Kim <dg77.kim@samsung.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH v9] drivers/hwmon NTC Thermistor Initial
Date: Wed, 15 Jun 2011 10:06:21 +0000	[thread overview]
Message-ID: <4DF8841D.9020102@samsung.com> (raw)
In-Reply-To: <1308122532-9483-1-git-send-email-dg77.kim@samsung.com>

Hi,

On 2011년 06월 15일 17:52, Shubhrajyoti Datta wrote:
> Hi ,
> Not a comment really was a bit curious.
> Feel free to ignore such comments.
> 
> On Wed, Jun 15, 2011 at 12:52 PM, Donggeun Kim <dg77.kim@samsung.com> wrote:
> 
>> This patch adds support for NTC Thermistor series. In this release, the
>> following thermistors are supported: NCP15WB473, NCP18WB473, NCP03WB473,
>> and NCP15WL333. This driver is based on the datasheet of MURATA.
>>
>> The driver in the patch does conversion from the raw ADC value
>> (either voltage or resistence) to temperature. In order to use
>> voltage values as input, the circuit schematics should be provided
>> with the platform data. A compensation table for each type of thermistor
>> is provided for the conversion.
>>
>> Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
>> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
>> Signed-off-by: KyungMin Park <kyungmin.park@samsung.com>
>>
>> --
>> Updates
>> v9
>> - remove unnecessary variables(mintemp, maxtemp) and checking lines for
>> them
>> v8
>> - remove compiler warning message
>> - update Documentation/hwmon/ntc_thermistor
>> - add EXPERIMENTAL Kconfig dependency
>> v7
>> - move header file location
>> - rename header and driver file
>> - style fixes
>> v6
>> - updated Documentation/hwmon/ntc
>> - style fixes
>> v5
>> - use binary search on sorted table
>> - removed unnecessary attributes
>> - style fixes
>> v4
>> - put in alphabetic order in Kconfig/Makefile
>> - handle additional error cases
>> - remove the exported function
>> v3
>> - style fixes
>> - removed symbol exports
>> - avoid divide-by-zero
>> - omitted files added (Kconfig/Makefile)
>> - removed unnecessary codes
>> - return error values, not default values for errors.
>> v2
>> - added Documentation/hwmon/ntc
>> - followed hwmon sysfs
>> - detached the monitoring service
>> (thank you for the comments, Guenter Roeck)
>> ---
>>  Documentation/hwmon/ntc_thermistor           |   93 ++++++
>>  drivers/hwmon/Kconfig                        |   14 +
>>  drivers/hwmon/Makefile                       |    1 +
>>  drivers/hwmon/ntc_thermistor.c               |  453
>> ++++++++++++++++++++++++++
>>  include/linux/platform_data/ntc_thermistor.h |   53 +++
>>  5 files changed, 614 insertions(+), 0 deletions(-)
>>  create mode 100644 Documentation/hwmon/ntc_thermistor
>>  create mode 100644 drivers/hwmon/ntc_thermistor.c
>>  create mode 100644 include/linux/platform_data/ntc_thermistor.h
>>
>>
>> <snip>
> Why have a function starting with a  _
> 
> 
> 
> 
>> +static int _ntc_thermistor_read(struct ntc_data *data, int *temp)
>> +{
>> +       int ret;
>> +       int read_ohm, read_uV;
>> +       unsigned int ohm = 0;
>> +
>> +       if (data->pdata->read_ohm) {
>> +               read_ohm = data->pdata->read_ohm();
>>
> 
> Is the platform function posted?
> What errors could these functions return ?
> Should we mask the errors here?
> 
> 
Two platform functions have not posted.
The positive values are returned by read_ohm and read_uV functions, when
errors do not occur.
It is assumed that the functions simply return negative value for error
cases.
Thus, the driver code checks whether positive or negative value is
returned and returns -EINVAL for negative value.
>> +               if (read_ohm < 0)
>> +                       return -EINVAL;
>> +               ohm = (unsigned int)read_ohm;
>> +       }
>> +
>> +       if (data->pdata->read_uV) {
>> +               read_uV = data->pdata->read_uV();
>>
> same here
> 
>> +               if (read_uV < 0)
>> +                       return -EINVAL;
>> +               ohm = get_ohm_of_thermistor(data, (unsigned int)read_uV);
>> +       }
>> +
>>
> 

Thanks.


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2011-06-15 10:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15  7:22 [lm-sensors] [PATCH v9] drivers/hwmon NTC Thermistor Initial Donggeun Kim
2011-06-15  9:04 ` Shubhrajyoti Datta
2011-06-15 10:06 ` Donggeun Kim [this message]
2011-06-15 14:28 ` Guenter Roeck

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=4DF8841D.9020102@samsung.com \
    --to=dg77.kim@samsung.com \
    --cc=lm-sensors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.