[lm-sensors] [PATCH 04/12] adt7470: Fix pwm*-auto-point* to be temp*-auto-point*
Jean Delvare
khali at linux-fr.org
Wed Oct 8 11:25:29 CEST 2008
Hi Darrick,
On Mon, 06 Oct 2008 18:18:44 -0700, Darrick J. Wong wrote:
> It turns out that Tmin/Tmax should be attached to the temperature sensors, not
> to the pwm control. Fix my misinterpretation of the datasheet.
Really? I'm confused. The ADT7470 has 4 PWM outputs and 10 temperature
inputs. There are only 4 Tmin registers. How can they be attached to
temperature inputs? What about inputs temp5 to temp10? I think your
original interpretation is correct and Tmin is attached to a PWM
channel, and this patch is incorrect. What makes you think otherwise?
>
> Signed-off-by: Darrick J. Wong <djwong at us.ibm.com>
> ---
>
> drivers/hwmon/adt7470.c | 32 ++++++++++++++++----------------
> 1 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
> index d368d8f..656bf3d 100644
> --- a/drivers/hwmon/adt7470.c
> +++ b/drivers/hwmon/adt7470.c
> @@ -888,22 +888,22 @@ static SENSOR_DEVICE_ATTR(pwm3_auto_point2_pwm, S_IWUSR | S_IRUGO,
> static SENSOR_DEVICE_ATTR(pwm4_auto_point2_pwm, S_IWUSR | S_IRUGO,
> show_pwm_max, set_pwm_max, 3);
>
> -static SENSOR_DEVICE_ATTR(pwm1_auto_point1_temp, S_IWUSR | S_IRUGO,
> +static SENSOR_DEVICE_ATTR(temp1_auto_point1_temp, S_IWUSR | S_IRUGO,
> show_pwm_tmin, set_pwm_tmin, 0);
> -static SENSOR_DEVICE_ATTR(pwm2_auto_point1_temp, S_IWUSR | S_IRUGO,
> +static SENSOR_DEVICE_ATTR(temp2_auto_point1_temp, S_IWUSR | S_IRUGO,
> show_pwm_tmin, set_pwm_tmin, 1);
> -static SENSOR_DEVICE_ATTR(pwm3_auto_point1_temp, S_IWUSR | S_IRUGO,
> +static SENSOR_DEVICE_ATTR(temp3_auto_point1_temp, S_IWUSR | S_IRUGO,
> show_pwm_tmin, set_pwm_tmin, 2);
> -static SENSOR_DEVICE_ATTR(pwm4_auto_point1_temp, S_IWUSR | S_IRUGO,
> +static SENSOR_DEVICE_ATTR(temp4_auto_point1_temp, S_IWUSR | S_IRUGO,
> show_pwm_tmin, set_pwm_tmin, 3);
>
> -static SENSOR_DEVICE_ATTR(pwm1_auto_point2_temp, S_IRUGO, show_pwm_tmax,
> +static SENSOR_DEVICE_ATTR(temp1_auto_point2_temp, S_IRUGO, show_pwm_tmax,
> NULL, 0);
> -static SENSOR_DEVICE_ATTR(pwm2_auto_point2_temp, S_IRUGO, show_pwm_tmax,
> +static SENSOR_DEVICE_ATTR(temp2_auto_point2_temp, S_IRUGO, show_pwm_tmax,
> NULL, 1);
> -static SENSOR_DEVICE_ATTR(pwm3_auto_point2_temp, S_IRUGO, show_pwm_tmax,
> +static SENSOR_DEVICE_ATTR(temp3_auto_point2_temp, S_IRUGO, show_pwm_tmax,
> NULL, 2);
> -static SENSOR_DEVICE_ATTR(pwm4_auto_point2_temp, S_IRUGO, show_pwm_tmax,
> +static SENSOR_DEVICE_ATTR(temp4_auto_point2_temp, S_IRUGO, show_pwm_tmax,
> NULL, 3);
>
> static SENSOR_DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO, show_pwm_auto,
> @@ -996,14 +996,14 @@ static struct attribute *adt7470_attr[] =
> &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr,
> &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr,
> &sensor_dev_attr_pwm4_auto_point2_pwm.dev_attr.attr,
> - &sensor_dev_attr_pwm1_auto_point1_temp.dev_attr.attr,
> - &sensor_dev_attr_pwm2_auto_point1_temp.dev_attr.attr,
> - &sensor_dev_attr_pwm3_auto_point1_temp.dev_attr.attr,
> - &sensor_dev_attr_pwm4_auto_point1_temp.dev_attr.attr,
> - &sensor_dev_attr_pwm1_auto_point2_temp.dev_attr.attr,
> - &sensor_dev_attr_pwm2_auto_point2_temp.dev_attr.attr,
> - &sensor_dev_attr_pwm3_auto_point2_temp.dev_attr.attr,
> - &sensor_dev_attr_pwm4_auto_point2_temp.dev_attr.attr,
> + &sensor_dev_attr_temp1_auto_point1_temp.dev_attr.attr,
> + &sensor_dev_attr_temp2_auto_point1_temp.dev_attr.attr,
> + &sensor_dev_attr_temp3_auto_point1_temp.dev_attr.attr,
> + &sensor_dev_attr_temp4_auto_point1_temp.dev_attr.attr,
> + &sensor_dev_attr_temp1_auto_point2_temp.dev_attr.attr,
> + &sensor_dev_attr_temp2_auto_point2_temp.dev_attr.attr,
> + &sensor_dev_attr_temp3_auto_point2_temp.dev_attr.attr,
> + &sensor_dev_attr_temp4_auto_point2_temp.dev_attr.attr,
> &sensor_dev_attr_pwm1_enable.dev_attr.attr,
> &sensor_dev_attr_pwm2_enable.dev_attr.attr,
> &sensor_dev_attr_pwm3_enable.dev_attr.attr,
>
>
> _______________________________________________
> lm-sensors mailing list
> lm-sensors at lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
--
Jean Delvare
More information about the lm-sensors
mailing list