From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754555AbbIILLW (ORCPT ); Wed, 9 Sep 2015 07:11:22 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:53241 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753100AbbIILLM (ORCPT ); Wed, 9 Sep 2015 07:11:12 -0400 Subject: Re: [PATCH v4 07/13] usb: otg: add OTG core To: Alan Stern References: CC: Peter Chen , "Balbi, Felipe" , Greg Kroah-Hartman , Dan Williams , Li Jun , Mathias Nyman , Tony Lindgren , , Andrew Bresticker , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , From: Roger Quadros Message-ID: <55F013C1.9080400@ti.com> Date: Wed, 9 Sep 2015 14:10:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (adding back folks in cc) On 08/09/15 20:35, Alan Stern wrote: > On Tue, 8 Sep 2015, Roger Quadros wrote: > >>>> What if there is another architecture like so? >>>> >>>> C: >>>> [Parent] >>>> | >>>> | >>>> |------------------|--------------| >>>> [OTG core] [gadget] [host] >>>> >>>> We need a more flexible mechanism to link the gadget and >>>> host device to the otg core for non DT case. >>>> >>>> How about adding struct usb_otg parameter to usb_otg_register_hcd()? >>>> >>>> e.g. >>>> int usb_otg_register_hcd(struct usb_otg *otg, struct usb_hcd *hcd, ..) >>>> >>>> If otg is NULL it will try DT otg-controller property or parent to >>>> get the otg controller. >>> >>> This seems a lot like something Peter and I discussed recently. See >>> >>> http://marc.info/?l=linux-usb&m=143977568021328&w=2 >>> >>> and the following messages in that thread. >>> >> >> If I understood right, your proposal was to add a usb_pointers data >> struct to the device's drvdata? > > Right. > >> This is fine only if the otg/gadget/host share the same device. >> It does not solve the problem where each have different platform devices. > > Why not? Each of the platform devices can store a pointer to the same > usb_pointers structure. Wouldn't that be suitable? > I didn't understand how all of them get the reference to the same usb_pointer structure (or contents) when their respective platform devices get created so that they can store it in their respective drvdata. Worst case, the 3 devices could be totally independent of each other without a common parent, and get registered at different times. The common resource here is the physical USB port for which the 3 drivers otg/host/gadget are being registered. There should be a mechanism for each device to tell that it is part of this particular USB port. (or usb_pointers struct) cheers, -roger