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 v2 4/7] hwmon: (max1619) Convert to use regmap
Date: Mon, 29 Jul 2024 02:18:13 +0000	[thread overview]
Message-ID: <Zqb75Ue3NjENz8g0@google.com> (raw)
In-Reply-To: <20240728143715.1585816-5-linux@roeck-us.net>

On Sun, Jul 28, 2024 at 07:37:12AM -0700, Guenter Roeck wrote:
> -static void max1619_init_client(struct i2c_client *client)
> +static int max1619_init_chip(struct regmap *regmap)
>  {
> -	u8 config;
> +	int ret;
>  
> -	/*
> -	 * 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 */
> +	ret = regmap_write(regmap, MAX1619_REG_CONVRATE, 5);	/* 2 Hz */
> +	if (ret)
> +		return ret;
> +
> +	/* Start conversions */
> +	return regmap_set_bits(regmap, MAX1619_REG_CONFIG, 0x40);

Should be regmap_clear_bits()?

  reply	other threads:[~2024-07-29  2:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-28 14:37 [PATCH v2 0/7] hwmon: (max1619) Modernize driver Guenter Roeck
2024-07-28 14:37 ` [PATCH v2 1/7] hwmon: (max1619) Clamp temperature range when writing limits Guenter Roeck
2024-07-28 14:37 ` [PATCH v2 2/7] hwmon: (max1619) Reorder include files to alphabetic order Guenter Roeck
2024-07-28 14:37 ` [PATCH v2 3/7] hwmon: (max1619) Mask valid alarm bits Guenter Roeck
2024-07-29  2:18   ` Tzung-Bi Shih
2024-07-28 14:37 ` [PATCH v2 4/7] hwmon: (max1619) Convert to use regmap Guenter Roeck
2024-07-29  2:18   ` Tzung-Bi Shih [this message]
2024-07-29  3:16     ` Guenter Roeck
2024-07-29  3:24       ` Tzung-Bi Shih
2024-07-29  3:58         ` Guenter Roeck
2024-07-28 14:37 ` [PATCH v2 5/7] hwmon: (max1619) Convert to with_info API Guenter Roeck
2024-07-28 14:37 ` [PATCH v2 6/7] hwmon: (max1619) Add support for update_interval attribute Guenter Roeck
2024-07-28 14:37 ` [PATCH v2 7/7] hwmon: (max1619) Improve chip detection code 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=Zqb75Ue3NjENz8g0@google.com \
    --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