2018-12-28 06:37:33

by Pavel Machek

[permalink] [raw]
Subject: cpcap-charger: generate events for userspace


The driver doesn't generate uevents on charger connect/disconnect.
This leads to UPower not detecting when AC is on or off... and that is
bad.

Reported by Arthur D. on github (
https://github.com/maemo-leste/bugtracker/issues/206 ), thanks to
Merlijn Wajer for suggesting a fix.

Cc: [email protected]
Signed-off-by: Pavel Machek <[email protected]>

diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
index 9e8ff5c..7d8b4d5 100644
--- a/drivers/power/supply/cpcap-charger.c
+++ b/drivers/power/supply/cpcap-charger.c
@@ -576,6 +576,7 @@ static void cpcap_usb_detect(struct work_struct *work)
goto out_err;
}

+ power_supply_changed(ddata->usb);
return;

out_err:

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (887.00 B)
signature.asc (188.00 B)
Digital signature
Download all attachments

2018-12-29 07:28:36

by Tony Lindgren

[permalink] [raw]
Subject: Re: cpcap-charger: generate events for userspace

* Pavel Machek <[email protected]> [181227 11:52]:
>
> The driver doesn't generate uevents on charger connect/disconnect.
> This leads to UPower not detecting when AC is on or off... and that is
> bad.

Acked-by: Tony Lindgren <[email protected]>

2019-01-21 07:15:00

by Sebastian Reichel

[permalink] [raw]
Subject: Re: cpcap-charger: generate events for userspace

Hi,

On Thu, Dec 27, 2018 at 08:52:21PM +0100, Pavel Machek wrote:
> The driver doesn't generate uevents on charger connect/disconnect.
> This leads to UPower not detecting when AC is on or off... and that is
> bad.
>
> Reported by Arthur D. on github (
> https://github.com/maemo-leste/bugtracker/issues/206 ), thanks to
> Merlijn Wajer for suggesting a fix.
>
> Cc: [email protected]
> Signed-off-by: Pavel Machek <[email protected]>

Thanks, queued to power-supply-next.

-- Sebastian

> diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
> index 9e8ff5c..7d8b4d5 100644
> --- a/drivers/power/supply/cpcap-charger.c
> +++ b/drivers/power/supply/cpcap-charger.c
> @@ -576,6 +576,7 @@ static void cpcap_usb_detect(struct work_struct *work)
> goto out_err;
> }
>
> + power_supply_changed(ddata->usb);
> return;
>
> out_err:
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html



Attachments:
(No filename) (1.04 kB)
signature.asc (849.00 B)
Download all attachments