omap: musb: Add device tree support
Subsystems (8)
v2 cover omap: musb: Add device tree support
This patch series adds device tree support for MUSB.
The glue layer is now made to write to mailbox register (present in control module) instead of calling phy layer to write to mailbox register. Writing to mailbox register notifies the core of events like device connect/disconnect.
Changes from v1:
* Added a comment in hwmod data to remove the control module data from otg_hs once control driver is in place.
* Fixed the omap-usb Documentation to the correct compatible value (Should be "ti,omap4-musb" or "ti,omap3-musb")
Previously these patches were part of [PATCH v7 0/7] omap: musb: Add device tree support
This patch series was created to contain only the *musb* part and it also has one hwmod patch.
This patch series was created ongit://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git musb
Kishon Vijay Abraham I (3):
arm: omap: hwmod: add a new addr space in otg for writing to control
module
usb: musb: omap: write directly to mailbox instead of using phy
usb: musb: omap: Add device tree support for omap musb glue
Documentation/devicetree/bindings/usb/omap-usb.txt | 33 ++++++ arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 6 ++ drivers/usb/musb/omap2430.c | 106 ++++++++++++++++++-- drivers/usb/musb/omap2430.h | 9 ++ 4 files changed, 147 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/omap-usb.txt
Signature · 1 line
1.7.9.5
PATCH v2 1/3 arm: omap: hwmod: add a new addr space in otg for writing to control module
The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.
Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to usb_otg_hs.
--- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +6 -0
@@ -5890,6 +5890,12 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { .pa_end = 0x4a0ab003, .flags = ADDR_TYPE_RT }, + { +/* XXX: Remove this once control module driver is in place */ + .pa_start = 0x4a00233c, + .pa_end = 0x4a00233f, + .flags = ADDR_TYPE_RT + }, { } };
Signature · 1 line
1.7.9.5
PATCH v2 2/3 usb: musb: omap: write directly to mailbox instead of using phy
In reply to Kishon Vijay Abraham IThe glue layer should directly write to mailbox register (present in control module) instead of calling phy layer to write to mailbox register. Writing to mailbox register notifies the core of events like device connect/disconnect.
Currently writing to control module register is taken care in this driver which will be removed once the control module driver is in place.
--- drivers/usb/musb/omap2430.c | 52 +++++++++++++++++++++++++++++++++++++------ drivers/usb/musb/omap2430.h | 9 ++++++++ 2 files changed, 54 insertions(+), 7 deletions(-)
drivers/usb/musb/omap2430.c +45 -7
@@ -45,6 +45,7 @@ struct omap2430_glue {struct platform_device *musb;enum omap_musb_vbus_id_status status;struct work_struct omap_musb_mailbox_work; +u32 __iomem *control_otghs; };#define glue_to_musb (g) platform_get_drvdata(g->musb)
@@ -52,6 +53,26 @@ struct omap2430_glue *_glue;static struct timer_list musb_idle_timer; +/** +* omap4_usb_phy_mailbox - write to usb otg mailbox +* @glue: struct omap2430_glue * +* @val: the value to be written to the mailbox +* +* On detection of a device (ID pin is grounded), this API should be called +* to set AVALID, VBUSVALID and ID pin is grounded. +* +* When OMAP is connected to a host (OMAP in device mode), this API +* is called to set AVALID, VBUSVALID and ID pin in high impedance. +* +* XXX: This function will be removed once we have a seperate driver for +* control module +*/ +static void omap4_usb_phy_mailbox (struct omap2430_glue *glue,u32 val) +{ +if (glue->control_otghs) +writel (val, glue->control_otghs); +} +static void musb_do_idle (unsigned long _musb) {struct musb *musb = (void *)_musb;
@@ -247,6 +268,7 @@ EXPORT_SYMBOL_GPL(omap_musb_mailbox);static void omap_musb_set_mailbox (struct omap2430_glue *glue) { +u32 val;struct musb *musb =glue_to_musb (glue);struct device *dev = musb->controller;struct musb_hdrc_platform_data *pdata = dev->platform_data;
@@ -262,7 +284,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) musb->xceiv->last_event =USB_EVENT_ID ;if (musb->gadget_driver) {pm_runtime_get_sync (dev); -usb_phy_init (musb->xceiv); + val =AVALID |VBUSVALID ; +omap4_usb_phy_mailbox (glue, val);omap2430_musb_set_vbus (musb,1 ); }break ;
@@ -275,7 +298,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) musb->xceiv->last_event =USB_EVENT_VBUS ;if (musb->gadget_driver)pm_runtime_get_sync (dev); -usb_phy_init (musb->xceiv); + val =IDDIG |AVALID |VBUSVALID ; +omap4_usb_phy_mailbox (glue, val);break ;case OMAP_MUSB_ID_FLOAT :
@@ -292,7 +316,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)if (musb->xceiv->otg->set_vbus)otg_set_vbus (musb->xceiv->otg,0 ); } -usb_phy_shutdown (musb->xceiv); + val =SESSEND |IDDIG ; +omap4_usb_phy_mailbox (glue, val);break ;default :dev_dbg (dev,"ID float\n" );
@@ -367,6 +392,7 @@ err1:static void omap2430_musb_enable (struct musb *musb) {u8 devctl; +u32 val;unsigned long timeout = jiffies +msecs_to_jiffies (1000 );struct device *dev = musb->controller;struct omap2430_glue *glue =dev_get_drvdata (dev->parent);
@@ -376,7 +402,8 @@ static void omap2430_musb_enable(struct musb *musb)switch (glue->status) {case OMAP_MUSB_ID_GROUND : -usb_phy_init (musb->xceiv); + val =AVALID |VBUSVALID ; +omap4_usb_phy_mailbox (glue, val);if (data->interface_type !=MUSB_INTERFACE_UTMI )break ; devctl =musb_readb (musb->mregs,MUSB_DEVCTL );
@@ -395,7 +422,8 @@ static void omap2430_musb_enable(struct musb *musb)break ;case OMAP_MUSB_VBUS_VALID : -usb_phy_init (musb->xceiv); + val =IDDIG |AVALID |VBUSVALID ; +omap4_usb_phy_mailbox (glue, val);break ;default :
@@ -405,11 +433,14 @@ static void omap2430_musb_enable(struct musb *musb)static void omap2430_musb_disable (struct musb *musb) { +u32 val;struct device *dev = musb->controller;struct omap2430_glue *glue =dev_get_drvdata (dev->parent); -if (glue->status !=OMAP_MUSB_UNKNOWN ) -usb_phy_shutdown (musb->xceiv); +if (glue->status !=OMAP_MUSB_UNKNOWN ) { + val =SESSEND |IDDIG ; +omap4_usb_phy_mailbox (glue, val); + } }static int omap2430_musb_exit (struct musb *musb)
@@ -441,6 +472,7 @@ static int __devinit omap2430_probe(struct platform_device *pdev)struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;struct platform_device *musb;struct omap2430_glue *glue; +struct resource *res;int ret = -ENOMEM ; glue =devm_kzalloc (&pdev->dev,sizeof (*glue),GFP_KERNEL );
@@ -463,6 +495,12 @@ static int __devinit omap2430_probe(struct platform_device *pdev) glue->musb = musb; glue->status =OMAP_MUSB_UNKNOWN ; + res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); + + glue->control_otghs =devm_request_and_ioremap (&pdev->dev, res); +if (glue->control_otghs ==NULL ) +dev_dbg (&pdev->dev,"Failed to obtain control memory\n" ); + pdata->platform_ops = &omap2430_ops;platform_set_drvdata (pdev, glue);
drivers/usb/musb/omap2430.h +9 -0
@@ -49,4 +49,13 @@#define OTG_FORCESTDBY 0x414# define ENABLEFORCE (1 << 0) +/* +* Control Module bit definitions +* XXX: Will be removed once we have a driver for control module. +*/ +#define AVALID BIT(0) +#define BVALID BIT(1) +#define VBUSVALID BIT(2) +#define SESSEND BIT(3) +#define IDDIG BIT(4)#endif /* __MUSB_OMAP243X_H__ */
Signature · 1 line
1.7.9.5
PATCH v2 3/3 usb: musb: omap: Add device tree support for omap musb glue
In reply to Kishon Vijay Abraham IAdded device tree support for omap musb driver and updated the Documentation with device tree binding information.
--- Documentation/devicetree/bindings/usb/omap-usb.txt | 33 ++++++++++++ drivers/usb/musb/omap2430.c | 54 ++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/omap-usb.txt
Documentation/devicetree/bindings/usb/omap-usb.txt new file +33 -0
@@ -0,0 +1,33 @@ +OMAP GLUE + +OMAP MUSB GLUE + - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb" + - ti,hwmods : must be "usb_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 : This is a board specific setting to describe the type of + interface between the controller and the phy. It should be "0" or "1" + specifying ULPI and UTMI respectively. + - mode : Should be "3" to represent OTG. "1" signifies HOST and "2" + represents PERIPHERAL. + - power : Should be "50". This signifies the controller can supply upto + 100mA when operating in host mode. + +SOC specific device node entry +usb_otg_hs: usb_otg_hs at 4a0ab000 { + compatible = "ti,omap4-musb"; + ti,hwmods = "usb_otg_hs"; + multipoint = <1>; + num_eps = <16>; + ram_bits = <12>; +}; + +Board specific device node entry +&usb_otg_hs { + interface_type = <1>; + mode = <3>; + power = <50>; +};
drivers/usb/musb/omap2430.c +54 -0
86 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Re: [PATCH v2 1/3] arm: omap: hwmod: add a new addr space in otg for writing to control module
In reply to Kishon Vijay Abraham IQuoted 10 lines · Kishon Vijay Abraham I
The mailbox register for usb otg in omap is present in control module. On detection of any events VBUS or ID, this register should be written to send the notification to musb core.
Till we have a separate control module driver to write to control module, omap2430 will handle the register writes to control module by itself. So a new address space to represent this control module register is added to
usb_otg_hs.Signed-off-by Kishon Vijay Abraham I <[email protected]>
Quoted 22 lines
--- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm/mach-omap2/omap_hwmod_44xx_data.c +6
-0@@ -5890,6 +5890,12 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { .pa_end = 0x4a0ab003, .flags = ADDR_TYPE_RT }, + { +/* XXX: Remove this once control module driver is in place */ + .pa_start = 0x4a00233c, + .pa_end = 0x4a00233f, + .flags = ADDR_TYPE_RT + }, { } };
Re: [PATCH v2 3/3] usb: musb: omap: Add device tree support for omap musb glue
In reply to Kishon Vijay Abraham IQuoted 32 lines · Kishon Vijay Abraham I
Added device tree support for omap musb driver and updated the Documentation with device tree binding information.
Signed-off-by Kishon Vijay Abraham I <[email protected]>--- Documentation/devicetree/bindings/usb/omap-usb.txt | 33 ++++++++++++ drivers/usb/musb/omap2430.c | 54 ++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/omap-usb.txtDocumentation/devicetree/bindings/usb/omap-usb.txt new file +16
-0@@ -0,0 +1,33 @@ +OMAP GLUE + +OMAP MUSB GLUE + - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb" + - ti,hwmods : must be "usb_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 : This is a board specific setting to describe the type of + interface between the controller and the phy. It should be "0" or "1" + specifying ULPI and UTMI respectively. + - mode : Should be "3" to represent OTG. "1" signifies HOST and "2" + represents PERIPHERAL. + - power : Should be "50". This signifies the controller can supply upto
Documentation/devicetree/bindings/usb/omap-usb.txt line 26
Quoted 10 lines
Documentation/devicetree/bindings/usb/omap-usb.txt new file +10
-0+ 100mA when operating in host mode. + +SOC specific device node entry +usb_otg_hs: usb_otg_hs at 4a0ab000 { + compatible = "ti,omap4-musb"; + ti,hwmods = "usb_otg_hs"; + multipoint = <1>; + num_eps = <16>; + ram_bits = <12>; +};
reg and interrupt properties are missing here.
I would encourage to specify "reg" and "interrupt" properties in every node getting newly added to the OMAP DTS files.
Thanks,
Vaibhav
Quoted 102 lines
Documentation/devicetree/bindings/usb/omap-usb.txt new file +7
-0+ +Board specific device node entry +&usb_otg_hs { + interface_type = <1>; + mode = <3>; + power = <50>; +};drivers/usb/musb/omap2430.c +54
-0@@ -30,6 +30,7 @@#include <linux/init.h> #include <linux/list.h> #include <linux/io.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <linux/pm_runtime.h> @@ -470,8 +471,11 @@ static u64 omap2430_dmamask = DMA_BIT_MASK(32);static int __devinit omap2430_probe (struct platform_device *pdev) {struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; +struct omap_musb_board_data *data;struct platform_device *musb;struct omap2430_glue *glue; +struct device_node *np = pdev->dev.of_node; +struct musb_hdrc_config *config;struct resource *res;int ret = -ENOMEM ;@@ -501,6 +505,42 @@ static int __devinit omap2430_probe(struct platform_device *pdev)if (glue->control_otghs ==NULL )dev_dbg (&pdev->dev,"Failed to obtain control memory\n" ); +if (np) { + pdata =devm_kzalloc (&pdev->dev,sizeof (*pdata),GFP_KERNEL ); +if (!pdata) { +dev_err (&pdev->dev, +"failed to allocate musb platfrom data\n" ); + ret = -ENOMEM ; + goto err1; + } + + data =devm_kzalloc (&pdev->dev,sizeof (*data),GFP_KERNEL ); +if (!data) { +dev_err (&pdev->dev, +"failed to allocate musb board data\n" ); + ret = -ENOMEM ; + goto err1; + } + + config =devm_kzalloc (&pdev->dev,sizeof (*config),GFP_KERNEL ); +if (!data) { +dev_err (&pdev->dev, +"failed to allocate musb hdrc config\n" ); + goto err1; + } + +of_property_read_u32 (np,"mode" , (u32 *)&pdata->mode); +of_property_read_u32 (np,"interface_type" , + (u32 *)&data->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); + config->multipoint =of_property_read_bool (np,"multipoint" ); + + pdata->board_data = data; + pdata->config = config; + } + pdata->platform_ops = &omap2430_ops;platform_set_drvdata (pdev, glue);@@ -597,12 +637,26 @@ static struct dev_pm_ops omap2430_pm_ops = {#define DEV_PM_OPS NULL#endif +#ifdef CONFIG_OF +static const struct of_device_id omap2430_id_table[] = { + { + .compatible ="ti,omap4-musb" + }, + { + .compatible ="ti,omap3-musb" + }, + {}, +}; +MODULE_DEVICE_TABLE (of, omap2430_id_table); +#endif +static struct platform_driver omap2430_driver = { .probe = omap2430_probe, .remove =__devexit_p (omap2430_remove), .driver = { .name ="musb-omap2430" , .pm =DEV_PM_OPS , + .of_match_table =of_match_ptr (omap2430_id_table), }, };
Re: [PATCH v2 3/3] usb: musb: omap: Add device tree support for omap musb glue
Hi,
Quoted 49 lines · Vaibhav Hiremath
Quoted 32 lines · Kishon Vijay Abraham I
Added device tree support for omap musb driver and updated the Documentation with device tree binding information.
Signed-off-by Kishon Vijay Abraham I <[email protected]>--- Documentation/devicetree/bindings/usb/omap-usb.txt | 33 ++++++++++++ drivers/usb/musb/omap2430.c | 54 ++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/omap-usb.txtDocumentation/devicetree/bindings/usb/omap-usb.txt new file +16
-0@@ -0,0 +1,33 @@ +OMAP GLUE + +OMAP MUSB GLUE + - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb" + - ti,hwmods : must be "usb_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 : This is a board specific setting to describe the type of + interface between the controller and the phy. It should be "0" or "1" + specifying ULPI and UTMI respectively. + - mode : Should be "3" to represent OTG. "1" signifies HOST and "2" + represents PERIPHERAL. + - power : Should be "50". This signifies the controller can supply uptoDocumentation/devicetree/bindings/usb/omap-usb.txt line 26
Quoted 10 lines
Documentation/devicetree/bindings/usb/omap-usb.txt new file +10
-0+ 100mA when operating in host mode. + +SOC specific device node entry +usb_otg_hs: usb_otg_hs at 4a0ab000 { + compatible = "ti,omap4-musb"; + ti,hwmods = "usb_otg_hs"; + multipoint = <1>; + num_eps = <16>; + ram_bits = <12>; +};reg and interrupt properties are missing here.
Quoted 2 lines
I would encourage to specify "reg" and "interrupt" properties in every node getting newly added to the OMAP DTS files.
Sure. will add that in my next version.
Thanks
Kishon
RE: [PATCH v2 3/3] usb: musb: omap: Add device tree support for omap musb glue
Quoted 52 lines · KISHON VIJAY
Hi,
Quoted 49 lines · Vaibhav Hiremath
Quoted 32 lines · Kishon Vijay Abraham I
Added device tree support for omap musb driver and updated the Documentation with device tree binding information.
Signed-off-by Kishon Vijay Abraham I <[email protected]>--- Documentation/devicetree/bindings/usb/omap-usb.txt | 33 ++++++++++++ drivers/usb/musb/omap2430.c | 54 ++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/omap-usb.txtDocumentation/devicetree/bindings/usb/omap-usb.txt new file +16
-0@@ -0,0 +1,33 @@ +OMAP GLUE + +OMAP MUSB GLUE + - compatible : Should be "ti,omap4-musb" or "ti,omap3-musb" + - ti,hwmods : must be "usb_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 : This is a board specific setting to describe the type of + interface between the controller and the phy. It should be "0" or "1" + specifying ULPI and UTMI respectively. + - mode : Should be "3" to represent OTG. "1" signifies HOST and "2" + represents PERIPHERAL. + - power : Should be "50". This signifies the controller can supply uptoDocumentation/devicetree/bindings/usb/omap-usb.txt line 26
Quoted 10 lines
Documentation/devicetree/bindings/usb/omap-usb.txt new file +10
-0+ 100mA when operating in host mode. + +SOC specific device node entry +usb_otg_hs: usb_otg_hs at 4a0ab000 { + compatible = "ti,omap4-musb"; + ti,hwmods = "usb_otg_hs"; + multipoint = <1>; + num_eps = <16>; + ram_bits = <12>; +};reg and interrupt properties are missing here.
Quoted 5 lines
Quoted 2 lines
I would encourage to specify "reg" and "interrupt" properties in every node getting newly added to the OMAP DTS files.
Sure. will add that in my next version.
I saw there is some discussion going-on for which baseline to use, so make sure that you test the patches on top of below patch (already available in linux-omap/devel-dt)
Thanks,
Vaibhav
Quoted 3 lines
Thanks
Kishon
Re: [PATCH v2 3/3] usb: musb: omap: Add device tree support for omap musb glue
In reply to Kishon Vijay Abraham IHello.
Quoted 4 lines · Kishon Vijay Abraham I
Added device tree support for omap musb driver and updated the Documentation with device tree binding information.
Signed-off-by Kishon Vijay Abraham I <[email protected]>
Belated comments to the patch which didn't pass my message size filter in
time. :-)
Quoted 4 lines
drivers/usb/musb/omap2430.c +0
-0
[...]
Quoted 13 lines
drivers/usb/musb/omap2430.c +3
-0@@ -470,8 +471,11 @@ static u64 omap2430_dmamask = DMA_BIT_MASK(32);static int __devinit omap2430_probe (struct platform_device *pdev) {struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data; +struct omap_musb_board_data *data;struct platform_device *musb;struct omap2430_glue *glue; +struct device_node *np = pdev->dev.of_node; +struct musb_hdrc_config *config;struct resource *res;int ret = -ENOMEM ;
drivers/usb/musb/omap2430.c static int __devinit omap2430_probe(struct platform_device *pdev) · line 513
Quoted 9 lines
drivers/usb/musb/omap2430.c +6
-0@@ -501,6 +505,42 @@ static int __devinit omap2430_probe(struct platform_device *pdev)if (glue->control_otghs ==NULL )dev_dbg (&pdev->dev,"Failed to obtain control memory\n" ); +if (np) { + pdata =devm_kzalloc (&pdev->dev,sizeof (*pdata),GFP_KERNEL ); +if (!pdata) { +dev_err (&pdev->dev, +"failed to allocate musb platfrom data\n" ); + ret = -ENOMEM ;
'ret' is pre-initialized to -ENOMEM.
drivers/usb/musb/omap2430.c static int __devinit omap2430_probe(struct platform_device *pdev) · line 520
Quoted 7 lines
drivers/usb/musb/omap2430.c +7
-0+ goto err1; + } + + data =devm_kzalloc (&pdev->dev,sizeof (*data),GFP_KERNEL ); +if (!data) { +dev_err (&pdev->dev, +"failed to allocate musb board data\n" );
Overindented this line.
drivers/usb/musb/omap2430.c static int __devinit omap2430_probe(struct platform_device *pdev) · line 521
Quoted 1 line
drivers/usb/musb/omap2430.c +1
-0+ ret = -ENOMEM ;
Same comment about already pre-initialized variable.
drivers/usb/musb/omap2430.c static int __devinit omap2430_probe(struct platform_device *pdev) · line 526
Quoted 5 lines
drivers/usb/musb/omap2430.c +5
-0+ goto err1; + } + + config =devm_kzalloc (&pdev->dev,sizeof (*config),GFP_KERNEL ); +if (!data) {
You allocate 'config' but check 'data' again, so instead of exiting
gracefully we get an oops later on...
drivers/usb/musb/omap2430.c static int __devinit omap2430_probe(struct platform_device *pdev) · line 528
Quoted 2 lines
drivers/usb/musb/omap2430.c +2
-0+dev_err (&pdev->dev, +"failed to allocate musb hdrc config\n" );
No 'ret = -ENOMEM;' here -- kinda inconsistent. :-)
Quoted 8 lines
drivers/usb/musb/omap2430.c +8
-0+ goto err1; + } + +of_property_read_u32 (np,"mode" , (u32 *)&pdata->mode); +of_property_read_u32 (np,"interface_type" , + (u32 *)&data->interface_type); +of_property_read_u32 (np,"num_eps" , (u32 *)&config->num_eps); +of_property_read_u32 (np,"ram_bits" , (u32 *)&config->ram_bits);
drivers/usb/musb/omap2430.c static int __devinit omap2430_probe(struct platform_device *pdev) · line 546
Quoted 10 lines
drivers/usb/musb/omap2430.c +7
-0+of_property_read_u32 (np,"power" , (u32 *)&pdata->power); + config->multipoint =of_property_read_bool (np,"multipoint" ); + + pdata->board_data = data; + pdata->config = config; + } + pdata->platform_ops = &omap2430_ops;platform_set_drvdata (pdev, glue);
Don't worry now, I've just sent two patches to address these shortcomings.
WBR, Sergei