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: add one fsl picophy parameter tuning implementation

In some cases, the user may need to tune the rise/fall time of the
high-speed transmitter waveform for USB Certification. This will add
a parameter for this purpose. The value will be fetched from dtb and
finally written to the register.

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-3-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Xu Yang and committed by
Greg Kroah-Hartman
3bd442e4 8d2c452c

+13
+3
drivers/usb/chipidea/ci_hdrc_imx.c
··· 182 182 if (of_property_read_u32(np, "samsung,picophy-dc-vol-level-adjust", 183 183 &data->dc_vol_level_adjust)) 184 184 data->dc_vol_level_adjust = -1; 185 + if (of_property_read_u32(np, "fsl,picophy-rise-fall-time-adjust", 186 + &data->rise_fall_time_adjust)) 187 + data->rise_fall_time_adjust = -1; 185 188 186 189 return data; 187 190 }
+1
drivers/usb/chipidea/ci_hdrc_imx.h
··· 28 28 enum usb_dr_mode available_role; /* runtime usb dr mode */ 29 29 int emp_curr_control; 30 30 int dc_vol_level_adjust; 31 + int rise_fall_time_adjust; 31 32 }; 32 33 33 34 int imx_usbmisc_init(struct imx_usbmisc_data *data);
+9
drivers/usb/chipidea/usbmisc_imx.c
··· 131 131 #define MX7D_USB_OTG_PHY_CFG1 0x30 132 132 #define TXPREEMPAMPTUNE0_BIT 28 133 133 #define TXPREEMPAMPTUNE0_MASK (3 << 28) 134 + #define TXRISETUNE0_BIT 24 135 + #define TXRISETUNE0_MASK (3 << 24) 134 136 #define TXVREFTUNE0_BIT 20 135 137 #define TXVREFTUNE0_MASK (0xf << 20) 136 138 ··· 674 672 (TXVREFTUNE0_MASK >> TXVREFTUNE0_BIT)) { 675 673 reg &= ~TXVREFTUNE0_MASK; 676 674 reg |= (data->dc_vol_level_adjust << TXVREFTUNE0_BIT); 675 + } 676 + 677 + if (data->rise_fall_time_adjust >= 0 && 678 + data->rise_fall_time_adjust <= 679 + (TXRISETUNE0_MASK >> TXRISETUNE0_BIT)) { 680 + reg &= ~TXRISETUNE0_MASK; 681 + reg |= (data->rise_fall_time_adjust << TXRISETUNE0_BIT); 677 682 } 678 683 679 684 writel(reg, usbmisc->base + MX7D_USB_OTG_PHY_CFG1);