linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: <lm-sensors@lm-sensors.org>, <linux-kernel@vger.kernel.org>,
	Jean Delvare <khali@linux-fr.org>,
	Guenter Roeck <guenter.roeck@ericsson.com>,
	<dg77.kim@samsung.com>, <kyungmin.park@samsung.com>,
	<myungjoo.ham@gmail.com>
Subject: Re: [RFC PATCH 0/2] HWMON: add in-kernel interfaces to read sensor values.
Date: Fri, 11 Nov 2011 20:46:43 +0000	[thread overview]
Message-ID: <1321044403.2757.23.camel@bwh-desktop> (raw)
In-Reply-To: <1320389433-1671-1-git-send-email-myungjoo.ham@samsung.com>

On Fri, 2011-11-04 at 15:50 +0900, MyungJoo Ham wrote:
> We have been reading hwmon values (TMU, the SoC-core temperature sensor,
> and NTC, the ambient or battery surface temperature sensor) for
> Charger-Manager. However, because hwmon does not have in-kernel interface,
> we have been using undesired method, including "../../../fs/*.h".
> 
> This patch is to provide in-kernel interface for hwmon:
> hwmon_get_value and hwmon_set_value. In order to use these two functions,
> the hwmon driver should provide its sysfs attributes to hwmon framework
> as well. If the hwmon driver does not provide (by providing NULL), the users
> of the hwmon won't be able to use hwmon_get/set_value();
> The sysfs attribute (struct attribuyte_group *) is provided with
> hwmon_device_register; adding the second parameter to hwmon_device_register().
> The 2/2 patch shows the changes in device drivers due to this.
[...]

This is an improvement, but I don't think it is quite enough.  As I
understand the hwmon sysfs interface, all sensor values should be
integers.  So the in-kernel interface should also work with integers,
not strings.

As a first implementation you could perhaps parse the strings back to
integers.  However in the longer term the driver API should be changed
so that hwmon drivers fully describe their sensors to the core and the
core takes care of exposing them through sysfs and the in-kernel API.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  parent reply	other threads:[~2011-11-11 20:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04  6:50 [RFC PATCH 0/2] HWMON: add in-kernel interfaces to read sensor values MyungJoo Ham
2011-11-04  6:50 ` [RFC PATCH 1/2] HWMON: add interfaces to read/write hwmon values inside kernel MyungJoo Ham
2011-11-04  6:50 ` [RFC PATCH 2/2] HWMON: adapt to the HWMON interface changes MyungJoo Ham
2011-11-06  5:53 ` [RFC PATCH 0/2] HWMON: add in-kernel interfaces to read sensor values Guenter Roeck
2011-11-07  4:35   ` MyungJoo Ham
2011-11-11 20:46 ` Ben Hutchings [this message]
2011-11-14  1:31   ` MyungJoo Ham
2011-11-14 16:39     ` Jonathan Cameron
2011-11-17  8:22       ` MyungJoo Ham
2011-11-17 20:40         ` Jonathan Cameron

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=1321044403.2757.23.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=dg77.kim@samsung.com \
    --cc=guenter.roeck@ericsson.com \
    --cc=khali@linux-fr.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=myungjoo.ham@gmail.com \
    --cc=myungjoo.ham@samsung.com \
    /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;
as well as URLs for NNTP newsgroup(s).