Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp934576lqa; Sun, 28 Apr 2024 10:21:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwTub03rb9KbM/HQHWmxwZ2IbRF4Uy8w5fI056B7AgmQ97oIMSQTrjHLiAfRcJaDKkBtuMxsEOltbeJxNP98vXsFnlk0V+sS4vyLnIaQ== X-Google-Smtp-Source: AGHT+IFeF/PiQibk/j9x8c0ETdEe8XSkxaW5yoCZ+mrJ4EWeF1VV22PE0bWr7ziEwgI8j+vrNpio X-Received: by 2002:a17:906:1416:b0:a58:2fad:32fc with SMTP id p22-20020a170906141600b00a582fad32fcmr5477654ejc.9.1714324860468; Sun, 28 Apr 2024 10:21:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714324860; cv=pass; d=google.com; s=arc-20160816; b=Dfe75eCumW3iI8MTtBlSlcgV2c3KHO8MP78KQDHfP4mtlhhEBSSQ5ISZOxJ/35bXK0 gGryiFp1MhkEPi98ZJisVPNLtRMrJvY1s07gRt+rAUV85OAeVLwXXCzWOJWSsrzPGLgF 2hZnO0nySYOOswXDPEaKdSF8CK+MmSC8gkdVWt+WQbrjHied2zPclAqgSYZ4gnq0Vew8 qu5h7yM97byq6tBcU7CpP9icxnwSbNsG6/MFLIS1OSm8Xtkni29R496897o+fHlbr3PC 1efSIjCsO6XTaFxpbWdi3dJEB4Lv5a4WpCYcyyUu5mO4e4yCz1Z+fw8/0pvLLEFUMN3r jbcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=1XRdk8SS04aWW9LvQNo/ZYeC3yA7v+WMTcu1mRyzBFU=; fh=lZXpz7rfTegZX1rkayX0oNkELxT9OYHbVpS0pOetSfc=; b=myPTJTmji/9+SDMD22/5HOKUxRKe07LKaPO/Qj7OZMZxSujHp6cCTKIWQGvD971wCe GMvPBKIGAAtF6OH4cHi9jEztDDtgfpTPqtgku23FVBx1EzDLPK4lguv0rvQ8TfjinfS7 vtVDd5JgcHEhwD/wVh7mv1LbJQXFjOkAd/XvXV4Gvqnm0oGM+JKRTVtHETyE411kv3qq pBpcC3/OEWXFEZ/fD7BF4e2V6pFhr/ias3GH7jEQxkZSKQ9b4uaBFJ3swkYUBTTrgs41 p0sHdLBaGSrPWfSHPpMNfCyte2SdZb+0OIiRNAtdS1iDT/3ubxUwKf1akwK927dzHSMT 7Xkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IOzduPMJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-161520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161520-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hg7-20020a170906f34700b00a558ef79588si11526943ejb.605.2024.04.28.10.21.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 10:21:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IOzduPMJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-161520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161520-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 031811F21239 for ; Sun, 28 Apr 2024 17:21:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58CF373196; Sun, 28 Apr 2024 17:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IOzduPMJ" Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3CFC71B27; Sun, 28 Apr 2024 17:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714324851; cv=none; b=GMZX7CUWyPyvnzLogTUjLJgdlhiUFnR87nSxDPb5UBExvY48mA23RO1E854YgFbc7HqHC4v5nDI+Xa6dsg5rcVLn+RyzSWlzDRAETJwhINHqZZWE6pEKugnfaKgMNjRgFBH7E6l9wIy4YNX6/3NxAdkkPSm7KbrJ9I73puAptxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714324851; c=relaxed/simple; bh=yqDz5DhrHQniAugwobla9PQINqUZrk3cVpGcXK+g5TE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jgFk5bgikuW8dOyYp4P6dxjHDa3wF6K5aKKaVbJP+Vxhm43uxuBJu/bq6qb4as1buJ/3l0GUn5OvNQ5ngwPsXFQJSKWhXAhoT+5ZzVnUVrp0fkspatCF0pkPRymcQJqSZYdzjKAH3lyu22vDor2bDTtozr0RsyfEc+yLsDntauA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IOzduPMJ; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6ee12766586so2777981b3a.0; Sun, 28 Apr 2024 10:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714324849; x=1714929649; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=1XRdk8SS04aWW9LvQNo/ZYeC3yA7v+WMTcu1mRyzBFU=; b=IOzduPMJbefb28MlVxYpaGCUBi2wFPwACCbvPimFQZwFIH8mwbeCqdTwY+zfxMeBL3 6IFGexh2b9CjzrW/+Trb2XuTcRep+IOyxhN9rnBCT0YChb9tpw09xQgM+fmB36Z5LLod 5glb4k4zGuLqyiizoTmOpmvgOewnsf+MWFgVqv964H8Yy22uRPTk/EPDu5c7HqGNu2Z3 i7UWkl3/R42EA9ExcO9Xo4iufgvJE9HZv7EYd23xgDvMQhMWG806TPNyMW4OcTDwqI2s uuogJFRL6TVlKRBEzg72btw13WI4rTBOcsaZ7VYOTCG/YwdGcuOv5PgzaxBVjrwMiJwj eDaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714324849; x=1714929649; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1XRdk8SS04aWW9LvQNo/ZYeC3yA7v+WMTcu1mRyzBFU=; b=hBA6fOMGOgveye+t+sMdoBFbHbTbYWWdm1BIWX3I1umMyEBdM+S0jXpDIqW64+4zSo mNtOdqVhcSy7KqDdDQo7l2T9lRD7gjCPnx+4Xae73DMBMrCx/tt0IpEbo+eiixM9OLDq 3DvVxO4Vli1znmCQ7ixqWVzxDiIpnFOQSimS3HlwTQbrYAfmaleNaTHphQN/1TMQutYr 5TORcXLxk178J3+sspr6eqRaGMudcoNHuGh4bRoqdH9M9g8GJzcD+X3SyRYWvHdpYmQ+ oH9H/s184aGvQn5QoIYIpHbMfIKhg3E9cObKr0nF5c6uPkuKaiBKJauIGCBA0jAhekV+ iBng== X-Forwarded-Encrypted: i=1; AJvYcCX5BQC0TliWB9rbQs3Cf3ZKMSbOEqqPG9mqpkw58+oqGscpScLyo4A/0VUODWsjW6A+4WSLcOak6QW1wtDBw+Yj1nU+uXXDdBWG3afYmCCebpVuenskFO6Pg9RaDvczT0bUCp7gIr9z X-Gm-Message-State: AOJu0YxLFnsfH4h4D8a5hP/VXIXE5THgTX/Fw96lEmhb2Ear+89Dufwx M3XCGaFvjM3QTdqGueniFEmGrFBtnNlVajRK1qGg4vkvUPDt01U9 X-Received: by 2002:a05:6a20:3ca8:b0:1ae:4292:5cc0 with SMTP id b40-20020a056a203ca800b001ae42925cc0mr7444864pzj.26.1714324849055; Sun, 28 Apr 2024 10:20:49 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n7-20020a635907000000b0061236221eeesm1667968pgb.21.2024.04.28.10.20.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 10:20:48 -0700 (PDT) Sender: Guenter Roeck Date: Sun, 28 Apr 2024 10:20:47 -0700 From: Guenter Roeck To: Aleksa Savic Cc: linux-hwmon@vger.kernel.org, David Flemstrom , Jack Doan , Jean Delvare , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] hwmon: (aquacomputer_d5next) Add support for Octo flow sensor Message-ID: <2d02ea01-2d9b-43e7-b795-7311fc1c6b86@roeck-us.net> References: <20240417175037.32499-1-savicaleksa83@gmail.com> <20240417175037.32499-2-savicaleksa83@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240417175037.32499-2-savicaleksa83@gmail.com> On Wed, Apr 17, 2024 at 07:50:35PM +0200, Aleksa Savic wrote: > Add support for reading the flow sensor value on > the Aquacomputer Octo. Implemented by David Flemstrom [1]. > > [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/95 > > Originally-from: David Flemstrom > Signed-off-by: Aleksa Savic Applied. Thanks, Guenter > --- > Documentation/hwmon/aquacomputer_d5next.rst | 8 ++--- > drivers/hwmon/aquacomputer_d5next.c | 34 +++++++++++++-------- > 2 files changed, 25 insertions(+), 17 deletions(-) > > diff --git a/Documentation/hwmon/aquacomputer_d5next.rst b/Documentation/hwmon/aquacomputer_d5next.rst > index cb073c79479c..f84b6a5e4373 100644 > --- a/Documentation/hwmon/aquacomputer_d5next.rst > +++ b/Documentation/hwmon/aquacomputer_d5next.rst > @@ -45,9 +45,9 @@ seems to require sending it a complete configuration. That includes addressable > RGB LEDs, for which there is no standard sysfs interface. Thus, that task is > better suited for userspace tools. > > -The Octo exposes four physical and sixteen virtual temperature sensors, as well as > -eight PWM controllable fans, along with their speed (in RPM), power, voltage and > -current. > +The Octo exposes four physical and sixteen virtual temperature sensors, a flow sensor > +as well as eight PWM controllable fans, along with their speed (in RPM), power, voltage > +and current. > > The Quadro exposes four physical and sixteen virtual temperature sensors, a flow > sensor and four PWM controllable fans, along with their speed (in RPM), power, > @@ -95,7 +95,7 @@ Sysfs entries > ================ ============================================================== > temp[1-20]_input Physical/virtual temperature sensors (in millidegrees Celsius) > temp[1-8]_offset Temperature sensor correction offset (in millidegrees Celsius) > -fan[1-8]_input Pump/fan speed (in RPM) / Flow speed (in dL/h) > +fan[1-9]_input Pump/fan speed (in RPM) / Flow speed (in dL/h) > fan1_min Minimal fan speed (in RPM) > fan1_max Maximal fan speed (in RPM) > fan1_target Target fan speed (in RPM) > diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c > index 2efe97f8d003..166044e01921 100644 > --- a/drivers/hwmon/aquacomputer_d5next.c > +++ b/drivers/hwmon/aquacomputer_d5next.c > @@ -202,12 +202,14 @@ static u16 aquastreamult_sensor_fan_offsets[] = { AQUASTREAMULT_FAN_OFFSET }; > #define OCTO_NUM_FANS 8 > #define OCTO_NUM_SENSORS 4 > #define OCTO_NUM_VIRTUAL_SENSORS 16 > +#define OCTO_NUM_FLOW_SENSORS 1 > #define OCTO_CTRL_REPORT_SIZE 0x65F > > /* Sensor report offsets for the Octo */ > #define OCTO_POWER_CYCLES 0x18 > #define OCTO_SENSOR_START 0x3D > #define OCTO_VIRTUAL_SENSORS_START 0x45 > +#define OCTO_FLOW_SENSOR_OFFSET 0x7B > static u16 octo_sensor_fan_offsets[] = { 0x7D, 0x8A, 0x97, 0xA4, 0xB1, 0xBE, 0xCB, 0xD8 }; > > /* Control report offsets for the Octo */ > @@ -363,18 +365,6 @@ static const char *const label_aquaero_calc_temp_sensors[] = { > "Calc. virtual sensor 4" > }; > > -/* Labels for Octo and Quadro (except speed) */ > -static const char *const label_fan_speed[] = { > - "Fan 1 speed", > - "Fan 2 speed", > - "Fan 3 speed", > - "Fan 4 speed", > - "Fan 5 speed", > - "Fan 6 speed", > - "Fan 7 speed", > - "Fan 8 speed" > -}; > - > static const char *const label_fan_power[] = { > "Fan 1 power", > "Fan 2 power", > @@ -408,6 +398,19 @@ static const char *const label_fan_current[] = { > "Fan 8 current" > }; > > +/* Labels for Octo fan speeds */ > +static const char *const label_octo_speeds[] = { > + "Fan 1 speed", > + "Fan 2 speed", > + "Fan 3 speed", > + "Fan 4 speed", > + "Fan 5 speed", > + "Fan 6 speed", > + "Fan 7 speed", > + "Fan 8 speed", > + "Flow speed [dL/h]", > +}; > + > /* Labels for Quadro fan speeds */ > static const char *const label_quadro_speeds[] = { > "Fan 1 speed", > @@ -844,6 +847,7 @@ static umode_t aqc_is_visible(const void *data, enum hwmon_sensor_types type, u3 > return 0444; > break; > case aquaero: > + case octo: > case quadro: > case highflow: > /* Special case to support flow sensors */ > @@ -1289,6 +1293,7 @@ static const struct hwmon_channel_info * const aqc_info[] = { > HWMON_F_INPUT | HWMON_F_LABEL | HWMON_F_PULSES, > HWMON_F_INPUT | HWMON_F_LABEL, > HWMON_F_INPUT | HWMON_F_LABEL, > + HWMON_F_INPUT | HWMON_F_LABEL, > HWMON_F_INPUT | HWMON_F_LABEL), > HWMON_CHANNEL_INFO(power, > HWMON_P_INPUT | HWMON_P_LABEL, > @@ -1658,6 +1663,9 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id) > priv->temp_sensor_start_offset = OCTO_SENSOR_START; > priv->num_virtual_temp_sensors = OCTO_NUM_VIRTUAL_SENSORS; > priv->virtual_temp_sensor_start_offset = OCTO_VIRTUAL_SENSORS_START; > + priv->num_flow_sensors = OCTO_NUM_FLOW_SENSORS; > + priv->flow_sensors_start_offset = OCTO_FLOW_SENSOR_OFFSET; > + > priv->temp_ctrl_offset = OCTO_TEMP_CTRL_OFFSET; > > priv->buffer_size = OCTO_CTRL_REPORT_SIZE; > @@ -1667,7 +1675,7 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id) > > priv->temp_label = label_temp_sensors; > priv->virtual_temp_label = label_virtual_temp_sensors; > - priv->speed_label = label_fan_speed; > + priv->speed_label = label_octo_speeds; > priv->power_label = label_fan_power; > priv->voltage_label = label_fan_voltage; > priv->current_label = label_fan_current;