diff options
| -rw-r--r-- | drivers/phy/allwinner/phy-sun4i-usb.c | 3 | ||||
| -rw-r--r-- | drivers/phy/amlogic/phy-meson-gxl-usb2.c | 5 | ||||
| -rw-r--r-- | drivers/phy/amlogic/phy-meson-gxl-usb3.c | 5 | ||||
| -rw-r--r-- | drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 3 | ||||
| -rw-r--r-- | drivers/phy/mediatek/phy-mtk-tphy.c | 2 | ||||
| -rw-r--r-- | drivers/phy/mediatek/phy-mtk-xsphy.c | 2 | ||||
| -rw-r--r-- | drivers/phy/mscc/phy-ocelot-serdes.c | 2 | ||||
| -rw-r--r-- | drivers/phy/phy-core.c | 6 | ||||
| -rw-r--r-- | drivers/phy/qualcomm/phy-qcom-qmp.c | 3 | ||||
| -rw-r--r-- | drivers/phy/qualcomm/phy-qcom-qusb2.c | 3 | ||||
| -rw-r--r-- | drivers/phy/qualcomm/phy-qcom-ufs-qmp-14nm.c | 3 | ||||
| -rw-r--r-- | drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c | 3 | ||||
| -rw-r--r-- | drivers/phy/qualcomm/phy-qcom-usb-hs.c | 3 | ||||
| -rw-r--r-- | drivers/phy/ti/phy-da8xx-usb.c | 3 | ||||
| -rw-r--r-- | drivers/phy/ti/phy-tusb1210.c | 2 | ||||
| -rw-r--r-- | include/linux/phy/phy.h | 13 |
16 files changed, 39 insertions, 22 deletions
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index ae16854a770a..5163097b43df 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c | |||
| @@ -478,7 +478,8 @@ static int sun4i_usb_phy_power_off(struct phy *_phy) | |||
| 478 | return 0; | 478 | return 0; |
| 479 | } | 479 | } |
| 480 | 480 | ||
| 481 | static int sun4i_usb_phy_set_mode(struct phy *_phy, enum phy_mode mode) | 481 | static int sun4i_usb_phy_set_mode(struct phy *_phy, |
| 482 | enum phy_mode mode, int submode) | ||
| 482 | { | 483 | { |
| 483 | struct sun4i_usb_phy *phy = phy_get_drvdata(_phy); | 484 | struct sun4i_usb_phy *phy = phy_get_drvdata(_phy); |
| 484 | struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy); | 485 | struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy); |
diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c index 9f9b5414b97a..148ef0bdb9c1 100644 --- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c +++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c | |||
| @@ -152,7 +152,8 @@ static int phy_meson_gxl_usb2_reset(struct phy *phy) | |||
| 152 | return 0; | 152 | return 0; |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | static int phy_meson_gxl_usb2_set_mode(struct phy *phy, enum phy_mode mode) | 155 | static int phy_meson_gxl_usb2_set_mode(struct phy *phy, |
| 156 | enum phy_mode mode, int submode) | ||
| 156 | { | 157 | { |
| 157 | struct phy_meson_gxl_usb2_priv *priv = phy_get_drvdata(phy); | 158 | struct phy_meson_gxl_usb2_priv *priv = phy_get_drvdata(phy); |
| 158 | 159 | ||
| @@ -209,7 +210,7 @@ static int phy_meson_gxl_usb2_power_on(struct phy *phy) | |||
| 209 | /* power on the PHY by taking it out of reset mode */ | 210 | /* power on the PHY by taking it out of reset mode */ |
| 210 | regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_POWER_ON_RESET, 0); | 211 | regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_POWER_ON_RESET, 0); |
| 211 | 212 | ||
| 212 | ret = phy_meson_gxl_usb2_set_mode(phy, priv->mode); | 213 | ret = phy_meson_gxl_usb2_set_mode(phy, priv->mode, 0); |
| 213 | if (ret) { | 214 | if (ret) { |
| 214 | phy_meson_gxl_usb2_power_off(phy); | 215 | phy_meson_gxl_usb2_power_off(phy); |
| 215 | 216 | ||
diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb3.c b/drivers/phy/amlogic/phy-meson-gxl-usb3.c index d37d94ddf9c0..c0e9e4c16149 100644 --- a/drivers/phy/amlogic/phy-meson-gxl-usb3.c +++ b/drivers/phy/amlogic/phy-meson-gxl-usb3.c | |||
| @@ -119,7 +119,8 @@ static int phy_meson_gxl_usb3_power_off(struct phy *phy) | |||
| 119 | return 0; | 119 | return 0; |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | static int phy_meson_gxl_usb3_set_mode(struct phy *phy, enum phy_mode mode) | 122 | static int phy_meson_gxl_usb3_set_mode(struct phy *phy, |
| 123 | enum phy_mode mode, int submode) | ||
| 123 | { | 124 | { |
| 124 | struct phy_meson_gxl_usb3_priv *priv = phy_get_drvdata(phy); | 125 | struct phy_meson_gxl_usb3_priv *priv = phy_get_drvdata(phy); |
| 125 | 126 | ||
| @@ -164,7 +165,7 @@ static int phy_meson_gxl_usb3_init(struct phy *phy) | |||
| 164 | if (ret) | 165 | if (ret) |
| 165 | goto err_disable_clk_phy; | 166 | goto err_disable_clk_phy; |
| 166 | 167 | ||
| 167 | ret = phy_meson_gxl_usb3_set_mode(phy, priv->mode); | 168 | ret = phy_meson_gxl_usb3_set_mode(phy, priv->mode, 0); |
| 168 | if (ret) | 169 | if (ret) |
| 169 | goto err_disable_clk_peripheral; | 170 | goto err_disable_clk_peripheral; |
| 170 | 171 | ||
diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c index 86a5f7b9448b..79b52c39c5b4 100644 --- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c +++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c | |||
| @@ -512,7 +512,8 @@ static int mvebu_comphy_power_on(struct phy *phy) | |||
| 512 | return ret; | 512 | return ret; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | static int mvebu_comphy_set_mode(struct phy *phy, enum phy_mode mode) | 515 | static int mvebu_comphy_set_mode(struct phy *phy, |
| 516 | enum phy_mode mode, int submode) | ||
| 516 | { | 517 | { |
| 517 | struct mvebu_comphy_lane *lane = phy_get_drvdata(phy); | 518 | struct mvebu_comphy_lane *lane = phy_get_drvdata(phy); |
| 518 | 519 | ||
diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index 3eb8e1bd7b78..5b6a470ca145 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c | |||
| @@ -971,7 +971,7 @@ static int mtk_phy_exit(struct phy *phy) | |||
| 971 | return 0; | 971 | return 0; |
| 972 | } | 972 | } |
| 973 | 973 | ||
| 974 | static int mtk_phy_set_mode(struct phy *phy, enum phy_mode mode) | 974 | static int mtk_phy_set_mode(struct phy *phy, enum phy_mode mode, int submode) |
| 975 | { | 975 | { |
| 976 | struct mtk_phy_instance *instance = phy_get_drvdata(phy); | 976 | struct mtk_phy_instance *instance = phy_get_drvdata(phy); |
| 977 | struct mtk_tphy *tphy = dev_get_drvdata(phy->dev.parent); | 977 | struct mtk_tphy *tphy = dev_get_drvdata(phy->dev.parent); |
diff --git a/drivers/phy/mediatek/phy-mtk-xsphy.c b/drivers/phy/mediatek/phy-mtk-xsphy.c index 020cd0227397..8c51131945c0 100644 --- a/drivers/phy/mediatek/phy-mtk-xsphy.c +++ b/drivers/phy/mediatek/phy-mtk-xsphy.c | |||
| @@ -426,7 +426,7 @@ static int mtk_phy_exit(struct phy *phy) | |||
| 426 | return 0; | 426 | return 0; |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | static int mtk_phy_set_mode(struct phy *phy, enum phy_mode mode) | 429 | static int mtk_phy_set_mode(struct phy *phy, enum phy_mode mode, int submode) |
| 430 | { | 430 | { |
| 431 | struct xsphy_instance *inst = phy_get_drvdata(phy); | 431 | struct xsphy_instance *inst = phy_get_drvdata(phy); |
| 432 | struct mtk_xsphy *xsphy = dev_get_drvdata(phy->dev.parent); | 432 | struct mtk_xsphy *xsphy = dev_get_drvdata(phy->dev.parent); |
diff --git a/drivers/phy/mscc/phy-ocelot-serdes.c b/drivers/phy/mscc/phy-ocelot-serdes.c index cbb49d9da6f9..c61a98908d36 100644 --- a/drivers/phy/mscc/phy-ocelot-serdes.c +++ b/drivers/phy/mscc/phy-ocelot-serdes.c | |||
| @@ -158,7 +158,7 @@ static const struct serdes_mux ocelot_serdes_muxes[] = { | |||
| 158 | HSIO_HW_CFG_PCIE_ENA), | 158 | HSIO_HW_CFG_PCIE_ENA), |
| 159 | }; | 159 | }; |
| 160 | 160 | ||
| 161 | static int serdes_set_mode(struct phy *phy, enum phy_mode mode) | 161 | static int serdes_set_mode(struct phy *phy, enum phy_mode mode, int submode) |
| 162 | { | 162 | { |
| 163 | struct serdes_macro *macro = phy_get_drvdata(phy); | 163 | struct serdes_macro *macro = phy_get_drvdata(phy); |
| 164 | unsigned int i; | 164 | unsigned int i; |
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 35fd38c5a4a1..df3d4ba516ab 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c | |||
| @@ -360,7 +360,7 @@ int phy_power_off(struct phy *phy) | |||
| 360 | } | 360 | } |
| 361 | EXPORT_SYMBOL_GPL(phy_power_off); | 361 | EXPORT_SYMBOL_GPL(phy_power_off); |
| 362 | 362 | ||
| 363 | int phy_set_mode(struct phy *phy, enum phy_mode mode) | 363 | int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode) |
| 364 | { | 364 | { |
| 365 | int ret; | 365 | int ret; |
| 366 | 366 | ||
| @@ -368,14 +368,14 @@ int phy_set_mode(struct phy *phy, enum phy_mode mode) | |||
| 368 | return 0; | 368 | return 0; |
| 369 | 369 | ||
| 370 | mutex_lock(&phy->mutex); | 370 | mutex_lock(&phy->mutex); |
| 371 | ret = phy->ops->set_mode(phy, mode); | 371 | ret = phy->ops->set_mode(phy, mode, submode); |
| 372 | if (!ret) | 372 | if (!ret) |
| 373 | phy->attrs.mode = mode; | 373 | phy->attrs.mode = mode; |
| 374 | mutex_unlock(&phy->mutex); | 374 | mutex_unlock(&phy->mutex); |
| 375 | 375 | ||
| 376 | return ret; | 376 | return ret; |
| 377 | } | 377 | } |
| 378 | EXPORT_SYMBOL_GPL(phy_set_mode); | 378 | EXPORT_SYMBOL_GPL(phy_set_mode_ext); |
| 379 | 379 | ||
| 380 | int phy_reset(struct phy *phy) | 380 | int phy_reset(struct phy *phy) |
| 381 | { | 381 | { |
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index a83332411026..514db7248a5d 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c | |||
| @@ -1365,7 +1365,8 @@ static int qcom_qmp_phy_poweron(struct phy *phy) | |||
| 1365 | return ret; | 1365 | return ret; |
| 1366 | } | 1366 | } |
| 1367 | 1367 | ||
| 1368 | static int qcom_qmp_phy_set_mode(struct phy *phy, enum phy_mode mode) | 1368 | static int qcom_qmp_phy_set_mode(struct phy *phy, |
| 1369 | enum phy_mode mode, int submode) | ||
| 1369 | { | 1370 | { |
| 1370 | struct qmp_phy *qphy = phy_get_drvdata(phy); | 1371 | struct qmp_phy *qphy = phy_get_drvdata(phy); |
| 1371 | struct qcom_qmp *qmp = qphy->qmp; | 1372 | struct qcom_qmp *qmp = qphy->qmp; |
diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c index 6d4b44b569bc..9177989f22d1 100644 --- a/drivers/phy/qualcomm/phy-qcom-qusb2.c +++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c | |||
| @@ -425,7 +425,8 @@ static void qusb2_phy_set_tune2_param(struct qusb2_phy *qphy) | |||
| 425 | HSTX_TRIM_MASK); | 425 | HSTX_TRIM_MASK); |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | static int qusb2_phy_set_mode(struct phy *phy, enum phy_mode mode) | 428 | static int qusb2_phy_set_mode(struct phy *phy, |
| 429 | enum phy_mode mode, int submode) | ||
| 429 | { | 430 | { |
| 430 | struct qusb2_phy *qphy = phy_get_drvdata(phy); | 431 | struct qusb2_phy *qphy = phy_get_drvdata(phy); |
| 431 | 432 | ||
diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-qmp-14nm.c b/drivers/phy/qualcomm/phy-qcom-ufs-qmp-14nm.c index ba1895b76a5d..1e0d4f2046a4 100644 --- a/drivers/phy/qualcomm/phy-qcom-ufs-qmp-14nm.c +++ b/drivers/phy/qualcomm/phy-qcom-ufs-qmp-14nm.c | |||
| @@ -65,7 +65,8 @@ static int ufs_qcom_phy_qmp_14nm_exit(struct phy *generic_phy) | |||
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | static | 67 | static |
| 68 | int ufs_qcom_phy_qmp_14nm_set_mode(struct phy *generic_phy, enum phy_mode mode) | 68 | int ufs_qcom_phy_qmp_14nm_set_mode(struct phy *generic_phy, |
| 69 | enum phy_mode mode, int submode) | ||
| 69 | { | 70 | { |
| 70 | struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy); | 71 | struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy); |
| 71 | 72 | ||
diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c b/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c index 49f435c71147..aef40f7a41d4 100644 --- a/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c +++ b/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c | |||
| @@ -84,7 +84,8 @@ static int ufs_qcom_phy_qmp_20nm_exit(struct phy *generic_phy) | |||
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | static | 86 | static |
| 87 | int ufs_qcom_phy_qmp_20nm_set_mode(struct phy *generic_phy, enum phy_mode mode) | 87 | int ufs_qcom_phy_qmp_20nm_set_mode(struct phy *generic_phy, |
| 88 | enum phy_mode mode, int submode) | ||
| 88 | { | 89 | { |
| 89 | struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy); | 90 | struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy); |
| 90 | 91 | ||
diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hs.c b/drivers/phy/qualcomm/phy-qcom-usb-hs.c index abbbe75070da..04934f8dac91 100644 --- a/drivers/phy/qualcomm/phy-qcom-usb-hs.c +++ b/drivers/phy/qualcomm/phy-qcom-usb-hs.c | |||
| @@ -42,7 +42,8 @@ struct qcom_usb_hs_phy { | |||
| 42 | struct notifier_block vbus_notify; | 42 | struct notifier_block vbus_notify; |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | static int qcom_usb_hs_phy_set_mode(struct phy *phy, enum phy_mode mode) | 45 | static int qcom_usb_hs_phy_set_mode(struct phy *phy, |
| 46 | enum phy_mode mode, int submode) | ||
| 46 | { | 47 | { |
| 47 | struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy); | 48 | struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy); |
| 48 | u8 addr; | 49 | u8 addr; |
diff --git a/drivers/phy/ti/phy-da8xx-usb.c b/drivers/phy/ti/phy-da8xx-usb.c index befb886ff121..d5f4fbc32b52 100644 --- a/drivers/phy/ti/phy-da8xx-usb.c +++ b/drivers/phy/ti/phy-da8xx-usb.c | |||
| @@ -93,7 +93,8 @@ static int da8xx_usb20_phy_power_off(struct phy *phy) | |||
| 93 | return 0; | 93 | return 0; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | static int da8xx_usb20_phy_set_mode(struct phy *phy, enum phy_mode mode) | 96 | static int da8xx_usb20_phy_set_mode(struct phy *phy, |
| 97 | enum phy_mode mode, int submode) | ||
| 97 | { | 98 | { |
| 98 | struct da8xx_usb_phy *d_phy = phy_get_drvdata(phy); | 99 | struct da8xx_usb_phy *d_phy = phy_get_drvdata(phy); |
| 99 | u32 val; | 100 | u32 val; |
diff --git a/drivers/phy/ti/phy-tusb1210.c b/drivers/phy/ti/phy-tusb1210.c index b8ec39ac4dfc..329fb938099a 100644 --- a/drivers/phy/ti/phy-tusb1210.c +++ b/drivers/phy/ti/phy-tusb1210.c | |||
| @@ -53,7 +53,7 @@ static int tusb1210_power_off(struct phy *phy) | |||
| 53 | return 0; | 53 | return 0; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | static int tusb1210_set_mode(struct phy *phy, enum phy_mode mode) | 56 | static int tusb1210_set_mode(struct phy *phy, enum phy_mode mode, int submode) |
| 57 | { | 57 | { |
| 58 | struct tusb1210 *tusb = phy_get_drvdata(phy); | 58 | struct tusb1210 *tusb = phy_get_drvdata(phy); |
| 59 | int ret; | 59 | int ret; |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 03b319f89a34..b17e7709c5dc 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
| @@ -60,7 +60,7 @@ struct phy_ops { | |||
| 60 | int (*exit)(struct phy *phy); | 60 | int (*exit)(struct phy *phy); |
| 61 | int (*power_on)(struct phy *phy); | 61 | int (*power_on)(struct phy *phy); |
| 62 | int (*power_off)(struct phy *phy); | 62 | int (*power_off)(struct phy *phy); |
| 63 | int (*set_mode)(struct phy *phy, enum phy_mode mode); | 63 | int (*set_mode)(struct phy *phy, enum phy_mode mode, int submode); |
| 64 | int (*reset)(struct phy *phy); | 64 | int (*reset)(struct phy *phy); |
| 65 | int (*calibrate)(struct phy *phy); | 65 | int (*calibrate)(struct phy *phy); |
| 66 | struct module *owner; | 66 | struct module *owner; |
| @@ -164,7 +164,10 @@ int phy_init(struct phy *phy); | |||
| 164 | int phy_exit(struct phy *phy); | 164 | int phy_exit(struct phy *phy); |
| 165 | int phy_power_on(struct phy *phy); | 165 | int phy_power_on(struct phy *phy); |
| 166 | int phy_power_off(struct phy *phy); | 166 | int phy_power_off(struct phy *phy); |
| 167 | int phy_set_mode(struct phy *phy, enum phy_mode mode); | 167 | int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode); |
| 168 | #define phy_set_mode(phy, mode) \ | ||
| 169 | phy_set_mode_ext(phy, mode, 0) | ||
| 170 | |||
| 168 | static inline enum phy_mode phy_get_mode(struct phy *phy) | 171 | static inline enum phy_mode phy_get_mode(struct phy *phy) |
| 169 | { | 172 | { |
| 170 | return phy->attrs.mode; | 173 | return phy->attrs.mode; |
| @@ -278,13 +281,17 @@ static inline int phy_power_off(struct phy *phy) | |||
| 278 | return -ENOSYS; | 281 | return -ENOSYS; |
| 279 | } | 282 | } |
| 280 | 283 | ||
| 281 | static inline int phy_set_mode(struct phy *phy, enum phy_mode mode) | 284 | static inline int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, |
| 285 | int submode) | ||
| 282 | { | 286 | { |
| 283 | if (!phy) | 287 | if (!phy) |
| 284 | return 0; | 288 | return 0; |
| 285 | return -ENOSYS; | 289 | return -ENOSYS; |
| 286 | } | 290 | } |
| 287 | 291 | ||
| 292 | #define phy_set_mode(phy, mode) \ | ||
| 293 | phy_set_mode_ext(phy, mode, 0) | ||
| 294 | |||
| 288 | static inline enum phy_mode phy_get_mode(struct phy *phy) | 295 | static inline enum phy_mode phy_get_mode(struct phy *phy) |
| 289 | { | 296 | { |
| 290 | return PHY_MODE_INVALID; | 297 | return PHY_MODE_INVALID; |
