Skip to content

Commit

Permalink
Merge tag 'phy-for-4.10' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/kishon/linux-phy into usb-next

Kishon writes:

phy: for 4.10

Merge contains:
 *) Add new usb2 phy driver for Meson8b and GXBB
 *) Remove phy drivers added for miphy365 and STiH415/6 (as support for
    these SoCs are removed from the kernel)
 *) Add a sysfs entry to facilitate usb role swap in rcar SoC
 *) Add support for otg port in rk3399
 *) misc fixes in various phy drivers and cleanups

Signed-off-by: Kishon Vijay Abraham I <[email protected]>
  • Loading branch information
gregkh committed Nov 28, 2016
2 parents 0edbf9e + 5e253df commit cdefb95
Show file tree
Hide file tree
Showing 23 changed files with 1,042 additions and 924 deletions.
15 changes: 15 additions & 0 deletions Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
What: /sys/devices/platform/<phy-name>/role
Date: October 2016
KernelVersion: 4.10
Contact: Yoshihiro Shimoda <[email protected]>
Description:
This file can be read and write.
The file can show/change the phy mode for role swap of usb.

Write the following strings to change the mode:
"host" - switching mode from peripheral to host.
"peripheral" - switching mode from host to peripheral.

Read the file, then it shows the following strings:
"host" - The mode is host now.
"peripheral" - The mode is peripheral now.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* Amlogic USB2 PHY
* Amlogic Meson8b and GXBB USB2 PHY

Required properties:
- compatible: Depending on the platform this should be one of:
Expand All @@ -16,10 +16,10 @@ Optional properties:

Example:

usb0_phy: usb_phy@0 {
usb0_phy: usb-phy@c0000000 {
compatible = "amlogic,meson-gxbb-usb2-phy";
#phy-cells = <0>;
reg = <0x0 0x0 0x0 0x20>;
reg = <0x0 0xc0000000 0x0 0x20>;
resets = <&reset RESET_USB_OTG>;
clocks = <&clkc CLKID_USB>, <&clkc CLKID_USB0>;
clock-names = "usb_general", "usb";
Expand Down
33 changes: 15 additions & 18 deletions drivers/phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,6 @@ config PHY_MIPHY28LP
Enable this to support the miphy transceiver (for SATA/PCIE/USB3)
that is part of STMicroelectronics STiH407 SoC.

config PHY_MIPHY365X
tristate "STMicroelectronics MIPHY365X PHY driver for STiH41x series"
depends on ARCH_STI
depends on HAS_IOMEM
depends on OF
select GENERIC_PHY
help
Enable this to support the miphy transceiver (for SATA/PCIE)
that is part of STMicroelectronics STiH41x SoC series.

config PHY_RCAR_GEN2
tristate "Renesas R-Car generation 2 USB PHY driver"
depends on ARCH_RENESAS
Expand Down Expand Up @@ -373,7 +363,9 @@ config PHY_ROCKCHIP_INNO_USB2
tristate "Rockchip INNO USB2PHY Driver"
depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF
depends on COMMON_CLK
depends on USB_SUPPORT
select GENERIC_PHY
select USB_COMMON
help
Support for Rockchip USB2.0 PHY with Innosilicon IP block.

Expand Down Expand Up @@ -438,14 +430,6 @@ config PHY_STIH407_USB
Enable this support to enable the picoPHY device used by USB2
and USB3 controllers on STMicroelectronics STiH407 SoC families.

config PHY_STIH41X_USB
tristate "STMicroelectronics USB2 PHY driver for STiH41x series"
depends on ARCH_STI
select GENERIC_PHY
help
Enable this to support the USB transceiver that is part of
STMicroelectronics STiH41x SoC series.

config PHY_QCOM_UFS
tristate "Qualcomm UFS PHY driver"
depends on OF && ARCH_QCOM
Expand Down Expand Up @@ -489,4 +473,17 @@ config PHY_NS2_PCIE
help
Enable this to support the Broadcom Northstar2 PCIe PHY.
If unsure, say N.

config PHY_MESON8B_USB2
tristate "Meson8b and GXBB USB2 PHY driver"
default ARCH_MESON
depends on OF && (ARCH_MESON || COMPILE_TEST)
depends on USB_SUPPORT
select USB_COMMON
select GENERIC_PHY
help
Enable this to support the Meson USB2 PHYs found in Meson8b
and GXBB SoCs.
If unsure, say N.

endmenu
3 changes: 1 addition & 2 deletions drivers/phy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ obj-$(CONFIG_PHY_PXA_28NM_USB2) += phy-pxa-28nm-usb2.o
obj-$(CONFIG_PHY_PXA_28NM_HSIC) += phy-pxa-28nm-hsic.o
obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o
obj-$(CONFIG_PHY_MIPHY28LP) += phy-miphy28lp.o
obj-$(CONFIG_PHY_MIPHY365X) += phy-miphy365x.o
obj-$(CONFIG_PHY_RCAR_GEN2) += phy-rcar-gen2.o
obj-$(CONFIG_PHY_RCAR_GEN3_USB2) += phy-rcar-gen3-usb2.o
obj-$(CONFIG_OMAP_CONTROL_PHY) += phy-omap-control.o
Expand Down Expand Up @@ -50,7 +49,6 @@ obj-$(CONFIG_PHY_ST_SPEAR1310_MIPHY) += phy-spear1310-miphy.o
obj-$(CONFIG_PHY_ST_SPEAR1340_MIPHY) += phy-spear1340-miphy.o
obj-$(CONFIG_PHY_XGENE) += phy-xgene.o
obj-$(CONFIG_PHY_STIH407_USB) += phy-stih407-usb.o
obj-$(CONFIG_PHY_STIH41X_USB) += phy-stih41x-usb.o
obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs.o
obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-20nm.o
obj-$(CONFIG_PHY_QCOM_UFS) += phy-qcom-ufs-qmp-14nm.o
Expand All @@ -60,3 +58,4 @@ obj-$(CONFIG_PHY_PISTACHIO_USB) += phy-pistachio-usb.o
obj-$(CONFIG_PHY_CYGNUS_PCIE) += phy-bcm-cygnus-pcie.o
obj-$(CONFIG_ARCH_TEGRA) += tegra/
obj-$(CONFIG_PHY_NS2_PCIE) += phy-bcm-ns2-pcie.o
obj-$(CONFIG_PHY_MESON8B_USB2) += phy-meson8b-usb2.o
3 changes: 1 addition & 2 deletions drivers/phy/phy-berlin-sata.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ static int phy_berlin_sata_power_on(struct phy *phy)
struct phy_berlin_desc *desc = phy_get_drvdata(phy);
struct phy_berlin_priv *priv = dev_get_drvdata(phy->dev.parent);
void __iomem *ctrl_reg = priv->base + 0x60 + (desc->index * 0x80);
int ret = 0;
u32 regval;

clk_prepare_enable(priv->clk);
Expand Down Expand Up @@ -130,7 +129,7 @@ static int phy_berlin_sata_power_on(struct phy *phy)

clk_disable_unprepare(priv->clk);

return ret;
return 0;
}

static int phy_berlin_sata_power_off(struct phy *phy)
Expand Down
6 changes: 3 additions & 3 deletions drivers/phy/phy-brcm-sata.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static inline void __iomem *brcm_sata_pcb_base(struct brcm_sata_port *port)
default:
dev_err(priv->dev, "invalid phy version\n");
break;
};
}

return priv->phy_base + (port->portnum * size);
}
Expand All @@ -157,7 +157,7 @@ static inline void __iomem *brcm_sata_ctrl_base(struct brcm_sata_port *port)
default:
dev_err(priv->dev, "invalid phy version\n");
break;
};
}

return priv->ctrl_base + (port->portnum * size);
}
Expand Down Expand Up @@ -365,7 +365,7 @@ static int brcm_sata_phy_init(struct phy *phy)
break;
default:
rc = -ENODEV;
};
}

return rc;
}
Expand Down
5 changes: 5 additions & 0 deletions drivers/phy/phy-da8xx-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <linux/platform_device.h>
#include <linux/regmap.h>

#define PHY_INIT_BITS (CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN)

struct da8xx_usb_phy {
struct phy_provider *phy_provider;
struct phy *usb11_phy;
Expand Down Expand Up @@ -208,6 +210,9 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
dev_warn(dev, "Failed to create usb20 phy lookup\n");
}

regmap_write_bits(d_phy->regmap, CFGCHIP(2),
PHY_INIT_BITS, PHY_INIT_BITS);

return 0;
}

Expand Down
15 changes: 1 addition & 14 deletions drivers/phy/phy-exynos-mipi-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,6 @@ struct exynos_mipi_video_phy {
spinlock_t slock;
};

static inline int __is_running(const struct exynos_mipi_phy_desc *data,
struct exynos_mipi_video_phy *state)
{
u32 val;
int ret;

ret = regmap_read(state->regmaps[data->resetn_map], data->resetn_reg, &val);
if (ret)
return 0;

return val & data->resetn_val;
}

static int __set_phy_state(const struct exynos_mipi_phy_desc *data,
struct exynos_mipi_video_phy *state, unsigned int on)
{
Expand All @@ -251,7 +238,7 @@ static int __set_phy_state(const struct exynos_mipi_phy_desc *data,

/* disable in PMU sysreg */
if (!on && data->coupled_phy_id >= 0 &&
!__is_running(state->phys[data->coupled_phy_id].data, state)) {
state->phys[data->coupled_phy_id].phy->power_count == 0) {
regmap_read(state->regmaps[data->enable_map], data->enable_reg,
&val);
val &= ~data->enable_val;
Expand Down
4 changes: 2 additions & 2 deletions drivers/phy/phy-exynos4210-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static void exynos4210_isol(struct samsung_usb2_phy_instance *inst, bool on)
break;
default:
return;
};
}

regmap_update_bits(drv->reg_pmu, offset, mask, on ? 0 : mask);
}
Expand Down Expand Up @@ -179,7 +179,7 @@ static void exynos4210_phy_pwr(struct samsung_usb2_phy_instance *inst, bool on)
rstbits = EXYNOS_4210_URSTCON_PHY1_P1P2 |
EXYNOS_4210_URSTCON_HOST_LINK_P2;
break;
};
}

if (on) {
clk = readl(drv->reg_phy + EXYNOS_4210_UPHYCLK);
Expand Down
4 changes: 2 additions & 2 deletions drivers/phy/phy-exynos4x12-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static void exynos4x12_isol(struct samsung_usb2_phy_instance *inst, bool on)
break;
default:
return;
};
}

regmap_update_bits(drv->reg_pmu, offset, mask, on ? 0 : mask);
}
Expand Down Expand Up @@ -237,7 +237,7 @@ static void exynos4x12_phy_pwr(struct samsung_usb2_phy_instance *inst, bool on)
rstbits = EXYNOS_4x12_URSTCON_HSIC1 |
EXYNOS_4x12_URSTCON_HOST_LINK_P1;
break;
};
}

if (on) {
pwr = readl(drv->reg_phy + EXYNOS_4x12_UPHYPWR);
Expand Down
2 changes: 1 addition & 1 deletion drivers/phy/phy-exynos5250-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static void exynos5250_isol(struct samsung_usb2_phy_instance *inst, bool on)
break;
default:
return;
};
}

regmap_update_bits(drv->reg_pmu, offset, mask, on ? 0 : mask);
}
Expand Down
Loading

0 comments on commit cdefb95

Please sign in to comment.