Message ID | 20231017131851.8299-2-quic_kriskura@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4128966vqb; Tue, 17 Oct 2023 06:19:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrk9/7Kyfnrx/HYWS3L4Ye4ZWg4e8zGJIp0de1PvDpyC63KbJcQLE2ajxP/u7BEhI3f3In X-Received: by 2002:a05:6a20:ce9a:b0:16c:b95c:6d38 with SMTP id if26-20020a056a20ce9a00b0016cb95c6d38mr2025425pzb.2.1697548791421; Tue, 17 Oct 2023 06:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697548791; cv=none; d=google.com; s=arc-20160816; b=txBqpZxYyI+Kq0cO8EeA22SRFFgagh3cgMbl8d7hHbdWrX+fTmBDas0vBmQvsyx8x4 t85pDuCnOS09txpgQgdqIpvp4CwSDOPUqcQaY3KaEOyFLHFU312gbLvCJFn5G5MZ6gRA VPGNGYbgDXLV+IwgZPtUCYhfkk6xKvIFblMMG4u2s0k/7ht88/tEeoPljPZEHoR34EM2 wRzjNFxsUwDwymleqXSz8GwJYd5bcV3gaWeiHIQkZswtQCm+hwg7ZGQdtLNuimTdocqk EFEAtaf+wjEL5XNsIeLDHNDpEGc7iUgymxPvVXnJK5+NWJJY1waUws1shpdxkstKnps+ LUfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gbjM2IVLBNGvsGAFYv/I5yJ/kDV3NlIrf+H28JhetGY=; fh=lnz4DRjlq9crmzgxXmwaNWKaJ11J7ZN7K9PizVBu28Q=; b=i3HZmRpC34PmGTMtnHD3fAiZR8iNqQc8uTpU6YmilKWrs9+AP3XWGCjilanEbg7138 HWXJXbAf56g7IEXvcMR+zxY2MY+JdDuILd8oFe1M2D9dOPpAvm8Mgxq/KcWi2xHgCqDN UQaRqa00R/RqDu3g2nZiL1/0Mw+PsO4nzhKiQnK5fmgZzOf6o64WiDQeMD5GUfqoJeFb uB2F5VqOGATkQtCbOsT+oTnGzdKEvh1HJMWnfRY0Zyl968MOJQ0qafjle9KBlcXebRj4 XEqtrpoKkFH38uCA6TW9VwTjdNjKjfjZAu1KjXG+eMol6SZ4jPKAvLZdYrPM+fgcoNVn tGlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=E4Em0O5+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e11-20020a6558cb000000b00577d99bd045si1652025pgu.843.2023.10.17.06.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 06:19:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=E4Em0O5+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 80329801BA7E; Tue, 17 Oct 2023 06:19:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343927AbjJQNTi (ORCPT <rfc822;hjfbswb@gmail.com> + 19 others); Tue, 17 Oct 2023 09:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343894AbjJQNTe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 17 Oct 2023 09:19:34 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF57CF1; Tue, 17 Oct 2023 06:19:32 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39HD7Iih005166; Tue, 17 Oct 2023 13:19:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=gbjM2IVLBNGvsGAFYv/I5yJ/kDV3NlIrf+H28JhetGY=; b=E4Em0O5+8I4UWlOK+btiOG3LYqDZMGNfN6wHe3hQc83E0LO4BOfO7Vbi1v2S6VU+9dKJ REAcVWtBTpHs+H9i45Ykww/JDI2oH1YFP12vwYsGNIVAax16XuaEqVgSkJt3brpDtvQu JwvEFIAOFfUW7T4qaqD2DqE3/hS8bJHyt3JpLyuAXLlLzZrm0Z9Usr0lhMpUeifmKqHj tO9khrp7RwK8izFaAmU3AGTtiubGGc6po37UIneq5sbsiNiKvd4tDPrKZ1kikE60QOIi pUZRZ51H8TA7j4mm4leOuvvd5Xh4gvL9zk+4nVaWxcjdVE8hWEixTzj3fwql7f1+uaQK 7A== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tstv9r0tj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 13:19:25 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39HDJArp002299 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Oct 2023 13:19:10 GMT Received: from hu-kriskura-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Tue, 17 Oct 2023 06:19:05 -0700 From: Krishna Kurapati <quic_kriskura@quicinc.com> To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Philipp Zabel <p.zabel@pengutronix.de>, "Andy Gross" <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, "Konrad Dybcio" <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, <quic_wcheng@quicinc.com> CC: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>, <quic_ppratap@quicinc.com>, <quic_jackp@quicinc.com>, Krishna Kurapati <quic_kriskura@quicinc.com> Subject: [RFC 1/8] dt-bindings: usb: qcom,dwc3: Add bindings to enable runtime Date: Tue, 17 Oct 2023 18:48:45 +0530 Message-ID: <20231017131851.8299-2-quic_kriskura@quicinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231017131851.8299-1-quic_kriskura@quicinc.com> References: <20231017131851.8299-1-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: JSVT3efDXhg8gJmkbeFVo0y2yCNmFAIm X-Proofpoint-ORIG-GUID: JSVT3efDXhg8gJmkbeFVo0y2yCNmFAIm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-17_02,2023-10-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 priorityscore=1501 mlxlogscore=660 impostorscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310170113 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 17 Oct 2023 06:19:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780008921567326247 X-GMAIL-MSGID: 1780008921567326247 |
Series |
Enable runtime suspend resume for QCOM devices
|
|
Commit Message
Krishna Kurapati
Oct. 17, 2023, 1:18 p.m. UTC
Add enable-rt binding to let the device register vendor hooks to
core and facilitate runtime suspend and resume.
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 5 +++++
1 file changed, 5 insertions(+)
Comments
On 17/10/2023 15:18, Krishna Kurapati wrote: > Add enable-rt binding to let the device register vendor hooks to > core and facilitate runtime suspend and resume. > > Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> > --- > Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > index cb50261c6a36..788d9c510abc 100644 > --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > @@ -151,6 +151,11 @@ properties: > HS/FS/LS modes are supported. > type: boolean > > + qcom,enable-rt: > + description: > + If present, register vendor hooks to facilitate runtime suspend/resume You described the desired Linux feature or behavior, not the actual hardware. The bindings are about the latter, so instead you need to rephrase the property and its description to match actual hardware capabilities/features/configuration etc. Best regards, Krzysztof
On 10/17/2023 10:49 PM, Krzysztof Kozlowski wrote: > On 17/10/2023 15:18, Krishna Kurapati wrote: >> Add enable-rt binding to let the device register vendor hooks to >> core and facilitate runtime suspend and resume. >> >> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> >> --- >> Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> index cb50261c6a36..788d9c510abc 100644 >> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> @@ -151,6 +151,11 @@ properties: >> HS/FS/LS modes are supported. >> type: boolean >> >> + qcom,enable-rt: >> + description: >> + If present, register vendor hooks to facilitate runtime suspend/resume > > You described the desired Linux feature or behavior, not the actual > hardware. The bindings are about the latter, so instead you need to > rephrase the property and its description to match actual hardware > capabilities/features/configuration etc. > Hi Krzysztof, Thanks for the review. Although it sounds like its a Linux property, internally what it does is configuring qscratch registers properly when (dr_mode == OTG) Would it be fine to rephrase the property name to "qcom,config-qscratch" and to make it dependent on dr_mode and usb-role-switch properties ? Would it be possible to make such a dependency in bindings ? Regards, Krishna,
On 17/10/2023 19:46, Krishna Kurapati PSSNV wrote: > > > On 10/17/2023 10:49 PM, Krzysztof Kozlowski wrote: >> On 17/10/2023 15:18, Krishna Kurapati wrote: >>> Add enable-rt binding to let the device register vendor hooks to >>> core and facilitate runtime suspend and resume. >>> >>> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> >>> --- >>> Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >>> index cb50261c6a36..788d9c510abc 100644 >>> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >>> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >>> @@ -151,6 +151,11 @@ properties: >>> HS/FS/LS modes are supported. >>> type: boolean >>> >>> + qcom,enable-rt: >>> + description: >>> + If present, register vendor hooks to facilitate runtime suspend/resume >> >> You described the desired Linux feature or behavior, not the actual >> hardware. The bindings are about the latter, so instead you need to >> rephrase the property and its description to match actual hardware >> capabilities/features/configuration etc. >> > > Hi Krzysztof, > > Thanks for the review. Although it sounds like its a Linux property, > internally what it does is configuring qscratch registers properly when > (dr_mode == OTG) That's not what you wrote. You wrote "register vendor hooks". Really, this is nothing to do with hardware. > > Would it be fine to rephrase the property name to > "qcom,config-qscratch" and to make it dependent on dr_mode and > usb-role-switch properties ? Would it be possible to make such a > dependency in bindings ? Examples are in: example-schema or my talk. Best regards, Krzysztof
On 17/10/2023 14:18, Krishna Kurapati wrote: > Add enable-rt binding to let the device register vendor hooks to > core and facilitate runtime suspend and resume. Hi Krishna, From reading through these patches, it's not clear to me why this behaviour should be conditional on a new devicetree property. Are there some platforms where this behaviour would be undesirable? And if so then would it be possible to determine this based on the QSCRATCH registers? > > Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> > --- > Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > index cb50261c6a36..788d9c510abc 100644 > --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml > @@ -151,6 +151,11 @@ properties: > HS/FS/LS modes are supported. > type: boolean > > + qcom,enable-rt: > + description: > + If present, register vendor hooks to facilitate runtime suspend/resume > + type: boolean A Krzysztof pointed out, properties should define the hardware behaviour, not tot the implementation details. For this case the hardware isn't wired up to vbus, so maybe something like "qcom,no-vbus"? > + > wakeup-source: true > > # Required child node:
On 11/2/2023 10:03 PM, Caleb Connolly wrote: > > > On 17/10/2023 14:18, Krishna Kurapati wrote: >> Add enable-rt binding to let the device register vendor hooks to >> core and facilitate runtime suspend and resume. > > Hi Krishna, > > From reading through these patches, it's not clear to me why this > behaviour should be conditional on a new devicetree property. Are there > some platforms where this behaviour would be undesirable? And if so then > would it be possible to determine this based on the QSCRATCH registers? >> Hi Caleb, There are two types of platforms, some use extcon and some use role-switch to deliver vbus/id notifications. Extcon targets already have this qscratch modifications present today in vbus and id handlers. But for role-switch based targets we don't have any way to get this notification to dwc3-qcom. In this implementation, I wanted to get those notications from core to glue and for this we implenented vendor hooks. The property added has been used to do two things: 1. Register glue's vendor hooks to core driver 2. Do runtime_allow for glue (and by default for core as the dt is not flattened) In case of extcon, we don't want to register vendor hooks as notifications are not necessary. For xhci, we opted to enable runtime from userspace. >> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> >> --- >> Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> index cb50261c6a36..788d9c510abc 100644 >> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> @@ -151,6 +151,11 @@ properties: >> HS/FS/LS modes are supported. >> type: boolean >> + qcom,enable-rt: >> + description: >> + If present, register vendor hooks to facilitate runtime >> suspend/resume >> + type: boolean > > A Krzysztof pointed out, properties should define the hardware > behaviour, not tot the implementation details. For this case the > hardware isn't wired up to vbus, so maybe something like "qcom,no-vbus"? >> + On all targets, vbus is not routed to hardware. This vbus toggle indication is given to controller via qscratch only. Regards, Krishna,
> Hi Caleb, > > There are two types of platforms, some use extcon and some use > role-switch to deliver vbus/id notifications. Extcon targets already > have this qscratch modifications present today in vbus and id handlers. > But for role-switch based targets we don't have any way to get this > notification to dwc3-qcom. In this implementation, I wanted to get those > notications from core to glue and for this we implenented vendor hooks. > > The property added has been used to do two things: > > 1. Register glue's vendor hooks to core driver > 2. Do runtime_allow for glue (and by default for core as the dt is not > flattened) > > In case of extcon, we don't want to register vendor hooks as > notifications are not necessary. Could it just be enabled when role_switch is present then? > > For xhci, we opted to enable runtime from userspace. >>> HS/FS/LS modes are supported. >>> type: boolean >>> + qcom,enable-rt: >>> + description: >>> + If present, register vendor hooks to facilitate runtime >>> suspend/resume >>> + type: boolean >> >> A Krzysztof pointed out, properties should define the hardware >> behaviour, not tot the implementation details. For this case the >> hardware isn't wired up to vbus, so maybe something like "qcom,no-vbus"? >>> + > > On all targets, vbus is not routed to hardware. This vbus toggle > indication is given to controller via qscratch only. > > Regards, > Krishna,
On 11/3/2023 12:10 AM, Caleb Connolly wrote: >> Hi Caleb, >> >> There are two types of platforms, some use extcon and some use >> role-switch to deliver vbus/id notifications. Extcon targets already >> have this qscratch modifications present today in vbus and id >> handlers. But for role-switch based targets we don't have any way to >> get this notification to dwc3-qcom. In this implementation, I wanted >> to get those notications from core to glue and for this we implenented >> vendor hooks. >> >> The property added has been used to do two things: >> >> 1. Register glue's vendor hooks to core driver >> 2. Do runtime_allow for glue (and by default for core as the dt is not >> flattened) >> >> In case of extcon, we don't want to register vendor hooks as >> notifications are not necessary. > > Could it just be enabled when role_switch is present then? >> So we would register vendor hooks when usb-role-switch is present but don't do runtime allow, and leave that option to user space right ? I think it would work and we can do away with the binding completely. Will wait for comments from other folks as well on this approach. Thanks for the review, Krishna,
On 03/11/2023 05:34, Krishna Kurapati PSSNV wrote: > > > On 11/3/2023 12:10 AM, Caleb Connolly wrote: >>> Hi Caleb, >>> >>> There are two types of platforms, some use extcon and some use >>> role-switch to deliver vbus/id notifications. Extcon targets already >>> have this qscratch modifications present today in vbus and id >>> handlers. But for role-switch based targets we don't have any way to >>> get this notification to dwc3-qcom. In this implementation, I wanted >>> to get those notications from core to glue and for this we >>> implenented vendor hooks. >>> >>> The property added has been used to do two things: >>> >>> 1. Register glue's vendor hooks to core driver >>> 2. Do runtime_allow for glue (and by default for core as the dt is >>> not flattened) >>> >>> In case of extcon, we don't want to register vendor hooks as >>> notifications are not necessary. >> >> Could it just be enabled when role_switch is present then? >>> > > So we would register vendor hooks when usb-role-switch is present but > don't do runtime allow, and leave that option to user space right ? > I think it would work and we can do away with the binding completely. Can we still enable runtime suspend? Maybe someone else wants to chime in here, but I'd guess that it's preferable to have it enabled by default, particularly for devices like phones. Or are there side effects from this? > > Will wait for comments from other folks as well on this approach. Sounds good, thanks! > > Thanks for the review, > Krishna,
On 11/3/2023 8:26 PM, Caleb Connolly wrote: > > > On 03/11/2023 05:34, Krishna Kurapati PSSNV wrote: >> >> >> On 11/3/2023 12:10 AM, Caleb Connolly wrote: >>>> Hi Caleb, >>>> >>>> There are two types of platforms, some use extcon and some use >>>> role-switch to deliver vbus/id notifications. Extcon targets already >>>> have this qscratch modifications present today in vbus and id >>>> handlers. But for role-switch based targets we don't have any way to >>>> get this notification to dwc3-qcom. In this implementation, I wanted >>>> to get those notications from core to glue and for this we >>>> implenented vendor hooks. >>>> >>>> The property added has been used to do two things: >>>> >>>> 1. Register glue's vendor hooks to core driver >>>> 2. Do runtime_allow for glue (and by default for core as the dt is >>>> not flattened) >>>> >>>> In case of extcon, we don't want to register vendor hooks as >>>> notifications are not necessary. >>> >>> Could it just be enabled when role_switch is present then? >>>> >> >> So we would register vendor hooks when usb-role-switch is present but >> don't do runtime allow, and leave that option to user space right ? >> I think it would work and we can do away with the binding completely. > > Can we still enable runtime suspend? Maybe someone else wants to chime > in here, but I'd guess that it's preferable to have it enabled by > default, particularly for devices like phones. Or are there side effects > from this? >> AFAIK, I don't see any side effects whether we enable runtime from user space or do runtime_allow() here in kernel itself and leave qscratch config to vendor hooks. But leaving it enabled by default, we do this for almost all targets in downstream today. So I guess there would be no side effects. Regards, Krishna,
diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index cb50261c6a36..788d9c510abc 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -151,6 +151,11 @@ properties: HS/FS/LS modes are supported. type: boolean + qcom,enable-rt: + description: + If present, register vendor hooks to facilitate runtime suspend/resume + type: boolean + wakeup-source: true # Required child node: