From: Guenter Roeck <linux@roeck-us.net>
To: Michael Walle <michael@walle.cc>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: adt7411: external thermal diode support
Date: Fri, 22 Jul 2016 06:21:54 -0700 [thread overview]
Message-ID: <57921DF2.1040704@roeck-us.net> (raw)
In-Reply-To: <aac86af3ebfe30bf306955c62470d797@walle.cc>
On 07/22/2016 04:09 AM, Michael Walle wrote:
> Hi,
>
> I'm looking into adding support for the external thermal diode. On the ADT7411 you can either use AIN1 and AIN2 to measure voltages or use the two input to measure temperature via a thermal diode. As far as I understand it, the sysfs attributes have to be created dynamically, eg. either create the in1_input and in2_input or temp2_input depending on the mode. All current drivers (besides coretemp) use devm_hwmon_device_register_with_groups() which has a static set of groups, but registers its attributes in /sys/class/hwmon/hwmonN/<attribute>. Drivers which use some kind of dynamic attributes use sysfs_create_group(<underlying device>) and hwmon_device_register(), where the attributes are visible at /sys/class/hwmon/hwmonN/device/<attribute>.
Do not use hwmon_device_register().
>
> /sys/class/hwmon/<attribute> is the preferred/new method, isn't it? If I add support for the the thermal diode I would have to switch the adt7411 driver to the old method, right? So, I guess this is a bad way to do it. Do you have any hints for me?
Either use multiple groups, and select the groups to use in the probe function,
or one group and the is_visible() callback.
>
> What entity should configure the external mode? Eg. the bootloader might set the EXT_TDM bit or the linux kernel could enable it depending on some DTS property.
>
Both are fine, though it would not normally be the bootloader but the BIOS or ROMMON.
Other possible methods would be to use platform data or ACPI.
Guenter
prev parent reply other threads:[~2016-07-22 13:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-22 11:09 adt7411: external thermal diode support Michael Walle
2016-07-22 13:21 ` 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=57921DF2.1040704@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-hwmon@vger.kernel.org \
--cc=michael@walle.cc \
/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.