* [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr
@ 2011-09-09 10:12 Hans de Goede
2011-09-12 17:48 ` Guenter Roeck
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Hans de Goede @ 2011-09-09 10:12 UTC (permalink / raw)
To: lm-sensors
This is a preparation patch for not registering fan/pwm attributes for
some fans (rather then register them for all or for none).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/hwmon/f71882fg.c | 50 +++++++++++++++++++++++----------------------
1 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index 2d96ed2..c0805aa 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -605,7 +605,7 @@ static struct sensor_device_attribute_2 fxxxx_fan_beep_attr[] = {
/* PWM attr for the f71862fg, fewer pwms and fewer zones per pwm than the
standard models */
-static struct sensor_device_attribute_2 f71862fg_auto_pwm_attr[] = {
+static struct sensor_device_attribute_2 f71862fg_auto_pwm_attr[3][7] = { {
SENSOR_ATTR_2(pwm1_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 0),
@@ -627,7 +627,7 @@ static struct sensor_device_attribute_2 f71862fg_auto_pwm_attr[] = {
0, 0),
SENSOR_ATTR_2(pwm1_auto_point2_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 0),
-
+}, {
SENSOR_ATTR_2(pwm2_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 1),
@@ -649,7 +649,7 @@ static struct sensor_device_attribute_2 f71862fg_auto_pwm_attr[] = {
0, 1),
SENSOR_ATTR_2(pwm2_auto_point2_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 1),
-
+}, {
SENSOR_ATTR_2(pwm3_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 2),
@@ -671,12 +671,12 @@ static struct sensor_device_attribute_2 f71862fg_auto_pwm_attr[] = {
0, 2),
SENSOR_ATTR_2(pwm3_auto_point2_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 2),
-};
+} };
/* PWM attr for the f71808e/f71869, almost identical to the f71862fg, but the
pwm setting when the temperature is above the pwmX_auto_point1_temp can be
programmed instead of being hardcoded to 0xff */
-static struct sensor_device_attribute_2 f71869_auto_pwm_attr[] = {
+static struct sensor_device_attribute_2 f71869_auto_pwm_attr[3][8] = { {
SENSOR_ATTR_2(pwm1_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 0),
@@ -701,7 +701,7 @@ static struct sensor_device_attribute_2 f71869_auto_pwm_attr[] = {
0, 0),
SENSOR_ATTR_2(pwm1_auto_point2_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 0),
-
+}, {
SENSOR_ATTR_2(pwm2_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 1),
@@ -726,7 +726,7 @@ static struct sensor_device_attribute_2 f71869_auto_pwm_attr[] = {
0, 1),
SENSOR_ATTR_2(pwm2_auto_point2_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 1),
-
+}, {
SENSOR_ATTR_2(pwm3_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 2),
@@ -751,7 +751,7 @@ static struct sensor_device_attribute_2 f71869_auto_pwm_attr[] = {
0, 2),
SENSOR_ATTR_2(pwm3_auto_point2_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 2),
-};
+} };
/* PWM attr for the standard models */
static struct sensor_device_attribute_2 fxxxx_auto_pwm_attr[4][14] = { {
@@ -928,7 +928,7 @@ static struct sensor_device_attribute_2 f8000_fan_attr[] = {
/* PWM attr for the f8000, zones mapped to temp instead of to pwm!
Also the register block at offset A0 maps to TEMP1 (so our temp2, as the
F8000 starts counting temps at 0), B0 maps the TEMP2 and C0 maps to TEMP0 */
-static struct sensor_device_attribute_2 f8000_auto_pwm_attr[] = {
+static struct sensor_device_attribute_2 f8000_auto_pwm_attr[3][14] = { {
SENSOR_ATTR_2(pwm1_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 0),
@@ -969,7 +969,7 @@ static struct sensor_device_attribute_2 f8000_auto_pwm_attr[] = {
show_pwm_auto_point_temp_hyst, NULL, 2, 2),
SENSOR_ATTR_2(temp1_auto_point4_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 2),
-
+}, {
SENSOR_ATTR_2(pwm2_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 1),
@@ -1010,7 +1010,7 @@ static struct sensor_device_attribute_2 f8000_auto_pwm_attr[] = {
show_pwm_auto_point_temp_hyst, NULL, 2, 0),
SENSOR_ATTR_2(temp2_auto_point4_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 0),
-
+}, {
SENSOR_ATTR_2(pwm3_auto_channels_temp, S_IRUGO|S_IWUSR,
show_pwm_auto_point_channel,
store_pwm_auto_point_channel, 0, 2),
@@ -1051,7 +1051,7 @@ static struct sensor_device_attribute_2 f8000_auto_pwm_attr[] = {
show_pwm_auto_point_temp_hyst, NULL, 2, 1),
SENSOR_ATTR_2(temp3_auto_point4_temp_hyst, S_IRUGO,
show_pwm_auto_point_temp_hyst, NULL, 3, 1),
-};
+} };
/* Super I/O functions */
static inline int superio_inb(int base, int reg)
@@ -2351,14 +2351,15 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
break;
case f71862fg:
err = f71882fg_create_sysfs_files(pdev,
- f71862fg_auto_pwm_attr,
- ARRAY_SIZE(f71862fg_auto_pwm_attr));
+ &f71862fg_auto_pwm_attr[0][0],
+ ARRAY_SIZE(f71862fg_auto_pwm_attr[0]) *
+ nr_fans);
break;
case f71808e:
case f71869:
err = f71882fg_create_sysfs_files(pdev,
- f71869_auto_pwm_attr,
- ARRAY_SIZE(f71869_auto_pwm_attr));
+ &f71869_auto_pwm_attr[0][0],
+ ARRAY_SIZE(f71869_auto_pwm_attr[0]) * nr_fans);
break;
case f8000:
err = f71882fg_create_sysfs_files(pdev,
@@ -2367,8 +2368,8 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
if (err)
goto exit_unregister_sysfs;
err = f71882fg_create_sysfs_files(pdev,
- f8000_auto_pwm_attr,
- ARRAY_SIZE(f8000_auto_pwm_attr));
+ &f8000_auto_pwm_attr[0][0],
+ ARRAY_SIZE(f8000_auto_pwm_attr[0]) * nr_fans);
break;
default:
err = f71882fg_create_sysfs_files(pdev,
@@ -2476,22 +2477,23 @@ static int f71882fg_remove(struct platform_device *pdev)
break;
case f71862fg:
f71882fg_remove_sysfs_files(pdev,
- f71862fg_auto_pwm_attr,
- ARRAY_SIZE(f71862fg_auto_pwm_attr));
+ &f71862fg_auto_pwm_attr[0][0],
+ ARRAY_SIZE(f71862fg_auto_pwm_attr[0]) *
+ nr_fans);
break;
case f71808e:
case f71869:
f71882fg_remove_sysfs_files(pdev,
- f71869_auto_pwm_attr,
- ARRAY_SIZE(f71869_auto_pwm_attr));
+ &f71869_auto_pwm_attr[0][0],
+ ARRAY_SIZE(f71869_auto_pwm_attr[0]) * nr_fans);
break;
case f8000:
f71882fg_remove_sysfs_files(pdev,
f8000_fan_attr,
ARRAY_SIZE(f8000_fan_attr));
f71882fg_remove_sysfs_files(pdev,
- f8000_auto_pwm_attr,
- ARRAY_SIZE(f8000_auto_pwm_attr));
+ &f8000_auto_pwm_attr[0][0],
+ ARRAY_SIZE(f8000_auto_pwm_attr[0]) * nr_fans);
break;
default:
f71882fg_remove_sysfs_files(pdev,
--
1.7.6.1
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr
2011-09-09 10:12 [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr Hans de Goede
@ 2011-09-12 17:48 ` Guenter Roeck
2011-09-12 17:59 ` Hans de Goede
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2011-09-12 17:48 UTC (permalink / raw)
To: lm-sensors
On Fri, 2011-09-09 at 06:12 -0400, Hans de Goede wrote:
> This is a preparation patch for not registering fan/pwm attributes for
> some fans (rather then register them for all or for none).
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
Hans,
what tree is your patch series based on ? I tried to apply it to
mainline for testing but it failed.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr
2011-09-09 10:12 [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr Hans de Goede
2011-09-12 17:48 ` Guenter Roeck
@ 2011-09-12 17:59 ` Hans de Goede
2011-09-12 18:06 ` Guenter Roeck
2011-09-12 18:42 ` Guenter Roeck
3 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2011-09-12 17:59 UTC (permalink / raw)
To: lm-sensors
Hi,
On 09/12/2011 07:48 PM, Guenter Roeck wrote:
> On Fri, 2011-09-09 at 06:12 -0400, Hans de Goede wrote:
>> This is a preparation patch for not registering fan/pwm attributes for
>> some fans (rather then register them for all or for none).
>>
>> Signed-off-by: Hans de Goede<hdegoede@redhat.com>
>> ---
>
> Hans,
>
> what tree is your patch series based on ? I tried to apply it to
> mainline for testing but it failed.
Hmm, they apply cleanly for me against a fully up2date checkout of:
git://github.com/torvalds/linux.git
Want me to resend them?
Regards,
Hans
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr
2011-09-09 10:12 [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr Hans de Goede
2011-09-12 17:48 ` Guenter Roeck
2011-09-12 17:59 ` Hans de Goede
@ 2011-09-12 18:06 ` Guenter Roeck
2011-09-12 18:42 ` Guenter Roeck
3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2011-09-12 18:06 UTC (permalink / raw)
To: lm-sensors
On Mon, 2011-09-12 at 13:59 -0400, Hans de Goede wrote:
> Hi,
>
> On 09/12/2011 07:48 PM, Guenter Roeck wrote:
> > On Fri, 2011-09-09 at 06:12 -0400, Hans de Goede wrote:
> >> This is a preparation patch for not registering fan/pwm attributes for
> >> some fans (rather then register them for all or for none).
> >>
> >> Signed-off-by: Hans de Goede<hdegoede@redhat.com>
> >> ---
> >
> > Hans,
> >
> > what tree is your patch series based on ? I tried to apply it to
> > mainline for testing but it failed.
>
> Hmm, they apply cleanly for me against a fully up2date checkout of:
> git://github.com/torvalds/linux.git
>
> Want me to resend them?
>
No need. I had copied the patches from the gmane.org archive in a single
mbox file, and tried to apply the series as it was received from that
file ... apparently it was not in order, and git does not like that. I
was able to apply the series after separating the patches into
individual patch files.
Thanks, and sorry for the noise.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr
2011-09-09 10:12 [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr Hans de Goede
` (2 preceding siblings ...)
2011-09-12 18:06 ` Guenter Roeck
@ 2011-09-12 18:42 ` Guenter Roeck
3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2011-09-12 18:42 UTC (permalink / raw)
To: lm-sensors
On Fri, 2011-09-09 at 06:12 -0400, Hans de Goede wrote:
> This is a preparation patch for not registering fan/pwm attributes for
> some fans (rather then register them for all or for none).
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-09-12 18:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-09 10:12 [lm-sensors] [PATCH 1/3] hwmon/f71882fg: Make all fan/pwm attr Hans de Goede
2011-09-12 17:48 ` Guenter Roeck
2011-09-12 17:59 ` Hans de Goede
2011-09-12 18:06 ` Guenter Roeck
2011-09-12 18:42 ` Guenter Roeck
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.