mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	usb: chipidea: imx: Fix ULPI on imx53
Traditionally, PORTSC should be set before initializing ULPI phys. But setting PORTSC before powering on the phy results in a kernel freeze on imx53 based GE PPD. As a workaround this initializes the phy early in the imx platform code and disables phy power management from the core. Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
		
							parent
							
								
									04e163794b
								
							
						
					
					
						commit
						be9cae2479
					
				
					 1 changed files with 12 additions and 0 deletions
				
			
		| 
						 | 
					@ -83,6 +83,7 @@ struct ci_hdrc_imx_data {
 | 
				
			||||||
	struct clk *clk;
 | 
						struct clk *clk;
 | 
				
			||||||
	struct imx_usbmisc_data *usbmisc_data;
 | 
						struct imx_usbmisc_data *usbmisc_data;
 | 
				
			||||||
	bool supports_runtime_pm;
 | 
						bool supports_runtime_pm;
 | 
				
			||||||
 | 
						bool override_phy_control;
 | 
				
			||||||
	bool in_lpm;
 | 
						bool in_lpm;
 | 
				
			||||||
	/* SoC before i.mx6 (except imx23/imx28) needs three clks */
 | 
						/* SoC before i.mx6 (except imx23/imx28) needs three clks */
 | 
				
			||||||
	bool need_three_clks;
 | 
						bool need_three_clks;
 | 
				
			||||||
| 
						 | 
					@ -254,6 +255,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
	const struct of_device_id *of_id;
 | 
						const struct of_device_id *of_id;
 | 
				
			||||||
	const struct ci_hdrc_imx_platform_flag *imx_platform_flag;
 | 
						const struct ci_hdrc_imx_platform_flag *imx_platform_flag;
 | 
				
			||||||
 | 
						struct device_node *np = pdev->dev.of_node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	of_id = of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev);
 | 
						of_id = of_match_device(ci_hdrc_imx_dt_ids, &pdev->dev);
 | 
				
			||||||
	if (!of_id)
 | 
						if (!of_id)
 | 
				
			||||||
| 
						 | 
					@ -288,6 +290,14 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pdata.usb_phy = data->phy;
 | 
						pdata.usb_phy = data->phy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (of_device_is_compatible(np, "fsl,imx53-usb") && pdata.usb_phy &&
 | 
				
			||||||
 | 
						    of_usb_get_phy_mode(np) == USBPHY_INTERFACE_MODE_ULPI) {
 | 
				
			||||||
 | 
							pdata.flags |= CI_HDRC_OVERRIDE_PHY_CONTROL;
 | 
				
			||||||
 | 
							data->override_phy_control = true;
 | 
				
			||||||
 | 
							usb_phy_init(pdata.usb_phy);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pdata.flags |= imx_platform_flag->flags;
 | 
						pdata.flags |= imx_platform_flag->flags;
 | 
				
			||||||
	if (pdata.flags & CI_HDRC_SUPPORTS_RUNTIME_PM)
 | 
						if (pdata.flags & CI_HDRC_SUPPORTS_RUNTIME_PM)
 | 
				
			||||||
		data->supports_runtime_pm = true;
 | 
							data->supports_runtime_pm = true;
 | 
				
			||||||
| 
						 | 
					@ -341,6 +351,8 @@ static int ci_hdrc_imx_remove(struct platform_device *pdev)
 | 
				
			||||||
		pm_runtime_put_noidle(&pdev->dev);
 | 
							pm_runtime_put_noidle(&pdev->dev);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	ci_hdrc_remove_device(data->ci_pdev);
 | 
						ci_hdrc_remove_device(data->ci_pdev);
 | 
				
			||||||
 | 
						if (data->override_phy_control)
 | 
				
			||||||
 | 
							usb_phy_shutdown(data->phy);
 | 
				
			||||||
	imx_disable_unprepare_clks(&pdev->dev);
 | 
						imx_disable_unprepare_clks(&pdev->dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue