* [PATCH v3 0/2] hwmon: (nct6775) Fix pwm bugs for NCT chips
@ 2023-11-21 8:16 Xing Tong Wu
2023-11-21 8:16 ` [PATCH v3 1/2] hwmon: (nct6775) Add support for 2 additional fan controls Xing Tong Wu
2023-11-21 8:16 ` [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode Xing Tong Wu
0 siblings, 2 replies; 5+ messages in thread
From: Xing Tong Wu @ 2023-11-21 8:16 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare, linux-hwmon, linux-kernel
Cc: xingtong.wu, tobias.schaffner, gerd.haeussler.ext
From: Xing Tong Wu <xingtong.wu@siemens.com>
These patches address bugs in the pwm features that do not meet the
specification definition.
changes since v2:
- Update commit message for 1/2 patch
- Extend 6106 arrays and remove 6116 arrays for PWM.
changes since v1:
- Add PWM mode and mask register arrays for NCT6116
- Delete 2nd patch for pwm_enable change
- Delete log print and add comment for pwm failure set
Xing Tong Wu (2):
hwmon: (nct6775) Add support for 2 additional fan controls
hwmon: (nct6775) Fix fan speed set failure in automatic mode
drivers/hwmon/nct6775-core.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 1/2] hwmon: (nct6775) Add support for 2 additional fan controls
2023-11-21 8:16 [PATCH v3 0/2] hwmon: (nct6775) Fix pwm bugs for NCT chips Xing Tong Wu
@ 2023-11-21 8:16 ` Xing Tong Wu
2023-11-21 15:59 ` Guenter Roeck
2023-11-21 8:16 ` [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode Xing Tong Wu
1 sibling, 1 reply; 5+ messages in thread
From: Xing Tong Wu @ 2023-11-21 8:16 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare, linux-hwmon, linux-kernel
Cc: xingtong.wu, tobias.schaffner, gerd.haeussler.ext
From: Xing Tong Wu <xingtong.wu@siemens.com>
The nct6116 has 2 additional PWM pins compared to the nct6106.
Extend the nct6106 PWM arrays to support the nct6116.
Signed-off-by: Xing Tong Wu <xingtong.wu@siemens.com>
---
drivers/hwmon/nct6775-core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index d928eb8ae5a3..88300fb99bb9 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -767,9 +767,9 @@ static const u16 NCT6106_REG_FAN_MIN[] = { 0xe0, 0xe2, 0xe4 };
static const u16 NCT6106_REG_FAN_PULSES[] = { 0xf6, 0xf6, 0xf6 };
static const u16 NCT6106_FAN_PULSE_SHIFT[] = { 0, 2, 4 };
-static const u8 NCT6106_REG_PWM_MODE[] = { 0xf3, 0xf3, 0xf3 };
-static const u8 NCT6106_PWM_MODE_MASK[] = { 0x01, 0x02, 0x04 };
-static const u16 NCT6106_REG_PWM_READ[] = { 0x4a, 0x4b, 0x4c };
+static const u8 NCT6106_REG_PWM_MODE[] = { 0xf3, 0xf3, 0xf3, 0, 0 };
+static const u8 NCT6106_PWM_MODE_MASK[] = { 0x01, 0x02, 0x04, 0, 0 };
+static const u16 NCT6106_REG_PWM_READ[] = { 0x4a, 0x4b, 0x4c, 0xd8, 0xd9 };
static const u16 NCT6106_REG_FAN_MODE[] = { 0x113, 0x123, 0x133 };
static const u16 NCT6106_REG_TEMP_SOURCE[] = {
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5 };
@@ -3595,7 +3595,7 @@ int nct6775_probe(struct device *dev, struct nct6775_data *data,
break;
case nct6116:
data->in_num = 9;
- data->pwm_num = 3;
+ data->pwm_num = 5;
data->auto_pwm_num = 4;
data->temp_fixed_num = 3;
data->num_temp_alarms = 3;
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode
2023-11-21 8:16 [PATCH v3 0/2] hwmon: (nct6775) Fix pwm bugs for NCT chips Xing Tong Wu
2023-11-21 8:16 ` [PATCH v3 1/2] hwmon: (nct6775) Add support for 2 additional fan controls Xing Tong Wu
@ 2023-11-21 8:16 ` Xing Tong Wu
2023-11-21 15:59 ` Guenter Roeck
1 sibling, 1 reply; 5+ messages in thread
From: Xing Tong Wu @ 2023-11-21 8:16 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare, linux-hwmon, linux-kernel
Cc: xingtong.wu, tobias.schaffner, gerd.haeussler.ext
From: Xing Tong Wu <xingtong.wu@siemens.com>
Setting the fan speed is only valid in manual mode; it is not possible
to set the fan's speed in automatic mode.
Return error when attempting to set the fan speed in automatic mode.
Signed-off-by: Xing Tong Wu <xingtong.wu@siemens.com>
---
drivers/hwmon/nct6775-core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 88300fb99bb9..83f1da5acd22 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -2553,6 +2553,13 @@ store_pwm(struct device *dev, struct device_attribute *attr, const char *buf,
int err;
u16 reg;
+ /*
+ * The fan control mode should be set to manual if the user wants to adjust
+ * the fan speed. Otherwise, it will fail to set.
+ */
+ if (index == 0 && data->pwm_enable[nr] > manual)
+ return -EBUSY;
+
err = kstrtoul(buf, 10, &val);
if (err < 0)
return err;
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] hwmon: (nct6775) Add support for 2 additional fan controls
2023-11-21 8:16 ` [PATCH v3 1/2] hwmon: (nct6775) Add support for 2 additional fan controls Xing Tong Wu
@ 2023-11-21 15:59 ` Guenter Roeck
0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2023-11-21 15:59 UTC (permalink / raw)
To: Xing Tong Wu
Cc: Jean Delvare, linux-hwmon, linux-kernel, xingtong.wu,
tobias.schaffner, gerd.haeussler.ext
On Tue, Nov 21, 2023 at 04:16:03PM +0800, Xing Tong Wu wrote:
> From: Xing Tong Wu <xingtong.wu@siemens.com>
>
> The nct6116 has 2 additional PWM pins compared to the nct6106.
> Extend the nct6106 PWM arrays to support the nct6116.
>
> Signed-off-by: Xing Tong Wu <xingtong.wu@siemens.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode
2023-11-21 8:16 ` [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode Xing Tong Wu
@ 2023-11-21 15:59 ` Guenter Roeck
0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2023-11-21 15:59 UTC (permalink / raw)
To: Xing Tong Wu
Cc: Jean Delvare, linux-hwmon, linux-kernel, xingtong.wu,
tobias.schaffner, gerd.haeussler.ext
On Tue, Nov 21, 2023 at 04:16:04PM +0800, Xing Tong Wu wrote:
> From: Xing Tong Wu <xingtong.wu@siemens.com>
>
> Setting the fan speed is only valid in manual mode; it is not possible
> to set the fan's speed in automatic mode.
> Return error when attempting to set the fan speed in automatic mode.
>
> Signed-off-by: Xing Tong Wu <xingtong.wu@siemens.com>
Applied.
Thanks,
Guenter
> ---
> drivers/hwmon/nct6775-core.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
> index 88300fb99bb9..83f1da5acd22 100644
> --- a/drivers/hwmon/nct6775-core.c
> +++ b/drivers/hwmon/nct6775-core.c
> @@ -2553,6 +2553,13 @@ store_pwm(struct device *dev, struct device_attribute *attr, const char *buf,
> int err;
> u16 reg;
>
> + /*
> + * The fan control mode should be set to manual if the user wants to adjust
> + * the fan speed. Otherwise, it will fail to set.
> + */
> + if (index == 0 && data->pwm_enable[nr] > manual)
> + return -EBUSY;
> +
> err = kstrtoul(buf, 10, &val);
> if (err < 0)
> return err;
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-21 15:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 8:16 [PATCH v3 0/2] hwmon: (nct6775) Fix pwm bugs for NCT chips Xing Tong Wu
2023-11-21 8:16 ` [PATCH v3 1/2] hwmon: (nct6775) Add support for 2 additional fan controls Xing Tong Wu
2023-11-21 15:59 ` Guenter Roeck
2023-11-21 8:16 ` [PATCH v3 2/2] hwmon: (nct6775) Fix fan speed set failure in automatic mode Xing Tong Wu
2023-11-21 15:59 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®