All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zev Weiss <zev@bewilderbeest.net>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Oleksandr Natalenko <oleksandr@natalenko.name>,
	Rob Herring <robh+dt@kernel.org>, Renze Nicolai <renze@rnplus.nl>
Subject: Re: [PATCH v2 0/6] hwmon: (nct6775) Convert to regmap, add i2c support
Date: Wed, 9 Mar 2022 03:16:12 -0800	[thread overview]
Message-ID: <YiiMfJV3bjUmoUcV@hatter.bewilderbeest.net> (raw)
In-Reply-To: <05667284-42f7-0df2-8fa0-463ad6ad9601@molgen.mpg.de>

On Wed, Mar 09, 2022 at 12:12:32AM PST, Paul Menzel wrote:
>Dear Zev,
>
>
>Am 09.03.22 um 01:50 schrieb Zev Weiss:
>
>>This is v2 of my patches to add i2c support to the nct6775 driver.
>>
>>Changes since v1 [0]:
>>  - Added preparatory patch converting driver to regmap API [Guenter]
>>  - Replaced ENOSPC with ENOBUFS and removed WARN_ON() in
>>    nct6775_add_attr_group() [Guenter]
>>  - Added dedicated symbol namespace [Guenter]
>>  - Removed nct6775_write_temp() and nct6775_update_device() symbol
>>    exports [Guenter]
>>  - Reordered patches to put dt-bindings patch first [Krzysztof]
>>
>>The nct6775-platform and nct6775-i2c drivers have both been tested on
>>the NCT6779D in an ASRock ROMED8HM3 system and the NCT6798 [1] in an
>>ASRock X570-D4U (the latter thanks to Renze, CCed); both seem to work
>>as expected on both systems.  I don't have access to any asuswmi
>>hardware, so testing of the nct6775-platform driver on that to ensure
>>it doesn't break there would be appreciated (Oleksandr, perhaps?).
>
>I have an ASUS F2A85-M PRO with that Super I/O. (It’s running coreboot 
>right now, but I can test with the proprietary vendor firmware, if you 
>tell me what and how I can test this.
>

Hi Paul,

Thanks for offering to test!  I don't see the F2A85-M PRO listed in the 
asus_wmi_boards array, so (unless there's some alternate model name it 
also goes by that's in that list) I don't think it will provide coverage 
for the asuswmi code, but additional testing of the platform driver 
would still be good anyway.

To try it out, first apply the patch series on top of Guenter's current 
hwmon-next tree (it's based on commit 5d4a2ea96b79).  You'll need to 
enable both the existing CONFIG_SENSORS_NCT6775 Kconfig option as well 
as the new CONFIG_SENSORS_NCT6775_PLATFORM.  Then compile, install, and 
boot into the resulting kernel.  If you set 
CONFIG_SENSORS_NCT6775_PLATFORM=m (compiling it as a module) you'll need 
to run 'modprobe nct6775-platform' to load the module, after which 
running 'sensors' from the lm-sensors package should show sensor 
readings from it -- if things are working right, it should behave pretty 
much exactly as the driver did prior to these patches.

However, since posting the v2 patch series I realized I bungled 
something in the regmap conversion (patch 2 of the series), so before 
compiling you should also apply this small fixup (which will be included 
in subsequent versions of the patchset):

diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index cb3958c977fa..5801aa9d60ee 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -1150,7 +1150,7 @@ static int nct6775_write_fan_div(struct nct6775_data *data, int nr)
  	if (err)
  		return err;
  	reg &= 0x70 >> oddshift;
-	reg |= data->fan_div[nr] & (0x7 << oddshift);
+	reg |= (data->fan_div[nr] & 0x7) << oddshift;
  	return nct6775_write_value(data, fandiv_reg, reg);
  }
  


Thanks,
Zev


WARNING: multiple messages have this Message-ID (diff)
From: Zev Weiss <zev@bewilderbeest.net>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	Jean Delvare <jdelvare@suse.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Oleksandr Natalenko <oleksandr@natalenko.name>,
	Rob Herring <robh+dt@kernel.org>, Renze Nicolai <renze@rnplus.nl>,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH v2 0/6] hwmon: (nct6775) Convert to regmap, add i2c support
Date: Wed, 9 Mar 2022 03:16:12 -0800	[thread overview]
Message-ID: <YiiMfJV3bjUmoUcV@hatter.bewilderbeest.net> (raw)
In-Reply-To: <05667284-42f7-0df2-8fa0-463ad6ad9601@molgen.mpg.de>

On Wed, Mar 09, 2022 at 12:12:32AM PST, Paul Menzel wrote:
>Dear Zev,
>
>
>Am 09.03.22 um 01:50 schrieb Zev Weiss:
>
>>This is v2 of my patches to add i2c support to the nct6775 driver.
>>
>>Changes since v1 [0]:
>>  - Added preparatory patch converting driver to regmap API [Guenter]
>>  - Replaced ENOSPC with ENOBUFS and removed WARN_ON() in
>>    nct6775_add_attr_group() [Guenter]
>>  - Added dedicated symbol namespace [Guenter]
>>  - Removed nct6775_write_temp() and nct6775_update_device() symbol
>>    exports [Guenter]
>>  - Reordered patches to put dt-bindings patch first [Krzysztof]
>>
>>The nct6775-platform and nct6775-i2c drivers have both been tested on
>>the NCT6779D in an ASRock ROMED8HM3 system and the NCT6798 [1] in an
>>ASRock X570-D4U (the latter thanks to Renze, CCed); both seem to work
>>as expected on both systems.  I don't have access to any asuswmi
>>hardware, so testing of the nct6775-platform driver on that to ensure
>>it doesn't break there would be appreciated (Oleksandr, perhaps?).
>
>I have an ASUS F2A85-M PRO with that Super I/O. (It’s running coreboot 
>right now, but I can test with the proprietary vendor firmware, if you 
>tell me what and how I can test this.
>

Hi Paul,

Thanks for offering to test!  I don't see the F2A85-M PRO listed in the 
asus_wmi_boards array, so (unless there's some alternate model name it 
also goes by that's in that list) I don't think it will provide coverage 
for the asuswmi code, but additional testing of the platform driver 
would still be good anyway.

To try it out, first apply the patch series on top of Guenter's current 
hwmon-next tree (it's based on commit 5d4a2ea96b79).  You'll need to 
enable both the existing CONFIG_SENSORS_NCT6775 Kconfig option as well 
as the new CONFIG_SENSORS_NCT6775_PLATFORM.  Then compile, install, and 
boot into the resulting kernel.  If you set 
CONFIG_SENSORS_NCT6775_PLATFORM=m (compiling it as a module) you'll need 
to run 'modprobe nct6775-platform' to load the module, after which 
running 'sensors' from the lm-sensors package should show sensor 
readings from it -- if things are working right, it should behave pretty 
much exactly as the driver did prior to these patches.

However, since posting the v2 patch series I realized I bungled 
something in the regmap conversion (patch 2 of the series), so before 
compiling you should also apply this small fixup (which will be included 
in subsequent versions of the patchset):

diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index cb3958c977fa..5801aa9d60ee 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -1150,7 +1150,7 @@ static int nct6775_write_fan_div(struct nct6775_data *data, int nr)
  	if (err)
  		return err;
  	reg &= 0x70 >> oddshift;
-	reg |= data->fan_div[nr] & (0x7 << oddshift);
+	reg |= (data->fan_div[nr] & 0x7) << oddshift;
  	return nct6775_write_value(data, fandiv_reg, reg);
  }
  


Thanks,
Zev


  reply	other threads:[~2022-03-09 11:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09  0:50 [PATCH v2 0/6] hwmon: (nct6775) Convert to regmap, add i2c support Zev Weiss
2022-03-09  0:50 ` Zev Weiss
2022-03-09  0:50 ` [PATCH v2 1/6] dt-bindings: hwmon: Add nuvoton,nct6775 Zev Weiss
2022-03-09  0:50   ` Zev Weiss
2022-04-25 15:07   ` Guenter Roeck
2022-04-25 15:07     ` Guenter Roeck
2022-04-26  1:23     ` Zev Weiss
2022-04-26  1:23       ` Zev Weiss
2022-03-09  0:50 ` [PATCH v2 2/6] hwmon: (nct6775) Convert register access to regmap API Zev Weiss
2022-03-09  0:50   ` Zev Weiss
2022-04-25 15:24   ` Guenter Roeck
2022-04-25 15:24     ` Guenter Roeck
2022-03-09  0:50 ` [PATCH v2 3/6] hwmon: (nct6775) Rearrange attr-group initialization Zev Weiss
2022-03-09  0:50   ` Zev Weiss
2022-03-09  0:50 ` [PATCH v2 4/6] hwmon: (nct6775) Add read-only mode Zev Weiss
2022-03-09  0:50   ` Zev Weiss
2022-03-09  0:50 ` [PATCH v2 5/6] hwmon: (nct6775) Split core and platform driver Zev Weiss
2022-03-09  0:50   ` Zev Weiss
2022-04-25 15:23   ` Guenter Roeck
2022-04-25 15:23     ` Guenter Roeck
2022-03-09  0:50 ` [PATCH v2 6/6] hwmon: (nct6775) Add i2c driver Zev Weiss
2022-03-09  0:50   ` Zev Weiss
2022-04-25 15:37   ` Guenter Roeck
2022-04-25 15:37     ` Guenter Roeck
2022-03-09  8:12 ` [PATCH v2 0/6] hwmon: (nct6775) Convert to regmap, add i2c support Paul Menzel
2022-03-09  8:12   ` Paul Menzel
2022-03-09 11:16   ` Zev Weiss [this message]
2022-03-09 11:16     ` Zev Weiss
2022-03-10 19:13 ` Guenter Roeck
2022-03-10 19:13   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YiiMfJV3bjUmoUcV@hatter.bewilderbeest.net \
    --to=zev@bewilderbeest.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=oleksandr@natalenko.name \
    --cc=openbmc@lists.ozlabs.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=renze@rnplus.nl \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.