* [PATCH RESEND^2] power: supply: rt9467: Add properties for VBUS and IBUS reading
@ 2025-08-14 7:27 cy_huang
2025-09-02 0:30 ` ChiYuan Huang
2025-09-06 21:45 ` Sebastian Reichel
0 siblings, 2 replies; 3+ messages in thread
From: cy_huang @ 2025-08-14 7:27 UTC (permalink / raw)
To: Sebastian Reichel; +Cc: linux-pm, linux-kernel, ChiYuan Huang
From: ChiYuan Huang <cy_huang@richtek.com>
Since there's the existing ADC function, add properties 'VOLTAGE_NOW'
and 'CURRENT_NOW' to report the current VBUS and IBUS value, respectively.
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
drivers/power/supply/rt9467-charger.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/power/supply/rt9467-charger.c b/drivers/power/supply/rt9467-charger.c
index e9aba9ad393c..998b56e81cd7 100644
--- a/drivers/power/supply/rt9467-charger.c
+++ b/drivers/power/supply/rt9467-charger.c
@@ -633,7 +633,9 @@ static int rt9467_psy_set_ieoc(struct rt9467_chg_data *data, int microamp)
static const enum power_supply_property rt9467_chg_properties[] = {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_ONLINE,
+ POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_CURRENT_MAX,
+ POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
@@ -656,6 +658,8 @@ static int rt9467_psy_get_property(struct power_supply *psy,
return rt9467_psy_get_status(data, &val->intval);
case POWER_SUPPLY_PROP_ONLINE:
return regmap_field_read(data->rm_field[F_PWR_RDY], &val->intval);
+ case POWER_SUPPLY_PROP_VOLTAGE_NOW:
+ return rt9467_get_adc(data, RT9467_ADC_VBUS_DIV5, &val->intval);
case POWER_SUPPLY_PROP_CURRENT_MAX:
mutex_lock(&data->attach_lock);
if (data->psy_usb_type == POWER_SUPPLY_USB_TYPE_UNKNOWN ||
@@ -665,6 +669,8 @@ static int rt9467_psy_get_property(struct power_supply *psy,
val->intval = 1500000;
mutex_unlock(&data->attach_lock);
return 0;
+ case POWER_SUPPLY_PROP_CURRENT_NOW:
+ return rt9467_get_adc(data, RT9467_ADC_IBUS, &val->intval);
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
mutex_lock(&data->ichg_ieoc_lock);
val->intval = data->ichg_ua;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND^2] power: supply: rt9467: Add properties for VBUS and IBUS reading
2025-08-14 7:27 [PATCH RESEND^2] power: supply: rt9467: Add properties for VBUS and IBUS reading cy_huang
@ 2025-09-02 0:30 ` ChiYuan Huang
2025-09-06 21:45 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: ChiYuan Huang @ 2025-09-02 0:30 UTC (permalink / raw)
To: Sebastian Reichel; +Cc: linux-pm, linux-kernel
On Thu, Aug 14, 2025 at 03:27:41PM +0800, cy_huang@richtek.com wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
>
> Since there's the existing ADC function, add properties 'VOLTAGE_NOW'
> and 'CURRENT_NOW' to report the current VBUS and IBUS value, respectively.
Ping.....
Regards
ChiYuan.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND^2] power: supply: rt9467: Add properties for VBUS and IBUS reading
2025-08-14 7:27 [PATCH RESEND^2] power: supply: rt9467: Add properties for VBUS and IBUS reading cy_huang
2025-09-02 0:30 ` ChiYuan Huang
@ 2025-09-06 21:45 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2025-09-06 21:45 UTC (permalink / raw)
To: Sebastian Reichel, cy_huang; +Cc: linux-pm, linux-kernel
On Thu, 14 Aug 2025 15:27:41 +0800, cy_huang@richtek.com wrote:
> Since there's the existing ADC function, add properties 'VOLTAGE_NOW'
> and 'CURRENT_NOW' to report the current VBUS and IBUS value, respectively.
>
>
Applied, thanks!
[1/1] power: supply: rt9467: Add properties for VBUS and IBUS reading
commit: 15a84d15a677533afa55010f1e2052a27fcd854d
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-06 21:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14 7:27 [PATCH RESEND^2] power: supply: rt9467: Add properties for VBUS and IBUS reading cy_huang
2025-09-02 0:30 ` ChiYuan Huang
2025-09-06 21:45 ` Sebastian Reichel
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.