All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [RFC PATCH 2/3] hwmon: sht15: add support for
Date: Tue, 22 Mar 2011 10:28:40 +0000	[thread overview]
Message-ID: <4D8879D8.6040008@cam.ac.uk> (raw)
In-Reply-To: <1300301050-15529-3-git-send-email-vivien.didelot@savoirfairelinux.com>

On 03/22/11 00:00, Vivien Didelot wrote:
> Hi Jonathan.
> On Mon, Mar 21, 2011 at 07:43:59PM +0000, Jonathan Cameron wrote:
>> On 03/16/11 18:44, Vivien Didelot wrote:
>>> Add support to read the sht15 status register. Explicitly:
>>> * The measurement resolution through the temp_resolution and
>>>   humidity_resolution sysfs attributes;
>>> * An end of battery indicator through the battery_alarm sysfs attribute;
>>> * Embedded heater support using the heater_enable sysfs attribute;
>>> * Reload from OTP available through the otp_reload sysfs attribute.
>> Hi Vivien.
>>
>> As Guenter said, these definitely need documenting.. Once that is available
>> I expect people will debate naming etc.
> Sure. After discussing about that, checksumming, otp_reload and
> *_resolution attributes have been removed. battery_alarm will be splitted into
> temp1_alarm and humidity1_alarm to respect the convention.
Really, Guenter / Jean is the is the right option?  The alarm isn't really about
either of the individual sensors, but rather about power to the chip?
> 
> I'll also add a documentation in Documentation/hwmon/ for the device.
...
>> Why cached the raw status?  Can't see any users.
>>> +	u8				val_status;
> As you've seen, it will be used in the next patch.
Ideally it would therefore be introduced in the next patch, but that's
a minor point.
...

>>>  /**
>>> @@ -378,6 +460,9 @@ static int sht15_update_vals(struct sht15_data *data)
>>>  	mutex_lock(&data->read_lock);
>>>  	if (time_after(jiffies, data->last_updat + timeout)
>>>  	    || !data->valid) {
>> As with the previous version, I'd make this optional controlled
>> by platform data.  Not everyone cares and it just made their gpio's
>> jump up and down a fair bit more.  Obviously if it's turned off, you
>> will also want to change what attributes are registered.
>>> +		ret = sht15_update_status(data);
>>> +		if (ret)
>>> +			goto error_ret;
> I put the sht15_update_status() call here so it could have benefit of the
> jiffies calculation. I also thought that it could be useful to update the
> device state before each measurement, in order to notice an eventual low
> power notice. Maybe I'm wrong and this test should be done separately?
The question is not whether it is worth doing in some cases, but rather
whether this is a change that will effect anyone in a negative fashion.
Its a balance between providing more error checking vs extra transactions
on what may be an extremely slow bus.

Lets go with butting this in.
> 
>>> +	/* Technically no need to read temperature and humidity as well */
>> Given we do a fresh read here, why bother having the cache at all?  Just
>> read it explicitly when we care.
>>> +	ret = sht15_update_vals(data);
> According to the previous comment, what about adding a mask as an argument
> to the sht15_update_vals() function to know which measurement to do (only
> status, temperature + humidity, etc.)?  Because the discussion could also
> be pointed on the temperature measurement, which update unnecessarily the
> humidity as well.
Good idea.
...

Jonathan

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

  parent reply	other threads:[~2011-03-22 10:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 18:44 [lm-sensors] [RFC PATCH 2/3] hwmon: sht15: add support for reading Vivien Didelot
2011-03-21 19:43 ` [lm-sensors] [RFC PATCH 2/3] hwmon: sht15: add support for Jonathan Cameron
2011-03-22  0:00 ` Vivien Didelot
2011-03-22  0:07 ` Guenter Roeck
2011-03-22 10:28 ` Jonathan Cameron [this message]
2011-03-22 14:28 ` Guenter Roeck
2011-03-26 17:16 ` Jean Delvare
2011-03-26 20:39 ` Jean Delvare
2011-03-26 23:29 ` Guenter Roeck
2011-03-28 16:46 ` Vivien Didelot
2011-03-28 19:19 ` Jean Delvare

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=4D8879D8.6040008@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --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.