All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Device tree support for AM35xx M-USB driver
@ 2015-10-23 15:42 Rolf Peukert
       [not found] ` <562A557B.4090501-cSCHQGRfioA@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Rolf Peukert @ 2015-10-23 15:42 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Tony Lindgren

The M-USB drivers glue code for AM35xx SOCs does not yet support device
trees.

In legacy kernels, it was left to the respective board_ file to set up
some necessary data structures before calling am35x_probe(). To support
initialization using a DT, this now needs to be done in am35x.c.

These data structures including a set of four pointers to CPU-specific
helper functions from the mach-omap2 directory.

Unfortunately those functions are only declared locally under
arch/arm/mach-omap2/, and they can not easily be moved over to am35x.c.
(While they just set a few bits in some system control module registers,
they call functions from control.c to access the SCM. These control.c
functions are also declared locally in mach-omap2 and not exported,
and use some static variables and several other local include files.)

So if we want these four functions to be accessible from the driver glue
code, their declarations have to be moved to the include/ hierarchy and
their names need to be exported. This makes it possible to use the am35x
M-USB driver as a kernel module.

The patch defines a new device 'compatible' name (am35x-musb) to
differentiate it from omap3-musb. It also adds clock name declarations
for interface and function clock to the device tree, so the am35x
glue code's clk_get() calls can find them.

Rolf Peukert (5):
  Make am35x helper function declarations accessible
  Export am35x helper functions
  Add device tree support for M-USB on AM35xx SOCs
  Use new MUSB device name in AM3517 device tree.
  Add some information about the new DT device name

 Documentation/devicetree/bindings/usb/omap-usb.txt | 35 +++++++++++
 arch/arm/boot/dts/am3517.dtsi                      |  4 +-
 arch/arm/mach-omap2/omap_phy_internal.c            |  4 ++
 arch/arm/mach-omap2/usb.h                          |  5 --
 drivers/usb/musb/am35x.c                           | 73
++++++++++++++++++++++
 include/linux/platform_data/usb-omap.h             |  5 ++
 6 files changed, 120 insertions(+), 6 deletions(-)

-- 
2.4.10
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] Make am35x helper function declarations accessible
       [not found] ` <562A557B.4090501-cSCHQGRfioA@public.gmane.org>
@ 2015-10-23 15:44   ` Rolf Peukert
  2015-10-23 15:46   ` [PATCH 2/5] Export am35x helper functions Rolf Peukert
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Rolf Peukert @ 2015-10-23 15:44 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Tony Lindgren

To be able to call these four helper functions from the M-USB AM35xx
glue code, their declarations need to be moved to a header file in the
kernels include hierarchy.

Signed-off-by: Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org>
---
 arch/arm/mach-omap2/usb.h              | 5 -----
 include/linux/platform_data/usb-omap.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
index 3395365..8b0cdf5 100644
--- a/arch/arm/mach-omap2/usb.h
+++ b/arch/arm/mach-omap2/usb.h
@@ -63,8 +63,3 @@ struct usbhs_phy_data {
 extern void usb_musb_init(struct omap_musb_board_data *board_data);
 extern void usbhs_init(struct usbhs_omap_platform_data *pdata);
 extern int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/5] Export am35x helper functions
       [not found] ` <562A557B.4090501-cSCHQGRfioA@public.gmane.org>
  2015-10-23 15:44   ` [PATCH 1/5] Make am35x helper function declarations accessible Rolf Peukert
@ 2015-10-23 15:46   ` Rolf Peukert
       [not found]     ` <562A5655.3000406-cSCHQGRfioA@public.gmane.org>
  2015-10-23 15:51   ` [PATCH 3/5] Add device tree support for M-USB on AM35xx SOCs Rolf Peukert
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Rolf Peukert @ 2015-10-23 15:46 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Tony Lindgren

To be able to call these four helper functions from a M-USB AM35x driver
module, their name symbols need to be exported.

Signed-off-by: Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org>
---
 arch/arm/mach-omap2/omap_phy_internal.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_phy_internal.c
b/arch/arm/mach-omap2/omap_phy_internal.c
index 8e90356..648a60f 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -82,6 +82,7 @@ void am35x_musb_reset(void)

 	regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
 }
+EXPORT_SYMBOL(am35x_musb_reset);

 void am35x_musb_phy_power(u8 on)
 {
@@ -120,6 +121,7 @@ void am35x_musb_phy_power(u8 on)
 		omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
 	}
 }
+EXPORT_SYMBOL(am35x_musb_phy_power);

 void am35x_musb_clear_irq(void)
 {
@@ -130,6 +132,7 @@ void am35x_musb_clear_irq(void)
 	omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
 	regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
 }
+EXPORT_SYMBOL(am35x_musb_clear_irq);

 void am35x_set_mode(u8 musb_mode)
 {
@@ -152,3 +155,4 @@ void am35x_set_mode(u8 musb_mode)

 	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
 }
+EXPORT_SYMBOL(am35x_set_mode);
-- 
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/5] Add device tree support for M-USB on AM35xx SOCs
       [not found] ` <562A557B.4090501-cSCHQGRfioA@public.gmane.org>
  2015-10-23 15:44   ` [PATCH 1/5] Make am35x helper function declarations accessible Rolf Peukert
  2015-10-23 15:46   ` [PATCH 2/5] Export am35x helper functions Rolf Peukert
@ 2015-10-23 15:51   ` Rolf Peukert
       [not found]     ` <562A5793.3020200-cSCHQGRfioA@public.gmane.org>
  2015-10-23 15:53   ` [PATCH 4/5] Use new MUSB device name in AM3517 device tree Rolf Peukert
  2015-10-23 15:57   ` [PATCH 5/5] Add information about the new DT device name Rolf Peukert
  4 siblings, 1 reply; 9+ messages in thread
From: Rolf Peukert @ 2015-10-23 15:51 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Tony Lindgren

Add a function that sets up necessary data structures. In older kernels
this was done in a board_ file. To support initialization via a DT, this
now needs to be included in the probe() function.
Also declare a new device 'compatible' name (am35x-musb) to
differentiate it from omap3-musb.

Signed-off-by: Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org>
---
 drivers/usb/musb/am35x.c | 73
++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index c41fe58..3c1477a 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -462,6 +462,59 @@ static const struct platform_device_info
am35x_dev_info = {
 	.dma_mask	= DMA_BIT_MASK(32),
 };

+static struct musb_hdrc_platform_data *am35x_get_config(
+	struct platform_device *pdev)
+{
+	struct musb_hdrc_platform_data *pdata;
+	struct omap_musb_board_data *bdata;
+	struct musb_hdrc_config *config;
+	struct device_node *np;
+	int val, ret;
+
+	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+	if (!pdata)
+		goto err_out;
+
+	bdata = devm_kzalloc(&pdev->dev, sizeof(*bdata), GFP_KERNEL);
+	if (!bdata)
+		goto err_pdata;
+
+	config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL);
+	if (!config)
+		goto err_bdata;
+
+	bdata->clear_irq = am35x_musb_clear_irq;
+	bdata->reset = am35x_musb_reset;
+	bdata->set_mode = am35x_set_mode;
+	bdata->set_phy_power = am35x_musb_phy_power;
+
+	pdata->board_data = bdata;
+	pdata->config = config;
+
+	/* Read settings from device tree */
+	np = pdev->dev.of_node;
+	if (np) {
+		of_property_read_u32(np, "mode", (u32 *)&pdata->mode);
+		of_property_read_u32(np, "interface-type",
+				(u32 *)&bdata->interface_type);
+		of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps);
+		of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits);
+		of_property_read_u32(np, "power", (u32 *)&pdata->power);
+
+		ret = of_property_read_u32(np, "multipoint", &val);
+		if (!ret && val)
+			config->multipoint = true;
+	}
+	return pdata;
+
+err_bdata:
+	devm_kfree(&pdev->dev, bdata);
+err_pdata:
+	devm_kfree(&pdev->dev, pdata);
+err_out:
+	return NULL;
+}
+
 static int am35x_probe(struct platform_device *pdev)
 {
 	struct musb_hdrc_platform_data	*pdata = dev_get_platdata(&pdev->dev);
@@ -479,6 +532,12 @@ static int am35x_probe(struct platform_device *pdev)
 		goto err0;
 	}

+	if (!pdata) {
+		pdata = am35x_get_config(pdev);
+		if (!pdata)
+			goto err1;
+	}
+
 	phy_clk = clk_get(&pdev->dev, "fck");
 	if (IS_ERR(phy_clk)) {
 		dev_err(&pdev->dev, "failed to get PHY clock\n");
@@ -548,6 +607,7 @@ err4:
 	clk_put(phy_clk);

 err3:
+err1:
 	kfree(glue);

 err0:
@@ -615,12 +675,25 @@ static int am35x_resume(struct device *dev)

 static SIMPLE_DEV_PM_OPS(am35x_pm_ops, am35x_suspend, am35x_resume);

+#ifdef CONFIG_OF
+static const struct of_device_id am35x_id_table[] = {
+	{
+		.compatible = "ti,am35x-musb"
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, am35x_id_table);
+#endif
+
 static struct platform_driver am35x_driver = {
 	.probe		= am35x_probe,
 	.remove		= am35x_remove,
 	.driver		= {
 		.name	= "musb-am35x",
 		.pm	= &am35x_pm_ops,
+#ifdef CONFIG_OF
+		.of_match_table = of_match_ptr(am35x_id_table),
+#endif
 	},
 };

-- 
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/5] Use new MUSB device name in AM3517 device tree.
       [not found] ` <562A557B.4090501-cSCHQGRfioA@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-10-23 15:51   ` [PATCH 3/5] Add device tree support for M-USB on AM35xx SOCs Rolf Peukert
@ 2015-10-23 15:53   ` Rolf Peukert
  2015-10-23 15:57   ` [PATCH 5/5] Add information about the new DT device name Rolf Peukert
  4 siblings, 0 replies; 9+ messages in thread
From: Rolf Peukert @ 2015-10-23 15:53 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Tony Lindgren

Use new MUSB device name in AM3517 device tree and add name declarations
for interface and function clock, so the am35x drivers clk_get() calls
can find them.

Signed-off-by: Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org>
---
 arch/arm/boot/dts/am3517.dtsi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
index 0b1c07f5..10838b5 100644
--- a/arch/arm/boot/dts/am3517.dtsi
+++ b/arch/arm/boot/dts/am3517.dtsi
@@ -17,9 +17,11 @@

 	ocp {
 		am35x_otg_hs: am35x_otg_hs@5c040000 {
-			compatible = "ti,omap3-musb";
+			compatible = "ti,am35x-musb";
 			ti,hwmods = "am35x_otg_hs";
 			status = "disabled";
+			clocks = <&hsotgusb_ick_am35xx>, <&hsotgusb_fck_am35xx>;
+			clock-names = "ick", "fck";
 			reg = <0x5c040000 0x1000>;
 			interrupts = <71>;
 			interrupt-names = "mc";
-- 
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/5] Add information about the new DT device name
       [not found] ` <562A557B.4090501-cSCHQGRfioA@public.gmane.org>
                     ` (3 preceding siblings ...)
  2015-10-23 15:53   ` [PATCH 4/5] Use new MUSB device name in AM3517 device tree Rolf Peukert
@ 2015-10-23 15:57   ` Rolf Peukert
       [not found]     ` <562A58DF.5020706-cSCHQGRfioA@public.gmane.org>
  4 siblings, 1 reply; 9+ messages in thread
From: Rolf Peukert @ 2015-10-23 15:57 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Tony Lindgren

Add some information about the new device name to the DT documentation.

Signed-off-by: Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org>
---
 Documentation/devicetree/bindings/usb/omap-usb.txt | 35
++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt
b/Documentation/devicetree/bindings/usb/omap-usb.txt
index 38d9bb8..cf98f61 100644
--- a/Documentation/devicetree/bindings/usb/omap-usb.txt
+++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
@@ -78,3 +78,38 @@ omap_dwc3 {
 	ranges;
 };

+AM35x MUSB GLUE
+ - compatible : Should be "ti,am35x-musb"
+ - ti,hwmods : must be "am35x_otg_hs"
+ - multipoint : Should be "1" indicating the musb controller supports
+   multipoint. This is a MUSB configuration-specific setting.
+ - num-eps : Specifies the number of endpoints. This is also a
+   MUSB configuration-specific setting. Should be set to "16"
+ - ram-bits : Specifies the ram address size. Should be set to "12"
+ - interface-type : Should be set to "1". (The AM35xx SOCs feature an
+   integrated phy, connected via UTMI+)
+ - mode : Should be "3" to represent OTG. "1" signifies HOST and "2"
+   represents PERIPHERAL.
+ - power : Should be "50". This signifies the controller can supply up to
+   100mA when operating in host mode.
+
+SOC specific device node entry
+am35x_otg_hs: am35x_otg_hs@5c040000 {
+	compatible = "ti,am35x-musb";
+	ti,hwmods = "am35x_otg_hs";
+	clocks = <&hsotgusb_ick_am35xx>, <&hsotgusb_fck_am35xx>;
+	clock-names = "ick", "fck";
+	reg = <0x5c040000 0x1000>;
+	interrupts = <71>;
+	interrupt-names = "mc";
+};
+
+Board specific device node entry
+&am35x_otg_hs {
+	mode = <1>;
+	interface-type = <1>;
+	multipoint = <1>;
+	num-eps = <16>;
+	ram-bits = <12>;
+	power = <50>;
+};
-- 
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 5/5] Add information about the new DT device name
       [not found]     ` <562A58DF.5020706-cSCHQGRfioA@public.gmane.org>
@ 2015-10-23 19:40       ` Sergei Shtylyov
  0 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2015-10-23 19:40 UTC (permalink / raw)
  To: Rolf Peukert, linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Tony Lindgren

Hello.

On 10/23/2015 06:57 PM, Rolf Peukert wrote:

> Add some information about the new device name to the DT documentation.
>
> Signed-off-by: Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org>
> ---
>   Documentation/devicetree/bindings/usb/omap-usb.txt | 35
> ++++++++++++++++++++++
>   1 file changed, 35 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt
> b/Documentation/devicetree/bindings/usb/omap-usb.txt
> index 38d9bb8..cf98f61 100644
> --- a/Documentation/devicetree/bindings/usb/omap-usb.txt
> +++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
> @@ -78,3 +78,38 @@ omap_dwc3 {
>   	ranges;
>   };
>
> +AM35x MUSB GLUE
> + - compatible : Should be "ti,am35x-musb"

    Wildcards in  "compatible" are not allowed; you should select a "least 
common denominator" model and use it.

> + - ti,hwmods : must be "am35x_otg_hs"
> + - multipoint : Should be "1" indicating the musb controller supports
> +   multipoint. This is a MUSB configuration-specific setting.

    Hm, I would think this should be boolean prop...

> + - num-eps : Specifies the number of endpoints. This is also a
> +   MUSB configuration-specific setting. Should be set to "16"
> + - ram-bits : Specifies the ram address size. Should be set to "12"
> + - interface-type : Should be set to "1". (The AM35xx SOCs feature an
> +   integrated phy, connected via UTMI+)

    Again, maybe boolean?

> + - mode : Should be "3" to represent OTG. "1" signifies HOST and "2"

    There's already standardized "dr_mode" prop for that.

> +   represents PERIPHERAL.
> + - power : Should be "50". This signifies the controller can supply up to
> +   100mA when operating in host mode.

    Why not just exparess it in mA?

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/5] Export am35x helper functions
       [not found]     ` <562A5655.3000406-cSCHQGRfioA@public.gmane.org>
@ 2015-10-24  1:28       ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2015-10-24  1:28 UTC (permalink / raw)
  To: Rolf Peukert
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi

* Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org> [151023 08:46]:
> To be able to call these four helper functions from a M-USB AM35x driver
> module, their name symbols need to be exported.

I'd rather get rid of this file completely.. How about just do a minimal
drivers/phy driver? Maybe take a look at the drivers/phy/phy-dm816x-usb.c
for an example. Then you probably want to use the musb_dsps.c driver if
possible instead of the legacy am35x.c :)

Regards,

Tony

> Signed-off-by: Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org>
> ---
>  arch/arm/mach-omap2/omap_phy_internal.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/omap_phy_internal.c
> b/arch/arm/mach-omap2/omap_phy_internal.c
> index 8e90356..648a60f 100644
> --- a/arch/arm/mach-omap2/omap_phy_internal.c
> +++ b/arch/arm/mach-omap2/omap_phy_internal.c
> @@ -82,6 +82,7 @@ void am35x_musb_reset(void)
> 
>  	regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
>  }
> +EXPORT_SYMBOL(am35x_musb_reset);
> 
>  void am35x_musb_phy_power(u8 on)
>  {
> @@ -120,6 +121,7 @@ void am35x_musb_phy_power(u8 on)
>  		omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
>  	}
>  }
> +EXPORT_SYMBOL(am35x_musb_phy_power);
> 
>  void am35x_musb_clear_irq(void)
>  {
> @@ -130,6 +132,7 @@ void am35x_musb_clear_irq(void)
>  	omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
>  	regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
>  }
> +EXPORT_SYMBOL(am35x_musb_clear_irq);
> 
>  void am35x_set_mode(u8 musb_mode)
>  {
> @@ -152,3 +155,4 @@ void am35x_set_mode(u8 musb_mode)
> 
>  	omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
>  }
> +EXPORT_SYMBOL(am35x_set_mode);
> -- 
> 2.4.10
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/5] Add device tree support for M-USB on AM35xx SOCs
       [not found]     ` <562A5793.3020200-cSCHQGRfioA@public.gmane.org>
@ 2015-10-28 12:58       ` Sergei Shtylyov
  0 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2015-10-28 12:58 UTC (permalink / raw)
  To: Rolf Peukert, linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Tony Lindgren

Hello.

On 10/23/2015 6:51 PM, Rolf Peukert wrote:

> Add a function that sets up necessary data structures. In older kernels
> this was done in a board_ file. To support initialization via a DT, this
> now needs to be included in the probe() function.
> Also declare a new device 'compatible' name (am35x-musb) to
> differentiate it from omap3-musb.
>
> Signed-off-by: Rolf Peukert <rolf.peukert-cSCHQGRfioA@public.gmane.org>
> ---
>   drivers/usb/musb/am35x.c | 73
> ++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 73 insertions(+)
>
> diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
> index c41fe58..3c1477a 100644
> --- a/drivers/usb/musb/am35x.c
> +++ b/drivers/usb/musb/am35x.c
> @@ -462,6 +462,59 @@ static const struct platform_device_info
> am35x_dev_info = {
>   	.dma_mask	= DMA_BIT_MASK(32),
>   };
>
> +static struct musb_hdrc_platform_data *am35x_get_config(
> +	struct platform_device *pdev)
> +{
[...]
> +	/* Read settings from device tree */
> +	np = pdev->dev.of_node;
> +	if (np) {
> +		of_property_read_u32(np, "mode", (u32 *)&pdata->mode);
> +		of_property_read_u32(np, "interface-type",
> +				(u32 *)&bdata->interface_type);
> +		of_property_read_u32(np, "num-eps", (u32 *)&config->num_eps);
> +		of_property_read_u32(np, "ram-bits", (u32 *)&config->ram_bits);
> +		of_property_read_u32(np, "power", (u32 *)&pdata->power);
> +
> +		ret = of_property_read_u32(np, "multipoint", &val);
> +		if (!ret && val)
> +			config->multipoint = true;

    These are common MUSB traits, so I think should be parsed by a generic 
function. If at all -- they might be determined from the "compatible" prop.

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-28 12:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-23 15:42 [PATCH 0/5] Device tree support for AM35xx M-USB driver Rolf Peukert
     [not found] ` <562A557B.4090501-cSCHQGRfioA@public.gmane.org>
2015-10-23 15:44   ` [PATCH 1/5] Make am35x helper function declarations accessible Rolf Peukert
2015-10-23 15:46   ` [PATCH 2/5] Export am35x helper functions Rolf Peukert
     [not found]     ` <562A5655.3000406-cSCHQGRfioA@public.gmane.org>
2015-10-24  1:28       ` Tony Lindgren
2015-10-23 15:51   ` [PATCH 3/5] Add device tree support for M-USB on AM35xx SOCs Rolf Peukert
     [not found]     ` <562A5793.3020200-cSCHQGRfioA@public.gmane.org>
2015-10-28 12:58       ` Sergei Shtylyov
2015-10-23 15:53   ` [PATCH 4/5] Use new MUSB device name in AM3517 device tree Rolf Peukert
2015-10-23 15:57   ` [PATCH 5/5] Add information about the new DT device name Rolf Peukert
     [not found]     ` <562A58DF.5020706-cSCHQGRfioA@public.gmane.org>
2015-10-23 19:40       ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.