All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 1/2 RESEND] hwmon/sis5595: Add individual
Date: Mon, 15 Oct 2007 19:27:27 +0000	[thread overview]
Message-ID: <20071015212727.17f16eaa@hyperion.delvare> (raw)
In-Reply-To: <4713B68D.10602@gmail.com>

On Mon, 15 Oct 2007 20:50:53 +0200, Ivo Manca wrote:
> From: Ivo Manca <pinkel@gmail.com>
> 
> Add individual alarm files needed by the new libsensors.
> 
> Signed-off-by: Ivo Manca <pinkel@gmail.com>
> ---
> --- linux-2.6.23.1.orig/drivers/hwmon/sis5595.c	2007-10-12 18:43:44.000000000 +0200
> +++ linux-2.6.23.1/drivers/hwmon/sis5595.c	2007-10-15 20:38:44.375000000 +0200
> @@ -435,6 +435,22 @@ static ssize_t show_alarms(struct device
>  }
>  static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
>  
> +static ssize_t show_alarm(struct device *dev, struct device_attribute *da,
> +			  char *buf)
> +{
> +	struct sis5595_data *data = sis5595_update_device(dev);
> +	int nr = to_sensor_dev_attr(da)->index;
> +	return sprintf(buf, "%u\n", (data->alarms >> nr) & 1);
> +}
> +static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0);
> +static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1);
> +static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2);
> +static SENSOR_DEVICE_ATTR(in3_alarm, S_IRUGO, show_alarm, NULL, 3);
> +static SENSOR_DEVICE_ATTR(in4_alarm, S_IRUGO, show_alarm, NULL, 15);
> +static SENSOR_DEVICE_ATTR(fan1_alarm, S_IRUGO, show_alarm, NULL, 6);
> +static SENSOR_DEVICE_ATTR(fan2_alarm, S_IRUGO, show_alarm, NULL, 7);
> +static SENSOR_DEVICE_ATTR(temp1_alarm, S_IRUGO, show_alarm, NULL, 15);
> +
>  static ssize_t show_name(struct device *dev, struct device_attribute *attr,
>  			 char *buf)
>  {
> @@ -447,22 +463,28 @@ static struct attribute *sis5595_attribu
>  	&sensor_dev_attr_in0_input.dev_attr.attr,
>  	&sensor_dev_attr_in0_min.dev_attr.attr,
>  	&sensor_dev_attr_in0_max.dev_attr.attr,
> +	&sensor_dev_attr_in0_alarm.dev_attr.attr,
>  	&sensor_dev_attr_in1_input.dev_attr.attr,
>  	&sensor_dev_attr_in1_min.dev_attr.attr,
>  	&sensor_dev_attr_in1_max.dev_attr.attr,
> +	&sensor_dev_attr_in1_alarm.dev_attr.attr,
>  	&sensor_dev_attr_in2_input.dev_attr.attr,
>  	&sensor_dev_attr_in2_min.dev_attr.attr,
>  	&sensor_dev_attr_in2_max.dev_attr.attr,
> +	&sensor_dev_attr_in2_alarm.dev_attr.attr,
>  	&sensor_dev_attr_in3_input.dev_attr.attr,
>  	&sensor_dev_attr_in3_min.dev_attr.attr,
>  	&sensor_dev_attr_in3_max.dev_attr.attr,
> +	&sensor_dev_attr_in3_alarm.dev_attr.attr,
>  
>  	&sensor_dev_attr_fan1_input.dev_attr.attr,
>  	&sensor_dev_attr_fan1_min.dev_attr.attr,
>  	&sensor_dev_attr_fan1_div.dev_attr.attr,
> +	&sensor_dev_attr_fan1_alarm.dev_attr.attr,
>  	&sensor_dev_attr_fan2_input.dev_attr.attr,
>  	&sensor_dev_attr_fan2_min.dev_attr.attr,
>  	&sensor_dev_attr_fan2_div.dev_attr.attr,
> +	&sensor_dev_attr_fan2_alarm.dev_attr.attr,
>  
>  	&dev_attr_alarms.attr,
>  	&dev_attr_name.attr,
> @@ -477,10 +499,12 @@ static struct attribute *sis5595_attribu
>  	&sensor_dev_attr_in4_input.dev_attr.attr,
>  	&sensor_dev_attr_in4_min.dev_attr.attr,
>  	&sensor_dev_attr_in4_max.dev_attr.attr,
> +	&sensor_dev_attr_in4_alarm.dev_attr.attr,
>  
>  	&dev_attr_temp1_input.attr,
>  	&dev_attr_temp1_max.attr,
>  	&dev_attr_temp1_max_hyst.attr,
> +	&sensor_dev_attr_temp1_alarm.dev_attr.attr,
>  	NULL
>  };
>  
> @@ -545,7 +569,9 @@ static int __devinit sis5595_probe(struc
>  		 || (err = device_create_file(&pdev->dev,
>  					&sensor_dev_attr_in4_min.dev_attr))
>  		 || (err = device_create_file(&pdev->dev,
> -					&sensor_dev_attr_in4_max.dev_attr)))
> +					&sensor_dev_attr_in4_max.dev_attr))
> +		 || (err = device_create_file(&pdev->dev,
> +					&sensor_dev_attr_in4_alarm.dev_attr)))
>  			goto exit_remove_files;
>  	} else {
>  		if ((err = device_create_file(&pdev->dev,
> @@ -553,7 +579,9 @@ static int __devinit sis5595_probe(struc
>  		 || (err = device_create_file(&pdev->dev,
>  					      &dev_attr_temp1_max))
>  		 || (err = device_create_file(&pdev->dev,
> -					      &dev_attr_temp1_max_hyst)))
> +					      &dev_attr_temp1_max_hyst))
> +		 || (err = device_create_file(&pdev->dev,
> +				&sensor_dev_attr_temp1_alarm.dev_attr)))
>  			goto exit_remove_files;
>  	}
>  

Thanks for this patch.

Acked-by: Jean Delvare <khali@linux.org>

-- 
Jean Delvare

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

  reply	other threads:[~2007-10-15 19:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-15 18:50 [lm-sensors] [PATCH 1/2 RESEND] hwmon/sis5595: Add individual alarm Ivo Manca
2007-10-15 19:27 ` Jean Delvare [this message]
2007-10-16 11:08 ` [lm-sensors] [PATCH 1/2 RESEND] hwmon/sis5595: Add individual Mark M. Hoffman

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=20071015212727.17f16eaa@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@vger.kernel.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.