aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-07-04 11:19:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-07-04 11:19:21 -0400
commitc318a821b9828ef3be97d5d896d146e7daa43c86 (patch)
tree7ed40911ffebcbabf87ec4be692f6fb154053687 /drivers/phy
parent322832f2f19e04c866a0ce4bdac8cff8e695f2b3 (diff)
parenta99cde438de0c4c0cecc1d1af1a55a75b10bfdef (diff)
Merge 4.7-rc6 into usb-next
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-bcm-ns-usb2.c4
-rw-r--r--drivers/phy/phy-miphy28lp.c3
-rw-r--r--drivers/phy/phy-rcar-gen3-usb2.c14
-rw-r--r--drivers/phy/phy-rockchip-dp.c2
-rw-r--r--drivers/phy/phy-stih407-usb.c4
-rw-r--r--drivers/phy/phy-sun4i-usb.c14
6 files changed, 15 insertions, 26 deletions
diff --git a/drivers/phy/phy-bcm-ns-usb2.c b/drivers/phy/phy-bcm-ns-usb2.c
index 95ab6b2a0de5..58dff80e9386 100644
--- a/drivers/phy/phy-bcm-ns-usb2.c
+++ b/drivers/phy/phy-bcm-ns-usb2.c
@@ -109,8 +109,8 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
109 } 109 }
110 110
111 usb2->phy = devm_phy_create(dev, NULL, &ops); 111 usb2->phy = devm_phy_create(dev, NULL, &ops);
112 if (IS_ERR(dev)) 112 if (IS_ERR(usb2->phy))
113 return PTR_ERR(dev); 113 return PTR_ERR(usb2->phy);
114 114
115 phy_set_drvdata(usb2->phy, usb2); 115 phy_set_drvdata(usb2->phy, usb2);
116 platform_set_drvdata(pdev, usb2); 116 platform_set_drvdata(pdev, usb2);
diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c
index 3acd2a1808df..213e2e15339c 100644
--- a/drivers/phy/phy-miphy28lp.c
+++ b/drivers/phy/phy-miphy28lp.c
@@ -1143,7 +1143,8 @@ static int miphy28lp_probe_resets(struct device_node *node,
1143 struct miphy28lp_dev *miphy_dev = miphy_phy->phydev; 1143 struct miphy28lp_dev *miphy_dev = miphy_phy->phydev;
1144 int err; 1144 int err;
1145 1145
1146 miphy_phy->miphy_rst = of_reset_control_get(node, "miphy-sw-rst"); 1146 miphy_phy->miphy_rst =
1147 of_reset_control_get_shared(node, "miphy-sw-rst");
1147 1148
1148 if (IS_ERR(miphy_phy->miphy_rst)) { 1149 if (IS_ERR(miphy_phy->miphy_rst)) {
1149 dev_err(miphy_dev->dev, 1150 dev_err(miphy_dev->dev,
diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c
index 76bb88f0700a..4be3f5dbbc9f 100644
--- a/drivers/phy/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/phy-rcar-gen3-usb2.c
@@ -144,12 +144,6 @@ static void rcar_gen3_init_for_peri(struct rcar_gen3_chan *ch)
144 extcon_set_cable_state_(ch->extcon, EXTCON_USB, true); 144 extcon_set_cable_state_(ch->extcon, EXTCON_USB, true);
145} 145}
146 146
147static bool rcar_gen3_check_vbus(struct rcar_gen3_chan *ch)
148{
149 return !!(readl(ch->base + USB2_ADPCTRL) &
150 USB2_ADPCTRL_OTGSESSVLD);
151}
152
153static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch) 147static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
154{ 148{
155 return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG); 149 return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG);
@@ -157,13 +151,7 @@ static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
157 151
158static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch) 152static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch)
159{ 153{
160 bool is_host = true; 154 if (!rcar_gen3_check_id(ch))
161
162 /* B-device? */
163 if (rcar_gen3_check_id(ch) && rcar_gen3_check_vbus(ch))
164 is_host = false;
165
166 if (is_host)
167 rcar_gen3_init_for_host(ch); 155 rcar_gen3_init_for_host(ch);
168 else 156 else
169 rcar_gen3_init_for_peri(ch); 157 rcar_gen3_init_for_peri(ch);
diff --git a/drivers/phy/phy-rockchip-dp.c b/drivers/phy/phy-rockchip-dp.c
index 793ecb6d87bc..8b267a746576 100644
--- a/drivers/phy/phy-rockchip-dp.c
+++ b/drivers/phy/phy-rockchip-dp.c
@@ -90,7 +90,7 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev)
90 return -ENODEV; 90 return -ENODEV;
91 91
92 dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL); 92 dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
93 if (IS_ERR(dp)) 93 if (!dp)
94 return -ENOMEM; 94 return -ENOMEM;
95 95
96 dp->dev = dev; 96 dp->dev = dev;
diff --git a/drivers/phy/phy-stih407-usb.c b/drivers/phy/phy-stih407-usb.c
index 1d5ae5f8ef69..b1f44ab669fb 100644
--- a/drivers/phy/phy-stih407-usb.c
+++ b/drivers/phy/phy-stih407-usb.c
@@ -105,13 +105,13 @@ static int stih407_usb2_picophy_probe(struct platform_device *pdev)
105 phy_dev->dev = dev; 105 phy_dev->dev = dev;
106 dev_set_drvdata(dev, phy_dev); 106 dev_set_drvdata(dev, phy_dev);
107 107
108 phy_dev->rstc = devm_reset_control_get(dev, "global"); 108 phy_dev->rstc = devm_reset_control_get_shared(dev, "global");
109 if (IS_ERR(phy_dev->rstc)) { 109 if (IS_ERR(phy_dev->rstc)) {
110 dev_err(dev, "failed to ctrl picoPHY reset\n"); 110 dev_err(dev, "failed to ctrl picoPHY reset\n");
111 return PTR_ERR(phy_dev->rstc); 111 return PTR_ERR(phy_dev->rstc);
112 } 112 }
113 113
114 phy_dev->rstport = devm_reset_control_get(dev, "port"); 114 phy_dev->rstport = devm_reset_control_get_exclusive(dev, "port");
115 if (IS_ERR(phy_dev->rstport)) { 115 if (IS_ERR(phy_dev->rstport)) {
116 dev_err(dev, "failed to ctrl picoPHY reset\n"); 116 dev_err(dev, "failed to ctrl picoPHY reset\n");
117 return PTR_ERR(phy_dev->rstport); 117 return PTR_ERR(phy_dev->rstport);
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index bae54f7a1f48..de3101fbbf40 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -175,7 +175,7 @@ static void sun4i_usb_phy_write(struct sun4i_usb_phy *phy, u32 addr, u32 data,
175{ 175{
176 struct sun4i_usb_phy_data *phy_data = to_sun4i_usb_phy_data(phy); 176 struct sun4i_usb_phy_data *phy_data = to_sun4i_usb_phy_data(phy);
177 u32 temp, usbc_bit = BIT(phy->index * 2); 177 u32 temp, usbc_bit = BIT(phy->index * 2);
178 void *phyctl = phy_data->base + phy_data->cfg->phyctl_offset; 178 void __iomem *phyctl = phy_data->base + phy_data->cfg->phyctl_offset;
179 int i; 179 int i;
180 180
181 mutex_lock(&phy_data->mutex); 181 mutex_lock(&phy_data->mutex);
@@ -514,9 +514,9 @@ static int sun4i_usb_phy_remove(struct platform_device *pdev)
514 514
515 if (data->vbus_power_nb_registered) 515 if (data->vbus_power_nb_registered)
516 power_supply_unreg_notifier(&data->vbus_power_nb); 516 power_supply_unreg_notifier(&data->vbus_power_nb);
517 if (data->id_det_irq >= 0) 517 if (data->id_det_irq > 0)
518 devm_free_irq(dev, data->id_det_irq, data); 518 devm_free_irq(dev, data->id_det_irq, data);
519 if (data->vbus_det_irq >= 0) 519 if (data->vbus_det_irq > 0)
520 devm_free_irq(dev, data->vbus_det_irq, data); 520 devm_free_irq(dev, data->vbus_det_irq, data);
521 521
522 cancel_delayed_work_sync(&data->detect); 522 cancel_delayed_work_sync(&data->detect);
@@ -645,11 +645,11 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
645 645
646 data->id_det_irq = gpiod_to_irq(data->id_det_gpio); 646 data->id_det_irq = gpiod_to_irq(data->id_det_gpio);
647 data->vbus_det_irq = gpiod_to_irq(data->vbus_det_gpio); 647 data->vbus_det_irq = gpiod_to_irq(data->vbus_det_gpio);
648 if ((data->id_det_gpio && data->id_det_irq < 0) || 648 if ((data->id_det_gpio && data->id_det_irq <= 0) ||
649 (data->vbus_det_gpio && data->vbus_det_irq < 0)) 649 (data->vbus_det_gpio && data->vbus_det_irq <= 0))
650 data->phy0_poll = true; 650 data->phy0_poll = true;
651 651
652 if (data->id_det_irq >= 0) { 652 if (data->id_det_irq > 0) {
653 ret = devm_request_irq(dev, data->id_det_irq, 653 ret = devm_request_irq(dev, data->id_det_irq,
654 sun4i_usb_phy0_id_vbus_det_irq, 654 sun4i_usb_phy0_id_vbus_det_irq,
655 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 655 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@@ -660,7 +660,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
660 } 660 }
661 } 661 }
662 662
663 if (data->vbus_det_irq >= 0) { 663 if (data->vbus_det_irq > 0) {
664 ret = devm_request_irq(dev, data->vbus_det_irq, 664 ret = devm_request_irq(dev, data->vbus_det_irq,
665 sun4i_usb_phy0_id_vbus_det_irq, 665 sun4i_usb_phy0_id_vbus_det_irq,
666 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 666 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,