Skip to contentSkip to conversation

usb: dwc2_udc_otg_phy: fix compilation on non-Exynos patforms

PATCH Superseded Marius Dinu 3 participants 6 messages Mar 16 – Apr 22 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc2_udc_otg_phy: fix compilation on non-Exynos patforms

s5p_cpu_id used in drivers/usb/gadget/dwc2_udc_otg_phy.c is undefined on platforms other than Exynos.

---
 drivers/usb/gadget/dwc2_udc_otg_phy.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/gadget/dwc2_udc_otg_phy.c +2 -0
index e0ac5d142b0..3730bd70bb2 100644
@@ -56,10 +56,12 @@ void otg_phy_init(struct dwc2_udc *dev)
 	else /* C110 GONI */
 		clrbits_le32(&phy->phypwr, OTG_DISABLE_0 | ANALOG_PWRDOWN | FORCE_SUSPEND_0);
 
+#ifdef CONFIG_ARCH_EXYNOS
 	if (s5p_cpu_id == 0x4412)
 		clrsetbits_le32(&phy->phyclk, EXYNOS4X12_ID_PULLUP0 | EXYNOS4X12_COMMON_ON_N0,
 				EXYNOS4X12_CLK_SEL_24MHZ); /* PLL 24Mhz */
 	else
+#endif
 		clrsetbits_le32(&phy->phyclk, ID_PULLUP0 | COMMON_ON_N0,
 				CLK_SEL_24MHZ); /* PLL 24Mhz */
 
Signature · 1 line
2.52.0
#1 lore raw

Hi Marius,

Quoted 3 lines · Marius Dinu

s5p_cpu_id used in drivers/usb/gadget/dwc2_udc_otg_phy.c is undefined on platforms other than Exynos.

It's also made external in arch/arm/mach-s5pc1xx/include/mach/cpu.h, which I believe is enabled with CONFIG_ARCH_S5PC1XX?

Cheers,
Quentin

#2 lore raw

PATCH v2 1/1 usb: dwc2_udc_otg_phy: fix compilation on non-Exynos patforms

s5p_cpu_id used in drivers/usb/gadget/dwc2_udc_otg_phy.c is undefined on platforms other than Exynos.

---
 drivers/usb/gadget/dwc2_udc_otg_phy.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/gadget/dwc2_udc_otg_phy.c +2 -0
index e0ac5d142b0..c56ff1125bd 100644
@@ -56,10 +56,12 @@ void otg_phy_init(struct dwc2_udc *dev)
 	else /* C110 GONI */
 		clrbits_le32(&phy->phypwr, OTG_DISABLE_0 | ANALOG_PWRDOWN | FORCE_SUSPEND_0);
 
+#if defined(CONFIG_ARCH_EXYNOS) || defined(CONFIG_ARCH_S5PC1XX)
 	if (s5p_cpu_id == 0x4412)
 		clrsetbits_le32(&phy->phyclk, EXYNOS4X12_ID_PULLUP0 | EXYNOS4X12_COMMON_ON_N0,
 				EXYNOS4X12_CLK_SEL_24MHZ); /* PLL 24Mhz */
 	else
+#endif
 		clrsetbits_le32(&phy->phyclk, ID_PULLUP0 | COMMON_ON_N0,
 				CLK_SEL_24MHZ); /* PLL 24Mhz */
 
Signature · 1 line
2.52.0
Acked-by on v2 1/1
#3 lore raw

Hi Marius,

Quoted 4 lines · Marius Dinu

s5p_cpu_id used in drivers/usb/gadget/dwc2_udc_otg_phy.c is undefined on platforms other than Exynos.

I believe the reason this was not picked-up so far is because you forgot to add the right people in To: and Cc: recipients of your mail.

$ ./scripts/get_maintainer.pl -f drivers/usb/gadget/dwc2_udc_otg_phy.c
Lukasz Majewski <[email protected]> (maintainer:DFU)
Mattijs Korpershoek <[email protected]> (maintainer:DFU,commit_signer:2/1=100%)
Marek Vasut <[email protected]> (maintainer:USB,commit_signer:1/1=100%)
Tom Rini <[email protected]> (maintainer:THE REST)
Junhui Liu <[email protected]> (commit_signer:1/1=100%,authored:1/1=100%,added_lines:13/13=100%,removed_lines:20/20=100%)
[email protected] (open list)

Try to send a v3 with that fixed. See https://docs.u-boot.org/en/latest/develop/sending_patches.html. I **highly** recommend trying out b4 (https://b4.docs.kernel.org). See https://docs.u-boot.org/en/latest/develop/codingstyle.html as well.

Thanks!
Quentin

#4 lore raw

PATCH v3 1/1 usb: dwc2_udc_otg_phy: fix compilation on non-Exynos patforms

s5p_cpu_id used in drivers/usb/gadget/dwc2_udc_otg_phy.c is undefined on platforms other than Exynos.

---
 drivers/usb/gadget/dwc2_udc_otg_phy.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/gadget/dwc2_udc_otg_phy.c +2 -0
index e0ac5d142b0..c56ff1125bd 100644
@@ -56,10 +56,12 @@ void otg_phy_init(struct dwc2_udc *dev)
 	else /* C110 GONI */
 		clrbits_le32(&phy->phypwr, OTG_DISABLE_0 | ANALOG_PWRDOWN | FORCE_SUSPEND_0);
 
+#if defined(CONFIG_ARCH_EXYNOS) || defined(CONFIG_ARCH_S5PC1XX)
 	if (s5p_cpu_id == 0x4412)
 		clrsetbits_le32(&phy->phyclk, EXYNOS4X12_ID_PULLUP0 | EXYNOS4X12_COMMON_ON_N0,
 				EXYNOS4X12_CLK_SEL_24MHZ); /* PLL 24Mhz */
 	else
+#endif
 		clrsetbits_le32(&phy->phyclk, ID_PULLUP0 | COMMON_ON_N0,
 				CLK_SEL_24MHZ); /* PLL 24Mhz */
 
Signature · 1 line
2.52.0
#5 lore raw
Quoted 14 lines · Marius Dinu

s5p_cpu_id used in drivers/usb/gadget/dwc2_udc_otg_phy.c is undefined on platforms other than Exynos.

---
  drivers/usb/gadget/dwc2_udc_otg_phy.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/usb/gadget/dwc2_udc_otg_phy.c +0 -0
index e0ac5d142b0..c56ff1125bd 100644

drivers/usb/gadget/dwc2_udc_otg_phy.c void otg_phy_init(struct dwc2_udc *dev) · line 57

Quoted 2 lines
drivers/usb/gadget/dwc2_udc_otg_phy.c +0 -0
@@ -56,10 +56,12 @@ void otg_phy_init(struct dwc2_udc *dev)
  	else /* C110 GONI */
  		clrbits_le32(&phy->phypwr, OTG_DISABLE_0 | ANALOG_PWRDOWN | FORCE_SUSPEND_0);

This ^ C210 Universal and C110 Goni stuff is also Exynos specific. Do we need some SoC-specific dwc2_udc_otg_phy_exynos.c file which would contain that SoC specific code ?

Quoted 8 lines
drivers/usb/gadget/dwc2_udc_otg_phy.c +2 -0
+#if defined(CONFIG_ARCH_EXYNOS) || defined(CONFIG_ARCH_S5PC1XX)
  	if (s5p_cpu_id == 0x4412)
  		clrsetbits_le32(&phy->phyclk, EXYNOS4X12_ID_PULLUP0 | EXYNOS4X12_COMMON_ON_N0,
  				EXYNOS4X12_CLK_SEL_24MHZ); /* PLL 24Mhz */
  	else
+#endif
  		clrsetbits_le32(&phy->phyclk, ID_PULLUP0 | COMMON_ON_N0,
  				CLK_SEL_24MHZ); /* PLL 24Mhz */

[...]