Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713250

Re: [PATCH v2 08/14] power: supply: Add power_supply_set_input_current_limit_from_supplier helper

From Tony Lindgren <tony@atomide.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 08/14] power: supply: Add power_supply_set_input_current_limit_from_supplier helper
Date 2017-08-16 21:30 +0200
Message-ID <ufcaS-2DT-3@gated-at.bofh.it> (permalink)
References <ueQk1-5RL-9@gated-at.bofh.it> <ueQk5-5RL-63@gated-at.bofh.it> <uf8TE-t4-17@gated-at.bofh.it> <ufass-1zg-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Hans de Goede <hdegoede@redhat.com> [170816 10:38]:
> Hi,
> 
> On 16-08-17 17:54, Tony Lindgren wrote:
> > * Hans de Goede <hdegoede@redhat.com> [170815 13:06]:
> > > On some devices the USB Type-C port power (USB PD 2.0) negotiation is
> > > done by a separate port-controller IC, while the current limit is
> > > controlled through another (charger) IC.
> > > 
> > > It has been decided to model this by modelling the external Type-C
> > > power brick (adapter/charger) as a power-supply class device which
> > > supplies the charger-IC, with its voltage-now and current-max representing
> > > the negotiated voltage and max current draw.
> > > 
> > > This commit adds a power_supply_set_input_current_limit_from_supplier
> > > helper function which charger power-supply drivers can call to get
> > > the max-current from their supplier and have this applied
> > > through their set_property call-back to their input-current-limit.
> > 
> > Hmm so can this also be used for the USB gadget subsystem
> > to tell charge controller when it's OK to enable 500mA
> > charging after enumeration?
> 
> I'm not sure that that would be best modeled this way. Perhaps
> the phy-driver can directly control the gpio you have for that,
> that seems better then trying to solve this with cross subsystem
> calls which are always tricky.

I don't think the phy driver knows either when the system
has enumerated as a gadget..

> > FYI, that's controlled by the bq24190 pin named OTG that should
> > be only set high after enumeration. Any ideas how that is wired
> > on your device? Does it connect to the USB PHY or to a GPIO
> > line?
> 
> I believe it is just hardwired to be logical high all the time
> on my board.

OK thanks for checking.

Tony

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/14] Hookup typec power-negotation to the PMIC and charger Hans de Goede <hdegoede@redhat.com> - 2017-08-15 22:10 +0200
  [PATCH v2 11/14] power: supply: bq24190_charger: Get input_current_limit from our supplier Hans de Goede <hdegoede@redhat.com> - 2017-08-15 22:10 +0200
    Re: [PATCH v2 11/14] power: supply: bq24190_charger: Get  input_current_limit from our supplier Liam Breck <liam@networkimprov.net> - 2017-08-16 22:30 +0200
  [PATCH v2 09/14] power: supply: bq24190_charger: Export 5V boost converter as regulator Hans de Goede <hdegoede@redhat.com> - 2017-08-15 22:10 +0200
  [PATCH v2 06/14] staging: typec: fusb302: Add support for USB2 charger detection through extcon Hans de Goede <hdegoede@redhat.com> - 2017-08-15 22:10 +0200
  [PATCH v2 02/14] staging: typec: tcpm: Add get_current_limit tcpc_dev callback Hans de Goede <hdegoede@redhat.com> - 2017-08-15 22:10 +0200
    Re: [PATCH v2 02/14] staging: typec: tcpm: Add get_current_limit  tcpc_dev callback Guenter Roeck <linux@roeck-us.net> - 2017-08-16 17:20 +0200
  [PATCH v2 12/14] power: supply: bq24190_charger: Remove extcon handling Hans de Goede <hdegoede@redhat.com> - 2017-08-15 22:10 +0200
  [PATCH v2 08/14] power: supply: Add power_supply_set_input_current_limit_from_supplier helper Hans de Goede <hdegoede@redhat.com> - 2017-08-15 22:10 +0200
    Re: [PATCH v2 08/14] power: supply: Add  power_supply_set_input_current_limit_from_supplier helper Tony Lindgren <tony@atomide.com> - 2017-08-16 18:00 +0200
      Re: [PATCH v2 08/14] power: supply: Add  power_supply_set_input_current_limit_from_supplier helper Hans de Goede <hdegoede@redhat.com> - 2017-08-16 19:40 +0200
        Re: [PATCH v2 08/14] power: supply: Add  power_supply_set_input_current_limit_from_supplier helper Tony Lindgren <tony@atomide.com> - 2017-08-16 21:30 +0200
  [PATCH v2 01/14] i2c: Allow overriding dev_name through board_info Hans de Goede <hdegoede@redhat.com> - 2017-08-15 22:10 +0200

csiph-web