Merge tag 'usb-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes: usb: patches for v3.17 merge window Surprisingly enough, while a big set of patches, the majority is composed of cleanups (using devm_*, fixing sparse errors, moving code around, adding const, etc). The highlights are addition of new support for PLX USB338x devices, and support for USB 2.0-only configurations of the DWC3 IP core. Signed-of-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
@@ -122,16 +122,10 @@ static int am335x_phy_resume(struct device *dev)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops am335x_pm_ops = {
|
||||
SET_SYSTEM_SLEEP_PM_OPS(am335x_phy_suspend, am335x_phy_resume)
|
||||
};
|
||||
|
||||
#define DEV_PM_OPS (&am335x_pm_ops)
|
||||
#else
|
||||
#define DEV_PM_OPS NULL
|
||||
#endif
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(am335x_pm_ops, am335x_phy_suspend, am335x_phy_resume);
|
||||
|
||||
static const struct of_device_id am335x_phy_ids[] = {
|
||||
{ .compatible = "ti,am335x-usb-phy" },
|
||||
{ }
|
||||
@@ -144,7 +138,7 @@ static struct platform_driver am335x_phy_driver = {
|
||||
.driver = {
|
||||
.name = "am335x-phy-driver",
|
||||
.owner = THIS_MODULE,
|
||||
.pm = DEV_PM_OPS,
|
||||
.pm = &am335x_pm_ops,
|
||||
.of_match_table = am335x_phy_ids,
|
||||
},
|
||||
};
|
||||
|
@@ -253,11 +253,13 @@ static int gpio_vbus_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
gpio = pdata->gpio_vbus;
|
||||
|
||||
gpio_vbus = kzalloc(sizeof(struct gpio_vbus_data), GFP_KERNEL);
|
||||
gpio_vbus = devm_kzalloc(&pdev->dev, sizeof(struct gpio_vbus_data),
|
||||
GFP_KERNEL);
|
||||
if (!gpio_vbus)
|
||||
return -ENOMEM;
|
||||
|
||||
gpio_vbus->phy.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
|
||||
gpio_vbus->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
|
||||
GFP_KERNEL);
|
||||
if (!gpio_vbus->phy.otg) {
|
||||
kfree(gpio_vbus);
|
||||
return -ENOMEM;
|
||||
@@ -274,11 +276,11 @@ static int gpio_vbus_probe(struct platform_device *pdev)
|
||||
gpio_vbus->phy.otg->phy = &gpio_vbus->phy;
|
||||
gpio_vbus->phy.otg->set_peripheral = gpio_vbus_set_peripheral;
|
||||
|
||||
err = gpio_request(gpio, "vbus_detect");
|
||||
err = devm_gpio_request(&pdev->dev, gpio, "vbus_detect");
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "can't request vbus gpio %d, err: %d\n",
|
||||
gpio, err);
|
||||
goto err_gpio;
|
||||
return err;
|
||||
}
|
||||
gpio_direction_input(gpio);
|
||||
|
||||
@@ -296,27 +298,27 @@ static int gpio_vbus_probe(struct platform_device *pdev)
|
||||
/* if data line pullup is in use, initialize it to "not pulling up" */
|
||||
gpio = pdata->gpio_pullup;
|
||||
if (gpio_is_valid(gpio)) {
|
||||
err = gpio_request(gpio, "udc_pullup");
|
||||
err = devm_gpio_request(&pdev->dev, gpio, "udc_pullup");
|
||||
if (err) {
|
||||
dev_err(&pdev->dev,
|
||||
"can't request pullup gpio %d, err: %d\n",
|
||||
gpio, err);
|
||||
gpio_free(pdata->gpio_vbus);
|
||||
goto err_gpio;
|
||||
return err;
|
||||
}
|
||||
gpio_direction_output(gpio, pdata->gpio_pullup_inverted);
|
||||
}
|
||||
|
||||
err = request_irq(irq, gpio_vbus_irq, irqflags, "vbus_detect", pdev);
|
||||
err = devm_request_irq(&pdev->dev, irq, gpio_vbus_irq, irqflags,
|
||||
"vbus_detect", pdev);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "can't request irq %i, err: %d\n",
|
||||
irq, err);
|
||||
goto err_irq;
|
||||
return err;
|
||||
}
|
||||
|
||||
INIT_DELAYED_WORK(&gpio_vbus->work, gpio_vbus_work);
|
||||
|
||||
gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw");
|
||||
gpio_vbus->vbus_draw = devm_regulator_get(&pdev->dev, "vbus_draw");
|
||||
if (IS_ERR(gpio_vbus->vbus_draw)) {
|
||||
dev_dbg(&pdev->dev, "can't get vbus_draw regulator, err: %ld\n",
|
||||
PTR_ERR(gpio_vbus->vbus_draw));
|
||||
@@ -328,44 +330,23 @@ static int gpio_vbus_probe(struct platform_device *pdev)
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
|
||||
err);
|
||||
goto err_otg;
|
||||
return err;
|
||||
}
|
||||
|
||||
device_init_wakeup(&pdev->dev, pdata->wakeup);
|
||||
|
||||
return 0;
|
||||
err_otg:
|
||||
regulator_put(gpio_vbus->vbus_draw);
|
||||
free_irq(irq, pdev);
|
||||
err_irq:
|
||||
if (gpio_is_valid(pdata->gpio_pullup))
|
||||
gpio_free(pdata->gpio_pullup);
|
||||
gpio_free(pdata->gpio_vbus);
|
||||
err_gpio:
|
||||
kfree(gpio_vbus->phy.otg);
|
||||
kfree(gpio_vbus);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int gpio_vbus_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
|
||||
struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
|
||||
int gpio = pdata->gpio_vbus;
|
||||
|
||||
device_init_wakeup(&pdev->dev, 0);
|
||||
cancel_delayed_work_sync(&gpio_vbus->work);
|
||||
regulator_put(gpio_vbus->vbus_draw);
|
||||
|
||||
usb_remove_phy(&gpio_vbus->phy);
|
||||
|
||||
free_irq(gpio_vbus->irq, pdev);
|
||||
if (gpio_is_valid(pdata->gpio_pullup))
|
||||
gpio_free(pdata->gpio_pullup);
|
||||
gpio_free(gpio);
|
||||
kfree(gpio_vbus->phy.otg);
|
||||
kfree(gpio_vbus);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -279,11 +279,11 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert)
|
||||
|
||||
static int msm_otg_phy_clk_reset(struct msm_otg *motg)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (motg->pdata->phy_clk_reset)
|
||||
if (motg->pdata->phy_clk_reset && motg->phy_reset_clk)
|
||||
ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
|
||||
else
|
||||
else if (motg->phy_rst)
|
||||
ret = reset_control_reset(motg->phy_rst);
|
||||
|
||||
if (ret)
|
||||
@@ -1429,7 +1429,7 @@ static void msm_otg_debugfs_cleanup(void)
|
||||
debugfs_remove(msm_otg_dbg_root);
|
||||
}
|
||||
|
||||
static struct of_device_id msm_otg_dt_match[] = {
|
||||
static const struct of_device_id msm_otg_dt_match[] = {
|
||||
{
|
||||
.compatible = "qcom,usb-otg-ci",
|
||||
.data = (void *) CI_45NM_INTEGRATED_PHY
|
||||
@@ -1466,7 +1466,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
|
||||
|
||||
motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy");
|
||||
if (IS_ERR(motg->phy_rst))
|
||||
return PTR_ERR(motg->phy_rst);
|
||||
motg->phy_rst = NULL;
|
||||
|
||||
pdata->mode = of_usb_get_dr_mode(node);
|
||||
if (pdata->mode == USB_DR_MODE_UNKNOWN)
|
||||
@@ -1558,7 +1558,7 @@ static int msm_otg_probe(struct platform_device *pdev)
|
||||
np ? "phy" : "usb_phy_clk");
|
||||
if (IS_ERR(motg->phy_reset_clk)) {
|
||||
dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
|
||||
return PTR_ERR(motg->phy_reset_clk);
|
||||
motg->phy_reset_clk = NULL;
|
||||
}
|
||||
|
||||
motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
|
||||
|
@@ -962,7 +962,7 @@ static const struct tegra_phy_soc_config tegra30_soc_config = {
|
||||
.requires_extra_tuning_parameters = true,
|
||||
};
|
||||
|
||||
static struct of_device_id tegra_usb_phy_id_table[] = {
|
||||
static const struct of_device_id tegra_usb_phy_id_table[] = {
|
||||
{ .compatible = "nvidia,tegra30-usb-phy", .data = &tegra30_soc_config },
|
||||
{ .compatible = "nvidia,tegra20-usb-phy", .data = &tegra20_soc_config },
|
||||
{ },
|
||||
|
مرجع در شماره جدید
Block a user