usb: fix controller-PHY binding for OMAP3 platform
Subsystems (6)
cover usb: fix controller-PHY binding for OMAP3 platform
After the platform devices are created using PLATFORM_DEVID_AUTO, the device names given in usb_bind_phy (in board file) does not match with the actual device name causing the USB PHY library not to return the PHY reference when the MUSB controller request for the PHY in the non-dt boot case.
So removed creating platform devices using PLATFORM_DEVID_AUTO in omap2430.c. This is also needed for the Generic PHY Framework [1] after it's redesigned to address Greg's concerns [2]
*usb: musb: fix USB enumeration issue in OMAP3 platform* can be dropped since this patch series should fix the same issue.
I've tested in beagle, but if any of you have any other OMAP3 boards, would be great if you can test it too.
[1] -> https://git.kernel.org/cgit/linux/kernel/git/kishon/linux-phy.git/
[2] -> http://thread.gmane.org/gmane.linux.ports.arm.kernel/252813/focus=101661
Kishon Vijay Abraham I (2):
usb: musb: omap: remove using PLATFORM_DEVID_AUTO in omap2430.c
arm: omap: remove *.auto* from device names given in usb_bind_phy
arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3logic.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rm680.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 2 +- drivers/usb/musb/musb_core.c | 31 +++++++++++++++++++++++++- drivers/usb/musb/musb_core.h | 2 ++ drivers/usb/musb/omap2430.c | 16 +++++++++++-- 19 files changed, 62 insertions(+), 19 deletions(-)
Signature · 1 line
1.7.10.4
PATCH 1/2 usb: musb: omap: remove using PLATFORM_DEVID_AUTO in omap2430.c
After the platform devices are created using PLATFORM_DEVID_AUTO, the device names given in usb_bind_phy (in board file) does not match with the actual device name causing the USB PHY library not to return the PHY reference when the MUSB controller request for the PHY in the non-dt boot case.
So removed creating platform devices using PLATFORM_DEVID_AUTO in omap2430.c. This is also needed for the Generic PHY Framework.
--- drivers/usb/musb/musb_core.c | 31 ++++++++++++++++++++++++++++++- drivers/usb/musb/musb_core.h | 2 ++ drivers/usb/musb/omap2430.c | 16 ++++++++++++++-- 3 files changed, 46 insertions(+), 3 deletions(-)
drivers/usb/musb/musb_core.c +30 -1
@@ -121,7 +121,7 @@ MODULE_DESCRIPTION(DRIVER_INFO);MODULE_AUTHOR (DRIVER_AUTHOR );MODULE_LICENSE ("GPL" );MODULE_ALIAS ("platform:" MUSB_DRIVER_NAME ); - +static DEFINE_IDA (musb_ida);/*-------------------------------------------------------------------------*/
@@ -132,6 +132,35 @@ static inline struct musb *dev_to_musb(struct device *dev)/*-------------------------------------------------------------------------*/ +int musb_get_id (struct device *dev,gfp_t gfp_mask) +{ +int ret; +int id; + + ret =ida_pre_get (&musb_ida, gfp_mask); +if (!ret) { +dev_err (dev,"failed to reserve resource for id\n" ); +return -ENOMEM ; + } + + ret =ida_get_new (&musb_ida, &id); +if (ret <0 ) { +dev_err (dev,"failed to allocate a new id\n" ); +return ret; + } + +return id; +} +EXPORT_SYMBOL_GPL (musb_get_id); + +void musb_put_id (struct device *dev,int id) +{ + +dev_dbg (dev,"removing id %d\n" , id); +ida_remove (&musb_ida, id); +} +EXPORT_SYMBOL_GPL (musb_put_id); +#ifndef CONFIG_BLACKFIN static int musb_ulpi_read (struct usb_phy *phy,u32 offset) {
drivers/usb/musb/musb_core.h +2 -0
@@ -511,6 +511,8 @@ static inline void musb_configure_ep0(struct musb *musb)extern const char musb_driver_name[];extern void musb_stop (struct musb *musb); +extern int musb_get_id (struct device *dev,gfp_t gfp_mask); +extern void musb_put_id (struct device *dev,int id);extern void musb_write_fifo (struct musb_hw_ep *ep,u16 len,const u8 *src);extern void musb_read_fifo (struct musb_hw_ep *ep,u16 len,u8 *dst);
drivers/usb/musb/omap2430.c +14 -2
@@ -489,6 +489,7 @@ static int omap2430_probe(struct platform_device *pdev)struct device_node *np = pdev->dev.of_node;struct musb_hdrc_config *config;int ret = -ENOMEM ; +int musbid; glue =devm_kzalloc (&pdev->dev,sizeof (*glue),GFP_KERNEL );if (!glue) {
@@ -496,10 +497,18 @@ static int omap2430_probe(struct platform_device *pdev) goto err0; } - musb =platform_device_alloc ("musb-hdrc" ,PLATFORM_DEVID_AUTO ); +/* get the musb id */ + musbid =musb_get_id (&pdev->dev,GFP_KERNEL ); +if (musbid <0 ) { +dev_err (&pdev->dev,"failed to allocate musb id\n" ); + ret = -ENOMEM ; + goto err0; + } + + musb =platform_device_alloc ("musb-hdrc" , musbid);if (!musb) {dev_err (&pdev->dev,"failed to allocate musb device\n" ); - goto err0; + goto err1; } musb->dev.parent = &pdev->dev;
@@ -607,6 +616,9 @@ static int omap2430_probe(struct platform_device *pdev) err2:platform_device_put (musb); +err1: +musb_put_id (&pdev->dev, musbid); + err0:return ret; }
Signature · 1 line
1.7.10.4
PATCH 2/2 arm: omap: remove *.auto* from device names given in usb_bind_phy
In reply to Kishon Vijay Abraham IPreviously MUSB wrapper (OMAP) device used PLATFORM_DEVID_AUTO while creating MUSB core device. So in usb_bind_phy (binds the controller with the PHY), the device name of the controller had *.auto* in it. Since with using PLATFORM_DEVID_AUTO, there is no way to know the exact device name in advance, the data given in usb_bind_phy became obsolete and usb_get_phy was failing. So MUSB wrapper was modified not to use PLATFORM_DEVID_AUTO. Corresponding change is done in board file here.
--- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3logic.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rm680.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +1 -1
@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );board_smc91x_init ();
arch/arm/mach-omap2/board-3430sdp.c +1 -1
@@ -590,7 +590,7 @@ static void __init omap_3430sdp_init(void)omap_ads7846_init (1 , gpio_pendown,310 ,NULL );omap_serial_init ();omap_sdrc_init (hyb18m512160af6_sdrc_params,NULL ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );board_smc91x_init ();board_flash_init (sdp_flash_partitions, chip_sel_3430,0 );
arch/arm/mach-omap2/board-cm-t35.c +1 -1
@@ -691,7 +691,7 @@ static void __init cm_t3x_common_init(void)cm_t35_init_display ();omap_twl4030_audio_init ("cm-t3x" ,NULL ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );cm_t35_init_usbh ();cm_t35_init_camera ();
arch/arm/mach-omap2/board-devkit8000.c +1 -1
@@ -594,7 +594,7 @@ static void __init devkit8000_init(void)omap_ads7846_init (2 ,OMAP3_DEVKIT_TS_GPIO ,0 ,NULL ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );usbhs_init (&usbhs_bdata); board_nand_init(devkit8000_nand_partitions,
arch/arm/mach-omap2/board-igep0020.c +1 -1
@@ -659,7 +659,7 @@ static void __init igep_init(void)omap_serial_init ();omap_sdrc_init (m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );igep_flash_init ();
arch/arm/mach-omap2/board-ldp.c +1 -1
@@ -377,7 +377,7 @@ static void __init omap_ldp_init(void)omap_ads7846_init (1 ,54 ,310 ,NULL );omap_serial_init ();omap_sdrc_init (NULL ,NULL ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );board_nand_init (ldp_nand_partitions,ARRAY_SIZE (ldp_nand_partitions),ZOOM_NAND_CS ,0 , nand_default_timings);
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
@@ -551,7 +551,7 @@ static void __init omap3_beagle_init(void)omap_sdrc_init (mt46h32m32lf6_sdrc_params, mt46h32m32lf6_sdrc_params); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );usbhs_init (&usbhs_bdata);
arch/arm/mach-omap2/board-omap3evm.c +1 -1
@@ -706,7 +706,7 @@ static void __init omap3_evm_init(void)omap_mux_init_gpio (135 ,OMAP_PIN_OUTPUT ); phy_data[0 ].reset_gpio =135 ; } -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (&musb_board_data);usbhs_init_phys (phy_data,ARRAY_SIZE (phy_data));
arch/arm/mach-omap2/board-omap3logic.c +1 -1
@@ -216,7 +216,7 @@ static void __init omap3logic_init(void)board_mmc_init ();board_smsc911x_init (); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );/* Ensure SDRC pins are mux'd for self-refresh */
arch/arm/mach-omap2/board-omap3pandora.c +1 -1
@@ -611,7 +611,7 @@ static void __init omap3pandora_init(void)usbhs_init_phys (phy_data,ARRAY_SIZE (phy_data));usbhs_init (&usbhs_bdata); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );gpmc_nand_init (&pandora_nand_data,NULL );
arch/arm/mach-omap2/board-omap3stalker.c +1 -1
@@ -394,7 +394,7 @@ static void __init omap3_stalker_init(void)omap_serial_init ();omap_sdrc_init (mt46h32m32lf6_sdrc_params,NULL ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );usbhs_init_phys (phy_data,ARRAY_SIZE (phy_data));
arch/arm/mach-omap2/board-omap3touchbook.c +1 -1
@@ -367,7 +367,7 @@ static void __init omap3_touchbook_init(void)/* Touchscreen and accelerometer */ omap_ads7846_init (4 ,OMAP3_TS_GPIO ,310 , &ads7846_pdata); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );usbhs_init_phys (phy_data,ARRAY_SIZE (phy_data));
arch/arm/mach-omap2/board-overo.c +1 -1
@@ -473,7 +473,7 @@ static void __init overo_init(void) mt46h32m32lf6_sdrc_params);board_nand_init (overo_nand_partitions,ARRAY_SIZE (overo_nand_partitions),NAND_CS ,0 ,NULL ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );usbhs_init_phys (phy_data,ARRAY_SIZE (phy_data));
arch/arm/mach-omap2/board-rm680.c +1 -1
@@ -135,7 +135,7 @@ static void __init rm680_init(void) sdrc_params =nokia_get_sdram_timings ();omap_sdrc_init (sdrc_params, sdrc_params); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );rm680_peripherals_init (); }
arch/arm/mach-omap2/board-rx51.c +1 -1
@@ -99,7 +99,7 @@ static void __init rx51_init(void) sdrc_params =nokia_get_sdram_timings ();omap_sdrc_init (sdrc_params, sdrc_params); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (&musb_board_data);rx51_peripherals_init ();
arch/arm/mach-omap2/board-zoom-peripherals.c +1 -1
@@ -353,7 +353,7 @@ void __init zoom_peripherals_init(void)omap_i2c_init ();pwm_add_table (zoom_pwm_lookup,ARRAY_SIZE (zoom_pwm_lookup));platform_add_devices (zoom_devices,ARRAY_SIZE (zoom_devices)); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );usb_musb_init (NULL );enable_board_wakeup_source ();omap_serial_init ();
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 33 lines · Kishon Vijay Abraham I
Previously MUSB wrapper (OMAP) device used
PLATFORM_DEVID_AUTOwhile creating MUSB core device. So inusb_bind_phy(binds the controller with the PHY), the device name of the controller had *.auto* in it. Since with usingPLATFORM_DEVID_AUTO, there is no way to know the exact device name in advance, the data given inusb_bind_phybecame obsolete andusb_get_phywas failing. So MUSB wrapper was modified not to usePLATFORM_DEVID_AUTO. Corresponding change is done in board file here.Signed-off-by Kishon Vijay Abraham I <[email protected]>--- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3logic.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rm680.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-)arch/arm/mach-omap2/board-2430sdp.c +0
-0
arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 5 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );
how about moving usb_bind_phy() calls to omap2430.c ?
drivers/usb/musb/omap2430.c +3 -0
@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev) pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" ); }if (pdata->has_mailbox) {
The only problem is if some board comes with a PHY other than twl4030_usb, but in that case we can add a separate compatible flag and treat it properly. We only need to bind the phy in non-DT case anyway, so that's temporary. It might be better than to reintroduce the IDR in musb_core.c.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130729/a53c525b/attachment-0001.sig>
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 49 lines · Felipe Balbi
Hi,
Quoted 33 lines · Kishon Vijay Abraham I
Previously MUSB wrapper (OMAP) device used
PLATFORM_DEVID_AUTOwhile creating MUSB core device. So inusb_bind_phy(binds the controller with the PHY), the device name of the controller had *.auto* in it. Since with usingPLATFORM_DEVID_AUTO, there is no way to know the exact device name in advance, the data given inusb_bind_phybecame obsolete andusb_get_phywas failing. So MUSB wrapper was modified not to usePLATFORM_DEVID_AUTO. Corresponding change is done in board file here.Signed-off-by Kishon Vijay Abraham I <[email protected]>--- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3logic.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rm680.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-)arch/arm/mach-omap2/board-2430sdp.c +0
-0arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 5 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 6 lines
drivers/usb/musb/omap2430.c +3
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev) pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );
This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to get_phy_by_name.
Quoted 7 lines
drivers/usb/musb/omap2430.c +0
-0}if (pdata->has_mailbox) {The only problem is if some board comes with a PHY other than
twl4030_usb, but in that case we can add a separate compatible flag and treat it properly. We only need to bind the phy in non-DT case anyway,
right.
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.
that?s needed for generic phy framework anyway :-s
Thanks
Kishon
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 47 lines · Kishon Vijay Abraham I
Quoted 47 lines
Quoted 33 lines
Previously MUSB wrapper (OMAP) device used
PLATFORM_DEVID_AUTOwhile creating MUSB core device. So inusb_bind_phy(binds the controller with the PHY), the device name of the controller had *.auto* in it. Since with usingPLATFORM_DEVID_AUTO, there is no way to know the exact device name in advance, the data given inusb_bind_phybecame obsolete andusb_get_phywas failing. So MUSB wrapper was modified not to usePLATFORM_DEVID_AUTO. Corresponding change is done in board file here.Signed-off-by Kishon Vijay Abraham I <[email protected]>--- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3logic.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rm680.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-)arch/arm/mach-omap2/board-2430sdp.c +0
-0arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 5 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev)
Quoted 8 lines
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 5 lines
drivers/usb/musb/omap2430.c +3
-0pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to
get_phy_by_name.
actually, this is a workaround to the fact that we're not creating all platform_devices in arch/arm/mach-omap2/ :-)
If we had the musb allocation there, we could easily handle usb_bind_phy()
Quoted 4 lines
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.that?s needed for generic phy framework anyway :-s
right, but generic phy framework can handle everything just fine, the only problem is that names are changing.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130729/36df298b/attachment.sig>
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 65 lines · Felipe Balbi
Hi,
Quoted 47 lines · Kishon Vijay Abraham I
Quoted 47 lines
Quoted 33 lines
Previously MUSB wrapper (OMAP) device used
PLATFORM_DEVID_AUTOwhile creating MUSB core device. So inusb_bind_phy(binds the controller with the PHY), the device name of the controller had *.auto* in it. Since with usingPLATFORM_DEVID_AUTO, there is no way to know the exact device name in advance, the data given inusb_bind_phybecame obsolete andusb_get_phywas failing. So MUSB wrapper was modified not to usePLATFORM_DEVID_AUTO. Corresponding change is done in board file here.Signed-off-by Kishon Vijay Abraham I <[email protected]>--- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3logic.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rm680.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-)arch/arm/mach-omap2/board-2430sdp.c +0
-0arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 5 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev)Quoted 8 lines
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 5 lines
drivers/usb/musb/omap2430.c +3
-0pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to
get_phy_by_name.actually, this is a workaround to the fact that we're not creating all
platform_devicesinarch/arm/mach-omap2/:-)If we had the musb allocation there, we could easily handle
usb_bind_phy()
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.that?s needed for generic phy framework anyway :-s
right, but generic phy framework can handle everything just fine, the only problem is that names are changing.
right. But if the names change, PHY framework wouldn't be able to return the reference to the PHY.
Thanks
Kishon
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 66 lines · Kishon Vijay Abraham I
Quoted 66 lines · Kishon Vijay Abraham I
Quoted 47 lines
Quoted 47 lines
Quoted 33 lines
Previously MUSB wrapper (OMAP) device used
PLATFORM_DEVID_AUTOwhile creating MUSB core device. So inusb_bind_phy(binds the controller with the PHY), the device name of the controller had *.auto* in it. Since with usingPLATFORM_DEVID_AUTO, there is no way to know the exact device name in advance, the data given inusb_bind_phybecame obsolete andusb_get_phywas failing. So MUSB wrapper was modified not to usePLATFORM_DEVID_AUTO. Corresponding change is done in board file here.Signed-off-by Kishon Vijay Abraham I <[email protected]>--- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3logic.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rm680.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-)arch/arm/mach-omap2/board-2430sdp.c +0
-0arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 5 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev)Quoted 8 lines
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 5 lines
drivers/usb/musb/omap2430.c +3
-0pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to
get_phy_by_name.actually, this is a workaround to the fact that we're not creating all
platform_devicesinarch/arm/mach-omap2/:-)If we had the musb allocation there, we could easily handle
usb_bind_phy()Quoted 3 lines
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
that?s needed for generic phy framework anyway :-s
right, but generic phy framework can handle everything just fine, the only problem is that names are changing.
right. But if the names change, PHY framework wouldn't be able to return the reference to the PHY.
with my suggestion they can change whenever they want since we're using dev_name() of the just-created musb platform_device. Right ?
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130730/18f1bcd7/attachment-0001.sig>
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 71 lines · Felipe Balbi
Hi,
Quoted 68 lines · Kishon Vijay Abraham I
Quoted 68 lines · Kishon Vijay Abraham I
Quoted 47 lines
Quoted 47 lines
Quoted 33 lines
Previously MUSB wrapper (OMAP) device used
PLATFORM_DEVID_AUTOwhile creating MUSB core device. So inusb_bind_phy(binds the controller with the PHY), the device name of the controller had *.auto* in it. Since with usingPLATFORM_DEVID_AUTO, there is no way to know the exact device name in advance, the data given inusb_bind_phybecame obsolete andusb_get_phywas failing. So MUSB wrapper was modified not to usePLATFORM_DEVID_AUTO. Corresponding change is done in board file here.Signed-off-by Kishon Vijay Abraham I <[email protected]>--- arch/arm/mach-omap2/board-2430sdp.c | 2 +- arch/arm/mach-omap2/board-3430sdp.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 2 +- arch/arm/mach-omap2/board-devkit8000.c | 2 +- arch/arm/mach-omap2/board-igep0020.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-omap3logic.c | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-omap3stalker.c | 2 +- arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rm680.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom-peripherals.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-)arch/arm/mach-omap2/board-2430sdp.c +0
-0arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 5 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev)Quoted 8 lines
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 5 lines
drivers/usb/musb/omap2430.c +3
-0pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to
get_phy_by_name.actually, this is a workaround to the fact that we're not creating all
platform_devicesinarch/arm/mach-omap2/:-)If we had the musb allocation there, we could easily handle
usb_bind_phy()Quoted 4 lines
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.that?s needed for generic phy framework anyway :-s
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
right, but generic phy framework can handle everything just fine, the only problem is that names are changing.
right. But if the names change, PHY framework wouldn't be able to return the reference to the PHY.
with my suggestion they can change whenever they want since we're using
dev_name()of the just-created musbplatform_device. Right ?
right. But the PHY device can be created in a different place from where the musb devices are created. And in the PHY framework, the PHY device should have the list of controller device (names) it can support (PHY framework does not maintain a separate list for binding like how we had in USB PHY library). e.g.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg92817.html. In such cases how do we pass the device names. Also will the MUSB core device be created before twl4030-usb PHY device?
Thanks
Kishon
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 42 lines · Kishon Vijay Abraham I
Quoted 42 lines
Quoted 42 lines
Quoted 41 lines
Quoted 19 lines
Quoted 19 lines
arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 10 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev)Quoted 8 lines
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 5 lines
drivers/usb/musb/omap2430.c +3
-0pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to
get_phy_by_name.actually, this is a workaround to the fact that we're not creating all
platform_devicesinarch/arm/mach-omap2/:-)If we had the musb allocation there, we could easily handle
usb_bind_phy()Quoted 4 lines
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.that?s needed for generic phy framework anyway :-s
right, but generic phy framework can handle everything just fine, the only problem is that names are changing.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
right. But if the names change, PHY framework wouldn't be able to return the reference to the PHY.
with my suggestion they can change whenever they want since we're using
dev_name()of the just-created musbplatform_device. Right ?right. But the PHY device can be created in a different place from where the musb devices are created. And in the PHY framework, the PHY device should have
this shouldn't be a problem. As long as the phy is created, all should be good.
Quoted 3 lines
the list of controller device (names) it can support (PHY framework does not maintain a separate list for binding like how we had in USB PHY library). e.g.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg92817.html. In such
this has nothing to do with $subject though. We talk about generic PHY framework once all these PHY drivers are moved there :-)
Quoted 2 lines
cases how do we pass the device names. Also will the MUSB core device be created before twl4030-usb PHY device?
and why would that be a problem ? We're telling the framework that the musb device will use a phy with a name of 'twl4030'. If musb calls usb_get_phy_dev() and doesn't find a phy, it'll return -EPROBE_DEFER and try again later.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130730/c4161e9a/attachment.sig>
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 64 lines · Felipe Balbi
Hi,
Quoted 42 lines · Kishon Vijay Abraham I
Quoted 42 lines
Quoted 42 lines
Quoted 41 lines
Quoted 19 lines
Quoted 19 lines
arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 10 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev)Quoted 8 lines
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 5 lines
drivers/usb/musb/omap2430.c +3
-0pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to
get_phy_by_name.actually, this is a workaround to the fact that we're not creating all
platform_devicesinarch/arm/mach-omap2/:-)If we had the musb allocation there, we could easily handle
usb_bind_phy()Quoted 4 lines
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.that?s needed for generic phy framework anyway :-s
right, but generic phy framework can handle everything just fine, the only problem is that names are changing.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
right. But if the names change, PHY framework wouldn't be able to return the reference to the PHY.
with my suggestion they can change whenever they want since we're using
dev_name()of the just-created musbplatform_device. Right ?right. But the PHY device can be created in a different place from where the musb devices are created. And in the PHY framework, the PHY device should have
this shouldn't be a problem. As long as the phy is created, all should be good.
Quoted 3 lines
the list of controller device (names) it can support (PHY framework does not maintain a separate list for binding like how we had in USB PHY library). e.g.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg92817.html. In suchthis has nothing to do with $subject though. We talk about generic PHY framework once all these PHY drivers are moved there :-)
Quoted 7 lines
Quoted 2 lines
cases how do we pass the device names. Also will the MUSB core device be created before twl4030-usb PHY device?
and why would that be a problem ? We're telling the framework that the musb device will use a phy with a name of 'twl4030'. If musb calls
usb_get_phy_dev()and doesn't find a phy, it'll return -EPROBE_DEFER and try again later.
I think we are talking about different problems here ;-) I'm trying to tell using idr in MUSB core is needed for Generic PHY Framework. So in a way, the Generic PHY Framework series depends on this patch series or else MUSB in OMAP3 platforms wont work after Generic PHY framework gets merged.
Thanks
Kishon
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 70 lines · Kishon Vijay Abraham I
Quoted 62 lines · Kishon Vijay Abraham I
Quoted 42 lines
Quoted 42 lines
Quoted 42 lines
Quoted 41 lines
Quoted 19 lines
Quoted 19 lines
arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 10 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev)Quoted 8 lines
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 5 lines
drivers/usb/musb/omap2430.c +3
-0pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to
get_phy_by_name.actually, this is a workaround to the fact that we're not creating all
platform_devicesinarch/arm/mach-omap2/:-)If we had the musb allocation there, we could easily handle
usb_bind_phy()Quoted 4 lines
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.that?s needed for generic phy framework anyway :-s
right, but generic phy framework can handle everything just fine, the only problem is that names are changing.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
right. But if the names change, PHY framework wouldn't be able to return the reference to the PHY.
with my suggestion they can change whenever they want since we're using
dev_name()of the just-created musbplatform_device. Right ?right. But the PHY device can be created in a different place from where the musb devices are created. And in the PHY framework, the PHY device should have
this shouldn't be a problem. As long as the phy is created, all should be good.
Quoted 3 lines
the list of controller device (names) it can support (PHY framework does not maintain a separate list for binding like how we had in USB PHY library). e.g.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg92817.html. In suchthis has nothing to do with $subject though. We talk about generic PHY framework once all these PHY drivers are moved there :-)
Quoted 7 lines
Quoted 2 lines
cases how do we pass the device names. Also will the MUSB core device be created before twl4030-usb PHY device?
and why would that be a problem ? We're telling the framework that the musb device will use a phy with a name of 'twl4030'. If musb calls
usb_get_phy_dev()and doesn't find a phy, it'll return -EPROBE_DEFER and try again later.
Quoted 4 lines
I think we are talking about different problems here ;-) I'm trying to tell using idr in MUSB core is needed for Generic PHY Framework. So in a way, the Generic PHY Framework series depends on this patch series or else MUSB in OMAP3 platforms wont work after Generic PHY framework gets merged.
then you just found a limitation in your framework, right ? :-) I mean, imagine if now we have to add an IDR to every single user of your framework because they could end up in systems with multiple instances of the same IP ?
Now consider that you aim to have your framework be used by Network, USB, SATA, Graphics, etc... Have you really only considered DT platforms ? DT is quite easy since you can require folks to pass the proper phandle, but drivers will want to use PLATFORM_DEVID_AUTO and your framework needs to cope with that.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130730/6d076c74/attachment.sig>
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 78 lines · Felipe Balbi
Hi,
Quoted 70 lines · Kishon Vijay Abraham I
Quoted 62 lines · Kishon Vijay Abraham I
Quoted 42 lines
Quoted 42 lines
Quoted 42 lines
Quoted 41 lines
Quoted 19 lines
Quoted 19 lines
arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init(void) · line 236
Quoted 10 lines
arch/arm/mach-omap2/board-2430sdp.c +1
-1@@ -233,7 +233,7 @@ static void __init omap_2430sdp_init(void)omap_hsmmc_init (mmc);omap_mux_init_signal ("usb0hs_stp" ,OMAP_PULL_ENA |OMAP_PULL_UP ); -usb_bind_phy ("musb-hdrc.0.auto" ,0 ,"twl4030_usb" ); +usb_bind_phy ("musb-hdrc.0" ,0 ,"twl4030_usb" );how about moving
usb_bind_phy()calls toomap2430.c?drivers/usb/musb/omap2430.c +0
-0@@ -544,6 +544,9 @@ static int omap2430_probe(struct platform_device *pdev)Quoted 8 lines
drivers/usb/musb/omap2430.c static int omap2430_probe(struct platform_device *pdev) · line 549
Quoted 5 lines
drivers/usb/musb/omap2430.c +3
-0pdata->board_data = data; pdata->config = config; + }else { +/* bind the PHY */ +usb_bind_phy (dev_name (&musb->dev),0 ,"twl4030_usb" );This looks like a hack IMHO to workaround the usb phy library. otherwise it is similar to
get_phy_by_name.actually, this is a workaround to the fact that we're not creating all
platform_devicesinarch/arm/mach-omap2/:-)If we had the musb allocation there, we could easily handle
usb_bind_phy()Quoted 4 lines
Quoted 2 lines
so that's temporary. It might be better than to reintroduce the IDR in
musb_core.c.that?s needed for generic phy framework anyway :-s
right, but generic phy framework can handle everything just fine, the only problem is that names are changing.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
right. But if the names change, PHY framework wouldn't be able to return the reference to the PHY.
with my suggestion they can change whenever they want since we're using
dev_name()of the just-created musbplatform_device. Right ?right. But the PHY device can be created in a different place from where the musb devices are created. And in the PHY framework, the PHY device should have
this shouldn't be a problem. As long as the phy is created, all should be good.
Quoted 3 lines
the list of controller device (names) it can support (PHY framework does not maintain a separate list for binding like how we had in USB PHY library). e.g.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg92817.html. In suchthis has nothing to do with $subject though. We talk about generic PHY framework once all these PHY drivers are moved there :-)
Quoted 7 lines
Quoted 2 lines
cases how do we pass the device names. Also will the MUSB core device be created before twl4030-usb PHY device?
and why would that be a problem ? We're telling the framework that the musb device will use a phy with a name of 'twl4030'. If musb calls
usb_get_phy_dev()and doesn't find a phy, it'll return -EPROBE_DEFER and try again later.Quoted 4 lines
I think we are talking about different problems here ;-) I'm trying to tell using idr in MUSB core is needed for Generic PHY Framework. So in a way, the Generic PHY Framework series depends on this patch series or else MUSB in OMAP3 platforms wont work after Generic PHY framework gets merged.
Quoted 4 lines
then you just found a limitation in your framework, right ? :-) I mean, imagine if now we have to add an IDR to every single user of your framework because they could end up in systems with multiple instances of the same IP ?
I raised a similar concern in the PHY framework discussion [1] :-) And since it's used everywhere else regulators, clkdev, etc.. it's agreed to be used in PHY as well. Btw if PLATFORM_DEVID_AUTO is used even regulator, clk_get should fail IMO.
[1] -> http://lkml.indiana.edu/hypermail/linux/kernel/1307.2/03573.html
Thanks
Kishon
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Hi,
Quoted 25 lines · Kishon Vijay Abraham I
Quoted 20 lines
Quoted 15 lines
Quoted 7 lines
Quoted 3 lines
the list of controller device (names) it can support (PHY framework does not maintain a separate list for binding like how we had in USB PHY library). e.g.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg92817.html. In suchthis has nothing to do with $subject though. We talk about generic PHY framework once all these PHY drivers are moved there :-)
Quoted 7 lines
Quoted 2 lines
cases how do we pass the device names. Also will the MUSB core device be created before twl4030-usb PHY device?
and why would that be a problem ? We're telling the framework that the musb device will use a phy with a name of 'twl4030'. If musb calls
usb_get_phy_dev()and doesn't find a phy, it'll return -EPROBE_DEFER and try again later.Quoted 4 lines
I think we are talking about different problems here ;-) I'm trying to tell using idr in MUSB core is needed for Generic PHY Framework. So in a way, the Generic PHY Framework series depends on this patch series or else MUSB in OMAP3 platforms wont work after Generic PHY framework gets merged.
Quoted 4 lines
then you just found a limitation in your framework, right ? :-) I mean, imagine if now we have to add an IDR to every single user of your framework because they could end up in systems with multiple instances of the same IP ?
Quoted 6 lines
I raised a similar concern in the PHY framework discussion [1] :-) And since it's used everywhere else regulators, clkdev, etc.. it's agreed to be used in PHY as well. Btw if
PLATFORM_DEVID_AUTOis used even regulator,clk_getshould fail IMO.[1] -> http://lkml.indiana.edu/hypermail/linux/kernel/1307.2/03573.html
look at Greg's and my reply to that email.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130730/a74b90be/attachment.sig>
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Quoted 28 lines · Felipe Balbi
Hi,
Quoted 25 lines · Kishon Vijay Abraham I
Quoted 24 lines
Quoted 15 lines
Quoted 7 lines
Quoted 3 lines
the list of controller device (names) it can support (PHY framework does not maintain a separate list for binding like how we had in USB PHY library). e.g.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg92817.html. In suchthis has nothing to do with $subject though. We talk about generic PHY framework once all these PHY drivers are moved there :-)
Quoted 7 lines
Quoted 2 lines
cases how do we pass the device names. Also will the MUSB core device be created before twl4030-usb PHY device?
and why would that be a problem ? We're telling the framework that the musb device will use a phy with a name of 'twl4030'. If musb calls
usb_get_phy_dev()and doesn't find a phy, it'll return -EPROBE_DEFER and try again later.Quoted 4 lines
I think we are talking about different problems here ;-) I'm trying to tell using idr in MUSB core is needed for Generic PHY Framework. So in a way, the Generic PHY Framework series depends on this patch series or else MUSB in OMAP3 platforms wont work after Generic PHY framework gets merged.
then you just found a limitation in your framework, right ? :-) I mean, imagine if now we have to add an IDR to every single user of your framework because they could end up in systems with multiple instances of the same IP ?
Quoted 8 lines
Quoted 6 lines
I raised a similar concern in the PHY framework discussion [1] :-) And since it's used everywhere else regulators, clkdev, etc.. it's agreed to be used in PHY as well. Btw if
PLATFORM_DEVID_AUTOis used even regulator,clk_getshould fail IMO.[1] -> http://lkml.indiana.edu/hypermail/linux/kernel/1307.2/03573.html
look at Greg's and my reply to that email.
but finally Greg agreed to what Tomasz proposed no?
Thanks
Kishon
Re: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Quoted 34 lines · Kishon Vijay Abraham I
Quoted 33 lines · Felipe Balbi
Hi,
Quoted 30 lines · Kishon Vijay Abraham I
Quoted 20 lines
Quoted 15 lines
Quoted 7 lines
Quoted 3 lines
the list of controller device (names) it can support (PHY framework does not maintain a separate list for binding like how we had in USB PHY library). e.g.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg92817.html. In suchthis has nothing to do with $subject though. We talk about generic PHY framework once all these PHY drivers are moved there :-)
Quoted 7 lines
Quoted 2 lines
cases how do we pass the device names. Also will the MUSB core device be created before twl4030-usb PHY device?
and why would that be a problem ? We're telling the framework that the musb device will use a phy with a name of 'twl4030'. If musb calls
usb_get_phy_dev()and doesn't find a phy, it'll return -EPROBE_DEFER and try again later.Quoted 4 lines
I think we are talking about different problems here ;-) I'm trying to tell using idr in MUSB core is needed for Generic PHY Framework. So in a way, the Generic PHY Framework series depends on this patch series or else MUSB in OMAP3 platforms wont work after Generic PHY framework gets merged.
Quoted 4 lines
then you just found a limitation in your framework, right ? :-) I mean, imagine if now we have to add an IDR to every single user of your framework because they could end up in systems with multiple instances of the same IP ?
I raised a similar concern in the PHY framework discussion [1] :-) And since it's used everywhere else regulators, clkdev, etc.. it's agreed to be used in PHY as well. Btw if
PLATFORM_DEVID_AUTOis used even regulator,clk_getshould fail IMO.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
[1] -> http://lkml.indiana.edu/hypermail/linux/kernel/1307.2/03573.html
look at Greg's and my reply to that email.
but finally Greg agreed to what Tomasz proposed no?
that's not what I see in the thread. I see Greg agreed to regulator's own IDs being sequentially created, but he mentions device names can change.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130730/12cfc057/attachment.sig>
Greg KH
maintainerRe: [PATCH 2/2] arm: omap: remove *.auto* from device names given in usb_bind_phy
Quoted 7 lines · Felipe Balbi
Quoted 3 lines
Quoted 1 line
look at Greg's and my reply to that email.
but finally Greg agreed to what Tomasz proposed no?
that's not what I see in the thread. I see Greg agreed to regulator's own IDs being sequentially created, but he mentions device names can change.
And that no one should _ever_ rely on them to be a specific "name", the bus is responsible for creating the id, it could be "random" and everything should work just fine.
thanks,
greg k-h