Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3130827rdh; Thu, 28 Sep 2023 03:44:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeHcBCxWFFVlb+5wcmp+NS3RxK7qAYvAJCscJdxyTTciRstYd7EQju6RzNdWURTcnsYO6c X-Received: by 2002:a17:903:2445:b0:1c4:fae:bf4a with SMTP id l5-20020a170903244500b001c40faebf4amr750015pls.16.1695897858212; Thu, 28 Sep 2023 03:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695897858; cv=none; d=google.com; s=arc-20160816; b=W4yt24G5Y2OTfqP1MfeM9oomR9slsQgylpnG8D0owQNUd9PV+LoAqOOSZe85YT0oFo 8+8Q9urTZ1llK1Ee4SnK2YgcHuQAcumHRVykpJqr+Fp+qxtNsn/wpO7AS+j6ITAzOJFa r0P+O9f5+TSJvI6Yj8SpcmccLHqUvG7G5rNhwJRcCgU3FGsNL/7M40bw+qI/ztOWHowc PM1aiH77wyX3G7CdXJsw/8h6o6GEyHtCm3AeJaH8GwMrNFc1eIKDMz8DMMl2xBYbeOja /EIt09qup3j7Ea0fWxKl1mIIG3UflDNf3O94TebCVTx2CWoNLQeEd68CHN6Ddur+cKwt 7m5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DhBXWzc3k8LYHVgCjjZg3KYfMPRCJn6pv5Ntx364iWQ=; fh=1ZFgw0YHDIWduaWRfTBnDItdUVZfg1ZQGJTcoCRzi2c=; b=v4yF5GmoG7Bv8D4Q1UZt9HwT03AWiTGSSEhsw8dkoJyyuh9TUhNJlZoj1p0FypRHx1 5OSVj6iqn09pNhoP/aAAvOe3DbRQ53L4VRbxfRRagORyNs5LrHw0+1STid9rcbdMExwz q/OzT4O95fPpIeRuguOCGyaLuuhvxv5WfMtPJJ+Tc4Q83nqTlkNbBMJzfRi/vkKDGsn1 n5ygBIreskakQCHbVMKdwCNYABi7ttjlQtEVjtVJHfWPzAnI0o/tFRPmoZwdEWGzoczI o/HgvaUg5rgvBiQUTgEyMwXLn+QsBDQLYMPDgg9Ms2ipiHsJy0fYI9ax012LhMr7tKwT +x6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gULcXwiU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u3-20020a170902e80300b001c72476ca30si5298500plg.281.2023.09.28.03.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 03:44:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gULcXwiU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 50E2E8364280; Thu, 28 Sep 2023 02:54:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbjI1JyL (ORCPT + 99 others); Thu, 28 Sep 2023 05:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjI1JyJ (ORCPT ); Thu, 28 Sep 2023 05:54:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53EA3122 for ; Thu, 28 Sep 2023 02:54:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0609CC433C8; Thu, 28 Sep 2023 09:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695894848; bh=Kj0SxZL7f2frf3BzU+23hjNt9BY8ETQvEskGUsbV/hs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gULcXwiUDniTb2iIJ5XPcTY87uGCuTkYI8R0xtBdMAmb9/eB2zqPZPBqjKv+nP7Pq kFh84pLK03Orf/m3c3SJvElUXGm6LvWu2mnOCvBziCJuxw4X+UPAGgp3eYyNHsBOnl TwIqXLIrlUjTHR+efpZdzbUQnEzumPxaueXH+iTNBB8ywkIwvFWEcVYIS/iAI+fM2F 1Hw2Jch+qBOYVopFva0kci1f1iFrWsRPsmrdgX3BTHNlp2UI182Ssy2o25nc5XcYyk PjsMJ3W66VQEVV3Kz9/+6lQY1/+1B84YFuCyvMzWc/xTpR+HYz8JecxkKnBCePo78a fdqlMDb138uKQ== Date: Thu, 28 Sep 2023 17:53:55 +0800 From: Peter Chen To: Tomer Maimon Cc: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, xu.yang_2@nxp.com, peng.fan@nxp.com, avifishman70@gmail.com, tali.perry1@gmail.com, joel@jms.id.au, venture@google.com, yuenn@google.com, benjaminfair@google.com, j.neuschaefer@gmx.net, openbmc@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 1/3] usb: chipidea: add CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS flag Message-ID: <20230928095355.GA2081690@nchen-desktop> References: <20230927095509.267029-1-tmaimon77@gmail.com> <20230927095509.267029-2-tmaimon77@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230927095509.267029-2-tmaimon77@gmail.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 28 Sep 2023 02:54:18 -0700 (PDT) On 23-09-27 12:55:07, Tomer Maimon wrote: > Adding CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS flag to modify the vbus_active > parameter to active in case the ChipIdea USB IP role is device-only and > there is no otgsc register. > > Signed-off-by: Tomer Maimon Acked-by: Peter Chen Peter > --- > drivers/usb/chipidea/otg.c | 5 ++++- > include/linux/usb/chipidea.h | 1 + > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c > index f5490f2a5b6b..647e98f4e351 100644 > --- a/drivers/usb/chipidea/otg.c > +++ b/drivers/usb/chipidea/otg.c > @@ -130,8 +130,11 @@ enum ci_role ci_otg_role(struct ci_hdrc *ci) > > void ci_handle_vbus_change(struct ci_hdrc *ci) > { > - if (!ci->is_otg) > + if (!ci->is_otg) { > + if (ci->platdata->flags & CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS) > + usb_gadget_vbus_connect(&ci->gadget); > return; > + } > > if (hw_read_otgsc(ci, OTGSC_BSV) && !ci->vbus_active) > usb_gadget_vbus_connect(&ci->gadget); > diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h > index 0b4f2d5faa08..5a7f96684ea2 100644 > --- a/include/linux/usb/chipidea.h > +++ b/include/linux/usb/chipidea.h > @@ -64,6 +64,7 @@ struct ci_hdrc_platform_data { > #define CI_HDRC_PMQOS BIT(15) > #define CI_HDRC_PHY_VBUS_CONTROL BIT(16) > #define CI_HDRC_HAS_PORTSC_PEC_MISSED BIT(17) > +#define CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS BIT(18) > enum usb_dr_mode dr_mode; > #define CI_HDRC_CONTROLLER_RESET_EVENT 0 > #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 > -- > 2.33.0 > -- Thanks, Peter Chen