lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1576936514.3.0@crapouillou.net>
Date:   Sat, 21 Dec 2019 14:55:14 +0100
From:   Paul Cercueil <paul@...pouillou.net>
To:     Rob Herring <robh@...nel.org>
Cc:     Peter Chen <peter.chen@....com>,
        Sebastian Reichel <sre@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>, od@...c.me,
        linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH v2 3/3] power/supply: Add generic USB charger driver

Hi Rob,


Le jeu., déc. 19, 2019 at 13:38, Rob Herring <robh@...nel.org> a 
écrit :
> On Mon, Dec 16, 2019 at 11:52:05AM +0100, Paul Cercueil wrote:
>>  Hi Peter,
>> 
>> 
>>  Le lun., déc. 16, 2019 at 01:24, Peter Chen <peter.chen@....com> a 
>> écrit :
>>  >
>>  > >  >>  +
>>  > >  >>  +	desc = &charger->desc;
>>  > >  >>  +	desc->name = "usb-charger";
>>  > >  >>  +	desc->properties = usb_charger_properties;
>>  > >  >>  +	desc->num_properties = 
>> ARRAY_SIZE(usb_charger_properties);
>>  > >  >>  +	desc->get_property = usb_charger_get_property;
>>  > >  >>  +	desc->type = POWER_SUPPLY_TYPE_USB;
>>  > >  >
>>  > >  > What's your further plan for this generic USB charger?
>>  > >  > To support BC1.2, we need to know charger type, and how we 
>> could
>>  > > get
>>  > >  > it?
>>  > >  >
>>  > >  > Peter
>>  > >
>>  > >  Well I don't really know. The USB role framework does not give 
>> any
>>  > > info about
>>  > >  what's plugged.
>>  > >
>>  >
>>  > What's the use case for this patch set? How it be used?
>> 
>>  My devicetree:
>> 
>>  usb_otg: usb@...40000 {
>>  	compatible = "ingenic,jz4770-musb", "simple-mfd";
>>  	reg = <0x13440000 0x10000>;
>>  	[...]
>> 
>>  	usb-role-switch;
>> 
>>  	connector {
>>  		compatible = "gpio-usb-b-connector", "usb-b-connector";
>>  		label = "mini-USB";
>>  		type = "mini";
>> 
>>  		id-gpios = <&gpf 18 GPIO_ACTIVE_HIGH>;
>>  		vbus-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>;
>>  		[...]
>>  	};
>> 
>>  	usb_charger: usb-charger {
>>  		compatible = "usb-charger";
> 
> What h/w device is this?

GCW Zero: arch/mips/boot/dts/ingenic/gcw0.dts

Most of it isn't upstream, so I can still experiment things to get the 
perfect devicetree.

> 
>>  	};
>>  };
>> 
>>  The new gpio-usb-connector driver uses the ID/VBUS GPIOs to detect 
>> in which
>>  state (device, host, unconnected) a OTG connector is. However, that 
>> means I
>>  cannot use the standard gpio-charger driver to detect the presence 
>> of a
>>  charger based on the state of the VBUS gpio, since it's already 
>> requested
>>  here. So the point of this patchset is to provide an alternative to
>>  gpio-charger that works with OTG controllers compatible with
>>  'usb-role-switch'.
> 
> Why not fix gpio-charger or make whatever 'owns' vbus-gpios to 
> register
> a charger device?

I see there is a GPIOD_FLAGS_BIT_NONEXCLUSIVE bit that could be used, 
I'll have a look.

Thanks,
-Paul

> 
> I guess you could have Vbus sensing with no charging capability, but
> that sounds like a new property, not a node to me.
> 
> Rob


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ