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

Merge tag 'usb-ci-v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-next

Peter writes:

Two changes for chipidea imx driver:
- Add picophy parameter tuning interface
- Restore pinctrl for system suspend/resume

* tag 'usb-ci-v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb:
usb: chipidea: ci_hdrc_imx: restore pinctrl
usb: chipidea: imx: add two samsung picophy parameters tuning implementation
doc: dt-binding: ci-hdrc-usb2: add property for samsung picophy

+44 -1
+9
Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
··· 100 100 It's recommended to specify the over current polarity. 101 101 - power-active-high: power signal polarity is active high 102 102 - external-vbus-divider: enables off-chip resistor divider for Vbus 103 + - samsung,picophy-pre-emp-curr-control: HS Transmitter Pre-Emphasis Current 104 + Control. This signal controls the amount of current sourced to the 105 + USB_OTG*_DP and USB_OTG*_DN pins after a J-to-K or K-to-J transition. 106 + The range is from 0x0 to 0x3, the default value is 0x1. 107 + Details can refer to TXPREEMPAMPTUNE0 bits of USBNC_n_PHY_CFG1. 108 + - samsung,picophy-dc-vol-level-adjust: HS DC Voltage Level Adjustment. 109 + Adjust the high-speed transmitter DC level voltage. 110 + The range is from 0x0 to 0xf, the default value is 0x3. 111 + Details can refer to TXVREFTUNE0 bits of USBNC_n_PHY_CFG1. 103 112 104 113 Example: 105 114
+12 -1
drivers/usb/chipidea/ci_hdrc_imx.c
··· 165 165 if (of_usb_get_phy_mode(np) == USBPHY_INTERFACE_MODE_ULPI) 166 166 data->ulpi = 1; 167 167 168 + of_property_read_u32(np, "samsung,picophy-pre-emp-curr-control", 169 + &data->emp_curr_control); 170 + of_property_read_u32(np, "samsung,picophy-dc-vol-level-adjust", 171 + &data->dc_vol_level_adjust); 172 + 168 173 return data; 169 174 } 170 175 ··· 614 609 } 615 610 } 616 611 617 - return imx_controller_suspend(dev); 612 + ret = imx_controller_suspend(dev); 613 + if (ret) 614 + return ret; 615 + 616 + pinctrl_pm_select_sleep_state(dev); 617 + return ret; 618 618 } 619 619 620 620 static int __maybe_unused ci_hdrc_imx_resume(struct device *dev) ··· 627 617 struct ci_hdrc_imx_data *data = dev_get_drvdata(dev); 628 618 int ret; 629 619 620 + pinctrl_pm_select_default_state(dev); 630 621 ret = imx_controller_resume(dev); 631 622 if (!ret && data->supports_runtime_pm) { 632 623 pm_runtime_disable(dev);
+2
drivers/usb/chipidea/ci_hdrc_imx.h
··· 26 26 unsigned int ext_vbus:1; /* Vbus from exteranl event */ 27 27 struct usb_phy *usb_phy; 28 28 enum usb_dr_mode available_role; /* runtime usb dr mode */ 29 + int emp_curr_control; 30 + int dc_vol_level_adjust; 29 31 }; 30 32 31 33 int imx_usbmisc_init(struct imx_usbmisc_data *data);
+21
drivers/usb/chipidea/usbmisc_imx.c
··· 128 128 #define MX7D_USB_OTG_PHY_STATUS_VBUS_VLD BIT(3) 129 129 #define MX7D_USB_OTG_PHY_STATUS_CHRGDET BIT(29) 130 130 131 + #define MX7D_USB_OTG_PHY_CFG1 0x30 132 + #define TXPREEMPAMPTUNE0_BIT 28 133 + #define TXPREEMPAMPTUNE0_MASK (3 << 28) 134 + #define TXVREFTUNE0_BIT 20 135 + #define TXVREFTUNE0_MASK (0xf << 20) 136 + 131 137 #define MX6_USB_OTG_WAKEUP_BITS (MX6_BM_WAKEUP_ENABLE | MX6_BM_VBUS_WAKEUP | \ 132 138 MX6_BM_ID_WAKEUP) 133 139 ··· 655 649 writel(reg | MX7D_USB_VBUS_WAKEUP_SOURCE_BVALID 656 650 | MX7D_USBNC_AUTO_RESUME, 657 651 usbmisc->base + MX7D_USBNC_USB_CTRL2); 652 + /* PHY tuning for signal quality */ 653 + reg = readl(usbmisc->base + MX7D_USB_OTG_PHY_CFG1); 654 + if (data->emp_curr_control && data->emp_curr_control <= 655 + (TXPREEMPAMPTUNE0_MASK >> TXPREEMPAMPTUNE0_BIT)) { 656 + reg &= ~TXPREEMPAMPTUNE0_MASK; 657 + reg |= (data->emp_curr_control << TXPREEMPAMPTUNE0_BIT); 658 + } 659 + 660 + if (data->dc_vol_level_adjust && data->dc_vol_level_adjust <= 661 + (TXVREFTUNE0_MASK >> TXVREFTUNE0_BIT)) { 662 + reg &= ~TXVREFTUNE0_MASK; 663 + reg |= (data->dc_vol_level_adjust << TXVREFTUNE0_BIT); 664 + } 665 + 666 + writel(reg, usbmisc->base + MX7D_USB_OTG_PHY_CFG1); 658 667 } 659 668 660 669 spin_unlock_irqrestore(&usbmisc->lock, flags);