Commit e434a90f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'phy-for-5.1-rc-v2' of...

Merge tag 'phy-for-5.1-rc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into char-misc-next

Kishon writes:

phy: for 5.1-rc

  *) Fix sun4i-usb PHY driver to get USB gadget working on H3/R40/V3/V3s
  *) Fix cable state handling in phy-twl4030-usb driver to get rid of
     regulator_put() warning
  *) Fix linker errors and compilation warnings got with randconfig
  *) Fix sparse warnings and .cocci warnings
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>

* tag 'phy-for-5.1-rc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy:
  phy: sun4i-usb: Make sure to disable PHY0 passby for peripheral mode
  phy: fix platform_no_drv_owner.cocci warnings
  phy: mapphone-mdm6600: add gpiolib dependency
  phy: ti: usb2: fix OMAP_CONTROL_PHY dependency
  phy: allwinner: allow compile testing
  phy: qcom-ufs: Make ufs_qcom_phy_disable_iface_clk static
  phy: rockchip-typec: Make usb3_pll_cfg and dp_pll_cfg static
  phy: phy-twl4030-usb: Fix cable state handling
parents 5450a5f4 e6f32efb
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
# #
config PHY_SUN4I_USB config PHY_SUN4I_USB
tristate "Allwinner sunxi SoC USB PHY driver" tristate "Allwinner sunxi SoC USB PHY driver"
depends on ARCH_SUNXI && HAS_IOMEM && OF depends on ARCH_SUNXI || COMPILE_TEST
depends on HAS_IOMEM
depends on RESET_CONTROLLER depends on RESET_CONTROLLER
depends on EXTCON depends on EXTCON
depends on POWER_SUPPLY depends on POWER_SUPPLY
...@@ -19,7 +20,8 @@ config PHY_SUN4I_USB ...@@ -19,7 +20,8 @@ config PHY_SUN4I_USB
config PHY_SUN6I_MIPI_DPHY config PHY_SUN6I_MIPI_DPHY
tristate "Allwinner A31 MIPI D-PHY Support" tristate "Allwinner A31 MIPI D-PHY Support"
depends on ARCH_SUNXI && HAS_IOMEM && OF depends on ARCH_SUNXI || COMPILE_TEST
depends on HAS_IOMEM
depends on RESET_CONTROLLER depends on RESET_CONTROLLER
select GENERIC_PHY select GENERIC_PHY
select GENERIC_PHY_MIPI_DPHY select GENERIC_PHY_MIPI_DPHY
...@@ -31,7 +33,8 @@ config PHY_SUN6I_MIPI_DPHY ...@@ -31,7 +33,8 @@ config PHY_SUN6I_MIPI_DPHY
config PHY_SUN9I_USB config PHY_SUN9I_USB
tristate "Allwinner sun9i SoC USB PHY driver" tristate "Allwinner sun9i SoC USB PHY driver"
depends on ARCH_SUNXI && HAS_IOMEM && OF depends on ARCH_SUNXI || COMPILE_TEST
depends on HAS_IOMEM
depends on RESET_CONTROLLER depends on RESET_CONTROLLER
depends on USB_SUPPORT depends on USB_SUPPORT
select USB_COMMON select USB_COMMON
......
...@@ -554,6 +554,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) ...@@ -554,6 +554,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work)
struct sun4i_usb_phy_data *data = struct sun4i_usb_phy_data *data =
container_of(work, struct sun4i_usb_phy_data, detect.work); container_of(work, struct sun4i_usb_phy_data, detect.work);
struct phy *phy0 = data->phys[0].phy; struct phy *phy0 = data->phys[0].phy;
struct sun4i_usb_phy *phy = phy_get_drvdata(phy0);
bool force_session_end, id_notify = false, vbus_notify = false; bool force_session_end, id_notify = false, vbus_notify = false;
int id_det, vbus_det; int id_det, vbus_det;
...@@ -610,6 +611,9 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) ...@@ -610,6 +611,9 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work)
mutex_unlock(&phy0->mutex); mutex_unlock(&phy0->mutex);
} }
/* Enable PHY0 passby for host mode only. */
sun4i_usb_phy_passby(phy, !id_det);
/* Re-route PHY0 if necessary */ /* Re-route PHY0 if necessary */
if (data->cfg->phy0_dual_route) if (data->cfg->phy0_dual_route)
sun4i_usb_phy0_reroute(data, id_det); sun4i_usb_phy0_reroute(data, id_det);
......
...@@ -266,7 +266,6 @@ static struct platform_driver mvebu_a3700_utmi_driver = { ...@@ -266,7 +266,6 @@ static struct platform_driver mvebu_a3700_utmi_driver = {
.probe = mvebu_a3700_utmi_phy_probe, .probe = mvebu_a3700_utmi_phy_probe,
.driver = { .driver = {
.name = "mvebu-a3700-utmi-phy", .name = "mvebu-a3700-utmi-phy",
.owner = THIS_MODULE,
.of_match_table = mvebu_a3700_utmi_of_match, .of_match_table = mvebu_a3700_utmi_of_match,
}, },
}; };
......
...@@ -13,7 +13,7 @@ config PHY_CPCAP_USB ...@@ -13,7 +13,7 @@ config PHY_CPCAP_USB
config PHY_MAPPHONE_MDM6600 config PHY_MAPPHONE_MDM6600
tristate "Motorola Mapphone MDM6600 modem USB PHY driver" tristate "Motorola Mapphone MDM6600 modem USB PHY driver"
depends on OF && USB_SUPPORT depends on OF && USB_SUPPORT && GPIOLIB
select GENERIC_PHY select GENERIC_PHY
help help
Enable this for MDM6600 USB modem to work on Motorola phones Enable this for MDM6600 USB modem to work on Motorola phones
......
...@@ -459,7 +459,7 @@ static int ufs_qcom_phy_enable_iface_clk(struct ufs_qcom_phy *phy) ...@@ -459,7 +459,7 @@ static int ufs_qcom_phy_enable_iface_clk(struct ufs_qcom_phy *phy)
} }
/* Turn OFF M-PHY RMMI interface clocks */ /* Turn OFF M-PHY RMMI interface clocks */
void ufs_qcom_phy_disable_iface_clk(struct ufs_qcom_phy *phy) static void ufs_qcom_phy_disable_iface_clk(struct ufs_qcom_phy *phy)
{ {
if (phy->is_iface_clk_enabled) { if (phy->is_iface_clk_enabled) {
clk_disable_unprepare(phy->tx_iface_clk); clk_disable_unprepare(phy->tx_iface_clk);
......
...@@ -400,7 +400,7 @@ struct phy_reg { ...@@ -400,7 +400,7 @@ struct phy_reg {
u32 addr; u32 addr;
}; };
struct phy_reg usb3_pll_cfg[] = { static struct phy_reg usb3_pll_cfg[] = {
{ 0xf0, CMN_PLL0_VCOCAL_INIT }, { 0xf0, CMN_PLL0_VCOCAL_INIT },
{ 0x18, CMN_PLL0_VCOCAL_ITER }, { 0x18, CMN_PLL0_VCOCAL_ITER },
{ 0xd0, CMN_PLL0_INTDIV }, { 0xd0, CMN_PLL0_INTDIV },
...@@ -417,7 +417,7 @@ struct phy_reg usb3_pll_cfg[] = { ...@@ -417,7 +417,7 @@ struct phy_reg usb3_pll_cfg[] = {
{ 0x8, CMN_DIAG_PLL0_LF_PROG }, { 0x8, CMN_DIAG_PLL0_LF_PROG },
}; };
struct phy_reg dp_pll_cfg[] = { static struct phy_reg dp_pll_cfg[] = {
{ 0xf0, CMN_PLL1_VCOCAL_INIT }, { 0xf0, CMN_PLL1_VCOCAL_INIT },
{ 0x18, CMN_PLL1_VCOCAL_ITER }, { 0x18, CMN_PLL1_VCOCAL_ITER },
{ 0x30b9, CMN_PLL1_VCOCAL_START }, { 0x30b9, CMN_PLL1_VCOCAL_START },
......
...@@ -37,7 +37,7 @@ config OMAP_USB2 ...@@ -37,7 +37,7 @@ config OMAP_USB2
depends on USB_SUPPORT depends on USB_SUPPORT
select GENERIC_PHY select GENERIC_PHY
select USB_PHY select USB_PHY
select OMAP_CONTROL_PHY if ARCH_OMAP2PLUS select OMAP_CONTROL_PHY if ARCH_OMAP2PLUS || COMPILE_TEST
help help
Enable this to support the transceiver that is part of SOC. This Enable this to support the transceiver that is part of SOC. This
driver takes care of all the PHY functionality apart from comparator. driver takes care of all the PHY functionality apart from comparator.
......
...@@ -172,6 +172,7 @@ struct twl4030_usb { ...@@ -172,6 +172,7 @@ struct twl4030_usb {
int irq; int irq;
enum musb_vbus_id_status linkstat; enum musb_vbus_id_status linkstat;
atomic_t connected;
bool vbus_supplied; bool vbus_supplied;
bool musb_mailbox_pending; bool musb_mailbox_pending;
...@@ -575,40 +576,30 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl) ...@@ -575,40 +576,30 @@ static irqreturn_t twl4030_usb_irq(int irq, void *_twl)
{ {
struct twl4030_usb *twl = _twl; struct twl4030_usb *twl = _twl;
enum musb_vbus_id_status status; enum musb_vbus_id_status status;
bool status_changed = false;
int err; int err;
status = twl4030_usb_linkstat(twl); status = twl4030_usb_linkstat(twl);
mutex_lock(&twl->lock); mutex_lock(&twl->lock);
if (status >= 0 && status != twl->linkstat) {
status_changed =
cable_present(twl->linkstat) !=
cable_present(status);
twl->linkstat = status; twl->linkstat = status;
}
mutex_unlock(&twl->lock); mutex_unlock(&twl->lock);
if (status_changed) {
/* FIXME add a set_power() method so that B-devices can
* configure the charger appropriately. It's not always
* correct to consume VBUS power, and how much current to
* consume is a function of the USB configuration chosen
* by the host.
*
* REVISIT usb_gadget_vbus_connect(...) as needed, ditto
* its disconnect() sibling, when changing to/from the
* USB_LINK_VBUS state. musb_hdrc won't care until it
* starts to handle softconnect right.
*/
if (cable_present(status)) { if (cable_present(status)) {
if (atomic_add_unless(&twl->connected, 1, 1)) {
dev_dbg(twl->dev, "%s: cable connected %i\n",
__func__, status);
pm_runtime_get_sync(twl->dev); pm_runtime_get_sync(twl->dev);
twl->musb_mailbox_pending = true;
}
} else { } else {
if (atomic_add_unless(&twl->connected, -1, 0)) {
dev_dbg(twl->dev, "%s: cable disconnected %i\n",
__func__, status);
pm_runtime_mark_last_busy(twl->dev); pm_runtime_mark_last_busy(twl->dev);
pm_runtime_put_autosuspend(twl->dev); pm_runtime_put_autosuspend(twl->dev);
}
twl->musb_mailbox_pending = true; twl->musb_mailbox_pending = true;
} }
}
if (twl->musb_mailbox_pending) { if (twl->musb_mailbox_pending) {
err = musb_mailbox(status); err = musb_mailbox(status);
if (!err) if (!err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment