From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH v3] drivers/hwmon NTC Thermistor Initial
Date: Fri, 24 Dec 2010 02:08:18 +0000 [thread overview]
Message-ID: <20101224020818.GA30014@ericsson.com> (raw)
In-Reply-To: <1292842122-3992-1-git-send-email-myungjoo.ham@samsung.com>
On Thu, Dec 23, 2010 at 08:36:04PM -0500, MyungJoo Ham wrote:
[ ... ]
> >> +int ntc_thermistor_read(struct device *dev)
> >> +{
> >> + return _ntc_thermistor_read(dev_get_drvdata(dev));
> >> +}
> >
> > Function should be removed since it is no longer exported.
> >
>
> I have been considering to use this function at the board file in the
> kernel space.
That means you would have to export the function, and we are back to square one,
ie you really use a hwmon driver to provide functions to a non-hwmon driver.
> However, if it is removed, the driver may have a weird callback (a) or
> the board file
> may need to access sysfs filesystem and depends on sysfs (b).
>
> (a): add "int (*read_thermistor)(struct platform_device *pdev)" at
> struct ntc_thermistor_platform_data (in include/linux/ntc.h) and let
> ntc_thermistor_probe provide callback thru pdata back to the caller of
> platform_device_register().
>
> (b): read "/sysfs/devices/platform/blahblah/temp1_input"
> and keep /sysfs mounted always.
>
> Are these approaches fine?
>
Again, problem is that in order to have this functionality, you force
hwmon to be active for the board you are talking about. This is,
no matter how you do it, not the correct approach. Maybe someone wants to
build a kernel with no hwmon support. Then what ? This won't work.
If the adc values need to be used by non-hwmon driver(s), there should be
an independent driver providing adc values, a hwmon driver to convert the
adc values as appropriate via the hwmon sysfs ABI, and other drivers as needed,
such as your board driver, doing whatever they want to do with the adc values.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2010-12-24 2:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 10:48 [lm-sensors] [PATCH v3] drivers/hwmon NTC Thermistor Initial MyungJoo Ham
2010-12-23 20:34 ` Guenter Roeck
2010-12-24 1:36 ` MyungJoo Ham
2010-12-24 2:08 ` Guenter Roeck [this message]
2010-12-24 2:37 ` 함명주
2010-12-24 3:09 ` Guenter Roeck
2010-12-24 5:42 ` 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=20101224020818.GA30014@ericsson.com \
--to=guenter.roeck@ericsson.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.