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 03:24:00 +0000 [thread overview]
Message-ID: <ZqcLUDCtxKPs-sRN@google.com> (raw)
In-Reply-To: <ea599334-5916-4d03-a662-a0d02d1296bc@roeck-us.net>
On Sun, Jul 28, 2024 at 08:16:35PM -0700, Guenter Roeck wrote:
> On 7/28/24 19:18, Tzung-Bi Shih wrote:
> > 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()?
>
>
> Sigh. yes, of course.
With that,
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
next prev parent reply other threads:[~2024-07-29 3:24 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
2024-07-29 3:16 ` Guenter Roeck
2024-07-29 3:24 ` Tzung-Bi Shih [this message]
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=ZqcLUDCtxKPs-sRN@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 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.