From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99024C3A59E for ; Mon, 2 Sep 2019 16:20:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 782FA21881 for ; Mon, 2 Sep 2019 16:20:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725990AbfIBQUu (ORCPT ); Mon, 2 Sep 2019 12:20:50 -0400 Received: from muru.com ([72.249.23.125]:59480 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbfIBQUu (ORCPT ); Mon, 2 Sep 2019 12:20:50 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 5815A8022; Mon, 2 Sep 2019 16:21:19 +0000 (UTC) Date: Mon, 2 Sep 2019 09:20:46 -0700 From: Tony Lindgren To: Pavel Machek Cc: Sebastian Reichel , linux-pm@vger.kernel.org, linux-omap@vger.kernel.org, Jacopo Mondi , Kishon Vijay Abraham I , Marcel Partap , Merlijn Wajer , Michael Scott , NeKit Subject: Re: [PATCH] power: supply: cpcap-charger: Enable vbus boost voltage Message-ID: <20190902162046.GJ52127@atomide.com> References: <20190830232316.53750-1-tony@atomide.com> <20190902075943.GB15850@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190902075943.GB15850@amd> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org * Pavel Machek [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