Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Hardware Monitoring <linux-hwmon@vger.kernel.org>
Subject: Re: [PATCH 3/6] hwmon: (max1619) Convert to use regmap
Date: Sun, 28 Jul 2024 12:26:05 +0800	[thread overview]
Message-ID: <ZqXIXfsOQ-39VMsy@tzungbi-laptop> (raw)
In-Reply-To: <20240727143820.1358225-4-linux@roeck-us.net>

On Sat, Jul 27, 2024 at 07:38:17AM -0700, Guenter Roeck wrote:
> +static int get_alarms(struct regmap *regmap)
> +{
> +	static u32 regs[2] = { MAX1619_REG_STATUS, MAX1619_REG_CONFIG };
> +	u8 regdata[2];
> +	int ret;
> +
> +	ret = regmap_multi_reg_read(regmap, regs, regdata, 2);
> +	if (ret)
> +		return ret;
> +
> +	/* OVERT status bit may be reversed */
> +	if (!(regdata[1] & 0x20))
> +		regdata[0] ^= 0x02;
> +
> +	return regdata[0] & 0x1e;

Why `& 0x1e`?  Original max1619_update_device() doesn't do that.

> -static void max1619_init_client(struct i2c_client *client)
> -{
> -	u8 config;
> +/* regmap */
>  
> -	/*
> -	 * Start the conversions.
> -	 */
> -	i2c_smbus_write_byte_data(client, MAX1619_REG_W_CONVRATE,
> -				  5); /* 2 Hz */
> -	config = i2c_smbus_read_byte_data(client, MAX1619_REG_R_CONFIG);
> -	if (config & 0x40)
> -		i2c_smbus_write_byte_data(client, MAX1619_REG_W_CONFIG,
> -					  config & 0xBF); /* run */

Doesn't it need the initialization anymore?

  reply	other threads:[~2024-07-28  4:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-27 14:38 [PATCH 1/6] hwmon: (max1619) Modernize driver Guenter Roeck
2024-07-27 14:38 ` [PATCH 1/6] hwmon: (max1619) Clamp temperature range when writing limits Guenter Roeck
2024-07-28  4:25   ` Tzung-Bi Shih
2024-07-27 14:38 ` [PATCH 2/6] hwmon: (max1619) Reorder include files to alphabetic order Guenter Roeck
2024-07-28  4:25   ` Tzung-Bi Shih
2024-07-27 14:38 ` [PATCH 3/6] hwmon: (max1619) Convert to use regmap Guenter Roeck
2024-07-28  4:26   ` Tzung-Bi Shih [this message]
2024-07-28  5:22     ` Guenter Roeck
2024-07-28 12:17       ` Tzung-Bi Shih
2024-07-27 14:38 ` [PATCH 4/6] hwmon: (max1619) Convert to with_info API Guenter Roeck
2024-07-28  4:26   ` Tzung-Bi Shih
2024-07-27 14:38 ` [PATCH 5/6] hwmon: (max1619) Add support for update_interval attribute Guenter Roeck
2024-07-28  4:26   ` Tzung-Bi Shih
2024-07-27 14:38 ` [PATCH 6/6] hwmon: (max1619) Improve chip detection code Guenter Roeck
2024-07-28  4:26   ` Tzung-Bi Shih

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=ZqXIXfsOQ-39VMsy@tzungbi-laptop \
    --to=tzungbi@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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