* [lm-sensors] [PATCH] hwmon: (ntc_thermistor) Fix dependencies
@ 2014-05-21 12:01 Jean Delvare
2014-05-21 14:26 ` Guenter Roeck
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jean Delvare @ 2014-05-21 12:01 UTC (permalink / raw)
To: lm-sensors
In commit 9e8269de, support was added for ntc_thermistor devices being
declared in the device tree and implemented on top of IIO. With that
change, a dependency was added to the ntc_thermistor driver:
depends on (!OF && !IIO) || (OF && IIO)
This construct has the drawback that the driver can no longer be
selected when OF is set and IIO isn't, nor when IIO is set and OF is
not. This is a regression for the original users of the driver.
As the new code depends on IIO and is useless without OF, include it
only if both are enabled, and set the dependencies accordingly. This
is clearer, more simple and more correct.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Doug Anderson <dianders@chromium.org>
---
I've build-tested all option combinations (or so I believe) but
I don't have the hardware for functional testing. If Naveen or Doug
could test to confirm I didn't break anything, that would be great.
This is a regression so the fix is candidate for stable trees. I don't
know if this worries people enough in practice to justify it though.
drivers/hwmon/Kconfig | 2 +-
drivers/hwmon/ntc_thermistor.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
--- linux-3.15-rc5.orig/drivers/hwmon/Kconfig 2014-05-21 13:27:13.844415316 +0200
+++ linux-3.15-rc5/drivers/hwmon/Kconfig 2014-05-21 13:31:04.780217568 +0200
@@ -1053,7 +1053,7 @@ config SENSORS_PC87427
config SENSORS_NTC_THERMISTOR
tristate "NTC thermistor support"
- depends on (!OF && !IIO) || (OF && IIO)
+ depends on !OF || IIO=n || IIO
help
This driver supports NTC thermistors sensor reading and its
interpretation. The driver can also monitor the temperature and
--- linux-3.15-rc5.orig/drivers/hwmon/ntc_thermistor.c 2014-05-21 13:27:13.844415316 +0200
+++ linux-3.15-rc5/drivers/hwmon/ntc_thermistor.c 2014-05-21 13:31:04.781217589 +0200
@@ -141,7 +141,7 @@ struct ntc_data {
char name[PLATFORM_NAME_SIZE];
};
-#ifdef CONFIG_OF
+#if defined(CONFIG_OF) && IS_ENABLED(CONFIG_IIO)
static int ntc_adc_iio_read(struct ntc_thermistor_platform_data *pdata)
{
struct iio_channel *channel = pdata->chan;
@@ -223,6 +223,8 @@ ntc_thermistor_parse_dt(struct platform_
return NULL;
}
+#define ntc_match NULL
+
static void ntc_iio_channel_release(struct ntc_thermistor_platform_data *pdata)
{ }
#endif
--
Jean Delvare
SUSE L3 Support
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [lm-sensors] [PATCH] hwmon: (ntc_thermistor) Fix dependencies
2014-05-21 12:01 [lm-sensors] [PATCH] hwmon: (ntc_thermistor) Fix dependencies Jean Delvare
@ 2014-05-21 14:26 ` Guenter Roeck
2014-05-21 16:20 ` Jean Delvare
2014-06-09 21:03 ` Doug Anderson
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2014-05-21 14:26 UTC (permalink / raw)
To: lm-sensors
On 05/21/2014 05:01 AM, Jean Delvare wrote:
> In commit 9e8269de, support was added for ntc_thermistor devices being
> declared in the device tree and implemented on top of IIO. With that
> change, a dependency was added to the ntc_thermistor driver:
>
> depends on (!OF && !IIO) || (OF && IIO)
>
> This construct has the drawback that the driver can no longer be
> selected when OF is set and IIO isn't, nor when IIO is set and OF is
> not. This is a regression for the original users of the driver.
>
> As the new code depends on IIO and is useless without OF, include it
> only if both are enabled, and set the dependencies accordingly. This
> is clearer, more simple and more correct.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Doug Anderson <dianders@chromium.org>
> ---
> I've build-tested all option combinations (or so I believe) but
> I don't have the hardware for functional testing. If Naveen or Doug
> could test to confirm I didn't break anything, that would be great.
>
> This is a regression so the fix is candidate for stable trees. I don't
> know if this worries people enough in practice to justify it though.
>
Good catch, for both patches. Do you want to take it, or should I ?
For both patches:
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (ntc_thermistor) Fix dependencies
2014-05-21 12:01 [lm-sensors] [PATCH] hwmon: (ntc_thermistor) Fix dependencies Jean Delvare
2014-05-21 14:26 ` Guenter Roeck
@ 2014-05-21 16:20 ` Jean Delvare
2014-06-09 21:03 ` Doug Anderson
2 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2014-05-21 16:20 UTC (permalink / raw)
To: lm-sensors
On Wed, 21 May 2014 07:26:01 -0700, Guenter Roeck wrote:
> On 05/21/2014 05:01 AM, Jean Delvare wrote:
> > In commit 9e8269de, support was added for ntc_thermistor devices being
> > declared in the device tree and implemented on top of IIO. With that
> > change, a dependency was added to the ntc_thermistor driver:
> >
> > depends on (!OF && !IIO) || (OF && IIO)
> >
> > This construct has the drawback that the driver can no longer be
> > selected when OF is set and IIO isn't, nor when IIO is set and OF is
> > not. This is a regression for the original users of the driver.
> >
> > As the new code depends on IIO and is useless without OF, include it
> > only if both are enabled, and set the dependencies accordingly. This
> > is clearer, more simple and more correct.
> >
> > Signed-off-by: Jean Delvare <jdelvare@suse.de>
> > Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
> > Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Cc: Doug Anderson <dianders@chromium.org>
> > ---
> > I've build-tested all option combinations (or so I believe) but
> > I don't have the hardware for functional testing. If Naveen or Doug
> > could test to confirm I didn't break anything, that would be great.
> >
> > This is a regression so the fix is candidate for stable trees. I don't
> > know if this worries people enough in practice to justify it though.
>
> Good catch, for both patches. Do you want to take it, or should I ?
I'll take them. Just I would appreciate test results before I push them
upstream... Better safe than sorry.
> For both patches:
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Added, thanks.
--
Jean Delvare
SUSE L3 Support
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (ntc_thermistor) Fix dependencies
2014-05-21 12:01 [lm-sensors] [PATCH] hwmon: (ntc_thermistor) Fix dependencies Jean Delvare
2014-05-21 14:26 ` Guenter Roeck
2014-05-21 16:20 ` Jean Delvare
@ 2014-06-09 21:03 ` Doug Anderson
2 siblings, 0 replies; 4+ messages in thread
From: Doug Anderson @ 2014-06-09 21:03 UTC (permalink / raw)
To: lm-sensors
Jean,
On Wed, May 21, 2014 at 5:01 AM, Jean Delvare <jdelvare@suse.de> wrote:
> In commit 9e8269de, support was added for ntc_thermistor devices being
> declared in the device tree and implemented on top of IIO. With that
> change, a dependency was added to the ntc_thermistor driver:
>
> depends on (!OF && !IIO) || (OF && IIO)
>
> This construct has the drawback that the driver can no longer be
> selected when OF is set and IIO isn't, nor when IIO is set and OF is
> not. This is a regression for the original users of the driver.
>
> As the new code depends on IIO and is useless without OF, include it
> only if both are enabled, and set the dependencies accordingly. This
> is clearer, more simple and more correct.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Fixes: 9e8269de hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
> Cc: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Doug Anderson <dianders@chromium.org>
> ---
> I've build-tested all option combinations (or so I believe) but
> I don't have the hardware for functional testing. If Naveen or Doug
> could test to confirm I didn't break anything, that would be great.
>
> This is a regression so the fix is candidate for stable trees. I don't
> know if this worries people enough in practice to justify it though.
>
> drivers/hwmon/Kconfig | 2 +-
> drivers/hwmon/ntc_thermistor.c | 4 +++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
Also too late to matter, but confirming that I can still build with
this and see thermistors. In my case I've got the thermistors
compiled as modules...
I've got an early-rev exynos5250-snow (that still had thermistors on
it) and have hacked them into the device tree with:
diff --git a/arch/arm/boot/dts/exynos5250-snow.dts
b/arch/arm/boot/dts/exynos5250-snow.dts
index 079fdf9..28acb52 100644
--- a/arch/arm/boot/dts/exynos5250-snow.dts
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -20,6 +20,39 @@
i2c104 = &i2c_104;
};
+ adc@12D10000 {
+ status = "okay";
+ vdd-supply = <&buck5_reg>;
+ ncp15wb473@3 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 3>;
+ };
+ ncp15wb473@4 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 4>;
+ };
+ ncp15wb473@5 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 5>;
+ };
+ ncp15wb473@6 {
+ compatible = "ntc,ncp15wb473";
+ pullup-uv = <1800000>;
+ pullup-ohm = <47000>;
+ pulldown-ohm = <0>;
+ io-channels = <&adc 6>;
+ };
+ };
+
rtc@101E0000 {
status = "okay";
};
-Doug
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-09 21:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 12:01 [lm-sensors] [PATCH] hwmon: (ntc_thermistor) Fix dependencies Jean Delvare
2014-05-21 14:26 ` Guenter Roeck
2014-05-21 16:20 ` Jean Delvare
2014-06-09 21:03 ` Doug Anderson
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.