From: Guenter Roeck <linux@roeck-us.net>
To: vjardin@free.fr, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v5 3/3] hwmon: pmbus: add MPQ8646 driver
Date: Thu, 23 Jul 2026 19:15:35 -0700 [thread overview]
Message-ID: <6abbdabe-91ec-4757-a646-8b2b2d4058d3@roeck-us.net> (raw)
In-Reply-To: <20260724-mpq8646_v0-v5-3-5915b5ae9aa2@free.fr>
On 7/23/26 16:55, Vincent Jardin via B4 Relay wrote:
...
> +
> +/* Adapted from lm90.c */
> +static void mpq8646_alarm_poll_work(struct work_struct *work)
> +{
> + struct mpq8646_priv *priv = container_of(to_delayed_work(work),
> + struct mpq8646_priv,
> + alarm_poll_work);
> + int rc;
> + u16 cur, newly_set;
> + size_t i;
> +
> + if (priv->client->irq)
> + return; /* SMBALERT# wired; polling not needed */
> +
> + if (!priv->alarm_poll_interval_ms)
> + return; /* polling disabled; don't re-arm */
> +
> + if (!priv->hwmon_dev)
> + goto rearm; /* hwmon not ready yet; try again next tick */
> +
> + /* Serialise with the pmbus core's own transactions on this client. */
> + pmbus_lock(priv->client);
> + rc = i2c_smbus_read_word_data(priv->client, PMBUS_STATUS_WORD);
> + pmbus_unlock(priv->client);
> + if (rc < 0)
> + goto rearm;
> +
> + cur = (u16)rc;
> + newly_set = cur & ~priv->last_status_word;
> + priv->last_status_word = cur;
> +
> + if (!newly_set)
> + goto rearm;
> +
> + for (i = 0; i < ARRAY_SIZE(mpq8646_alarm_map); i++) {
> + if (newly_set & mpq8646_alarm_map[i].mask)
> + hwmon_notify_event(priv->hwmon_dev,
> + mpq8646_alarm_map[i].type,
> + mpq8646_alarm_map[i].attr,
> + mpq8646_alarm_map[i].channel);
This is wrong. This will require a new exported notification function
in pmbus code.
Guenter
next prev parent reply other threads:[~2026-07-24 2:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 23:55 [PATCH v5 0/3] hwmon: pmbus: add MPS MPQ8646 support Vincent Jardin via B4 Relay
2026-07-23 23:55 ` [PATCH v5 1/3] hwmon: pmbus: event notification with alarms Vincent Jardin via B4 Relay
2026-07-23 23:55 ` [PATCH v5 2/3] dt-bindings: hwmon: pmbus: add MPS MPQ8646 binding Vincent Jardin via B4 Relay
2026-07-27 7:13 ` Krzysztof Kozlowski
2026-07-23 23:55 ` [PATCH v5 3/3] hwmon: pmbus: add MPQ8646 driver Vincent Jardin via B4 Relay
2026-07-24 2:15 ` Guenter Roeck [this message]
2026-07-24 10:18 ` Vincent Jardin
2026-07-24 13:23 ` Guenter Roeck
2026-07-24 14:00 ` Guenter Roeck
2026-07-24 16:40 ` Markus Elfring
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=6abbdabe-91ec-4757-a646-8b2b2d4058d3@roeck-us.net \
--to=linux@roeck-us.net \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=vjardin@free.fr \
/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
all inboxes | Powered by JetHome®