phy: for 4.7-rc5

*) Fix in sun4i-usb phy driver to properly handle the return value of
    gpiod_to_irq
 *) Fix a sparse warning in sun4i-usb phy driver
 *) Fix bcm-ns-usb2 phy driver to check the correct variable
 *) Fix spurious interrupts during VBUS change in rcar-gen3-usb2 phy
    driver
 
 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJXaoNJAAoJEA5ceFyATYLZNaMP/jvuMm85UWMTU/G21lULLv3D
 XpTHWdVd0s21IyuR7eFiGpo8pA0AyluCmcB+ZzNZz1cXZWvS9fZNJgKwB/L0hYlZ
 uvnbD5d7WdAS981izQ+ke6EeL5lZ+I0RYtP64yoSocVu50Fpmh3dqPkXJNjYttk/
 ch/rX+hgYHB7Pm8mmhJ/kI1KjyrZVzCIUB0A7C5w+74x4uDNN4odXRUXpdy+ZLmd
 ZAktvqAOpCnwQcK269Sm3AzhvPeelG8fyaeB7wHabq5duiUnZK+a8vpdV43548Gp
 +nLZPlyhfPBKLZXLKPv1Sml9rjf452xTQi+zYfY62HLb0saSHWJ85eUWlydqbkg4
 TtpIcfNQqNuaso8BTrqoMQ/Mnn7ryjPhqi7BonBhLrVbpCe05Nd5Qy0n4xNyjtLv
 tx+kgWzYq5ROH+URKEqzKhp82lHXL/IX86w0UetvhUjlsk3QxvncE/Ta34cJct0Z
 68sPGWL74MAP1MCvQdZKkZYafyvUVzsdBCV/asaIY5oEDD9MD8yaj4fCgAW9wKyR
 M/oIJKyI95uajmdmvkyuzA3FGXZaM+21eaWIUGWSJolV/CIsg8QlFVd1C8yrHLvn
 UJ/vCm1PC3EOkyHttCdDvMu57Ab3HHS36D0Uq7SOCUhDyY1WPmhyNUb2it02xN45
 0Mpw9EYkstUILswvN/DG
 =kUtK
 -----END PGP SIGNATURE-----

Merge tag 'phy-for-4.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus

Kishon writes:

phy: for 4.7-rc5

*) Fix in sun4i-usb phy driver to properly handle the return value of
   gpiod_to_irq
*) Fix a sparse warning in sun4i-usb phy driver
*) Fix bcm-ns-usb2 phy driver to check the correct variable
*) Fix spurious interrupts during VBUS change in rcar-gen3-usb2 phy
   driver

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:
Greg Kroah-Hartman 2016-06-24 17:01:43 -07:00
commit 1a34c4d0ae
4 changed files with 11 additions and 23 deletions

View File

@ -109,8 +109,8 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
}
usb2->phy = devm_phy_create(dev, NULL, &ops);
if (IS_ERR(dev))
return PTR_ERR(dev);
if (IS_ERR(usb2->phy))
return PTR_ERR(usb2->phy);
phy_set_drvdata(usb2->phy, usb2);
platform_set_drvdata(pdev, usb2);

View File

@ -144,12 +144,6 @@ static void rcar_gen3_init_for_peri(struct rcar_gen3_chan *ch)
extcon_set_cable_state_(ch->extcon, EXTCON_USB, true);
}
static bool rcar_gen3_check_vbus(struct rcar_gen3_chan *ch)
{
return !!(readl(ch->base + USB2_ADPCTRL) &
USB2_ADPCTRL_OTGSESSVLD);
}
static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
{
return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG);
@ -157,13 +151,7 @@ static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch)
{
bool is_host = true;
/* B-device? */
if (rcar_gen3_check_id(ch) && rcar_gen3_check_vbus(ch))
is_host = false;
if (is_host)
if (!rcar_gen3_check_id(ch))
rcar_gen3_init_for_host(ch);
else
rcar_gen3_init_for_peri(ch);

View File

@ -90,7 +90,7 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev)
return -ENODEV;
dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
if (IS_ERR(dp))
if (!dp)
return -ENOMEM;
dp->dev = dev;

View File

@ -175,7 +175,7 @@ static void sun4i_usb_phy_write(struct sun4i_usb_phy *phy, u32 addr, u32 data,
{
struct sun4i_usb_phy_data *phy_data = to_sun4i_usb_phy_data(phy);
u32 temp, usbc_bit = BIT(phy->index * 2);
void *phyctl = phy_data->base + phy_data->cfg->phyctl_offset;
void __iomem *phyctl = phy_data->base + phy_data->cfg->phyctl_offset;
int i;
mutex_lock(&phy_data->mutex);
@ -514,9 +514,9 @@ static int sun4i_usb_phy_remove(struct platform_device *pdev)
if (data->vbus_power_nb_registered)
power_supply_unreg_notifier(&data->vbus_power_nb);
if (data->id_det_irq >= 0)
if (data->id_det_irq > 0)
devm_free_irq(dev, data->id_det_irq, data);
if (data->vbus_det_irq >= 0)
if (data->vbus_det_irq > 0)
devm_free_irq(dev, data->vbus_det_irq, data);
cancel_delayed_work_sync(&data->detect);
@ -645,11 +645,11 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
data->id_det_irq = gpiod_to_irq(data->id_det_gpio);
data->vbus_det_irq = gpiod_to_irq(data->vbus_det_gpio);
if ((data->id_det_gpio && data->id_det_irq < 0) ||
(data->vbus_det_gpio && data->vbus_det_irq < 0))
if ((data->id_det_gpio && data->id_det_irq <= 0) ||
(data->vbus_det_gpio && data->vbus_det_irq <= 0))
data->phy0_poll = true;
if (data->id_det_irq >= 0) {
if (data->id_det_irq > 0) {
ret = devm_request_irq(dev, data->id_det_irq,
sun4i_usb_phy0_id_vbus_det_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
@ -660,7 +660,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
}
}
if (data->vbus_det_irq >= 0) {
if (data->vbus_det_irq > 0) {
ret = devm_request_irq(dev, data->vbus_det_irq,
sun4i_usb_phy0_id_vbus_det_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,