From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754805AbcEYOoj (ORCPT ); Wed, 25 May 2016 10:44:39 -0400 Received: from mail-am1on0082.outbound.protection.outlook.com ([157.56.112.82]:39264 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753648AbcEYOog convert rfc822-to-8bit (ORCPT ); Wed, 25 May 2016 10:44:36 -0400 From: Jun Li To: Roger Quadros , Peter Chen CC: "peter.chen@freescale.com" , "balbi@kernel.org" , "tony@atomide.com" , "gregkh@linuxfoundation.org" , "dan.j.williams@intel.com" , "mathias.nyman@linux.intel.com" , "Joao.Pinto@synopsys.com" , "sergei.shtylyov@cogentembedded.com" , "jun.li@freescale.com" , "grygorii.strashko@ti.com" , "yoshihiro.shimoda.uh@renesas.com" , "robh@kernel.org" , "nsekhar@ti.com" , "b-liu@ti.com" , "linux-usb@vger.kernel.org" , "linux-omap@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: RE: [PATCH v8 08/14] usb: otg: add OTG/dual-role core Thread-Topic: [PATCH v8 08/14] usb: otg: add OTG/dual-role core Thread-Index: AQHRrP9sqfg6l/ahB0Gor+Wq8+BtSZ/H6BgAgAEcnoCAAKFEgIAAJMYQ Date: Wed, 25 May 2016 14:44:32 +0000 Message-ID: References: <1463133808-10630-1-git-send-email-rogerq@ti.com> <1463133808-10630-9-git-send-email-rogerq@ti.com> <574422CA.8080002@ti.com> <20160525024427.GA31142@shlinux2> <574598D3.5090405@ti.com> In-Reply-To: <574598D3.5090405@ti.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: ti.com; dkim=none (message not signed) header.d=none;ti.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [117.81.40.233] x-ms-office365-filtering-correlation-id: 5abdd733-67a9-4241-1c73-08d384ab15ca x-microsoft-exchange-diagnostics: 1;AM4PR04MB2130;5:lDs6KpSgn0Vy44smfol1X7YbdF7Q16XkdYMGozHUNqRIKXgVjOY/CSJMTC/eDu3O/uQwTsKRxrq/HrAFBMkIM/YKMamDYOe53fXuG0kuH6qz542l66xhaU24J47IlNPvm/UL/oh2jVtbJQWLb7dpbQ==;24:1lGa5TQrsht1tSURRiBwVvx/KhW7BJGCe/5Sb+IYFqBMRIPyaEJ9B3Grdy9V8m0xV1bXHeJrXM/5c0DMuc7eNtcivO7Z/Bxj4jRYjOR6VFc=;7:AYBgpuFKhfKG3YWoHqDebBGxI5iNFI3ZTzyKBudDEVP9gspUomCYfpDRMV7gAED1gSLmSn+hORNJ04F9gSZzudBfMBgGYGbcD+qlHOWGOf2Ej2L3AaZ2fYFPNUchjGG8JA84RfdTId7mwbOe2A6UESutquBovqDz4hUYUruqAN9PLVlA6e/IZmoKOg2Jqfie x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM4PR04MB2130; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:AM4PR04MB2130;BCL:0;PCL:0;RULEID:;SRVR:AM4PR04MB2130; x-forefront-prvs: 09538D3531 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(74316001)(102836003)(2950100001)(8936002)(5004730100002)(9686002)(189998001)(6116002)(3846002)(5003600100002)(586003)(66066001)(10400500002)(5008740100001)(76176999)(54356999)(81166006)(2900100001)(50986999)(106116001)(87936001)(92566002)(8666003)(11100500001)(76576001)(5001770100001)(8676002)(86362001)(2906002)(33656002)(5002640100001)(3660700001)(3280700002)(77096005)(1220700001)(122556002)(93886004)(4326007)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR04MB2130;H:AM4PR04MB2130.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 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: 25 May 2016 14:44:32.7650 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR04MB2130 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Roger > >> > >> Here, we should be checking if user needs to disable any OTG > >> features. So, > >> > >> if (dev->of_node) > >> of_usb_update_otg_caps(dev->of_node, &otg->caps); > >> > >> Do you agree? > >> This means we need to change otg->caps from 'struct usb_otg_caps > *caps;' > >> to 'struct usb_otg_caps caps;' so that we can modify the local copy > >> instead of the one passed by the OTG controller. > > > > Why can't modify the one from OTG controller directly? > > > > There are 2 things. > 1) OTG features supported by hardware. This is the controller's config- > >otg_caps > 2) OTG features needed by system designer. This can be a subset of (1). Let's make things simple, we only need this subnet, which can be set by controller driver in config->otg_caps before pass (its address) to OTG core. So controller driver should get the capability of HW(+SW) and user config by whatever approach, then set its config->otg_caps. Li Jun