linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Frank Crawford <frank@crawford.emu.id.au>
Cc: Jean Delvare <jdelvare@suse.com>, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v1 1/2] hwmon: (it87) Allow calling superio_enter outside mux
Date: Tue, 3 Jan 2023 10:37:07 -0800	[thread overview]
Message-ID: <20230103183707.GA204971@roeck-us.net> (raw)
In-Reply-To: <20230103064612.404401-2-frank@crawford.emu.id.au>

On Tue, Jan 03, 2023 at 05:46:11PM +1100, Frank Crawford wrote:
> Allow for superio_enter to be called outside mux, in particular for

"outside mux" is really a bad wording. I had to look into the code
to understand what it means. "without requesting the muxed memory
region", maybe.

Guenter

> initialisation of the second chipset, which must be entered, but never
> exited.

The second chipset is not "entered", it must enter configuration
mode (or be put into configuration mode). The name of the function
does not reflect the associated functionality.

Please rephrase.

Thanks,
Guenter

> 
> Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
> ---
>  drivers/hwmon/it87.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> index 9997f76b1f4a..4ebce2c661d7 100644
> --- a/drivers/hwmon/it87.c
> +++ b/drivers/hwmon/it87.c
> @@ -87,6 +87,14 @@ static struct platform_device *it87_pdev[2];
>  #define	DEVID	0x20	/* Register: Device ID */
>  #define	DEVREV	0x22	/* Register: Device Revision */
>  
> +static inline void __superio_enter(int ioreg)
> +{
> +	outb(0x87, ioreg);
> +	outb(0x01, ioreg);
> +	outb(0x55, ioreg);
> +	outb(ioreg == REG_4E ? 0xaa : 0x55, ioreg);
> +}
> +
>  static inline int superio_inb(int ioreg, int reg)
>  {
>  	outb(reg, ioreg);
> @@ -124,10 +132,7 @@ static inline int superio_enter(int ioreg)
>  	if (!request_muxed_region(ioreg, 2, DRVNAME))
>  		return -EBUSY;
>  
> -	outb(0x87, ioreg);
> -	outb(0x01, ioreg);
> -	outb(0x55, ioreg);
> -	outb(ioreg == REG_4E ? 0xaa : 0x55, ioreg);
> +	__superio_enter(ioreg);
>  	return 0;
>  }
>  
> -- 
> 2.38.1
> 

  reply	other threads:[~2023-01-03 18:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03  6:46 [PATCH v1 0/2] hwmon: (it87) Set second Super-IO chip in configuration mode Frank Crawford
2023-01-03  6:46 ` [PATCH v1 1/2] hwmon: (it87) Allow calling superio_enter outside mux Frank Crawford
2023-01-03 18:37   ` Guenter Roeck [this message]
2023-01-04  0:37     ` Frank Crawford
2023-01-04  2:58       ` Guenter Roeck
2023-01-03  6:46 ` [PATCH v1 2/2] hwmon: (it87) Add entries to dmi_table Frank Crawford
2023-01-03 18:46   ` Guenter Roeck
2023-01-04  0:43     ` Frank Crawford

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=20230103183707.GA204971@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=frank@crawford.emu.id.au \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.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 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).