[PATCH] hwmon: (nct7802) Add autopoint attributes

2015-07-11 Thread Constantine Shulyupin
Introduced pwm[1..3]_auto_point[1..5]_temp, pwm[1..3]_auto_point[1..5]_pwm,
nct7802_auto_point_attrs, nct7802_auto_point_group.
nct7802_auto_point_is_visible,

---

Changed in v2:
- Removed PWM_REG, TEMP_REG
- auto_point[1..4]_temp, auto_point[1..4]_pwm and auto_point_crit_temp
expanded and replaced with pwm[1..3]_auto_point[1..5]_temp
and pwm[1..3]_auto_point[1..5]_pwm.
- Introduced nct7802_auto_point_is_visible
- added used sysfs_update_group in store_pwm_enable

Signed-off-by: Constantine Shulyupin 
---
 drivers/hwmon/nct7802.c | 179 +++-
 1 file changed, 162 insertions(+), 17 deletions(-)

diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
index 2f6bbe5..e1bc7a6 100644
--- a/drivers/hwmon/nct7802.c
+++ b/drivers/hwmon/nct7802.c
@@ -130,6 +130,9 @@ static ssize_t show_pwm(struct device *dev, struct 
device_attribute *devattr,
unsigned int val;
int ret;
 
+   if (!attr->index)
+   return sprintf(buf, "255\n");
+
ret = regmap_read(data->regmap, attr->index, );
if (ret < 0)
return ret;
@@ -170,23 +173,7 @@ static ssize_t show_pwm_enable(struct device *dev,
 
 static ssize_t store_pwm_enable(struct device *dev,
struct device_attribute *attr,
-   const char *buf, size_t count)
-{
-   struct nct7802_data *data = dev_get_drvdata(dev);
-   struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr);
-   u8 val;
-   int ret;
-
-   ret = kstrtou8(buf, 0, );
-   if (ret < 0)
-   return ret;
-   if (val < 1 || val > 2)
-   return -EINVAL;
-   ret = regmap_update_bits(data->regmap, REG_SMARTFAN_EN(sattr->index),
-1 << SMARTFAN_EN_SHIFT(sattr->index),
-(val - 1) << SMARTFAN_EN_SHIFT(sattr->index));
-   return ret ? : count;
-}
+   const char *buf, size_t count);
 
 static int nct7802_read_temp(struct nct7802_data *data,
 u8 reg_temp, u8 reg_temp_low, int *temp)
@@ -890,11 +877,169 @@ static struct attribute_group nct7802_pwm_group = {
.attrs = nct7802_pwm_attrs,
 };
 
+/* 7.2.115... 0x80-0x83, 0x84 Temperature (X-axis) transition */
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x80, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x81, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point3_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x82, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point4_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x83, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point5_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x84, 0);
+
+/* 7.2.120... 0x85-0x88 PWM (Y-axis) transition */
+static SENSOR_DEVICE_ATTR(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x85);
+static SENSOR_DEVICE_ATTR(pwm1_auto_point2_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x86);
+static SENSOR_DEVICE_ATTR(pwm1_auto_point3_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x87);
+static SENSOR_DEVICE_ATTR(pwm1_auto_point4_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x88);
+static SENSOR_DEVICE_ATTR(pwm1_auto_point5_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, NULL, 0);
+
+/* 7.2.124 Table 2 X-axis Transition Point 1 Register */
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x90, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x91, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point3_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x92, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x93, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point5_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x94, 0);
+
+/* 7.2.129 Table 2 Y-axis Transition Point 1 Register */
+static SENSOR_DEVICE_ATTR(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x95);
+static SENSOR_DEVICE_ATTR(pwm2_auto_point2_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x96);
+static SENSOR_DEVICE_ATTR(pwm2_auto_point3_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x97);
+static SENSOR_DEVICE_ATTR(pwm2_auto_point4_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x98);
+static SENSOR_DEVICE_ATTR(pwm2_auto_point5_pwm, S_IRUGO | S_IWUSR,
+ 

[PATCH] hwmon: (nct7802) Add autopoint attributes

2015-07-11 Thread Constantine Shulyupin
Introduced pwm[1..3]_auto_point[1..5]_temp, pwm[1..3]_auto_point[1..5]_pwm,
nct7802_auto_point_attrs, nct7802_auto_point_group.
nct7802_auto_point_is_visible,

---

Changed in v2:
- Removed PWM_REG, TEMP_REG
- auto_point[1..4]_temp, auto_point[1..4]_pwm and auto_point_crit_temp
expanded and replaced with pwm[1..3]_auto_point[1..5]_temp
and pwm[1..3]_auto_point[1..5]_pwm.
- Introduced nct7802_auto_point_is_visible
- added used sysfs_update_group in store_pwm_enable

Signed-off-by: Constantine Shulyupin co...@makelinux.com
---
 drivers/hwmon/nct7802.c | 179 +++-
 1 file changed, 162 insertions(+), 17 deletions(-)

diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
index 2f6bbe5..e1bc7a6 100644
--- a/drivers/hwmon/nct7802.c
+++ b/drivers/hwmon/nct7802.c
@@ -130,6 +130,9 @@ static ssize_t show_pwm(struct device *dev, struct 
device_attribute *devattr,
unsigned int val;
int ret;
 
+   if (!attr-index)
+   return sprintf(buf, 255\n);
+
ret = regmap_read(data-regmap, attr-index, val);
if (ret  0)
return ret;
@@ -170,23 +173,7 @@ static ssize_t show_pwm_enable(struct device *dev,
 
 static ssize_t store_pwm_enable(struct device *dev,
struct device_attribute *attr,
-   const char *buf, size_t count)
-{
-   struct nct7802_data *data = dev_get_drvdata(dev);
-   struct sensor_device_attribute *sattr = to_sensor_dev_attr(attr);
-   u8 val;
-   int ret;
-
-   ret = kstrtou8(buf, 0, val);
-   if (ret  0)
-   return ret;
-   if (val  1 || val  2)
-   return -EINVAL;
-   ret = regmap_update_bits(data-regmap, REG_SMARTFAN_EN(sattr-index),
-1  SMARTFAN_EN_SHIFT(sattr-index),
-(val - 1)  SMARTFAN_EN_SHIFT(sattr-index));
-   return ret ? : count;
-}
+   const char *buf, size_t count);
 
 static int nct7802_read_temp(struct nct7802_data *data,
 u8 reg_temp, u8 reg_temp_low, int *temp)
@@ -890,11 +877,169 @@ static struct attribute_group nct7802_pwm_group = {
.attrs = nct7802_pwm_attrs,
 };
 
+/* 7.2.115... 0x80-0x83, 0x84 Temperature (X-axis) transition */
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x80, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x81, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point3_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x82, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point4_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x83, 0);
+static SENSOR_DEVICE_ATTR_2(pwm1_auto_point5_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x84, 0);
+
+/* 7.2.120... 0x85-0x88 PWM (Y-axis) transition */
+static SENSOR_DEVICE_ATTR(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x85);
+static SENSOR_DEVICE_ATTR(pwm1_auto_point2_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x86);
+static SENSOR_DEVICE_ATTR(pwm1_auto_point3_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x87);
+static SENSOR_DEVICE_ATTR(pwm1_auto_point4_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x88);
+static SENSOR_DEVICE_ATTR(pwm1_auto_point5_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, NULL, 0);
+
+/* 7.2.124 Table 2 X-axis Transition Point 1 Register */
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x90, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x91, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point3_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x92, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x93, 0);
+static SENSOR_DEVICE_ATTR_2(pwm2_auto_point5_temp, S_IRUGO | S_IWUSR,
+   show_temp, store_temp, 0x94, 0);
+
+/* 7.2.129 Table 2 Y-axis Transition Point 1 Register */
+static SENSOR_DEVICE_ATTR(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x95);
+static SENSOR_DEVICE_ATTR(pwm2_auto_point2_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x96);
+static SENSOR_DEVICE_ATTR(pwm2_auto_point3_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x97);
+static SENSOR_DEVICE_ATTR(pwm2_auto_point4_pwm, S_IRUGO | S_IWUSR,
+ show_pwm, store_pwm, 0x98);
+static SENSOR_DEVICE_ATTR(pwm2_auto_point5_pwm, S_IRUGO | S_IWUSR,
+ 

Re: [PATCH] hwmon: (nct7802) Add autopoint attributes

2015-07-09 Thread Guenter Roeck
Hi Constantine,

On Thu, Jul 09, 2015 at 01:49:08AM +0300, Constantine Shulyupin wrote:
> Introduced PWM_REG, TEMP_REG, auto_pointX_temp, auto_pointX_pwm,
> nct7802_auto_point_attrs, nct7802_auto_point_group.
> 
> Signed-off-by: Constantine Shulyupin 
> ---
>  drivers/hwmon/nct7802.c | 41 +
>  1 file changed, 41 insertions(+)
> 
> diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
> index 2f6bbe5..a3f3063 100644
> --- a/drivers/hwmon/nct7802.c
> +++ b/drivers/hwmon/nct7802.c
> @@ -153,6 +153,10 @@ static ssize_t store_pwm(struct device *dev, struct 
> device_attribute *devattr,
>   return err ? : count;
>  }
>  
> +#define PWM_REG(_name, _reg) \
> + SENSOR_DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
> +   show_pwm, store_pwm, _reg)
> +
>  static ssize_t show_pwm_enable(struct device *dev,
>  struct device_attribute *attr, char *buf)
>  {
> @@ -404,6 +408,10 @@ static ssize_t store_temp(struct device *dev, struct 
> device_attribute *attr,
>   return err ? : count;
>  }
>  
> +#define TEMP_REG(_name, _high, _low) \
> + SENSOR_DEVICE_ATTR_2(_name, S_IRUGO | S_IWUSR, \
> + show_temp, store_temp, _high, _low)
> +

Please drop those macros and use SENSOR_DEVICE_ATTR.. directly.

>  static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
>   char *buf)
>  {
> @@ -890,11 +898,44 @@ static struct attribute_group nct7802_pwm_group = {
>   .attrs = nct7802_pwm_attrs,
>  };
>  
> +/* 7.2.115... 0x80-0x83, 0x84 Temperature (X-axis) transition */
> +static TEMP_REG(auto_point1_temp, 0x80, 0);
> +static TEMP_REG(auto_point2_temp, 0x81, 0);
> +static TEMP_REG(auto_point3_temp, 0x82, 0);
> +static TEMP_REG(auto_point4_temp, 0x83, 0);
> +static TEMP_REG(auto_point_crit_temp, 0x84, 0);

I am not really happy with the crit_temp attribute.
Usually we have just gave this another index, ie point5_temp.

Your code is missing the other two tables at register addresses 0x90+
and 0xa0+. Any reason for not including those ?

It might be better to use the attribute names we have used in other
drivers, ie pwm[123]_auto_point[1-5]_pwm and pwm[1-3]_auto_point[1-5]_temp
and support the other two tables as well. One option for the critical
pwm value might be to make it read-only and always report it as 255
for consistency.

Thanks,
Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] hwmon: (nct7802) Add autopoint attributes

2015-07-09 Thread Guenter Roeck
Hi Constantine,

On Thu, Jul 09, 2015 at 01:49:08AM +0300, Constantine Shulyupin wrote:
 Introduced PWM_REG, TEMP_REG, auto_pointX_temp, auto_pointX_pwm,
 nct7802_auto_point_attrs, nct7802_auto_point_group.
 
 Signed-off-by: Constantine Shulyupin co...@makelinux.com
 ---
  drivers/hwmon/nct7802.c | 41 +
  1 file changed, 41 insertions(+)
 
 diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
 index 2f6bbe5..a3f3063 100644
 --- a/drivers/hwmon/nct7802.c
 +++ b/drivers/hwmon/nct7802.c
 @@ -153,6 +153,10 @@ static ssize_t store_pwm(struct device *dev, struct 
 device_attribute *devattr,
   return err ? : count;
  }
  
 +#define PWM_REG(_name, _reg) \
 + SENSOR_DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
 +   show_pwm, store_pwm, _reg)
 +
  static ssize_t show_pwm_enable(struct device *dev,
  struct device_attribute *attr, char *buf)
  {
 @@ -404,6 +408,10 @@ static ssize_t store_temp(struct device *dev, struct 
 device_attribute *attr,
   return err ? : count;
  }
  
 +#define TEMP_REG(_name, _high, _low) \
 + SENSOR_DEVICE_ATTR_2(_name, S_IRUGO | S_IWUSR, \
 + show_temp, store_temp, _high, _low)
 +

Please drop those macros and use SENSOR_DEVICE_ATTR.. directly.

  static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
   char *buf)
  {
 @@ -890,11 +898,44 @@ static struct attribute_group nct7802_pwm_group = {
   .attrs = nct7802_pwm_attrs,
  };
  
 +/* 7.2.115... 0x80-0x83, 0x84 Temperature (X-axis) transition */
 +static TEMP_REG(auto_point1_temp, 0x80, 0);
 +static TEMP_REG(auto_point2_temp, 0x81, 0);
 +static TEMP_REG(auto_point3_temp, 0x82, 0);
 +static TEMP_REG(auto_point4_temp, 0x83, 0);
 +static TEMP_REG(auto_point_crit_temp, 0x84, 0);

I am not really happy with the crit_temp attribute.
Usually we have just gave this another index, ie point5_temp.

Your code is missing the other two tables at register addresses 0x90+
and 0xa0+. Any reason for not including those ?

It might be better to use the attribute names we have used in other
drivers, ie pwm[123]_auto_point[1-5]_pwm and pwm[1-3]_auto_point[1-5]_temp
and support the other two tables as well. One option for the critical
pwm value might be to make it read-only and always report it as 255
for consistency.

Thanks,
Guenter
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] hwmon: (nct7802) Add autopoint attributes

2015-07-08 Thread Constantine Shulyupin
Introduced PWM_REG, TEMP_REG, auto_pointX_temp, auto_pointX_pwm,
nct7802_auto_point_attrs, nct7802_auto_point_group.

Signed-off-by: Constantine Shulyupin 
---
 drivers/hwmon/nct7802.c | 41 +
 1 file changed, 41 insertions(+)

diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
index 2f6bbe5..a3f3063 100644
--- a/drivers/hwmon/nct7802.c
+++ b/drivers/hwmon/nct7802.c
@@ -153,6 +153,10 @@ static ssize_t store_pwm(struct device *dev, struct 
device_attribute *devattr,
return err ? : count;
 }
 
+#define PWM_REG(_name, _reg) \
+   SENSOR_DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
+ show_pwm, store_pwm, _reg)
+
 static ssize_t show_pwm_enable(struct device *dev,
   struct device_attribute *attr, char *buf)
 {
@@ -404,6 +408,10 @@ static ssize_t store_temp(struct device *dev, struct 
device_attribute *attr,
return err ? : count;
 }
 
+#define TEMP_REG(_name, _high, _low) \
+   SENSOR_DEVICE_ATTR_2(_name, S_IRUGO | S_IWUSR, \
+   show_temp, store_temp, _high, _low)
+
 static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
char *buf)
 {
@@ -890,11 +898,44 @@ static struct attribute_group nct7802_pwm_group = {
.attrs = nct7802_pwm_attrs,
 };
 
+/* 7.2.115... 0x80-0x83, 0x84 Temperature (X-axis) transition */
+static TEMP_REG(auto_point1_temp, 0x80, 0);
+static TEMP_REG(auto_point2_temp, 0x81, 0);
+static TEMP_REG(auto_point3_temp, 0x82, 0);
+static TEMP_REG(auto_point4_temp, 0x83, 0);
+static TEMP_REG(auto_point_crit_temp, 0x84, 0);
+
+/* 7.2.120... 0x85-0x88 PWM (Y-axis) transition */
+static PWM_REG(auto_point1_pwm, 0x85);
+static PWM_REG(auto_point2_pwm, 0x86);
+static PWM_REG(auto_point3_pwm, 0x87);
+static PWM_REG(auto_point4_pwm, 0x88);
+
+static struct attribute *nct7802_auto_point_attrs[] = {
+   _dev_attr_auto_point1_temp.dev_attr.attr,
+   _dev_attr_auto_point2_temp.dev_attr.attr,
+   _dev_attr_auto_point3_temp.dev_attr.attr,
+   _dev_attr_auto_point4_temp.dev_attr.attr,
+   _dev_attr_auto_point_crit_temp.dev_attr.attr,
+
+   _dev_attr_auto_point1_pwm.dev_attr.attr,
+   _dev_attr_auto_point2_pwm.dev_attr.attr,
+   _dev_attr_auto_point3_pwm.dev_attr.attr,
+   _dev_attr_auto_point4_pwm.dev_attr.attr,
+
+   NULL
+};
+
+static struct attribute_group nct7802_auto_point_group = {
+   .attrs = nct7802_auto_point_attrs,
+};
+
 static const struct attribute_group *nct7802_groups[] = {
_temp_group,
_in_group,
_fan_group,
_pwm_group,
+   _auto_point_group,
NULL
 };
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] hwmon: (nct7802) Add autopoint attributes

2015-07-08 Thread Constantine Shulyupin
Introduced PWM_REG, TEMP_REG, auto_pointX_temp, auto_pointX_pwm,
nct7802_auto_point_attrs, nct7802_auto_point_group.

Signed-off-by: Constantine Shulyupin co...@makelinux.com
---
 drivers/hwmon/nct7802.c | 41 +
 1 file changed, 41 insertions(+)

diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
index 2f6bbe5..a3f3063 100644
--- a/drivers/hwmon/nct7802.c
+++ b/drivers/hwmon/nct7802.c
@@ -153,6 +153,10 @@ static ssize_t store_pwm(struct device *dev, struct 
device_attribute *devattr,
return err ? : count;
 }
 
+#define PWM_REG(_name, _reg) \
+   SENSOR_DEVICE_ATTR(_name, S_IRUGO | S_IWUSR, \
+ show_pwm, store_pwm, _reg)
+
 static ssize_t show_pwm_enable(struct device *dev,
   struct device_attribute *attr, char *buf)
 {
@@ -404,6 +408,10 @@ static ssize_t store_temp(struct device *dev, struct 
device_attribute *attr,
return err ? : count;
 }
 
+#define TEMP_REG(_name, _high, _low) \
+   SENSOR_DEVICE_ATTR_2(_name, S_IRUGO | S_IWUSR, \
+   show_temp, store_temp, _high, _low)
+
 static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
char *buf)
 {
@@ -890,11 +898,44 @@ static struct attribute_group nct7802_pwm_group = {
.attrs = nct7802_pwm_attrs,
 };
 
+/* 7.2.115... 0x80-0x83, 0x84 Temperature (X-axis) transition */
+static TEMP_REG(auto_point1_temp, 0x80, 0);
+static TEMP_REG(auto_point2_temp, 0x81, 0);
+static TEMP_REG(auto_point3_temp, 0x82, 0);
+static TEMP_REG(auto_point4_temp, 0x83, 0);
+static TEMP_REG(auto_point_crit_temp, 0x84, 0);
+
+/* 7.2.120... 0x85-0x88 PWM (Y-axis) transition */
+static PWM_REG(auto_point1_pwm, 0x85);
+static PWM_REG(auto_point2_pwm, 0x86);
+static PWM_REG(auto_point3_pwm, 0x87);
+static PWM_REG(auto_point4_pwm, 0x88);
+
+static struct attribute *nct7802_auto_point_attrs[] = {
+   sensor_dev_attr_auto_point1_temp.dev_attr.attr,
+   sensor_dev_attr_auto_point2_temp.dev_attr.attr,
+   sensor_dev_attr_auto_point3_temp.dev_attr.attr,
+   sensor_dev_attr_auto_point4_temp.dev_attr.attr,
+   sensor_dev_attr_auto_point_crit_temp.dev_attr.attr,
+
+   sensor_dev_attr_auto_point1_pwm.dev_attr.attr,
+   sensor_dev_attr_auto_point2_pwm.dev_attr.attr,
+   sensor_dev_attr_auto_point3_pwm.dev_attr.attr,
+   sensor_dev_attr_auto_point4_pwm.dev_attr.attr,
+
+   NULL
+};
+
+static struct attribute_group nct7802_auto_point_group = {
+   .attrs = nct7802_auto_point_attrs,
+};
+
 static const struct attribute_group *nct7802_groups[] = {
nct7802_temp_group,
nct7802_in_group,
nct7802_fan_group,
nct7802_pwm_group,
+   nct7802_auto_point_group,
NULL
 };
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/