Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: chipidea: imx: improve logic if samsung,picophy-* parameter is 0

In current driver, the value of tuning parameter will not take effect
if samsung,picophy-* is assigned as 0. Because 0 is also a valid value
acccording to the description of USB_PHY_CFG1 register, this will improve
the logic to let it work.

Fixes: 58a3cefb3840 ("usb: chipidea: imx: add two samsung picophy parameters tuning implementation")
cc: <stable@vger.kernel.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20230627112126.1882666-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Xu Yang and committed by
Greg Kroah-Hartman
36668515 8405bc52

+10 -6
+6 -4
drivers/usb/chipidea/ci_hdrc_imx.c
··· 176 176 if (of_usb_get_phy_mode(np) == USBPHY_INTERFACE_MODE_ULPI) 177 177 data->ulpi = 1; 178 178 179 - of_property_read_u32(np, "samsung,picophy-pre-emp-curr-control", 180 - &data->emp_curr_control); 181 - of_property_read_u32(np, "samsung,picophy-dc-vol-level-adjust", 182 - &data->dc_vol_level_adjust); 179 + if (of_property_read_u32(np, "samsung,picophy-pre-emp-curr-control", 180 + &data->emp_curr_control)) 181 + data->emp_curr_control = -1; 182 + if (of_property_read_u32(np, "samsung,picophy-dc-vol-level-adjust", 183 + &data->dc_vol_level_adjust)) 184 + data->dc_vol_level_adjust = -1; 183 185 184 186 return data; 185 187 }
+4 -2
drivers/usb/chipidea/usbmisc_imx.c
··· 660 660 usbmisc->base + MX7D_USBNC_USB_CTRL2); 661 661 /* PHY tuning for signal quality */ 662 662 reg = readl(usbmisc->base + MX7D_USB_OTG_PHY_CFG1); 663 - if (data->emp_curr_control && data->emp_curr_control <= 663 + if (data->emp_curr_control >= 0 && 664 + data->emp_curr_control <= 664 665 (TXPREEMPAMPTUNE0_MASK >> TXPREEMPAMPTUNE0_BIT)) { 665 666 reg &= ~TXPREEMPAMPTUNE0_MASK; 666 667 reg |= (data->emp_curr_control << TXPREEMPAMPTUNE0_BIT); 667 668 } 668 669 669 - if (data->dc_vol_level_adjust && data->dc_vol_level_adjust <= 670 + if (data->dc_vol_level_adjust >= 0 && 671 + data->dc_vol_level_adjust <= 670 672 (TXVREFTUNE0_MASK >> TXVREFTUNE0_BIT)) { 671 673 reg &= ~TXVREFTUNE0_MASK; 672 674 reg |= (data->dc_vol_level_adjust << TXVREFTUNE0_BIT);