linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] hwmon: (aquacomputer_d5next) Add D5 Next fan control support
@ 2022-07-17 17:14 Aleksa Savic
  2022-07-21  3:48 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Aleksa Savic @ 2022-07-17 17:14 UTC (permalink / raw)
  To: linux-hwmon
  Cc: Aleksa Savic, Jack Doan, Jean Delvare, Guenter Roeck, linux-kernel

Define pump and fan speed register offsets in
D5 Next control report, as well as its size, to expose PWM fan control.

Originally-from: Jack Doan <me@jackdoan.com>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
---
Changes in v2:
- Clarified in the commit message that Jack Doan is the code author
---
 drivers/hwmon/aquacomputer_d5next.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c
index 0e56cc711a26..997d72ea6182 100644
--- a/drivers/hwmon/aquacomputer_d5next.c
+++ b/drivers/hwmon/aquacomputer_d5next.c
@@ -71,8 +71,12 @@ static u8 secondary_ctrl_report[] = {
 #define D5NEXT_PUMP_OFFSET		0x6c
 #define D5NEXT_FAN_OFFSET		0x5f
 #define D5NEXT_5V_VOLTAGE		0x39
+#define D5NEXT_CTRL_REPORT_SIZE		0x329
 static u8 d5next_sensor_fan_offsets[] = { D5NEXT_PUMP_OFFSET, D5NEXT_FAN_OFFSET };
 
+/* Pump and fan speed registers in D5 Next control report (from 0-100%) */
+static u16 d5next_ctrl_fan_offsets[] = { 0x97, 0x42 };
+
 /* Register offsets for the Farbwerk RGB controller */
 #define FARBWERK_NUM_SENSORS		4
 #define FARBWERK_SENSOR_START		0x2f
@@ -667,9 +671,11 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
 
 		priv->num_fans = D5NEXT_NUM_FANS;
 		priv->fan_sensor_offsets = d5next_sensor_fan_offsets;
+		priv->fan_ctrl_offsets = d5next_ctrl_fan_offsets;
 		priv->num_temp_sensors = D5NEXT_NUM_SENSORS;
 		priv->temp_sensor_start_offset = D5NEXT_COOLANT_TEMP;
 		priv->power_cycle_count_offset = D5NEXT_POWER_CYCLES;
+		priv->buffer_size = D5NEXT_CTRL_REPORT_SIZE;
 
 		priv->temp_label = label_d5next_temp;
 		priv->speed_label = label_d5next_speeds;
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] hwmon: (aquacomputer_d5next) Add D5 Next fan control support
  2022-07-17 17:14 [PATCH v2] hwmon: (aquacomputer_d5next) Add D5 Next fan control support Aleksa Savic
@ 2022-07-21  3:48 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-07-21  3:48 UTC (permalink / raw)
  To: Aleksa Savic; +Cc: linux-hwmon, Jack Doan, Jean Delvare, linux-kernel

On Sun, Jul 17, 2022 at 07:14:12PM +0200, Aleksa Savic wrote:
> Define pump and fan speed register offsets in
> D5 Next control report, as well as its size, to expose PWM fan control.
> 
> Originally-from: Jack Doan <me@jackdoan.com>
> Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>

Applied.

Thanks,
Guenter

> ---
> Changes in v2:
> - Clarified in the commit message that Jack Doan is the code author
> ---
>  drivers/hwmon/aquacomputer_d5next.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c
> index 0e56cc711a26..997d72ea6182 100644
> --- a/drivers/hwmon/aquacomputer_d5next.c
> +++ b/drivers/hwmon/aquacomputer_d5next.c
> @@ -71,8 +71,12 @@ static u8 secondary_ctrl_report[] = {
>  #define D5NEXT_PUMP_OFFSET		0x6c
>  #define D5NEXT_FAN_OFFSET		0x5f
>  #define D5NEXT_5V_VOLTAGE		0x39
> +#define D5NEXT_CTRL_REPORT_SIZE		0x329
>  static u8 d5next_sensor_fan_offsets[] = { D5NEXT_PUMP_OFFSET, D5NEXT_FAN_OFFSET };
>  
> +/* Pump and fan speed registers in D5 Next control report (from 0-100%) */
> +static u16 d5next_ctrl_fan_offsets[] = { 0x97, 0x42 };
> +
>  /* Register offsets for the Farbwerk RGB controller */
>  #define FARBWERK_NUM_SENSORS		4
>  #define FARBWERK_SENSOR_START		0x2f
> @@ -667,9 +671,11 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
>  
>  		priv->num_fans = D5NEXT_NUM_FANS;
>  		priv->fan_sensor_offsets = d5next_sensor_fan_offsets;
> +		priv->fan_ctrl_offsets = d5next_ctrl_fan_offsets;
>  		priv->num_temp_sensors = D5NEXT_NUM_SENSORS;
>  		priv->temp_sensor_start_offset = D5NEXT_COOLANT_TEMP;
>  		priv->power_cycle_count_offset = D5NEXT_POWER_CYCLES;
> +		priv->buffer_size = D5NEXT_CTRL_REPORT_SIZE;
>  
>  		priv->temp_label = label_d5next_temp;
>  		priv->speed_label = label_d5next_speeds;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-21  3:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-17 17:14 [PATCH v2] hwmon: (aquacomputer_d5next) Add D5 Next fan control support Aleksa Savic
2022-07-21  3:48 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).