From: Waqar Hameed <waqar.hameed@axis.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: <kernel@axis.com>, <linux-pm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 3/4] power: supply: bq25630: Add macro define for IRQ cycle time
Date: Wed, 28 Oct 2026 22:56:15 +0100 [thread overview]
Message-ID: <c5a65c0505242d04d6c30e8fb7e97bb2bcf67e1b.1793223841.git.waqar.hameed@axis.com> (raw)
In-Reply-To: <cover.1793223841.git.waqar.hameed@axis.com>
The interrupt pulse time of 256 µs can be seen as an "inherent" property
of the device. It is currently only used for when polling the reset
register, but it could/should be used when polling whatever
register (e.g. liquid check). To facilitate this, add a macro define for
the interrupt pulse time.
Signed-off-by: Waqar Hameed <waqar.hameed@axis.com>
---
drivers/power/supply/bq25630_charger.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/bq25630_charger.c b/drivers/power/supply/bq25630_charger.c
index 3106da710d6b6..a934f3deba63b 100644
--- a/drivers/power/supply/bq25630_charger.c
+++ b/drivers/power/supply/bq25630_charger.c
@@ -15,6 +15,7 @@
#include <linux/power_supply.h>
#define BQ25630_DRV_NAME "bq25630-charger"
+#define BQ25630_IRQ_CYCLE 256 /* µs */
/* Registers. */
#define BQ25630_REG_CHARGE_CURRENT_LIMIT 0x02
@@ -726,8 +727,8 @@ static int bq25630_reset(struct bq25630_data *data)
* this register field to 0. Try reading it for some interrupt cycles.
*/
ret = regmap_field_read_poll_timeout(
- data->regfields[BQ25630_REGF_REG_RST], regval, regval == 0, 256,
- 100000);
+ data->regfields[BQ25630_REGF_REG_RST], regval, regval == 0,
+ BQ25630_IRQ_CYCLE, 100000);
if (ret) {
dev_err(data->dev, "Could not read reset register field (%d)\n",
ret);
--
2.43.0
next prev parent reply other threads:[~2026-10-28 21:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 21:56 [PATCH 0/4] power: supply: Add support for liquid detection Waqar Hameed
2026-10-28 21:56 ` [PATCH 1/4] power: supply: Add sysfs entry for liquid detection control Waqar Hameed
2026-10-28 21:56 ` [PATCH 2/4] power: supply: Add liquid detection to health property enum Waqar Hameed
2026-10-28 21:56 ` Waqar Hameed [this message]
2026-10-28 21:56 ` [PATCH 4/4] power: supply: bq25630: Add support for liquid detection Waqar Hameed
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=c5a65c0505242d04d6c30e8fb7e97bb2bcf67e1b.1793223841.git.waqar.hameed@axis.com \
--to=waqar.hameed@axis.com \
--cc=kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@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
all inboxes | Powered by JetHome®