[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5767d188-2b99-4c21-b824-5135cc52b511@kernel.org>
Date: Fri, 16 Aug 2024 12:02:22 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Artur Weber <aweber.kernel@...il.com>,
Chanwoo Choi <cw00.choi@...sung.com>
Cc: Sebastian Reichel <sre@...nel.org>, Rob Herring <robh@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Lee Jones <lee@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Alim Akhtar <alim.akhtar@...sung.com>, linux-pm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-samsung-soc@...r.kernel.org,
~postmarketos/upstreaming@...ts.sr.ht, Henrik Grimler <henrik@...mler.se>,
Wolfgang Wiedmeyer <wolfgit@...dmeyer.de>,
Denis 'GNUtoo' Carikli <GNUtoo@...erdimension.org>
Subject: Re: [PATCH v4 07/10] power: supply: max77693: Set up charge/input
current according to cable type
On 16/08/2024 10:19, Artur Weber wrote:
> This behavior was observed on a downstream kernel - for chargers, the
> current would be set to a fast charge current value, and it would be
> bumped down for all other cable types.
>
> If we leave only the fast charge current value applied, peripheral mode
> stops working. If we stick to 500mA, charging becomes too slow. So, set
> the charge input current limit accordingly to the cable type.
>
> Tested-by: Henrik Grimler <henrik@...mler.se>
> Signed-off-by: Artur Weber <aweber.kernel@...il.com>
> ---
> Changes in v3:
> - Re-introduced this commit from v1. It seems to have been accidentally
> rolled into the previous commit in v2.
> ---
> drivers/power/supply/max77693_charger.c | 23 ++++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/power/supply/max77693_charger.c b/drivers/power/supply/max77693_charger.c
> index bf156544fe1b..908fd2a178ee 100644
> --- a/drivers/power/supply/max77693_charger.c
> +++ b/drivers/power/supply/max77693_charger.c
> @@ -716,6 +716,7 @@ static void max77693_charger_extcon_work(struct work_struct *work)
> cable.work);
> struct extcon_dev *edev = chg->cable.edev;
> bool set_charging, set_otg;
> + unsigned int input_current;
> int connector, state;
> int ret;
>
> @@ -728,19 +729,28 @@ static void max77693_charger_extcon_work(struct work_struct *work)
>
> switch (connector) {
> case EXTCON_CHG_USB_SDP:
> - case EXTCON_CHG_USB_DCP:
Why do you move it? Wasn't it added in previous patch?
> case EXTCON_CHG_USB_CDP:
> + case EXTCON_CHG_USB_SLOW:
> + input_current = 500000; /* 500 mA */
> + set_charging = true;
> + set_otg = false;
> +
> + dev_info(chg->dev, "slow charging. connector type: %d\n",
> + connector);
> + break;
Best regards,
Krzysztof
Powered by blists - more mailing lists