From: Linus Torvalds Date: Wed, 19 Dec 2012 16:19:07 +0000 (-0800) Subject: Merge tag 'for-3.8-rc1' of git://gitorious.org/linux-pwm/linux-pwm X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=74779e22261172ea728b989310f6ecc991b57d62;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Merge tag 'for-3.8-rc1' of git://gitorious.org/linux-pwm/linux-pwm Pull pwm changes from Thierry Reding: "A new driver has been added for the SPEAr platform and the TWL4030/6030 driver has been replaced by two drivers that control the regular PWMs and the PWM driven LEDs provided by the chips. The vt8500, tiecap, tiehrpwm, i.MX, LPC32xx and Samsung drivers have all been improved and the device tree bindings now support the PWM signal polarity." Fix up trivial conflicts due to __devinit/exit removal. * tag 'for-3.8-rc1' of git://gitorious.org/linux-pwm/linux-pwm: (21 commits) pwm: samsung: add missing s3c->pwm_id assignment pwm: lpc32xx: Set the chip base for dynamic allocation pwm: lpc32xx: Properly disable the clock on device removal pwm: lpc32xx: Fix the PWM polarity pwm: i.MX: eliminate build warning pwm: Export of_pwm_xlate_with_flags() pwm: Remove pwm-twl6030 driver pwm: New driver to support PWM driven LEDs on TWL4030/6030 series of PMICs pwm: New driver to support PWMs on TWL4030/6030 series of PMICs pwm: pwm-tiehrpwm: pinctrl support pwm: tiehrpwm: Add device-tree binding pwm: pwm-tiehrpwm: Adding TBCLK gating support. pwm: pwm-tiecap: pinctrl support pwm: tiecap: Add device-tree binding pwm: Add TI PWM subsystem driver pwm: Device tree support for PWM polarity pwm: vt8500: Ensure PWM clock is enabled during pwm_config pwm: vt8500: Fix build error pwm: spear: Staticize spear_pwm_config() pwm: Add SPEAr PWM chip driver support ... --- 74779e22261172ea728b989310f6ecc991b57d62 diff --cc drivers/pwm/pwm-lpc32xx.c index 015a82235620,81db1bd5e92d..14106440294f --- a/drivers/pwm/pwm-lpc32xx.c +++ b/drivers/pwm/pwm-lpc32xx.c @@@ -118,11 -134,14 +134,14 @@@ static int lpc32xx_pwm_probe(struct pla return 0; } -static int __devexit lpc32xx_pwm_remove(struct platform_device *pdev) +static int lpc32xx_pwm_remove(struct platform_device *pdev) { struct lpc32xx_pwm_chip *lpc32xx = platform_get_drvdata(pdev); + unsigned int i; + + for (i = 0; i < lpc32xx->chip.npwm; i++) + pwm_disable(&lpc32xx->chip.pwms[i]); - clk_disable(lpc32xx->clk); return pwmchip_remove(&lpc32xx->chip); } diff --cc drivers/pwm/pwm-tiecap.c index 87c091b245cc,b4f9d4756d58..5cf016dd9822 --- a/drivers/pwm/pwm-tiecap.c +++ b/drivers/pwm/pwm-tiecap.c @@@ -184,7 -188,13 +188,13 @@@ static const struct pwm_ops ecap_pwm_op .owner = THIS_MODULE, }; + static const struct of_device_id ecap_of_match[] = { + { .compatible = "ti,am33xx-ecap" }, + {}, + }; + MODULE_DEVICE_TABLE(of, ecap_of_match); + -static int __devinit ecap_pwm_probe(struct platform_device *pdev) +static int ecap_pwm_probe(struct platform_device *pdev) { int ret; struct resource *r; @@@ -231,11 -249,29 +249,29 @@@ } pm_runtime_enable(&pdev->dev); + pm_runtime_get_sync(&pdev->dev); + + status = pwmss_submodule_state_change(pdev->dev.parent, + PWMSS_ECAPCLK_EN); + if (!(status & PWMSS_ECAPCLK_EN_ACK)) { + dev_err(&pdev->dev, "PWMSS config space clock enable failed\n"); + ret = -EINVAL; + goto pwmss_clk_failure; + } + + pm_runtime_put_sync(&pdev->dev); + platform_set_drvdata(pdev, pc); return 0; + + pwmss_clk_failure: + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + pwmchip_remove(&pc->chip); + return ret; } -static int __devexit ecap_pwm_remove(struct platform_device *pdev) +static int ecap_pwm_remove(struct platform_device *pdev) { struct ecap_pwm_chip *pc = platform_get_drvdata(pdev); @@@ -246,10 -290,12 +290,12 @@@ static struct platform_driver ecap_pwm_driver = { .driver = { - .name = "ecap", + .name = "ecap", + .owner = THIS_MODULE, + .of_match_table = ecap_of_match, }, .probe = ecap_pwm_probe, - .remove = __devexit_p(ecap_pwm_remove), + .remove = ecap_pwm_remove, }; module_platform_driver(ecap_pwm_driver); diff --cc drivers/pwm/pwm-tiehrpwm.c index 9ffd389d0c8b,542d5f38ccf6..72a6dd40c9ec --- a/drivers/pwm/pwm-tiehrpwm.c +++ b/drivers/pwm/pwm-tiehrpwm.c @@@ -392,7 -403,13 +403,13 @@@ static const struct pwm_ops ehrpwm_pwm_ .owner = THIS_MODULE, }; + static const struct of_device_id ehrpwm_of_match[] = { + { .compatible = "ti,am33xx-ehrpwm" }, + {}, + }; + MODULE_DEVICE_TABLE(of, ehrpwm_of_match); + -static int __devinit ehrpwm_pwm_probe(struct platform_device *pdev) +static int ehrpwm_pwm_probe(struct platform_device *pdev) { int ret; struct resource *r; @@@ -439,11 -471,29 +471,29 @@@ } pm_runtime_enable(&pdev->dev); + pm_runtime_get_sync(&pdev->dev); + + status = pwmss_submodule_state_change(pdev->dev.parent, + PWMSS_EPWMCLK_EN); + if (!(status & PWMSS_EPWMCLK_EN_ACK)) { + dev_err(&pdev->dev, "PWMSS config space clock enable failed\n"); + ret = -EINVAL; + goto pwmss_clk_failure; + } + + pm_runtime_put_sync(&pdev->dev); + platform_set_drvdata(pdev, pc); return 0; + + pwmss_clk_failure: + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + pwmchip_remove(&pc->chip); + return ret; } -static int __devexit ehrpwm_pwm_remove(struct platform_device *pdev) +static int ehrpwm_pwm_remove(struct platform_device *pdev) { struct ehrpwm_pwm_chip *pc = platform_get_drvdata(pdev); @@@ -454,10 -512,12 +512,12 @@@ static struct platform_driver ehrpwm_pwm_driver = { .driver = { - .name = "ehrpwm", + .name = "ehrpwm", + .owner = THIS_MODULE, + .of_match_table = ehrpwm_of_match, }, .probe = ehrpwm_pwm_probe, - .remove = __devexit_p(ehrpwm_pwm_remove), + .remove = ehrpwm_pwm_remove, }; module_platform_driver(ehrpwm_pwm_driver);