All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org, linux-omap@vger.kernel.org,
	Jacopo Mondi <jacopo@jmondi.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Marcel Partap <mpartap@gmx.net>,
	Merlijn Wajer <merlijn@wizzup.org>,
	Michael Scott <hashcode0f@gmail.com>, NeKit <nekit1000@gmail.com>
Subject: Re: [PATCH] power: supply: cpcap-charger: Enable vbus boost voltage
Date: Mon, 2 Sep 2019 09:20:46 -0700	[thread overview]
Message-ID: <20190902162046.GJ52127@atomide.com> (raw)
In-Reply-To: <20190902075943.GB15850@amd>

* Pavel Machek <pavel@ucw.cz> [190902 08:00]:
> Hi!
> 
> > We are currently not enabling VBUS boost for cpcap when in host mode.
> > This means the VBUS is fed at the battery voltage level, which can cause
> > flakeyness enumerating devices.
> > 
> > Looks like the boost control for VBUS is CPCAP_BIT_VBUS_SWITCH that we
> > must enable in the charger for nice 4.92 V VBUS output. And looks like
> > we must not use the STBY pin enabling but must instead use manual VBUS
> > control in phy-cpcap-usb.
> > 
> > We want to do this in cpcap_charger_vbus_work() and also set a flag for
> > feeding_vbus to avoid races between USB detection and charger detection,
> > and disable charging if feeding_vbus is set.
> 
> I did not know phone is supposed to provide voltage on USB. USB mouse
> works for me.. in stock android, provided I conect USB hub and
> external power.

Yup that's standard USB OTG feature when ID pin is grounded.

> This does not seem to work for me.. and it does not even work on stock
> kernel. What is going on here?

Sounds like you're missing a USB micro-B cable with ID pin grounded
and trying to use debugfs/sysfs instead to force the host mode.

> Is there some kind of debug ineterface where I could test just the
> vbus switch? I do have voltmeter for the usb port...

Yeah well.. just ground the ID pin :) No debug interface should be
needed here.

If you really wanted to add some kind of debugfs interface for forcing
host mode without ID pin grounded, you could try to have the USB phy
driver enable ID pin pull-down via sysfs. That's the cpcap PMIC in this
case, I think some combination of CPCAP_BIT_ID* bits might do the
trick.

Regards,

Tony


  reply	other threads:[~2019-09-02 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 23:23 [PATCH] power: supply: cpcap-charger: Enable vbus boost voltage Tony Lindgren
2019-09-02  7:59 ` Pavel Machek
2019-09-02 16:20   ` Tony Lindgren [this message]
2019-09-02 21:12 ` Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190902162046.GJ52127@atomide.com \
    --to=tony@atomide.com \
    --cc=hashcode0f@gmail.com \
    --cc=jacopo@jmondi.org \
    --cc=kishon@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=mpartap@gmx.net \
    --cc=nekit1000@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.