From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 30 Oct 2015 18:07:04 +0100 Subject: [U-Boot] [PATCH v3] colibri_vf: Add board_usb_phy_mode function In-Reply-To: <8a41f98b787bf99c7bb5efec36f14a37@agner.ch> References: <3e44b4bdb032e372519551149dd09cba2973f2c0.1446112949.git.maitysanchayan@gmail.com> <201510301724.52271.marex@denx.de> <8a41f98b787bf99c7bb5efec36f14a37@agner.ch> Message-ID: <201510301807.05096.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday, October 30, 2015 at 05:26:25 PM, Stefan Agner wrote: > On 2015-10-30 09:24, Marek Vasut wrote: > > On Friday, October 30, 2015 at 05:12:54 PM, Stefan Agner wrote: > >> Hi All, > > > > Hi! > > > >> On 2015-10-30 05:26, Sanchayan Maity wrote: > >> > + > >> > +int board_usb_phy_mode(int port) > >> > +{ > >> > + switch (port) { > >> > + case 0: > >> > + return gpio_get_value(USB_CDET_GPIO); > >> > + break; > >> > + case 1: > >> > + return USB_INIT_HOST; > >> > + break; > >> > + default: > >> > + return USB_INIT_HOST; > >> > + break; > >> > >> One thing I would like to note in this whole discussion is that the old > >> setup is kind of the "default" role of each dual-role controller: The > >> boot ROM uses USB1 as client, the tower board uses this configuration > >> too... So maybe we could/should keep that default role at least in here? > > > > Well we cannot, since this is a custom board, right ? > > Ah sorry, the switch statement is enumerating the port numbers, hence > this default refers to ports > 2. Somehow read that the wrong way > around. Well, if it is not obvious to you, comment in the code is a good idea. Sanchayan, please add one. Best regards, Marek Vasut