search for: attr_set

Displaying 20 results from an estimated 65 matches for "attr_set".

Did you mean: attr_get
2017 Jul 17
2
[PATCH] drm/nouveau/hwmon: Uninitialized variables in sysfs
...ruct device *d, struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_therm *therm = nvxx_therm(&drm->client.device); long value; + int ret; - if (kstrtol(buf, 10, &value) == -EINVAL) - return count; + ret = kstrtol(buf, 10, &value); + if (ret) + return ret; therm->attr_set(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST, value / 1000); @@ -101,9 +103,11 @@ nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d, struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_therm *therm = nvxx_therm(&drm->client.device); long value; + int ret; - if (kstrtol(...
2017 Apr 13
0
[PATCH 2/4] nouveau_hwmon: migrate to hwmon_device_register_with_info
..._temp(struct nouveau_drm *drm, long val) { - struct drm_device *dev = dev_get_drvdata(d); - struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_therm *therm = nvxx_therm(&drm->client.device); - long value; - if (kstrtol(buf, 10, &value) == -EINVAL) - return count; - - therm->attr_set(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK, value / 1000); - - return count; + return therm->attr_set(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK, + val / 1000); } -static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, nouveau_hwmon_max_temp, - nouveau_hwmon_set_max_temp, - 0); -stat...
2017 May 16
7
[PATCH v7 0/5] replace hwmon_device_register for hwmon_device_register_with_info
...mp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4: * Rever const to struct attribute. Kbuild complains. v4 -> v5: * Drops a check for attr_set in "nouveau_temp_is_visible". v5 -> v6: * Change to nouveau/hwmon all commit titles * Drop author change * Coding-Style * Move the check before the switch in nouveau_power_is_visible function * Expose temperature attrs as RW again * Get rid of nouveau_hwmon_set_pwm1/_enable and i...
2017 May 08
5
[PATCH v6 0/5] replace hwmon_device_register for hwmon_device_register_with_info
...mp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4: * Rever const to struct attribute. Kbuild complains. v4 -> v5: * Drops a check for attr_set in "nouveau_temp_is_visible". v5 -> v6: * Change to nouveau/hwmon all commit titles * Drop author change * Coding-Style * Move the check before the switch in nouveau_power_is_visible function * Expose temperature attrs as RW again * Get rid of nouveau_hwmon_set_pwm1/_enable and i...
2017 May 18
7
[PATCH v8 0/5] replace hwmon_device_register for hwmon_device_register_with_info
...mp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4: * Rever const to struct attribute. Kbuild complains. v4 -> v5: * Drops a check for attr_set in "nouveau_temp_is_visible". v5 -> v6: * Change to nouveau/hwmon all commit titles * Drop author change * Coding-Style * Move the check before the switch in nouveau_power_is_visible function * Expose temperature attrs as RW again * Get r...
2017 Apr 11
2
[PATCH 1/1] nouveau_hwmon: migrate to hwmon_device_register_with_info
..._temp(struct nouveau_drm *drm, long val) { - struct drm_device *dev = dev_get_drvdata(d); - struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_therm *therm = nvxx_therm(&drm->client.device); - long value; - - if (kstrtol(buf, 10, &value) == -EINVAL) - return count; - therm->attr_set(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK, value / 1000); - - return count; + therm->attr_set(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK, val / 1000); + return val; } -static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, nouveau_hwmon_max_temp, - nouveau_hwmon_set_max_temp, - 0); -stati...
2017 Jul 22
0
[PATCH] drm/nouveau/hwmon: Uninitialized variables in sysfs
...(dev); > struct nvkm_therm *therm = nvxx_therm(&drm->client.device); > long value; > + int ret; > > - if (kstrtol(buf, 10, &value) == -EINVAL) > - return count; > + ret = kstrtol(buf, 10, &value); > + if (ret) > + return ret; > > therm->attr_set(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST, > value / 1000); > @@ -101,9 +103,11 @@ nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d, > struct nouveau_drm *drm = nouveau_drm(dev); > struct nvkm_therm *therm = nvxx_therm(&drm->client.device); > long value; &g...
2018 Jul 11
0
[PATCH] drm/nouveau/hwmon: potential uninitialized variables
...on.c @@ -69,8 +69,8 @@ nouveau_hwmon_set_temp1_auto_point1_temp(struct device *d, struct nvkm_therm *therm = nvxx_therm(&drm->client.device); long value; - if (kstrtol(buf, 10, &value) == -EINVAL) - return count; + if (kstrtol(buf, 10, &value)) + return -EINVAL; therm->attr_set(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST, value / 1000); @@ -102,8 +102,8 @@ nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d, struct nvkm_therm *therm = nvxx_therm(&drm->client.device); long value; - if (kstrtol(buf, 10, &value) == -EINVAL) - return count; + if (ks...
2017 Apr 12
0
[PATCH 1/1] nouveau_hwmon: migrate to hwmon_device_register_with_info
...vdata(d); > - struct nouveau_drm *drm = nouveau_drm(dev); > struct nvkm_therm *therm = nvxx_therm(&drm->client.device); > - long value; > - > - if (kstrtol(buf, 10, &value) == -EINVAL) > - return count; > > - therm->attr_set(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK, value / 1000); > - > - return count; > + therm->attr_set(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK, val / 1000); > + return val; > } > -static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, nouveau_hwmon_max_temp, > - no...
2017 Apr 26
9
[PATCH v5 0/5] replace hwmon_device_register for hwmon_device_register_with_info
This v5 drops a check for attr_set. Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4: * Rever const to struct attribute. Kbuild complain...
2017 Apr 26
0
[PATCH v5 3/5] nouveau_hwmon: Remove old code, add .write/.read operations
..._hwmon_max_temp(struct nouveau_drm *drm) { - struct drm_device *dev = dev_get_drvdata(d); - struct nouveau_drm *drm = nouveau_drm(dev); struct nvkm_therm *therm = nvxx_therm(&drm->client.device); - long value; - if (kstrtol(buf, 10, &value) == -EINVAL) - return count; - - therm->attr_set(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK, value / 1000); - - return count; + return therm->attr_get(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK) * 1000; } -static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, nouveau_hwmon_max_temp, - nouveau_hwmon_set_max_temp, - 0); -static ssize_t -n...
2017 Apr 22
6
[PATCH v4 0/5] replace hwmon_device_register for hwmon_device_register_with_info
Kbuild sent me an e-mail due to a fixup I introduced in v3. It complains due to an incompatible pointer type and it doesn't build. This version reverts it. Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits v3 -> v4:
2017 Apr 17
9
[PATCH v2 0/5] replace hwmon_device_register for hwmon_device_register_with_info
Hi! This patchseries replaces the deprecated hwmon_device_register function with the new one hwmon_device_register_with_info. It also does some cleanup. Here is the list of patches and what they do: 1/ Adds config structures for all sensors and their possible settings. This patch and the next one are just preparing the code for what it comes. 2/ Now everything goes through
2017 Apr 21
6
[PATCH v3 0/5] replace hwmon_device_register for hwmon_device_register_with_info
Hi, this is version v3 with some fix-ups: Versions: v1 -> v2: * Keep temp attrs as read only v2 -> v3: * Code fix-ups: struct and string as const and add return within switch due to fallthrough * Add Signed-off-by to all commits This patchseries replaces the deprecated hwmon_device_register function with the new one hwmon_device_register_with_info. It also does some cleanup. Here
2016 Feb 20
0
[PATCH v4 5/6] hwmon: don't require therm to be valid to get any data
...ouveau_hwmon.c b/drm/nouveau/nouveau_hwmon.c index c4f77f5..a630192 100644 --- a/drm/nouveau/nouveau_hwmon.c +++ b/drm/nouveau/nouveau_hwmon.c @@ -643,9 +643,6 @@ nouveau_hwmon_init(struct drm_device *dev) return -ENOMEM; hwmon->dev = dev; - if (!therm || !therm->attr_get || !therm->attr_set) - return -ENODEV; - hwmon_dev = hwmon_device_register(&dev->pdev->dev); if (IS_ERR(hwmon_dev)) { ret = PTR_ERR(hwmon_dev); @@ -659,26 +656,28 @@ nouveau_hwmon_init(struct drm_device *dev) if (ret) goto error; - /* if the card has a working thermal sensor */ - if (nvkm_ther...
2017 Apr 13
2
[PATCH 1/4] nouveau_hwmon: migrate to hwmon_device_register_with_info
...0; + } +} + +static umode_t +nouveau_temp_is_visible(const void *data, u32 attr, int channel) +{ + struct nouveau_drm *drm = nouveau_drm((struct drm_device *)data); + struct nvkm_therm *therm = nvxx_therm(&drm->client.device); + + if (therm && therm->attr_get && therm->attr_set) + if (nvkm_therm_temp_get(therm) < 0) + return 0; + + switch (attr) { + case hwmon_temp_input: + return 0444; + case hwmon_temp_max: + case hwmon_temp_max_hyst: + case hwmon_temp_crit: + case hwmon_temp_crit_hyst: + case hwmon_temp_emergency: + case hwmon_temp_emergency_hyst: + return 0644...
2017 Apr 18
2
[PATCH v2 2/5] nouveau_hwmon: Add nouveau_hwmon_ops structure with .is_visible/.read_string
...channel) > +{ > + struct nouveau_drm *drm = nouveau_drm((struct drm_device *)data); > + struct nvkm_therm *therm = nvxx_therm(&drm->client.device); > + > + if (therm && > + therm->attr_get && > + therm->attr_set && > + nvkm_therm_temp_get(therm) < 0) > + return 0; > + > + switch (attr) { > + case hwmon_temp_input: > + case hwmon_temp_max: > + case hwmon_temp_max_hyst: > + case hwmon_temp_crit: > + case hwm...
2017 Nov 22
2
[PATCH 03/32] therm: Split return code and value in nvkm_get_temp
...**); > diff --git a/drm/nouveau/include/nvkm/subdev/therm.h b/drm/nouveau/include/nvkm/subdev/therm.h > index 9841f076..8c84017f 100644 > --- a/drm/nouveau/include/nvkm/subdev/therm.h > +++ b/drm/nouveau/include/nvkm/subdev/therm.h > @@ -86,7 +86,7 @@ struct nvkm_therm { > int (*attr_set)(struct nvkm_therm *, enum nvkm_therm_attr_type, int); > }; > > -int nvkm_therm_temp_get(struct nvkm_therm *); > +int nvkm_therm_temp_get(struct nvkm_therm *, int *); > int nvkm_therm_fan_sense(struct nvkm_therm *); > int nvkm_therm_cstate(struct nvkm_therm *, int, int); >...
2017 Oct 08
1
[RFC PATCH 01/29] therm: split return code and value in nvkm_get_temp
...gt; > diff --git a/drm/nouveau/include/nvkm/subdev/therm.h b/drm/nouveau/include/nvkm/subdev/therm.h > index 9841f076..8c84017f 100644 > --- a/drm/nouveau/include/nvkm/subdev/therm.h > +++ b/drm/nouveau/include/nvkm/subdev/therm.h > @@ -86,7 +86,7 @@ struct nvkm_therm { > int (*attr_set)(struct nvkm_therm *, enum nvkm_therm_attr_type, int); > }; > > -int nvkm_therm_temp_get(struct nvkm_therm *); > +int nvkm_therm_temp_get(struct nvkm_therm *, int *); > int nvkm_therm_fan_sense(struct nvkm_therm *); > int nvkm_therm_cstate(struct nvkm_therm *, int, int); >...
2017 Sep 15
0
[RFC PATCH 01/29] therm: split return code and value in nvkm_get_temp
...55 insertions(+), 39 deletions(-) diff --git a/drm/nouveau/include/nvkm/subdev/therm.h b/drm/nouveau/include/nvkm/subdev/therm.h index 9841f076..8c84017f 100644 --- a/drm/nouveau/include/nvkm/subdev/therm.h +++ b/drm/nouveau/include/nvkm/subdev/therm.h @@ -86,7 +86,7 @@ struct nvkm_therm { int (*attr_set)(struct nvkm_therm *, enum nvkm_therm_attr_type, int); }; -int nvkm_therm_temp_get(struct nvkm_therm *); +int nvkm_therm_temp_get(struct nvkm_therm *, int *); int nvkm_therm_fan_sense(struct nvkm_therm *); int nvkm_therm_cstate(struct nvkm_therm *, int, int); diff --git a/drm/nouveau/nouveau...