diff options
| author | David S. Miller <davem@davemloft.net> | 2016-07-06 13:35:22 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-07-06 13:35:22 -0400 |
| commit | 30d0844bdcea9fb8b0b3c8abfa5547bc3bcf8baa (patch) | |
| tree | 87302af9e03ee50cf135cc9ce6589f41fe3b3db1 /drivers/phy | |
| parent | ae3e4562e2ce0149a4424c994a282955700711e7 (diff) | |
| parent | bc86765181aa26cc9afcb0a6f9f253cbb1186f26 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/usb/r8152.c
All three conflicts were overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/phy')
| -rw-r--r-- | drivers/phy/phy-bcm-ns-usb2.c | 4 | ||||
| -rw-r--r-- | drivers/phy/phy-miphy28lp.c | 3 | ||||
| -rw-r--r-- | drivers/phy/phy-rcar-gen3-usb2.c | 14 | ||||
| -rw-r--r-- | drivers/phy/phy-rockchip-dp.c | 2 | ||||
| -rw-r--r-- | drivers/phy/phy-stih407-usb.c | 4 | ||||
| -rw-r--r-- | drivers/phy/phy-sun4i-usb.c | 14 |
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 | ||
| 147 | static bool rcar_gen3_check_vbus(struct rcar_gen3_chan *ch) | ||
| 148 | { | ||
| 149 | return !!(readl(ch->base + USB2_ADPCTRL) & | ||
| 150 | USB2_ADPCTRL_OTGSESSVLD); | ||
| 151 | } | ||
| 152 | |||
| 153 | static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch) | 147 | static 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 | ||
| 158 | static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch) | 152 | static 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, |
