From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jun Li Subject: RE: [PATCH 08/21] usb: chipidea: Kick OTG state machine for AVVIS with vbus extcon Date: Thu, 30 Jun 2016 01:50:03 +0000 Message-ID: References: <20160626072838.28082-1-stephen.boyd@linaro.org> <20160626072838.28082-9-stephen.boyd@linaro.org> <20160629030913.GC25236@shlinux2> <146724959973.16253.818114721999543873@sboyd-linaro> <20160630012652.GB19928@shlinux2> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160630012652.GB19928@shlinux2> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Peter Chen , Stephen Boyd Cc: Felipe Balbi , Arnd Bergmann , Neil Armstrong , "linux-arm-msm@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Bjorn Andersson , Peter Chen , Greg Kroah-Hartman , Andy Gross , "linux-arm-kernel@lists.infradead.org" List-Id: linux-arm-msm@vger.kernel.org Hi Stephen, > -----Original Message----- > From: linux-usb-owner@vger.kernel.org [mailto:linux-usb- > owner@vger.kernel.org] On Behalf Of Peter Chen > Sent: Thursday, June 30, 2016 9:27 AM > To: Stephen Boyd > Cc: linux-usb@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > linux-kernel@vger.kernel.org; linux-arm-msm@vger.kernel.org; Andy Gross > ; Bjorn Andersson ; > Neil Armstrong ; Arnd Bergmann ; > Felipe Balbi ; Peter Chen ; Greg > Kroah-Hartman > Subject: Re: [PATCH 08/21] usb: chipidea: Kick OTG state machine for AVVIS > with vbus extcon > > On Wed, Jun 29, 2016 at 06:19:59PM -0700, Stephen Boyd wrote: > > Quoting Peter Chen (2016-06-28 20:09:13) > > > On Sun, Jun 26, 2016 at 12:28:25AM -0700, Stephen Boyd wrote: > > > > Force the OTG state machine to go forward when we're using an > > > > extcon for vbus detection. In this case, the controller may never > > > > raise an interrupt for AVVIS, so we need to simulate the event by > > > > toggling the appropriate OTG fsm bits and kicking the state > > > > machine again. > > > > > > > > > > Well, I think you may misunderstand the OTG FSM and dual-role. > > > From my and Felipe's point, there are seldom users for USB FSM, > > > there are only OTG FSM spec and related OTG certification. > > > > Probably yes. > > > > > > > > The OTG FSM needs related SoC support, the vbus will be off at > > > several states, and the SRP should be supported by SoC. > > > > > > By default, the dts needs below properties for disabling it if you > > > choose otg fsm support at kernel configuration. > > > > > > &usbotg1 { > > > vbus-supply = <®_usb_otg1_vbus>; > > > srp-disable; > > > hnp-disable; > > > adp-disable; > > > status = "okay"; > > > }; > > > > > > See Documentation/devicetree/bindings/usb/generic.txt. > > > > Does this mean we should be setting all those properties if we're > > using an extcon for vbus and id? > > It is not related to how we know vbus and id. If your controller is otg- > capable, and you don't want to enable OTG FSM (just want dual-role), you > should set them at dts since the zImage is multi-platforms, the > CONFIG_USB_OTG and CONFIG_USB_OTG_FSM may be chosen. > > > I have noticed that vbus is powered off after some time when no device > > is connected and we're in A_HOST state because the timeout for a B > > device connection happens. > > I think it is not you want, but it is OTG compliance. For simple, if you don't want OTG(i.e HNP&SRP) at all, just needs dual role, you may disable CONFIG_USB_OTG and CONFIG_USB_OTG_FSM in your menuconfig, then you don't need touch all those properties. Li Jun > > -- > > Best Regards, > Peter Chen > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org More majordomo info at > http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbcF3CHS (ORCPT ); Wed, 29 Jun 2016 22:07:18 -0400 Received: from mail-db3on0069.outbound.protection.outlook.com ([157.55.234.69]:57710 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751480AbcF3CHO convert rfc822-to-8bit (ORCPT ); Wed, 29 Jun 2016 22:07:14 -0400 From: Jun Li To: Peter Chen , Stephen Boyd CC: "linux-usb@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" , Andy Gross , "Bjorn Andersson" , Neil Armstrong , Arnd Bergmann , Felipe Balbi , Peter Chen , Greg Kroah-Hartman Subject: RE: [PATCH 08/21] usb: chipidea: Kick OTG state machine for AVVIS with vbus extcon Thread-Topic: [PATCH 08/21] usb: chipidea: Kick OTG state machine for AVVIS with vbus extcon Thread-Index: AQHRz3zlnRaAN2+lRU+JfSXhcDZO1p//yD+AgAF4TM2AAAKyEA== Date: Thu, 30 Jun 2016 01:50:03 +0000 Message-ID: References: <20160626072838.28082-1-stephen.boyd@linaro.org> <20160626072838.28082-9-stephen.boyd@linaro.org> <20160629030913.GC25236@shlinux2> <146724959973.16253.818114721999543873@sboyd-linaro> <20160630012652.GB19928@shlinux2> In-Reply-To: <20160630012652.GB19928@shlinux2> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=jun.li@nxp.com; x-originating-ip: [192.158.241.86] x-ms-office365-filtering-correlation-id: b2e45137-0a07-4cd8-5b54-08d3a088daae x-microsoft-exchange-diagnostics: 1;DB5PR04MB1445;6:/b+LJa5htKHG8bMxAOs57N8B3Q+5bcTjhLla1zFZ/+jcXi+qdRROLA8ruAxSYIu9LEYABfxz8DeN6tUM+uWPDeSv41GtJaoiq5xQgumh8BTa8eoWgs3yycgHxijOJy/Fj6B50Njc/NzHimqSen3SBIXE6Dp1GY5/L6xC/uiRzmqM+ppo+teel+FZazL8OB39+BCxMXa84ceHp4hjL9egKnuKVvwqeoe00C9teFqRg9iTb9R+zhgnUDI/BQnfi5C71Au/gEDboeNBxK+C3IebNdBeY5rh9/cU+ekmAZGlA4s/ho/lLkKm6JUkFcuk6jM75GTjRWzNH+tQ4VVcMRE7iCptrFGK4ld0hPkTzPmso+k=;5:v4FzcJ8iB+ppDazTUavSQHKjoJ1Wva6DeIuYrLrQnQkt4Jove3X50uBVBDkWKBoKKRf1hMc96I2dMT5IC4PlId87+c+IKG8WzTnHBZBLTMv0mTkVMKmQN4UkepbfkxDwfjW7bTUoc2/eq3gQyMhcNA==;24:iMQ/xaYakSnYynNI+ZewKooTTmpXayeiAjwpKgLE+lQvxRz+7C/epq76qKbhZIgH4vBD4IgKhQ0IO68gjIZGZSG5IrMUv+S7pQqq5Z+K2U8=;7:VYZ8lWilKORmLofMEogxhqo9LpcUFFCNuHgFhVHDWGZDPVB3dJilZ9RygWmQzu/gqNCmiLRjsgaCgRAZSEjxyB21ilrKJM4aXx4xYijbepUY1VQv1032ZrSYY+3pKk/TwAUaZVxzIrWj5hL+Ek+rN2Kyi7pKoT8UCKl03Atzp0cqvD6kiapD1sfQBLK8AwEKuHwQiusk1ymCu2kmPUmS7Z68Mn7xP+uGBrTi8aGOwduVJFo47uwQQkAR2WcrcCNb3mBEeOF4sNPap2Y94LlHNg== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB1445; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197)(258649278758335); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:DB5PR04MB1445;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB1445; x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(13464003)(189002)(377424004)(24454002)(377454003)(199003)(7846002)(7736002)(5003600100003)(74316001)(77096005)(7696003)(2900100001)(305945005)(5002640100001)(106116001)(106356001)(105586002)(15975445007)(97736004)(189998001)(5001770100001)(66066001)(2950100001)(81166006)(93886004)(586003)(11100500001)(33656002)(102836003)(3846002)(6116002)(86362001)(76576001)(68736007)(81156014)(92566002)(122556002)(87936001)(4326007)(19580395003)(9686002)(3660700001)(101416001)(2906002)(8676002)(8936002)(10400500002)(50986999)(76176999)(54356999)(19580405001)(3280700002)(422495003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR04MB1445;H:AM4PR04MB2130.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jun 2016 01:50:03.2496 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB1445 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, > -----Original Message----- > From: linux-usb-owner@vger.kernel.org [mailto:linux-usb- > owner@vger.kernel.org] On Behalf Of Peter Chen > Sent: Thursday, June 30, 2016 9:27 AM > To: Stephen Boyd > Cc: linux-usb@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > linux-kernel@vger.kernel.org; linux-arm-msm@vger.kernel.org; Andy Gross > ; Bjorn Andersson ; > Neil Armstrong ; Arnd Bergmann ; > Felipe Balbi ; Peter Chen ; Greg > Kroah-Hartman > Subject: Re: [PATCH 08/21] usb: chipidea: Kick OTG state machine for AVVIS > with vbus extcon > > On Wed, Jun 29, 2016 at 06:19:59PM -0700, Stephen Boyd wrote: > > Quoting Peter Chen (2016-06-28 20:09:13) > > > On Sun, Jun 26, 2016 at 12:28:25AM -0700, Stephen Boyd wrote: > > > > Force the OTG state machine to go forward when we're using an > > > > extcon for vbus detection. In this case, the controller may never > > > > raise an interrupt for AVVIS, so we need to simulate the event by > > > > toggling the appropriate OTG fsm bits and kicking the state > > > > machine again. > > > > > > > > > > Well, I think you may misunderstand the OTG FSM and dual-role. > > > From my and Felipe's point, there are seldom users for USB FSM, > > > there are only OTG FSM spec and related OTG certification. > > > > Probably yes. > > > > > > > > The OTG FSM needs related SoC support, the vbus will be off at > > > several states, and the SRP should be supported by SoC. > > > > > > By default, the dts needs below properties for disabling it if you > > > choose otg fsm support at kernel configuration. > > > > > > &usbotg1 { > > > vbus-supply = <®_usb_otg1_vbus>; > > > srp-disable; > > > hnp-disable; > > > adp-disable; > > > status = "okay"; > > > }; > > > > > > See Documentation/devicetree/bindings/usb/generic.txt. > > > > Does this mean we should be setting all those properties if we're > > using an extcon for vbus and id? > > It is not related to how we know vbus and id. If your controller is otg- > capable, and you don't want to enable OTG FSM (just want dual-role), you > should set them at dts since the zImage is multi-platforms, the > CONFIG_USB_OTG and CONFIG_USB_OTG_FSM may be chosen. > > > I have noticed that vbus is powered off after some time when no device > > is connected and we're in A_HOST state because the timeout for a B > > device connection happens. > > I think it is not you want, but it is OTG compliance. For simple, if you don't want OTG(i.e HNP&SRP) at all, just needs dual role, you may disable CONFIG_USB_OTG and CONFIG_USB_OTG_FSM in your menuconfig, then you don't need touch all those properties. Li Jun > > -- > > Best Regards, > Peter Chen > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org More majordomo info at > http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: jun.li@nxp.com (Jun Li) Date: Thu, 30 Jun 2016 01:50:03 +0000 Subject: [PATCH 08/21] usb: chipidea: Kick OTG state machine for AVVIS with vbus extcon In-Reply-To: <20160630012652.GB19928@shlinux2> References: <20160626072838.28082-1-stephen.boyd@linaro.org> <20160626072838.28082-9-stephen.boyd@linaro.org> <20160629030913.GC25236@shlinux2> <146724959973.16253.818114721999543873@sboyd-linaro> <20160630012652.GB19928@shlinux2> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Stephen, > -----Original Message----- > From: linux-usb-owner at vger.kernel.org [mailto:linux-usb- > owner at vger.kernel.org] On Behalf Of Peter Chen > Sent: Thursday, June 30, 2016 9:27 AM > To: Stephen Boyd > Cc: linux-usb at vger.kernel.org; linux-arm-kernel at lists.infradead.org; > linux-kernel at vger.kernel.org; linux-arm-msm at vger.kernel.org; Andy Gross > ; Bjorn Andersson ; > Neil Armstrong ; Arnd Bergmann ; > Felipe Balbi ; Peter Chen ; Greg > Kroah-Hartman > Subject: Re: [PATCH 08/21] usb: chipidea: Kick OTG state machine for AVVIS > with vbus extcon > > On Wed, Jun 29, 2016 at 06:19:59PM -0700, Stephen Boyd wrote: > > Quoting Peter Chen (2016-06-28 20:09:13) > > > On Sun, Jun 26, 2016 at 12:28:25AM -0700, Stephen Boyd wrote: > > > > Force the OTG state machine to go forward when we're using an > > > > extcon for vbus detection. In this case, the controller may never > > > > raise an interrupt for AVVIS, so we need to simulate the event by > > > > toggling the appropriate OTG fsm bits and kicking the state > > > > machine again. > > > > > > > > > > Well, I think you may misunderstand the OTG FSM and dual-role. > > > From my and Felipe's point, there are seldom users for USB FSM, > > > there are only OTG FSM spec and related OTG certification. > > > > Probably yes. > > > > > > > > The OTG FSM needs related SoC support, the vbus will be off at > > > several states, and the SRP should be supported by SoC. > > > > > > By default, the dts needs below properties for disabling it if you > > > choose otg fsm support at kernel configuration. > > > > > > &usbotg1 { > > > vbus-supply = <®_usb_otg1_vbus>; > > > srp-disable; > > > hnp-disable; > > > adp-disable; > > > status = "okay"; > > > }; > > > > > > See Documentation/devicetree/bindings/usb/generic.txt. > > > > Does this mean we should be setting all those properties if we're > > using an extcon for vbus and id? > > It is not related to how we know vbus and id. If your controller is otg- > capable, and you don't want to enable OTG FSM (just want dual-role), you > should set them at dts since the zImage is multi-platforms, the > CONFIG_USB_OTG and CONFIG_USB_OTG_FSM may be chosen. > > > I have noticed that vbus is powered off after some time when no device > > is connected and we're in A_HOST state because the timeout for a B > > device connection happens. > > I think it is not you want, but it is OTG compliance. For simple, if you don't want OTG(i.e HNP&SRP) at all, just needs dual role, you may disable CONFIG_USB_OTG and CONFIG_USB_OTG_FSM in your menuconfig, then you don't need touch all those properties. Li Jun > > -- > > Best Regards, > Peter Chen > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo at vger.kernel.org More majordomo info at > http://vger.kernel.org/majordomo-info.html