Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1417110 > unrolled thread
| Started by | Roger Quadros <rogerq@ti.com> |
|---|---|
| First post | 2016-06-08 11:10 +0200 |
| Last post | 2016-06-09 09:30 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v9 12/14] usb: hcd: Adapt to OTG core Roger Quadros <rogerq@ti.com> - 2016-06-08 11:10 +0200
Re: [PATCH v9 12/14] usb: hcd: Adapt to OTG core Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-08 13:50 +0200
Re: [PATCH v9 12/14] usb: hcd: Adapt to OTG core Roger Quadros <rogerq@ti.com> - 2016-06-08 14:10 +0200
Re: [PATCH v9 12/14] usb: hcd: Adapt to OTG core Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-06-08 14:20 +0200
Re: [PATCH v9 12/14] usb: hcd: Adapt to OTG core Roger Quadros <rogerq@ti.com> - 2016-06-09 09:30 +0200
| From | Roger Quadros <rogerq@ti.com> |
|---|---|
| Date | 2016-06-08 11:10 +0200 |
| Subject | [PATCH v9 12/14] usb: hcd: Adapt to OTG core |
| Message-ID | <rHHER-6Fd-7@gated-at.bofh.it> |
Introduce usb_otg_add/remove_hcd() for use by host
controllers that are part of OTG/dual-role port.
Non Device tree platforms can use the otg_dev argument
to specify the OTG controller device. If otg_dev is NULL
then the device tree node's otg-controller property is used to
get the otg_dev device.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
---
drivers/usb/core/hcd.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/usb/hcd.h | 4 ++++
2 files changed, 59 insertions(+)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index ae6c76d..c6f4155 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -46,6 +46,11 @@
#include <linux/usb.h>
#include <linux/usb/hcd.h>
#include <linux/usb/phy.h>
+#include <linux/usb/otg.h>
+#include <linux/usb/of.h>
+
+#include <linux/of.h>
+#include <linux/of_platform.h>
#include "usb.h"
@@ -3025,6 +3030,56 @@ void usb_remove_hcd(struct usb_hcd *hcd)
}
EXPORT_SYMBOL_GPL(usb_remove_hcd);
+static struct otg_hcd_ops otg_hcd_intf = {
+ .add = usb_add_hcd,
+ .remove = usb_remove_hcd,
+ .usb_bus_start_enum = usb_bus_start_enum,
+ .usb_control_msg = usb_control_msg,
+ .usb_hub_find_child = usb_hub_find_child,
+};
+
+/**
+ * usb_otg_add_hcd - Register the HCD with OTG core.
+ * @hcd: the usb_hcd structure to initialize
+ * @irqnum: Interrupt line to allocate
+ * @irqflags: Interrupt type flags
+ * @otg_dev: OTG controller device managing this HCD
+ *
+ * Registers the HCD with OTG core. OTG core will call usb_add_hcd()
+ * or usb_remove_hcd() as necessary.
+ * If otg_dev is NULL then device tree node is checked for OTG
+ * controller device via the otg-controller property.
+ */
+int usb_otg_add_hcd(struct usb_hcd *hcd,
+ unsigned int irqnum, unsigned long irqflags,
+ struct device *otg_dev)
+{
+ struct device *dev = hcd->self.controller;
+
+ if (!otg_dev) {
+ hcd->otg_dev = of_usb_get_otg(dev->of_node);
+ if (!hcd->otg_dev)
+ return -ENODEV;
+ } else {
+ hcd->otg_dev = otg_dev;
+ }
+
+ return usb_otg_register_hcd(hcd, irqnum, irqflags, &otg_hcd_intf);
+}
+EXPORT_SYMBOL_GPL(usb_otg_add_hcd);
+
+/**
+ * usb_otg_remove_hcd - Unregister the HCD with OTG core.
+ * @hcd: the usb_hcd structure to remove
+ *
+ * Unregisters the HCD from the OTG core.
+ */
+void usb_otg_remove_hcd(struct usb_hcd *hcd)
+{
+ usb_otg_unregister_hcd(hcd);
+}
+EXPORT_SYMBOL_GPL(usb_otg_remove_hcd);
+
void
usb_hcd_platform_shutdown(struct platform_device *dev)
{
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 845c761..2331b48 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -473,6 +473,10 @@ extern int usb_hcd_is_primary_hcd(struct usb_hcd *hcd);
extern int usb_add_hcd(struct usb_hcd *hcd,
unsigned int irqnum, unsigned long irqflags);
extern void usb_remove_hcd(struct usb_hcd *hcd);
+extern int usb_otg_add_hcd(struct usb_hcd *hcd,
+ unsigned int irqnum, unsigned long irqflags,
+ struct device *otg_dev);
+extern void usb_otg_remove_hcd(struct usb_hcd *hcd);
extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1);
struct platform_device;
--
2.7.4
[toc] | [next] | [standalone]
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Date | 2016-06-08 13:50 +0200 |
| Message-ID | <rHK9H-83E-5@gated-at.bofh.it> |
| In reply to | #1417110 |
On 6/8/2016 12:03 PM, Roger Quadros wrote:
> Introduce usb_otg_add/remove_hcd() for use by host
> controllers that are part of OTG/dual-role port.
>
> Non Device tree platforms can use the otg_dev argument
> to specify the OTG controller device. If otg_dev is NULL
> then the device tree node's otg-controller property is used to
> get the otg_dev device.
>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Acked-by: Peter Chen <peter.chen@nxp.com>
> ---
> drivers/usb/core/hcd.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/usb/hcd.h | 4 ++++
> 2 files changed, 59 insertions(+)
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index ae6c76d..c6f4155 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
[...]
> @@ -3025,6 +3030,56 @@ void usb_remove_hcd(struct usb_hcd *hcd)
> }
> EXPORT_SYMBOL_GPL(usb_remove_hcd);
>
> +static struct otg_hcd_ops otg_hcd_intf = {
> + .add = usb_add_hcd,
> + .remove = usb_remove_hcd,
> + .usb_bus_start_enum = usb_bus_start_enum,
> + .usb_control_msg = usb_control_msg,
> + .usb_hub_find_child = usb_hub_find_child,
> +};
> +
> +/**
> + * usb_otg_add_hcd - Register the HCD with OTG core.
> + * @hcd: the usb_hcd structure to initialize
> + * @irqnum: Interrupt line to allocate
> + * @irqflags: Interrupt type flags
> + * @otg_dev: OTG controller device managing this HCD
Device managing a driver? That's interesting. :-)
[...]
MBR, Sergei
[toc] | [prev] | [next] | [standalone]
| From | Roger Quadros <rogerq@ti.com> |
|---|---|
| Date | 2016-06-08 14:10 +0200 |
| Message-ID | <rHKt4-8pd-23@gated-at.bofh.it> |
| In reply to | #1417320 |
On 08/06/16 14:42, Sergei Shtylyov wrote:
> On 6/8/2016 12:03 PM, Roger Quadros wrote:
>
>> Introduce usb_otg_add/remove_hcd() for use by host
>> controllers that are part of OTG/dual-role port.
>>
>> Non Device tree platforms can use the otg_dev argument
>> to specify the OTG controller device. If otg_dev is NULL
>> then the device tree node's otg-controller property is used to
>> get the otg_dev device.
>>
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>> Acked-by: Peter Chen <peter.chen@nxp.com>
>> ---
>> drivers/usb/core/hcd.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
>> include/linux/usb/hcd.h | 4 ++++
>> 2 files changed, 59 insertions(+)
>>
>> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
>> index ae6c76d..c6f4155 100644
>> --- a/drivers/usb/core/hcd.c
>> +++ b/drivers/usb/core/hcd.c
> [...]
>> @@ -3025,6 +3030,56 @@ void usb_remove_hcd(struct usb_hcd *hcd)
>> }
>> EXPORT_SYMBOL_GPL(usb_remove_hcd);
>>
>> +static struct otg_hcd_ops otg_hcd_intf = {
>> + .add = usb_add_hcd,
>> + .remove = usb_remove_hcd,
>> + .usb_bus_start_enum = usb_bus_start_enum,
>> + .usb_control_msg = usb_control_msg,
>> + .usb_hub_find_child = usb_hub_find_child,
>> +};
>> +
>> +/**
>> + * usb_otg_add_hcd - Register the HCD with OTG core.
>> + * @hcd: the usb_hcd structure to initialize
>> + * @irqnum: Interrupt line to allocate
>> + * @irqflags: Interrupt type flags
>> + * @otg_dev: OTG controller device managing this HCD
>
> Device managing a driver? That's interesting. :-)
Well it is the OTG controller instance really.
How else do you want me to write it?
cheers,
-roger
[toc] | [prev] | [next] | [standalone]
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Date | 2016-06-08 14:20 +0200 |
| Message-ID | <rHKCK-8sB-39@gated-at.bofh.it> |
| In reply to | #1417339 |
On 6/8/2016 3:06 PM, Roger Quadros wrote:
>>> Introduce usb_otg_add/remove_hcd() for use by host
>>> controllers that are part of OTG/dual-role port.
>>>
>>> Non Device tree platforms can use the otg_dev argument
>>> to specify the OTG controller device. If otg_dev is NULL
>>> then the device tree node's otg-controller property is used to
>>> get the otg_dev device.
>>>
>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>> Acked-by: Peter Chen <peter.chen@nxp.com>
>>> ---
>>> drivers/usb/core/hcd.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
>>> include/linux/usb/hcd.h | 4 ++++
>>> 2 files changed, 59 insertions(+)
>>>
>>> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
>>> index ae6c76d..c6f4155 100644
>>> --- a/drivers/usb/core/hcd.c
>>> +++ b/drivers/usb/core/hcd.c
>> [...]
>>> @@ -3025,6 +3030,56 @@ void usb_remove_hcd(struct usb_hcd *hcd)
>>> }
>>> EXPORT_SYMBOL_GPL(usb_remove_hcd);
>>>
>>> +static struct otg_hcd_ops otg_hcd_intf = {
>>> + .add = usb_add_hcd,
>>> + .remove = usb_remove_hcd,
>>> + .usb_bus_start_enum = usb_bus_start_enum,
>>> + .usb_control_msg = usb_control_msg,
>>> + .usb_hub_find_child = usb_hub_find_child,
>>> +};
>>> +
>>> +/**
>>> + * usb_otg_add_hcd - Register the HCD with OTG core.
>>> + * @hcd: the usb_hcd structure to initialize
>>> + * @irqnum: Interrupt line to allocate
>>> + * @irqflags: Interrupt type flags
>>> + * @otg_dev: OTG controller device managing this HCD
>>
>> Device managing a driver? That's interesting. :-)
>
> Well it is the OTG controller instance really.
> How else do you want me to write it?
Just HC again? Or maybe HCI (HC interface)?
> cheers,
> -roger
MBR, Sergei
[toc] | [prev] | [next] | [standalone]
| From | Roger Quadros <rogerq@ti.com> |
|---|---|
| Date | 2016-06-09 09:30 +0200 |
| Message-ID | <rI2zE-3dZ-19@gated-at.bofh.it> |
| In reply to | #1417350 |
On 08/06/16 15:11, Sergei Shtylyov wrote:
> On 6/8/2016 3:06 PM, Roger Quadros wrote:
>
>>>> Introduce usb_otg_add/remove_hcd() for use by host
>>>> controllers that are part of OTG/dual-role port.
>>>>
>>>> Non Device tree platforms can use the otg_dev argument
>>>> to specify the OTG controller device. If otg_dev is NULL
>>>> then the device tree node's otg-controller property is used to
>>>> get the otg_dev device.
>>>>
>>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>>> Acked-by: Peter Chen <peter.chen@nxp.com>
>>>> ---
>>>> drivers/usb/core/hcd.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
>>>> include/linux/usb/hcd.h | 4 ++++
>>>> 2 files changed, 59 insertions(+)
>>>>
>>>> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
>>>> index ae6c76d..c6f4155 100644
>>>> --- a/drivers/usb/core/hcd.c
>>>> +++ b/drivers/usb/core/hcd.c
>>> [...]
>>>> @@ -3025,6 +3030,56 @@ void usb_remove_hcd(struct usb_hcd *hcd)
>>>> }
>>>> EXPORT_SYMBOL_GPL(usb_remove_hcd);
>>>>
>>>> +static struct otg_hcd_ops otg_hcd_intf = {
>>>> + .add = usb_add_hcd,
>>>> + .remove = usb_remove_hcd,
>>>> + .usb_bus_start_enum = usb_bus_start_enum,
>>>> + .usb_control_msg = usb_control_msg,
>>>> + .usb_hub_find_child = usb_hub_find_child,
>>>> +};
>>>> +
>>>> +/**
>>>> + * usb_otg_add_hcd - Register the HCD with OTG core.
>>>> + * @hcd: the usb_hcd structure to initialize
>>>> + * @irqnum: Interrupt line to allocate
>>>> + * @irqflags: Interrupt type flags
>>>> + * @otg_dev: OTG controller device managing this HCD
>>>
>>> Device managing a driver? That's interesting. :-)
>>
>> Well it is the OTG controller instance really.
>> How else do you want me to write it?
>
> Just HC again? Or maybe HCI (HC interface)?
In my entire series HCD has always meant Host Controller Device.
I think I'll leave it the way it is.
cheers,
-roger
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web