All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Arnaud Ebalard <arno@natisbad.org>
Cc: Andrew Lunn <andrew@lunn.ch>, Jean Delvare <khali@linux-fr.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	lm-sensors@lm-sensors.org, devicetree-discuss@lists.ozlabs.org,
	Rob Landley <rob@landley.net>,
	linux-doc@vger.kernel.org,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Jason Cooper <jason@lakedaemon.net>,
	Simon Guinot <simon.guinot@sequanux.org>,
	Olivier Mouchet <olivier.mouchet@gmail.com>
Subject: Re: [lm-sensors] [PATCH 1/3] Add support for GMT G72/G763 PWM fan controller
Date: Fri, 19 Apr 2013 13:37:28 +0000	[thread overview]
Message-ID: <20130419133728.GA8445@roeck-us.net> (raw)
In-Reply-To: <87y5ceahas.fsf@natisbad.org>

On Fri, Apr 19, 2013 at 01:30:51PM +0200, Arnaud Ebalard wrote:
> Hi,
> 
> Andrew Lunn <andrew@lunn.ch> writes:
> 
> > Hi Arnaud
> >
> >> +static DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, get_pwm, set_pwm);
> >> +static DEVICE_ATTR(pwm1_polarity, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_polarity, set_pwm_polarity);
> >> +static DEVICE_ATTR(pwm1_mode, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_mode, set_pwm_mode);
> >> +static DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO,
> >> +		   get_speed_control_mode, set_speed_control_mode);
> >> +static DEVICE_ATTR(pwm1_freq, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_freq, set_pwm_freq);
> >> +
> >> +static DEVICE_ATTR(fan1_input, S_IRUGO, get_fan_rpm, NULL);
> >> +static DEVICE_ATTR(fan1_alarm, S_IRUGO, get_fan_ooc, NULL);
> >> +static DEVICE_ATTR(fan1_alarm_detection, S_IWUSR | S_IRUGO,
> >> +		   get_fan_ooc_detection, set_fan_ooc_detection);
> >> +static DEVICE_ATTR(fan1_fault, S_IRUGO, get_fan_failure, NULL);
> >> +static DEVICE_ATTR(fan1_fault_detection, S_IWUSR | S_IRUGO,
> >> +		   get_fan_failure_detection, set_fan_failure_detection);
> >> +static DEVICE_ATTR(fan1_target, S_IWUSR | S_IRUGO,
> >> +		   get_fan_target, set_fan_target);
> >> +static DEVICE_ATTR(fan1_pulses, S_IWUSR | S_IRUGO,
> >> +		   get_fan_pulses, set_fan_pulses);
> >> +static DEVICE_ATTR(fan1_div, S_IWUSR | S_IRUGO,
> >> +		   get_fan_clk_div, set_fan_clk_div);
> >> +static DEVICE_ATTR(fan1_gear_mode, S_IWUSR | S_IRUGO,
> >> +		   get_fan_gear_mode, set_fan_gear_mode);
> >> +static DEVICE_ATTR(fan1_startup_voltage, S_IWUSR | S_IRUGO,
> >> +		   get_fan_startup_voltage, set_fan_startup_voltage);
> >
> > It is normal to use SENSOR_ATTR, not DEVICE_ATTR. Take a look at the
> > existing fan drivers.
> 
> I will take a look and use SENSOR_ATTR if it is the expected way. For
> the records, the g760a.c which I used as basis uses DEVICE_ATTR ;-)
> 
You only need SENSOR_ATTR if you have an index parameter. Otherwise DEVICE_ATTR
is just fine. I would actually reject the patch if I notice that it uses
SENSOR_ATTR without need for a parameter. Besides, in the context used,
it would probably be SENSOR_DEVICE_ATTR.

> > I also think a lot of these are not needed. They are fixed properties
> > of the board and cannot change dynamically. They are set once using DT
> > and user space does not need to care.
> 
> I added those knobs for a simple reason: I don't have all the various
> characteristics of the target platform I am working on (Netgear
> ReadyNAS Duo v2) and needed to be able to test various values w/o
> rebooting to get those rights. I thought this knobs would be useful for
> people with the same issue (for instance, the new ReadyNAS 102 also has
> a G762) and would not hurt.
> 
Testing is not a reason to add non-standard attributes.

Thanks,
Guenter

> Anyway, I will split the patch in two parts and keep the useless knobs
> on my side.
> 
> Thanks for your feedback,
> 
> Cheers,
> 
> a+
> 

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

WARNING: multiple messages have this Message-ID (diff)
From: linux@roeck-us.net (Guenter Roeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] Add support for GMT G72/G763 PWM fan controller
Date: Fri, 19 Apr 2013 06:37:28 -0700	[thread overview]
Message-ID: <20130419133728.GA8445@roeck-us.net> (raw)
In-Reply-To: <87y5ceahas.fsf@natisbad.org>

On Fri, Apr 19, 2013 at 01:30:51PM +0200, Arnaud Ebalard wrote:
> Hi,
> 
> Andrew Lunn <andrew@lunn.ch> writes:
> 
> > Hi Arnaud
> >
> >> +static DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, get_pwm, set_pwm);
> >> +static DEVICE_ATTR(pwm1_polarity, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_polarity, set_pwm_polarity);
> >> +static DEVICE_ATTR(pwm1_mode, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_mode, set_pwm_mode);
> >> +static DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO,
> >> +		   get_speed_control_mode, set_speed_control_mode);
> >> +static DEVICE_ATTR(pwm1_freq, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_freq, set_pwm_freq);
> >> +
> >> +static DEVICE_ATTR(fan1_input, S_IRUGO, get_fan_rpm, NULL);
> >> +static DEVICE_ATTR(fan1_alarm, S_IRUGO, get_fan_ooc, NULL);
> >> +static DEVICE_ATTR(fan1_alarm_detection, S_IWUSR | S_IRUGO,
> >> +		   get_fan_ooc_detection, set_fan_ooc_detection);
> >> +static DEVICE_ATTR(fan1_fault, S_IRUGO, get_fan_failure, NULL);
> >> +static DEVICE_ATTR(fan1_fault_detection, S_IWUSR | S_IRUGO,
> >> +		   get_fan_failure_detection, set_fan_failure_detection);
> >> +static DEVICE_ATTR(fan1_target, S_IWUSR | S_IRUGO,
> >> +		   get_fan_target, set_fan_target);
> >> +static DEVICE_ATTR(fan1_pulses, S_IWUSR | S_IRUGO,
> >> +		   get_fan_pulses, set_fan_pulses);
> >> +static DEVICE_ATTR(fan1_div, S_IWUSR | S_IRUGO,
> >> +		   get_fan_clk_div, set_fan_clk_div);
> >> +static DEVICE_ATTR(fan1_gear_mode, S_IWUSR | S_IRUGO,
> >> +		   get_fan_gear_mode, set_fan_gear_mode);
> >> +static DEVICE_ATTR(fan1_startup_voltage, S_IWUSR | S_IRUGO,
> >> +		   get_fan_startup_voltage, set_fan_startup_voltage);
> >
> > It is normal to use SENSOR_ATTR, not DEVICE_ATTR. Take a look at the
> > existing fan drivers.
> 
> I will take a look and use SENSOR_ATTR if it is the expected way. For
> the records, the g760a.c which I used as basis uses DEVICE_ATTR ;-)
> 
You only need SENSOR_ATTR if you have an index parameter. Otherwise DEVICE_ATTR
is just fine. I would actually reject the patch if I notice that it uses
SENSOR_ATTR without need for a parameter. Besides, in the context used,
it would probably be SENSOR_DEVICE_ATTR.

> > I also think a lot of these are not needed. They are fixed properties
> > of the board and cannot change dynamically. They are set once using DT
> > and user space does not need to care.
> 
> I added those knobs for a simple reason: I don't have all the various
> characteristics of the target platform I am working on (Netgear
> ReadyNAS Duo v2) and needed to be able to test various values w/o
> rebooting to get those rights. I thought this knobs would be useful for
> people with the same issue (for instance, the new ReadyNAS 102 also has
> a G762) and would not hurt.
> 
Testing is not a reason to add non-standard attributes.

Thanks,
Guenter

> Anyway, I will split the patch in two parts and keep the useless knobs
> on my side.
> 
> Thanks for your feedback,
> 
> Cheers,
> 
> a+
> 

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Arnaud Ebalard <arno@natisbad.org>
Cc: Andrew Lunn <andrew@lunn.ch>, Jean Delvare <khali@linux-fr.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	lm-sensors@lm-sensors.org, devicetree-discuss@lists.ozlabs.org,
	Rob Landley <rob@landley.net>,
	linux-doc@vger.kernel.org,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Jason Cooper <jason@lakedaemon.net>,
	Simon Guinot <simon.guinot@sequanux.org>,
	Olivier Mouchet <olivier.mouchet@gmail.com>
Subject: Re: [PATCH 1/3] Add support for GMT G72/G763 PWM fan controller
Date: Fri, 19 Apr 2013 06:37:28 -0700	[thread overview]
Message-ID: <20130419133728.GA8445@roeck-us.net> (raw)
In-Reply-To: <87y5ceahas.fsf@natisbad.org>

On Fri, Apr 19, 2013 at 01:30:51PM +0200, Arnaud Ebalard wrote:
> Hi,
> 
> Andrew Lunn <andrew@lunn.ch> writes:
> 
> > Hi Arnaud
> >
> >> +static DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, get_pwm, set_pwm);
> >> +static DEVICE_ATTR(pwm1_polarity, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_polarity, set_pwm_polarity);
> >> +static DEVICE_ATTR(pwm1_mode, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_mode, set_pwm_mode);
> >> +static DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO,
> >> +		   get_speed_control_mode, set_speed_control_mode);
> >> +static DEVICE_ATTR(pwm1_freq, S_IWUSR | S_IRUGO,
> >> +		   get_pwm_freq, set_pwm_freq);
> >> +
> >> +static DEVICE_ATTR(fan1_input, S_IRUGO, get_fan_rpm, NULL);
> >> +static DEVICE_ATTR(fan1_alarm, S_IRUGO, get_fan_ooc, NULL);
> >> +static DEVICE_ATTR(fan1_alarm_detection, S_IWUSR | S_IRUGO,
> >> +		   get_fan_ooc_detection, set_fan_ooc_detection);
> >> +static DEVICE_ATTR(fan1_fault, S_IRUGO, get_fan_failure, NULL);
> >> +static DEVICE_ATTR(fan1_fault_detection, S_IWUSR | S_IRUGO,
> >> +		   get_fan_failure_detection, set_fan_failure_detection);
> >> +static DEVICE_ATTR(fan1_target, S_IWUSR | S_IRUGO,
> >> +		   get_fan_target, set_fan_target);
> >> +static DEVICE_ATTR(fan1_pulses, S_IWUSR | S_IRUGO,
> >> +		   get_fan_pulses, set_fan_pulses);
> >> +static DEVICE_ATTR(fan1_div, S_IWUSR | S_IRUGO,
> >> +		   get_fan_clk_div, set_fan_clk_div);
> >> +static DEVICE_ATTR(fan1_gear_mode, S_IWUSR | S_IRUGO,
> >> +		   get_fan_gear_mode, set_fan_gear_mode);
> >> +static DEVICE_ATTR(fan1_startup_voltage, S_IWUSR | S_IRUGO,
> >> +		   get_fan_startup_voltage, set_fan_startup_voltage);
> >
> > It is normal to use SENSOR_ATTR, not DEVICE_ATTR. Take a look at the
> > existing fan drivers.
> 
> I will take a look and use SENSOR_ATTR if it is the expected way. For
> the records, the g760a.c which I used as basis uses DEVICE_ATTR ;-)
> 
You only need SENSOR_ATTR if you have an index parameter. Otherwise DEVICE_ATTR
is just fine. I would actually reject the patch if I notice that it uses
SENSOR_ATTR without need for a parameter. Besides, in the context used,
it would probably be SENSOR_DEVICE_ATTR.

> > I also think a lot of these are not needed. They are fixed properties
> > of the board and cannot change dynamically. They are set once using DT
> > and user space does not need to care.
> 
> I added those knobs for a simple reason: I don't have all the various
> characteristics of the target platform I am working on (Netgear
> ReadyNAS Duo v2) and needed to be able to test various values w/o
> rebooting to get those rights. I thought this knobs would be useful for
> people with the same issue (for instance, the new ReadyNAS 102 also has
> a G762) and would not hurt.
> 
Testing is not a reason to add non-standard attributes.

Thanks,
Guenter

> Anyway, I will split the patch in two parts and keep the useless knobs
> on my side.
> 
> Thanks for your feedback,
> 
> Cheers,
> 
> a+
> 

  reply	other threads:[~2013-04-19 13:37 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 22:27 [lm-sensors] [RFC, PATCHv0 0/3] Add support for GMT G762/G763 PWM fan controller Arnaud Ebalard
2013-04-18 22:27 ` [RFC,PATCHv0 " Arnaud Ebalard
2013-04-18 22:27 ` Arnaud Ebalard
2013-04-18 22:28 ` [lm-sensors] [PATCH 1/3] Add support for GMT G72/G763 " Arnaud Ebalard
2013-04-18 22:28   ` Arnaud Ebalard
2013-04-18 22:28   ` Arnaud Ebalard
2013-04-19  4:35   ` [lm-sensors] " Guenter Roeck
2013-04-19  4:35     ` Guenter Roeck
2013-04-19  4:35     ` Guenter Roeck
2013-04-19  5:34     ` [lm-sensors] " Arnaud Ebalard
2013-04-19  5:34       ` Arnaud Ebalard
2013-04-19  5:34       ` Arnaud Ebalard
2013-04-23 22:05     ` [lm-sensors] [PATCHv1 0/3] hwmon: " Arnaud Ebalard
2013-04-23 22:05       ` Arnaud Ebalard
2013-04-23 22:05       ` Arnaud Ebalard
2013-04-23 22:05       ` [lm-sensors] [PATCHv1 1/3] hwmon: Add support for GMT G762/G763 " Arnaud Ebalard
2013-04-23 22:05         ` Arnaud Ebalard
2013-04-23 22:05         ` Arnaud Ebalard
2013-04-24  5:37         ` [lm-sensors] " Andrew Lunn
2013-04-24  5:37           ` Andrew Lunn
2013-04-24  5:37           ` Andrew Lunn
2013-04-24  9:06           ` [lm-sensors] " Arnaud Ebalard
2013-04-24  9:06             ` Arnaud Ebalard
2013-04-24  9:06             ` Arnaud Ebalard
2013-04-24 10:04             ` [lm-sensors] " Simon Guinot
2013-04-24 10:04               ` Simon Guinot
2013-04-24 10:04               ` Simon Guinot
2013-04-24 10:50               ` [lm-sensors] " Arnaud Ebalard
2013-04-24 10:50                 ` Arnaud Ebalard
2013-04-24 10:50                 ` Arnaud Ebalard
2013-04-24 13:38             ` [lm-sensors] " Guenter Roeck
2013-04-24 13:38               ` Guenter Roeck
2013-04-24 13:38               ` Guenter Roeck
2013-04-24 20:28               ` [lm-sensors] " Arnaud Ebalard
2013-04-24 20:28                 ` Arnaud Ebalard
2013-04-24 20:28                 ` Arnaud Ebalard
2013-04-24 22:47                 ` [lm-sensors] " Guenter Roeck
2013-04-24 22:47                   ` Guenter Roeck
2013-04-24 22:47                   ` Guenter Roeck
2013-04-25 10:14                   ` [lm-sensors] " Simon Guinot
2013-04-25 10:14                     ` Simon Guinot
2013-04-25 10:14                     ` Simon Guinot
2013-04-24 17:06         ` [lm-sensors] " Simon Guinot
2013-04-24 17:06           ` Simon Guinot
2013-04-24 17:06           ` Simon Guinot
2013-04-24 23:37         ` [lm-sensors] " Guenter Roeck
2013-04-24 23:37           ` Guenter Roeck
2013-04-24 23:37           ` Guenter Roeck
2013-04-25  9:58         ` [lm-sensors] " Simon Guinot
2013-04-25  9:58           ` Simon Guinot
2013-04-25  9:58           ` Simon Guinot
2013-04-27 14:03         ` [lm-sensors] " Simon Guinot
2013-04-27 14:03           ` Simon Guinot
2013-04-27 14:03           ` Simon Guinot
2013-04-27 14:12           ` [lm-sensors] " Jean Delvare
2013-04-27 14:12             ` Jean Delvare
2013-04-27 14:12             ` Jean Delvare
2013-04-27 16:56           ` [lm-sensors] " Guenter Roeck
2013-04-27 16:56             ` Guenter Roeck
2013-04-27 16:56             ` Guenter Roeck
2013-04-27 18:55             ` [lm-sensors] " Arnaud Ebalard
2013-04-27 18:55               ` Arnaud Ebalard
2013-04-27 18:55               ` Arnaud Ebalard
2013-04-23 22:06       ` [lm-sensors] [PATCHv1 2/3] hwmon: Add documentation for g762 driver Arnaud Ebalard
2013-04-23 22:06         ` Arnaud Ebalard
2013-04-23 22:06         ` Arnaud Ebalard
2013-04-24 17:32         ` [lm-sensors] " Guenter Roeck
2013-04-24 17:32           ` Guenter Roeck
2013-04-24 17:32           ` Guenter Roeck
2013-04-24 20:33           ` [lm-sensors] " Arnaud Ebalard
2013-04-24 20:33             ` Arnaud Ebalard
2013-04-24 20:33             ` Arnaud Ebalard
2013-04-23 22:06       ` [lm-sensors] [PATCHv1 3/3] hwmon: Add DT " Arnaud Ebalard
2013-04-23 22:06         ` Arnaud Ebalard
2013-04-23 22:06         ` Arnaud Ebalard
2013-04-23 22:23         ` [lm-sensors] " Jason Cooper
2013-04-23 22:23           ` Jason Cooper
2013-04-23 22:23           ` Jason Cooper
2013-04-24  5:43           ` [lm-sensors] " Arnaud Ebalard
2013-04-24  5:43             ` Arnaud Ebalard
2013-04-24  5:43             ` Arnaud Ebalard
2013-04-19  5:50   ` [lm-sensors] [PATCH 1/3] Add support for GMT G72/G763 PWM fan controller Andrew Lunn
2013-04-19  5:50     ` Andrew Lunn
2013-04-19  5:50     ` Andrew Lunn
2013-04-19 11:30     ` [lm-sensors] " Arnaud Ebalard
2013-04-19 11:30       ` Arnaud Ebalard
2013-04-19 11:30       ` Arnaud Ebalard
2013-04-19 13:37       ` Guenter Roeck [this message]
2013-04-19 13:37         ` Guenter Roeck
2013-04-19 13:37         ` Guenter Roeck
2013-04-19  6:05   ` [lm-sensors] " Jean Delvare
2013-04-19  6:05     ` Jean Delvare
2013-04-19  6:05     ` Jean Delvare
2013-04-19 11:31     ` [lm-sensors] " Arnaud Ebalard
2013-04-19 11:31       ` Arnaud Ebalard
2013-04-19 11:31       ` Arnaud Ebalard
2013-04-18 22:28 ` [lm-sensors] [RFC, PATCHv0 2/3] Add DT documentation for G762 " Arnaud Ebalard
2013-04-18 22:28   ` [RFC,PATCHv0 " Arnaud Ebalard
2013-04-18 22:28   ` Arnaud Ebalard
2013-04-18 22:28 ` [lm-sensors] [PATCH 3/3] Add documentation for g762 driver Arnaud Ebalard
2013-04-18 22:28   ` Arnaud Ebalard
2013-04-18 22:28   ` Arnaud Ebalard

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=20130419133728.GA8445@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andrew@lunn.ch \
    --cc=arno@natisbad.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jason@lakedaemon.net \
    --cc=khali@linux-fr.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=lm-sensors@lm-sensors.org \
    --cc=olivier.mouchet@gmail.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=simon.guinot@sequanux.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.