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

Merge tag 'phy-for-4.3' of...

Merge tag 'phy-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next

Kishon writes:

phy: for 4.3

*) Add new NXP USB OTG PHY driver
*) Add vbus/id detection, extcon support and fixes in phy-sun4i-usb
   driver
*) Add support to use phy-sun4i-usb driver for sun8i-a23 and sun8i-a33
   SoCs
*) Other trivial code cleanups, dropping .owner assignment and constify
   phy_ops
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parents 37a842d3 cfd093bb
NXP LPC18xx/43xx internal USB OTG PHY binding
---------------------------------------------
This file contains documentation for the internal USB OTG PHY found
in NXP LPC18xx and LPC43xx SoCs.
Required properties:
- compatible : must be "nxp,lpc1850-usb-otg-phy"
- clocks : must be exactly one entry
See: Documentation/devicetree/bindings/clock/clock-bindings.txt
- #phy-cells : must be 0 for this phy
See: Documentation/devicetree/bindings/phy/phy-bindings.txt
The phy node must be a child of the creg syscon node.
Example:
creg: syscon@40043000 {
compatible = "nxp,lpc1850-creg", "syscon", "simple-mfd";
reg = <0x40043000 0x1000>;
usb0_otg_phy: phy@004 {
compatible = "nxp,lpc1850-usb-otg-phy";
clocks = <&ccu1 CLK_USB0>;
#phy-cells = <0>;
};
};
...@@ -7,6 +7,8 @@ Required properties: ...@@ -7,6 +7,8 @@ Required properties:
* allwinner,sun5i-a13-usb-phy * allwinner,sun5i-a13-usb-phy
* allwinner,sun6i-a31-usb-phy * allwinner,sun6i-a31-usb-phy
* allwinner,sun7i-a20-usb-phy * allwinner,sun7i-a20-usb-phy
* allwinner,sun8i-a23-usb-phy
* allwinner,sun8i-a33-usb-phy
- reg : a list of offset + length pairs - reg : a list of offset + length pairs
- reg-names : - reg-names :
* "phy_ctrl" * "phy_ctrl"
...@@ -17,12 +19,21 @@ Required properties: ...@@ -17,12 +19,21 @@ Required properties:
- clock-names : - clock-names :
* "usb_phy" for sun4i, sun5i or sun7i * "usb_phy" for sun4i, sun5i or sun7i
* "usb0_phy", "usb1_phy" and "usb2_phy" for sun6i * "usb0_phy", "usb1_phy" and "usb2_phy" for sun6i
* "usb0_phy", "usb1_phy" for sun8i
- resets : a list of phandle + reset specifier pairs - resets : a list of phandle + reset specifier pairs
- reset-names : - reset-names :
* "usb0_reset" * "usb0_reset"
* "usb1_reset" * "usb1_reset"
* "usb2_reset" for sun4i, sun6i or sun7i * "usb2_reset" for sun4i, sun6i or sun7i
Optional properties:
- usb0_id_det-gpios : gpio phandle for reading the otg id pin value
- usb0_vbus_det-gpios : gpio phandle for detecting the presence of usb0 vbus
- usb0_vbus_power-supply: power-supply phandle for usb0 vbus presence detect
- usb0_vbus-supply : regulator phandle for controller usb0 vbus
- usb1_vbus-supply : regulator phandle for controller usb1 vbus
- usb2_vbus-supply : regulator phandle for controller usb2 vbus
Example: Example:
usbphy: phy@0x01c13400 { usbphy: phy@0x01c13400 {
#phy-cells = <1>; #phy-cells = <1>;
...@@ -32,6 +43,13 @@ Example: ...@@ -32,6 +43,13 @@ Example:
reg-names = "phy_ctrl", "pmu1", "pmu2"; reg-names = "phy_ctrl", "pmu1", "pmu2";
clocks = <&usb_clk 8>; clocks = <&usb_clk 8>;
clock-names = "usb_phy"; clock-names = "usb_phy";
resets = <&usb_clk 1>, <&usb_clk 2>; resets = <&usb_clk 0>, <&usb_clk 1>, <&usb_clk 2>;
reset-names = "usb1_reset", "usb2_reset"; reset-names = "usb0_reset", "usb1_reset", "usb2_reset";
pinctrl-names = "default";
pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
usb0_id_det-gpios = <&pio 7 19 GPIO_ACTIVE_HIGH>; /* PH19 */
usb0_vbus_det-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
usb0_vbus-supply = <&reg_usb0_vbus>;
usb1_vbus-supply = <&reg_usb1_vbus>;
usb2_vbus-supply = <&reg_usb2_vbus>;
}; };
...@@ -54,6 +54,17 @@ config PHY_EXYNOS_MIPI_VIDEO ...@@ -54,6 +54,17 @@ config PHY_EXYNOS_MIPI_VIDEO
Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P Support for MIPI CSI-2 and MIPI DSI DPHY found on Samsung S5P
and EXYNOS SoCs. and EXYNOS SoCs.
config PHY_LPC18XX_USB_OTG
tristate "NXP LPC18xx/43xx SoC USB OTG PHY driver"
depends on OF && (ARCH_LPC18XX || COMPILE_TEST)
depends on MFD_SYSCON
select GENERIC_PHY
help
Enable this to support NXP LPC18xx/43xx internal USB OTG PHY.
This driver is need for USB0 support on LPC18xx/43xx and takes
care of enabling and clock setup.
config PHY_PXA_28NM_HSIC config PHY_PXA_28NM_HSIC
tristate "Marvell USB HSIC 28nm PHY Driver" tristate "Marvell USB HSIC 28nm PHY Driver"
depends on HAS_IOMEM depends on HAS_IOMEM
...@@ -199,6 +210,8 @@ config PHY_SUN4I_USB ...@@ -199,6 +210,8 @@ 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 && HAS_IOMEM && OF
depends on RESET_CONTROLLER depends on RESET_CONTROLLER
depends on EXTCON
depends on POWER_SUPPLY
select GENERIC_PHY select GENERIC_PHY
help help
Enable this to support the transceiver that is part of Allwinner Enable this to support the transceiver that is part of Allwinner
......
...@@ -10,6 +10,7 @@ obj-$(CONFIG_ARMADA375_USBCLUSTER_PHY) += phy-armada375-usb2.o ...@@ -10,6 +10,7 @@ obj-$(CONFIG_ARMADA375_USBCLUSTER_PHY) += phy-armada375-usb2.o
obj-$(CONFIG_BCM_KONA_USB2_PHY) += phy-bcm-kona-usb2.o obj-$(CONFIG_BCM_KONA_USB2_PHY) += phy-bcm-kona-usb2.o
obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO) += phy-exynos-dp-video.o obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO) += phy-exynos-dp-video.o
obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o
obj-$(CONFIG_PHY_LPC18XX_USB_OTG) += phy-lpc18xx-usb-otg.o
obj-$(CONFIG_PHY_PXA_28NM_USB2) += phy-pxa-28nm-usb2.o 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_PXA_28NM_HSIC) += phy-pxa-28nm-hsic.o
obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o
......
...@@ -51,7 +51,7 @@ static int armada375_usb_phy_init(struct phy *phy) ...@@ -51,7 +51,7 @@ static int armada375_usb_phy_init(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops armada375_usb_phy_ops = { static const struct phy_ops armada375_usb_phy_ops = {
.init = armada375_usb_phy_init, .init = armada375_usb_phy_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
...@@ -149,7 +149,6 @@ static struct platform_driver armada375_usb_phy_driver = { ...@@ -149,7 +149,6 @@ static struct platform_driver armada375_usb_phy_driver = {
.driver = { .driver = {
.of_match_table = of_usb_cluster_table, .of_match_table = of_usb_cluster_table,
.name = "armada-375-usb-cluster", .name = "armada-375-usb-cluster",
.owner = THIS_MODULE,
} }
}; };
module_platform_driver(armada375_usb_phy_driver); module_platform_driver(armada375_usb_phy_driver);
......
...@@ -91,7 +91,7 @@ static int bcm_kona_usb_phy_power_off(struct phy *gphy) ...@@ -91,7 +91,7 @@ static int bcm_kona_usb_phy_power_off(struct phy *gphy)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.init = bcm_kona_usb_phy_init, .init = bcm_kona_usb_phy_init,
.power_on = bcm_kona_usb_phy_power_on, .power_on = bcm_kona_usb_phy_power_on,
.power_off = bcm_kona_usb_phy_power_off, .power_off = bcm_kona_usb_phy_power_off,
......
...@@ -176,7 +176,7 @@ static struct phy *phy_berlin_sata_phy_xlate(struct device *dev, ...@@ -176,7 +176,7 @@ static struct phy *phy_berlin_sata_phy_xlate(struct device *dev,
return priv->phys[i]->phy; return priv->phys[i]->phy;
} }
static struct phy_ops phy_berlin_sata_ops = { static const struct phy_ops phy_berlin_sata_ops = {
.power_on = phy_berlin_sata_power_on, .power_on = phy_berlin_sata_power_on,
.power_off = phy_berlin_sata_power_off, .power_off = phy_berlin_sata_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -147,12 +147,12 @@ static int phy_berlin_usb_power_on(struct phy *phy) ...@@ -147,12 +147,12 @@ static int phy_berlin_usb_power_on(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops phy_berlin_usb_ops = { static const struct phy_ops phy_berlin_usb_ops = {
.power_on = phy_berlin_usb_power_on, .power_on = phy_berlin_usb_power_on,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static const struct of_device_id phy_berlin_sata_of_match[] = { static const struct of_device_id phy_berlin_usb_of_match[] = {
{ {
.compatible = "marvell,berlin2-usb-phy", .compatible = "marvell,berlin2-usb-phy",
.data = &phy_berlin_pll_dividers[0], .data = &phy_berlin_pll_dividers[0],
...@@ -163,12 +163,12 @@ static const struct of_device_id phy_berlin_sata_of_match[] = { ...@@ -163,12 +163,12 @@ static const struct of_device_id phy_berlin_sata_of_match[] = {
}, },
{ }, { },
}; };
MODULE_DEVICE_TABLE(of, phy_berlin_sata_of_match); MODULE_DEVICE_TABLE(of, phy_berlin_usb_of_match);
static int phy_berlin_usb_probe(struct platform_device *pdev) static int phy_berlin_usb_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match = const struct of_device_id *match =
of_match_device(phy_berlin_sata_of_match, &pdev->dev); of_match_device(phy_berlin_usb_of_match, &pdev->dev);
struct phy_berlin_usb_priv *priv; struct phy_berlin_usb_priv *priv;
struct resource *res; struct resource *res;
struct phy *phy; struct phy *phy;
...@@ -207,8 +207,7 @@ static struct platform_driver phy_berlin_usb_driver = { ...@@ -207,8 +207,7 @@ static struct platform_driver phy_berlin_usb_driver = {
.probe = phy_berlin_usb_probe, .probe = phy_berlin_usb_probe,
.driver = { .driver = {
.name = "phy-berlin-usb", .name = "phy-berlin-usb",
.owner = THIS_MODULE, .of_match_table = phy_berlin_usb_of_match,
.of_match_table = phy_berlin_sata_of_match,
}, },
}; };
module_platform_driver(phy_berlin_usb_driver); module_platform_driver(phy_berlin_usb_driver);
......
...@@ -122,7 +122,7 @@ static int brcm_sata_phy_init(struct phy *phy) ...@@ -122,7 +122,7 @@ static int brcm_sata_phy_init(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops phy_ops_28nm = { static const struct phy_ops phy_ops_28nm = {
.init = brcm_sata_phy_init, .init = brcm_sata_phy_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -113,7 +113,7 @@ static int dm816x_usb_phy_init(struct phy *x) ...@@ -113,7 +113,7 @@ static int dm816x_usb_phy_init(struct phy *x)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.init = dm816x_usb_phy_init, .init = dm816x_usb_phy_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -48,7 +48,7 @@ static int exynos_dp_video_phy_power_off(struct phy *phy) ...@@ -48,7 +48,7 @@ static int exynos_dp_video_phy_power_off(struct phy *phy)
EXYNOS5_PHY_ENABLE, 0); EXYNOS5_PHY_ENABLE, 0);
} }
static struct phy_ops exynos_dp_video_phy_ops = { static const struct phy_ops exynos_dp_video_phy_ops = {
.power_on = exynos_dp_video_phy_power_on, .power_on = exynos_dp_video_phy_power_on,
.power_off = exynos_dp_video_phy_power_off, .power_off = exynos_dp_video_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -124,7 +124,7 @@ static struct phy *exynos_mipi_video_phy_xlate(struct device *dev, ...@@ -124,7 +124,7 @@ static struct phy *exynos_mipi_video_phy_xlate(struct device *dev,
return state->phys[args->args[0]].phy; return state->phys[args->args[0]].phy;
} }
static struct phy_ops exynos_mipi_video_phy_ops = { static const struct phy_ops exynos_mipi_video_phy_ops = {
.power_on = exynos_mipi_video_phy_power_on, .power_on = exynos_mipi_video_phy_power_on,
.power_off = exynos_mipi_video_phy_power_off, .power_off = exynos_mipi_video_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -537,7 +537,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct device *dev, ...@@ -537,7 +537,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct device *dev,
return phy_drd->phys[args->args[0]].phy; return phy_drd->phys[args->args[0]].phy;
} }
static struct phy_ops exynos5_usbdrd_phy_ops = { static const struct phy_ops exynos5_usbdrd_phy_ops = {
.init = exynos5_usbdrd_phy_init, .init = exynos5_usbdrd_phy_init,
.exit = exynos5_usbdrd_phy_exit, .exit = exynos5_usbdrd_phy_exit,
.power_on = exynos5_usbdrd_phy_power_on, .power_on = exynos5_usbdrd_phy_power_on,
......
...@@ -154,7 +154,7 @@ static int exynos_sata_phy_init(struct phy *phy) ...@@ -154,7 +154,7 @@ static int exynos_sata_phy_init(struct phy *phy)
return ret; return ret;
} }
static struct phy_ops exynos_sata_phy_ops = { static const struct phy_ops exynos_sata_phy_ops = {
.init = exynos_sata_phy_init, .init = exynos_sata_phy_init,
.power_on = exynos_sata_phy_power_on, .power_on = exynos_sata_phy_power_on,
.power_off = exynos_sata_phy_power_off, .power_off = exynos_sata_phy_power_off,
......
...@@ -129,7 +129,7 @@ static int hix5hd2_sata_phy_init(struct phy *phy) ...@@ -129,7 +129,7 @@ static int hix5hd2_sata_phy_init(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops hix5hd2_sata_phy_ops = { static const struct phy_ops hix5hd2_sata_phy_ops = {
.init = hix5hd2_sata_phy_init, .init = hix5hd2_sata_phy_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
/*
* PHY driver for NXP LPC18xx/43xx internal USB OTG PHY
*
* Copyright (C) 2015 Joachim Eastwood <manabian@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
/* USB OTG PHY register offset and bit in CREG */
#define LPC18XX_CREG_CREG0 0x004
#define LPC18XX_CREG_CREG0_USB0PHY BIT(5)
struct lpc18xx_usb_otg_phy {
struct phy *phy;
struct clk *clk;
struct regmap *reg;
};
static int lpc18xx_usb_otg_phy_init(struct phy *phy)
{
struct lpc18xx_usb_otg_phy *lpc = phy_get_drvdata(phy);
int ret;
/* The PHY must be clocked at 480 MHz */
ret = clk_set_rate(lpc->clk, 480000000);
if (ret)
return ret;
return clk_prepare(lpc->clk);
}
static int lpc18xx_usb_otg_phy_exit(struct phy *phy)
{
struct lpc18xx_usb_otg_phy *lpc = phy_get_drvdata(phy);
clk_unprepare(lpc->clk);
return 0;
}
static int lpc18xx_usb_otg_phy_power_on(struct phy *phy)
{
struct lpc18xx_usb_otg_phy *lpc = phy_get_drvdata(phy);
int ret;
ret = clk_enable(lpc->clk);
if (ret)
return ret;
/* The bit in CREG is cleared to enable the PHY */
return regmap_update_bits(lpc->reg, LPC18XX_CREG_CREG0,
LPC18XX_CREG_CREG0_USB0PHY, 0);
}
static int lpc18xx_usb_otg_phy_power_off(struct phy *phy)
{
struct lpc18xx_usb_otg_phy *lpc = phy_get_drvdata(phy);
int ret;
ret = regmap_update_bits(lpc->reg, LPC18XX_CREG_CREG0,
LPC18XX_CREG_CREG0_USB0PHY,
LPC18XX_CREG_CREG0_USB0PHY);
if (ret)
return ret;
clk_disable(lpc->clk);
return 0;
}
static const struct phy_ops lpc18xx_usb_otg_phy_ops = {
.init = lpc18xx_usb_otg_phy_init,
.exit = lpc18xx_usb_otg_phy_exit,
.power_on = lpc18xx_usb_otg_phy_power_on,
.power_off = lpc18xx_usb_otg_phy_power_off,
.owner = THIS_MODULE,
};
static int lpc18xx_usb_otg_phy_probe(struct platform_device *pdev)
{
struct phy_provider *phy_provider;
struct lpc18xx_usb_otg_phy *lpc;
lpc = devm_kzalloc(&pdev->dev, sizeof(*lpc), GFP_KERNEL);
if (!lpc)
return -ENOMEM;
lpc->reg = syscon_node_to_regmap(pdev->dev.of_node->parent);
if (IS_ERR(lpc->reg)) {
dev_err(&pdev->dev, "failed to get syscon\n");
return PTR_ERR(lpc->reg);
}
lpc->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(lpc->clk)) {
dev_err(&pdev->dev, "failed to get clock\n");
return PTR_ERR(lpc->clk);
}
lpc->phy = devm_phy_create(&pdev->dev, NULL, &lpc18xx_usb_otg_phy_ops);
if (IS_ERR(lpc->phy)) {
dev_err(&pdev->dev, "failed to create PHY\n");
return PTR_ERR(lpc->phy);
}
phy_set_drvdata(lpc->phy, lpc);
phy_provider = devm_of_phy_provider_register(&pdev->dev,
of_phy_simple_xlate);
return PTR_ERR_OR_ZERO(phy_provider);
}
static const struct of_device_id lpc18xx_usb_otg_phy_match[] = {
{ .compatible = "nxp,lpc1850-usb-otg-phy" },
{ }
};
MODULE_DEVICE_TABLE(of, lpc18xx_usb_otg_phy_match);
static struct platform_driver lpc18xx_usb_otg_phy_driver = {
.probe = lpc18xx_usb_otg_phy_probe,
.driver = {
.name = "lpc18xx-usb-otg-phy",
.of_match_table = lpc18xx_usb_otg_phy_match,
},
};
module_platform_driver(lpc18xx_usb_otg_phy_driver);
MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
MODULE_DESCRIPTION("NXP LPC18xx/43xx USB OTG PHY driver");
MODULE_LICENSE("GPL v2");
...@@ -1132,7 +1132,7 @@ static struct phy *miphy28lp_xlate(struct device *dev, ...@@ -1132,7 +1132,7 @@ static struct phy *miphy28lp_xlate(struct device *dev,
return miphy_phy->phy; return miphy_phy->phy;
} }
static struct phy_ops miphy28lp_ops = { static const struct phy_ops miphy28lp_ops = {
.init = miphy28lp_init, .init = miphy28lp_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
...@@ -1268,7 +1268,6 @@ static struct platform_driver miphy28lp_driver = { ...@@ -1268,7 +1268,6 @@ static struct platform_driver miphy28lp_driver = {
.probe = miphy28lp_probe, .probe = miphy28lp_probe,
.driver = { .driver = {
.name = "miphy28lp-phy", .name = "miphy28lp-phy",
.owner = THIS_MODULE,
.of_match_table = miphy28lp_of_match, .of_match_table = miphy28lp_of_match,
} }
}; };
......
...@@ -510,7 +510,7 @@ static struct phy *miphy365x_xlate(struct device *dev, ...@@ -510,7 +510,7 @@ static struct phy *miphy365x_xlate(struct device *dev,
return miphy_phy->phy; return miphy_phy->phy;
} }
static struct phy_ops miphy365x_ops = { static const struct phy_ops miphy365x_ops = {
.init = miphy365x_init, .init = miphy365x_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -75,7 +75,7 @@ static int phy_mvebu_sata_power_off(struct phy *phy) ...@@ -75,7 +75,7 @@ static int phy_mvebu_sata_power_off(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops phy_mvebu_sata_ops = { static const struct phy_ops phy_mvebu_sata_ops = {
.power_on = phy_mvebu_sata_power_on, .power_on = phy_mvebu_sata_power_on,
.power_off = phy_mvebu_sata_power_off, .power_off = phy_mvebu_sata_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -137,7 +137,7 @@ static int omap_usb_init(struct phy *x) ...@@ -137,7 +137,7 @@ static int omap_usb_init(struct phy *x)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.init = omap_usb_init, .init = omap_usb_init,
.power_on = omap_usb_power_on, .power_on = omap_usb_power_on,
.power_off = omap_usb_power_off, .power_off = omap_usb_power_off,
......
...@@ -204,7 +204,7 @@ static int qcom_apq8064_sata_phy_exit(struct phy *generic_phy) ...@@ -204,7 +204,7 @@ static int qcom_apq8064_sata_phy_exit(struct phy *generic_phy)
return 0; return 0;
} }
static struct phy_ops qcom_apq8064_sata_phy_ops = { static const struct phy_ops qcom_apq8064_sata_phy_ops = {
.init = qcom_apq8064_sata_phy_init, .init = qcom_apq8064_sata_phy_init,
.exit = qcom_apq8064_sata_phy_exit, .exit = qcom_apq8064_sata_phy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -126,7 +126,7 @@ static int qcom_ipq806x_sata_phy_exit(struct phy *generic_phy) ...@@ -126,7 +126,7 @@ static int qcom_ipq806x_sata_phy_exit(struct phy *generic_phy)
return 0; return 0;
} }
static struct phy_ops qcom_ipq806x_sata_phy_ops = { static const struct phy_ops qcom_ipq806x_sata_phy_ops = {
.init = qcom_ipq806x_sata_phy_init, .init = qcom_ipq806x_sata_phy_init,
.exit = qcom_ipq806x_sata_phy_exit, .exit = qcom_ipq806x_sata_phy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -150,7 +150,7 @@ int ufs_qcom_phy_remove(struct phy *generic_phy, ...@@ -150,7 +150,7 @@ int ufs_qcom_phy_remove(struct phy *generic_phy,
struct ufs_qcom_phy *ufs_qcom_phy); struct ufs_qcom_phy *ufs_qcom_phy);
struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev, struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
struct ufs_qcom_phy *common_cfg, struct ufs_qcom_phy *common_cfg,
struct phy_ops *ufs_qcom_phy_gen_ops, const struct phy_ops *ufs_qcom_phy_gen_ops,
struct ufs_qcom_phy_specific_ops *phy_spec_ops); struct ufs_qcom_phy_specific_ops *phy_spec_ops);
int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy, int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy,
struct ufs_qcom_phy_calibration *tbl_A, int tbl_size_A, struct ufs_qcom_phy_calibration *tbl_A, int tbl_size_A,
......
...@@ -115,7 +115,7 @@ static int ufs_qcom_phy_qmp_14nm_is_pcs_ready(struct ufs_qcom_phy *phy_common) ...@@ -115,7 +115,7 @@ static int ufs_qcom_phy_qmp_14nm_is_pcs_ready(struct ufs_qcom_phy *phy_common)
return err; return err;
} }
static struct phy_ops ufs_qcom_phy_qmp_14nm_phy_ops = { static const struct phy_ops ufs_qcom_phy_qmp_14nm_phy_ops = {
.init = ufs_qcom_phy_qmp_14nm_init, .init = ufs_qcom_phy_qmp_14nm_init,
.exit = ufs_qcom_phy_exit, .exit = ufs_qcom_phy_exit,
.power_on = ufs_qcom_phy_power_on, .power_on = ufs_qcom_phy_power_on,
...@@ -191,7 +191,6 @@ static struct platform_driver ufs_qcom_phy_qmp_14nm_driver = { ...@@ -191,7 +191,6 @@ static struct platform_driver ufs_qcom_phy_qmp_14nm_driver = {
.driver = { .driver = {
.of_match_table = ufs_qcom_phy_qmp_14nm_of_match, .of_match_table = ufs_qcom_phy_qmp_14nm_of_match,
.name = "ufs_qcom_phy_qmp_14nm", .name = "ufs_qcom_phy_qmp_14nm",
.owner = THIS_MODULE,
}, },
}; };
......
...@@ -171,7 +171,7 @@ static int ufs_qcom_phy_qmp_20nm_is_pcs_ready(struct ufs_qcom_phy *phy_common) ...@@ -171,7 +171,7 @@ static int ufs_qcom_phy_qmp_20nm_is_pcs_ready(struct ufs_qcom_phy *phy_common)
return err; return err;
} }
static struct phy_ops ufs_qcom_phy_qmp_20nm_phy_ops = { static const struct phy_ops ufs_qcom_phy_qmp_20nm_phy_ops = {
.init = ufs_qcom_phy_qmp_20nm_init, .init = ufs_qcom_phy_qmp_20nm_init,
.exit = ufs_qcom_phy_exit, .exit = ufs_qcom_phy_exit,
.power_on = ufs_qcom_phy_power_on, .power_on = ufs_qcom_phy_power_on,
...@@ -247,7 +247,6 @@ static struct platform_driver ufs_qcom_phy_qmp_20nm_driver = { ...@@ -247,7 +247,6 @@ static struct platform_driver ufs_qcom_phy_qmp_20nm_driver = {
.driver = { .driver = {
.of_match_table = ufs_qcom_phy_qmp_20nm_of_match, .of_match_table = ufs_qcom_phy_qmp_20nm_of_match,
.name = "ufs_qcom_phy_qmp_20nm", .name = "ufs_qcom_phy_qmp_20nm",
.owner = THIS_MODULE,
}, },
}; };
......
...@@ -77,7 +77,7 @@ EXPORT_SYMBOL_GPL(ufs_qcom_phy_calibrate); ...@@ -77,7 +77,7 @@ EXPORT_SYMBOL_GPL(ufs_qcom_phy_calibrate);
struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev, struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
struct ufs_qcom_phy *common_cfg, struct ufs_qcom_phy *common_cfg,
struct phy_ops *ufs_qcom_phy_gen_ops, const struct phy_ops *ufs_qcom_phy_gen_ops,
struct ufs_qcom_phy_specific_ops *phy_spec_ops) struct ufs_qcom_phy_specific_ops *phy_spec_ops)
{ {
int err; int err;
......
...@@ -184,7 +184,7 @@ static int rcar_gen2_phy_power_off(struct phy *p) ...@@ -184,7 +184,7 @@ static int rcar_gen2_phy_power_off(struct phy *p)
return 0; return 0;
} }
static struct phy_ops rcar_gen2_phy_ops = { static const struct phy_ops rcar_gen2_phy_ops = {
.init = rcar_gen2_phy_init, .init = rcar_gen2_phy_init,
.exit = rcar_gen2_phy_exit, .exit = rcar_gen2_phy_exit,
.power_on = rcar_gen2_phy_power_on, .power_on = rcar_gen2_phy_power_on,
......
...@@ -84,7 +84,7 @@ static int rockchip_usb_phy_power_on(struct phy *_phy) ...@@ -84,7 +84,7 @@ static int rockchip_usb_phy_power_on(struct phy *_phy)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.power_on = rockchip_usb_phy_power_on, .power_on = rockchip_usb_phy_power_on,
.power_off = rockchip_usb_phy_power_off, .power_off = rockchip_usb_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -146,7 +146,6 @@ static struct platform_driver rockchip_usb_driver = { ...@@ -146,7 +146,6 @@ static struct platform_driver rockchip_usb_driver = {
.probe = rockchip_usb_phy_probe, .probe = rockchip_usb_phy_probe,
.driver = { .driver = {
.name = "rockchip-usb-phy", .name = "rockchip-usb-phy",
.owner = THIS_MODULE,
.of_match_table = rockchip_usb_phy_dt_ids, .of_match_table = rockchip_usb_phy_dt_ids,
}, },
}; };
......
...@@ -71,7 +71,7 @@ static int samsung_usb2_phy_power_off(struct phy *phy) ...@@ -71,7 +71,7 @@ static int samsung_usb2_phy_power_off(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops samsung_usb2_phy_ops = { static const struct phy_ops samsung_usb2_phy_ops = {
.power_on = samsung_usb2_phy_power_on, .power_on = samsung_usb2_phy_power_on,
.power_off = samsung_usb2_phy_power_off, .power_off = samsung_usb2_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -179,7 +179,7 @@ static const struct of_device_id spear1310_miphy_of_match[] = { ...@@ -179,7 +179,7 @@ static const struct of_device_id spear1310_miphy_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, spear1310_miphy_of_match); MODULE_DEVICE_TABLE(of, spear1310_miphy_of_match);
static struct phy_ops spear1310_miphy_ops = { static const struct phy_ops spear1310_miphy_ops = {
.init = spear1310_miphy_init, .init = spear1310_miphy_init,
.exit = spear1310_miphy_exit, .exit = spear1310_miphy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -189,7 +189,7 @@ static const struct of_device_id spear1340_miphy_of_match[] = { ...@@ -189,7 +189,7 @@ static const struct of_device_id spear1340_miphy_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, spear1340_miphy_of_match); MODULE_DEVICE_TABLE(of, spear1340_miphy_of_match);
static struct phy_ops spear1340_miphy_ops = { static const struct phy_ops spear1340_miphy_ops = {
.init = spear1340_miphy_init, .init = spear1340_miphy_init,
.exit = spear1340_miphy_exit, .exit = spear1340_miphy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -112,7 +112,7 @@ static int stih41x_usb_phy_power_off(struct phy *phy) ...@@ -112,7 +112,7 @@ static int stih41x_usb_phy_power_off(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops stih41x_usb_phy_ops = { static const struct phy_ops stih41x_usb_phy_ops = {
.init = stih41x_usb_phy_init, .init = stih41x_usb_phy_init,
.power_on = stih41x_usb_phy_power_on, .power_on = stih41x_usb_phy_power_on,
.power_off = stih41x_usb_phy_power_off, .power_off = stih41x_usb_phy_power_off,
......
This diff is collapsed.
...@@ -114,7 +114,7 @@ static int sun9i_usb_phy_exit(struct phy *_phy) ...@@ -114,7 +114,7 @@ static int sun9i_usb_phy_exit(struct phy *_phy)
return 0; return 0;
} }
static struct phy_ops sun9i_usb_phy_ops = { static const struct phy_ops sun9i_usb_phy_ops = {
.init = sun9i_usb_phy_init, .init = sun9i_usb_phy_init,
.exit = sun9i_usb_phy_exit, .exit = sun9i_usb_phy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -298,7 +298,7 @@ static int ti_pipe3_exit(struct phy *x) ...@@ -298,7 +298,7 @@ static int ti_pipe3_exit(struct phy *x)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.init = ti_pipe3_init, .init = ti_pipe3_init,
.exit = ti_pipe3_exit, .exit = ti_pipe3_exit,
.power_on = ti_pipe3_power_on, .power_on = ti_pipe3_power_on,
......
...@@ -53,7 +53,7 @@ static int tusb1210_power_off(struct phy *phy) ...@@ -53,7 +53,7 @@ static int tusb1210_power_off(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops phy_ops = { static const struct phy_ops phy_ops = {
.power_on = tusb1210_power_on, .power_on = tusb1210_power_on,
.power_off = tusb1210_power_off, .power_off = tusb1210_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* and it's controller, which is always the parent. * and it's controller, which is always the parent.
*/ */
static inline struct phy static inline struct phy
*ulpi_phy_create(struct ulpi *ulpi, struct phy_ops *ops) *ulpi_phy_create(struct ulpi *ulpi, const struct phy_ops *ops)
{ {
struct phy *phy; struct phy *phy;
int ret; int ret;
......
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