From: Roger Quadros <rogerq@ti.com>
To: Peter Chen <peter.chen@freescale.com>
Cc: <stern@rowland.harvard.edu>, <balbi@ti.com>,
<gregkh@linuxfoundation.org>, <dan.j.williams@intel.com>,
<jun.li@freescale.com>, <mathias.nyman@linux.intel.com>,
<tony@atomide.com>, <Joao.Pinto@synopsys.com>,
<abrestic@chromium.org>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>
Subject: Re: [PATCH v4 04/13] otg-fsm: move usb_bus_start_enum into otg-fsm->ops
Date: Tue, 8 Sep 2015 11:24:04 +0300 [thread overview]
Message-ID: <55EE9B24.1090305@ti.com> (raw)
In-Reply-To: <20150908065424.GC7802@shlinux2>
On 08/09/15 09:54, Peter Chen wrote:
> On Mon, Sep 07, 2015 at 12:57:21PM +0300, Roger Quadros wrote:
>> On 07/09/15 04:24, Peter Chen wrote:
>>> On Mon, Aug 24, 2015 at 04:21:15PM +0300, Roger Quadros wrote:
>>>> This is to prevent missing symbol build error if OTG is
>>>> enabled (built-in) and HCD core (CONFIG_USB) is module.
>>>>
>>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>>> Acked-by: Peter Chen <peter.chen@freescale.com>
>>>> ---
>>>> drivers/usb/common/usb-otg-fsm.c | 6 ++++--
>>>> drivers/usb/phy/phy-fsl-usb.c | 2 ++
>>>> include/linux/usb/otg-fsm.h | 1 +
>>>> 3 files changed, 7 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
>>>> index a46f29a..6e56c8c 100644
>>>> --- a/drivers/usb/common/usb-otg-fsm.c
>>>> +++ b/drivers/usb/common/usb-otg-fsm.c
>>>> @@ -165,8 +165,10 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
>>>> otg_loc_conn(fsm, 0);
>>>> otg_loc_sof(fsm, 1);
>>>> otg_set_protocol(fsm, PROTO_HOST);
>>>> - usb_bus_start_enum(fsm->otg->host,
>>>> - fsm->otg->host->otg_port);usb_bus_start_enum
>>>> + if (fsm->ops->start_enum) {
>>>> + fsm->ops->start_enum(fsm->otg->host,
>>>> + fsm->otg->host->otg_port);
>>>> + }
>>>> break;
>>>> case OTG_STATE_A_IDLE:
>>>> otg_drv_vbus(fsm, 0);
>>>> diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
>>>> index ee3f2c2..19541ed 100644
>>>> --- a/drivers/usb/phy/phy-fsl-usb.c
>>>> +++ b/drivers/usb/phy/phy-fsl-usb.c
>>>> @@ -783,6 +783,8 @@ static struct otg_fsm_ops fsl_otg_ops = {
>>>>
>>>> .start_host = fsl_otg_start_host,
>>>> .start_gadget = fsl_otg_start_gadget,
>>>> +
>>>> + .start_enum = usb_bus_start_enum,
>>>> };
>>>>
>>>> /* Initialize the global variable fsl_otg_dev and request IRQ for OTG */
>>>> diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h
>>>> index 672551c..75e82cc 100644
>>>> --- a/include/linux/usb/otg-fsm.h
>>>> +++ b/include/linux/usb/otg-fsm.h
>>>> @@ -199,6 +199,7 @@ struct otg_fsm_ops {
>>>> void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
>>>> int (*start_host)(struct otg_fsm *fsm, int on);
>>>> int (*start_gadget)(struct otg_fsm *fsm, int on);
>>>> + int (*start_enum)(struct usb_bus *bus, unsigned port_num);
>>>> };
>>>>
>>>>
>>>
>>> Get one build warning:
>>>
>>> In file included from /u/home/b29397/work/projects/usb/drivers/usb/chipidea/udc.c:23:0:
>>> /u/home/b29397/work/projects/usb/include/linux/usb/otg-fsm.h:207:27: warning: 'struct usb_bus' declared inside parameter list
>>> int (*start_enum)(struct usb_bus *bus, unsigned port_num);
>>> ^
>>> /u/home/b29397/work/projects/usb/include/linux/usb/otg-fsm.h:207:27: warning: its scope is only this definition or declaration, which is probably not what you want
>>>
>>> It probably dues to we should not have struct usb_bus* at udc driver
>>>
>> How about changing it to struct otg_fsm instead like the other APIs?
>> And do we leave usb_bus_start_enum() as it is?
>>
>
> You have defined struct otg_hcd_ops to let otg visit hcd stuff, how
> about move this to otg_hcd_ops?
Yes, this is a better idea. Thanks.
cheers,
-roger
next prev parent reply other threads:[~2015-09-08 8:24 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 13:21 [PATCH v4 00/13] USB: OTG/DRD Core functionality Roger Quadros
2015-08-24 13:21 ` [PATCH v4 01/13] usb: otg-fsm: Add documentation for struct otg_fsm Roger Quadros
2015-08-24 13:21 ` [PATCH v4 02/13] usb: otg-fsm: support multiple instances Roger Quadros
2015-09-06 5:52 ` Peter Chen
2015-08-24 13:21 ` [PATCH v4 03/13] usb: otg-fsm: Prevent build warning "VDBG" redefined Roger Quadros
2015-08-24 13:21 ` [PATCH v4 04/13] otg-fsm: move usb_bus_start_enum into otg-fsm->ops Roger Quadros
2015-09-07 1:24 ` Peter Chen
2015-09-07 9:57 ` Roger Quadros
2015-09-08 6:54 ` Peter Chen
2015-09-08 8:24 ` Roger Quadros [this message]
2015-08-24 13:21 ` [PATCH v4 05/13] usb: hcd.h: Add OTG to HCD interface Roger Quadros
2015-08-24 13:21 ` [PATCH v4 06/13] usb: gadget.h: Add OTG to gadget interface Roger Quadros
2015-08-24 13:21 ` [PATCH v4 07/13] usb: otg: add OTG core Roger Quadros
2015-09-07 1:23 ` Peter Chen
2015-09-07 10:23 ` Roger Quadros
2015-09-08 8:31 ` Peter Chen
2015-09-08 12:25 ` Roger Quadros
2015-09-08 14:34 ` Alan Stern
2015-09-08 17:29 ` Roger Quadros
2015-09-09 2:21 ` Peter Chen
2015-09-09 9:08 ` Roger Quadros
2015-09-09 8:13 ` Peter Chen
2015-09-09 9:33 ` Roger Quadros
2015-09-09 8:45 ` Peter Chen
2015-09-09 10:21 ` Roger Quadros
2015-09-10 5:35 ` Peter Chen
2015-09-10 14:17 ` Roger Quadros
2015-09-11 1:50 ` Peter Chen
2015-09-07 7:40 ` Li Jun
2015-09-07 10:53 ` Roger Quadros
2015-09-09 6:20 ` Li Jun
2015-09-09 10:01 ` Roger Quadros
2015-09-10 9:28 ` Li Jun
2015-09-10 14:14 ` Roger Quadros
2015-08-24 13:21 ` [PATCH v4 08/13] usb: doc: dt-binding: Add otg-controller property Roger Quadros
2015-08-24 13:21 ` [PATCH v4 09/13] usb: chipidea: move from CONFIG_USB_OTG_FSM to CONFIG_USB_OTG Roger Quadros
2015-08-24 13:21 ` [PATCH v4 10/13] usb: hcd: Adapt to OTG core Roger Quadros
2015-09-09 2:23 ` Peter Chen
2015-09-09 9:39 ` Roger Quadros
2015-08-24 13:21 ` [PATCH v4 11/13] usb: core: hub: Notify OTG fsm when A device sets b_hnp_enable Roger Quadros
2015-08-24 13:21 ` [PATCH v4 12/13] usb: gadget: udc: adapt to OTG core Roger Quadros
2015-08-24 13:21 ` [PATCH v4 13/13] usb: otg: Add dual-role device (DRD) support Roger Quadros
2015-09-07 7:53 ` Li Jun
2015-09-07 9:51 ` Roger Quadros
2015-08-26 6:19 ` [PATCH v4 00/13] USB: OTG/DRD Core functionality Peter Chen
2015-09-06 7:06 ` Peter Chen
2015-09-07 11:42 ` Roger Quadros
2015-12-03 8:19 ` Peter Chen
2015-12-03 8:54 ` Roger Quadros
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55EE9B24.1090305@ti.com \
--to=rogerq@ti.com \
--cc=Joao.Pinto@synopsys.com \
--cc=abrestic@chromium.org \
--cc=balbi@ti.com \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jun.li@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=peter.chen@freescale.com \
--cc=stern@rowland.harvard.edu \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome