[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v66jxw5acPXEQd0KwVbL96dOjeTj=8jZsC7DFiB_-=i0MA@mail.gmail.com>
Date: Mon, 6 Jan 2020 12:27:01 +0800
From: Chen-Yu Tsai <wens@...e.org>
To: Samuel Holland <samuel@...lland.org>
Cc: Sebastian Reichel <sre@...nel.org>,
Lee Jones <lee.jones@...aro.org>,
Hans de Goede <hdegoede@...hat.com>,
Oskari Lemmela <oskari@...mela.net>,
Quentin Schulz <quentin.schulz@...tlin.com>,
"open list:THERMAL" <linux-pm@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-sunxi <linux-sunxi@...glegroups.com>
Subject: Re: [linux-sunxi] [PATCH v2 9/9] power: supply: axp20x_usb_power:
Only poll while offline
On Sun, Jan 5, 2020 at 9:24 AM Samuel Holland <samuel@...lland.org> wrote:
>
> Investigation on the AXP803 shows that VBUS_PLUGIN/VBUS_REMOVAL IRQs are
> triggered on the rising/falling edge of AXP20X_PWR_STATUS_VBUS_USED. The
> reason IRQs do not arrive while N_VBUSEN/DRIVEVBUS is high is because
> AXP20X_PWR_STATUS_VBUS_USED also never goes high.
>
> This also means that if VBUS is online, a VBUS_REMOVAL IRQ is received
> immediately on setting N_VBUSEN/DRIVEVBUS high (and VBUS_PLUGIN shortly
> after it is set back low). This was also verified to be the case when
> manually offlining VBUS through AXP20X_VBUS_PATH_SELECT.
>
> As long as VBUS is online, a present->absent transition necessarily
> implies an online->offline transition. Since will cause an IRQ, there is
> no need to poll while VBUS is online.
>
> To ensure the driver's view of VBUS online status remains accurate,
> unconditionally poll once when receiving an IRQ and when resuming. If
> VBUS is still online at that time, polling will cease until the next
> VBUS_REMOVAL IRQ.
>
> Signed-off-by: Samuel Holland <samuel@...lland.org>
Reviewed-by: Chen-Yu Tsai <wens@...e.org>
Powered by blists - more mailing lists