[PATCH v3] drm/exynos: enable FIMD clocks
While migrating to common clock framework (CCF), found that the FIMD clocks were pulled down by the CCF. If CCF finds any clock(s) which has NOT been claimed by any of the drivers, then such clock(s) are PULLed low by CCF. By calling clk_prepare_enable() for FIMD clocks fixes the issue. this patch also replaces clk_disable() with clk_disable_unprepare() during exit. Signed-off-by: Vikas Sajjan --- Changes since v2: - moved clk_prepare_enable() and clk_disable_unprepare() from fimd_probe() to fimd_clock() as suggested by Inki Dae Changes since v1: - added error checking for clk_prepare_enable() and also replaced clk_disable() with clk_disable_unprepare() during exit. --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 9537761..f2400c8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -799,18 +799,18 @@ static int fimd_clock(struct fimd_context *ctx, bool enable) if (enable) { int ret; - ret = clk_enable(ctx->bus_clk); + ret = clk_prepare_enable(ctx->bus_clk); if (ret < 0) return ret; - ret = clk_enable(ctx->lcd_clk); + ret = clk_prepare_enable(ctx->lcd_clk); if (ret < 0) { - clk_disable(ctx->bus_clk); + clk_disable_unprepare(ctx->bus_clk); return ret; } } else { - clk_disable(ctx->lcd_clk); - clk_disable(ctx->bus_clk); + clk_disable_unprepare(ctx->lcd_clk); + clk_disable_unprepare(ctx->bus_clk); } return 0; @@ -981,8 +981,8 @@ static int fimd_remove(struct platform_device *pdev) if (ctx->suspended) goto out; - clk_disable(ctx->lcd_clk); - clk_disable(ctx->bus_clk); + clk_disable_unprepare(ctx->lcd_clk); + clk_disable_unprepare(ctx->bus_clk); pm_runtime_set_suspended(dev); pm_runtime_put_sync(dev); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] drm/exynos: enable FIMD clocks
On 1 April 2013 14:13, Vikas Sajjan wrote: > While migrating to common clock framework (CCF), found that the FIMD clocks s/found/we found/ > were pulled down by the CCF. > If CCF finds any clock(s) which has NOT been claimed by any of the > drivers, then such clock(s) are PULLed low by CCF. > > By calling clk_prepare_enable() for FIMD clocks fixes the issue. s/By calling/Calling/ and s/the/this > this patch also replaces clk_disable() with clk_disable_unprepare() s/this/This > during exit. Sorry but your log doesn't say what you are doing. You are just adding relevant calls to clk_prepare/unprepare() before calling clk_enable/disable. > Signed-off-by: Vikas Sajjan > --- > Changes since v2: > - moved clk_prepare_enable() and clk_disable_unprepare() from > fimd_probe() to fimd_clock() as suggested by Inki Dae > > Changes since v1: > - added error checking for clk_prepare_enable() and also replaced > clk_disable() with clk_disable_unprepare() during exit. > --- > drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > index 9537761..f2400c8 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c > @@ -799,18 +799,18 @@ static int fimd_clock(struct fimd_context *ctx, bool > enable) > if (enable) { > int ret; > > - ret = clk_enable(ctx->bus_clk); > + ret = clk_prepare_enable(ctx->bus_clk); > if (ret < 0) > return ret; > > - ret = clk_enable(ctx->lcd_clk); > + ret = clk_prepare_enable(ctx->lcd_clk); > if (ret < 0) { > - clk_disable(ctx->bus_clk); > + clk_disable_unprepare(ctx->bus_clk); > return ret; > } > } else { > - clk_disable(ctx->lcd_clk); > - clk_disable(ctx->bus_clk); > + clk_disable_unprepare(ctx->lcd_clk); > + clk_disable_unprepare(ctx->bus_clk); > } > > return 0; > @@ -981,8 +981,8 @@ static int fimd_remove(struct platform_device *pdev) > if (ctx->suspended) > goto out; > > - clk_disable(ctx->lcd_clk); > - clk_disable(ctx->bus_clk); > + clk_disable_unprepare(ctx->lcd_clk); > + clk_disable_unprepare(ctx->bus_clk); You are doing things at the right place but i have a suggestion. Are you doing anything in your clk_prepare() atleast for this device? Probably not. If not, then its better to call clk_prepare/unprepare only once at probe/remove and keep clk_enable/disable calls as is. -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH V2] DMA: PL330: Add check if device tree compatible
On Thu, Mar 21, 2013 at 4:39 AM, Vinod Koul wrote: > On Tue, Mar 05, 2013 at 02:55:31PM +0530, Padmavathi Venna wrote: >> This patch register the dma controller with generic dma helpers only >> in DT case. This also adds some extra error handling in the driver. >> >> Signed-off-by: Padmavathi Venna >> Reported-by: Sachin Kamat What's the status on this? It is needed for 3.9 to fix pl330 on highbank. Rob >> --- >> >> Based on Vinod Koul next branch. >> >> Changes since V1: >> - return silently when of_dma_controller_register fails, as >> suggested by Arnd. >> >> drivers/dma/pl330.c | 38 +++--- >> 1 files changed, 27 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c >> index 7181531..5dbc594 100644 >> --- a/drivers/dma/pl330.c >> +++ b/drivers/dma/pl330.c >> @@ -2882,7 +2882,7 @@ pl330_probe(struct amba_device *adev, const struct >> amba_id *id) >> { >> struct dma_pl330_platdata *pdat; >> struct dma_pl330_dmac *pdmac; >> - struct dma_pl330_chan *pch; >> + struct dma_pl330_chan *pch, *_p; >> struct pl330_info *pi; >> struct dma_device *pd; >> struct resource *res; >> @@ -2984,7 +2984,16 @@ pl330_probe(struct amba_device *adev, const struct >> amba_id *id) >> ret = dma_async_device_register(pd); >> if (ret) { >> dev_err(&adev->dev, "unable to register DMAC\n"); >> - goto probe_err2; >> + goto probe_err3; >> + } >> + >> + if (adev->dev.of_node) { >> + ret = of_dma_controller_register(adev->dev.of_node, >> + of_dma_pl330_xlate, pdmac); >> + if (ret) { >> + dev_err(&adev->dev, >> + "unable to register DMA to the generic DT DMA >> helpers\n"); > Indent? >> + } >> } >> >> dev_info(&adev->dev, >> @@ -2995,16 +3004,21 @@ pl330_probe(struct amba_device *adev, const struct >> amba_id *id) >> pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan, >> pi->pcfg.num_peri, pi->pcfg.num_events); >> >> - ret = of_dma_controller_register(adev->dev.of_node, >> - of_dma_pl330_xlate, pdmac); >> - if (ret) { >> - dev_err(&adev->dev, >> - "unable to register DMA to the generic DT DMA helpers\n"); >> - goto probe_err2; >> - } >> - >> return 0; >> +probe_err3: >> + amba_set_drvdata(adev, NULL); >> >> + /* Idle the DMAC */ >> + list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels, >> + chan.device_node) { >> + >> + /* Remove the channel */ >> + list_del(&pch->chan.device_node); >> + >> + /* Flush the channel */ >> + pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0); >> + pl330_free_chan_resources(&pch->chan); > free_chan for error handling in probe? > >> + } >> probe_err2: >> pl330_del(pi); >> probe_err1: >> @@ -3023,8 +3037,10 @@ static int pl330_remove(struct amba_device *adev) >> if (!pdmac) >> return 0; >> >> - of_dma_controller_free(adev->dev.of_node); >> + if (adev->dev.of_node) >> + of_dma_controller_free(adev->dev.of_node); >> >> + dma_async_device_unregister(&pdmac->ddma); >> amba_set_drvdata(adev, NULL); >> >> /* Idle the DMAC */ >> -- >> 1.7.4.4 >> -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 00/11] usb: dwc3/xhci/phy: Enable runtime power management
This patch-series enables runtime power management on xhci-plat, dwc3-core, dwc3-exynos as well as on Samsung's USB 2.0 type and USB 3.0 type PHYs. Based on 'next' branch of Felipe Balbi's USB tree. Changes from v2: - Using separate functions for USB PHY runtime power management, instead of using macros. - Adding 'pm_runtime_set_suspended()' api call in dwc3 core layer before enabling runtime pm. (Ideally, we should be explicitly make device 'suspended' or 'active' before enabling runtime pm on it). - Checking return code for 'put_sync' and 'get_sync' of USB-PHYs when waking up or suspending them from dwc3 core's runtime_pm callbacks. - Removed buggy pm_runtime_put() calls from driver's (xhci, dwc3 and PHY) remove functions. - Adding a patch to enable runtime power management of Samsung's USB 2.0 PHY (usb: phy: samsung: Enable runtime power management on usb2phy) Changes from v1: - Adding required PHY APIs to handle runtime power management instead of directly twiddling with phy->dev. - Handling runtime power management of usb PHYs in dwc3 core driver instead of in any glue layer. - Splitting the patch: [PATCH 4/4] usb: phy: samsung: Enable runtime power management on samsung-usb into required number to bifurcate functionality. Vivek Gautam (11): usb: phy: Add APIs for runtime power management USB: dwc3: Adjust runtime pm to allow autosuspend usb: dwc3: Enable runtime pm only after PHYs are initialized usb: dwc3: Add runtime power management callbacks usb: dwc3: exynos: Enable runtime power management usb: xhci: Enable runtime pm in xhci-plat usb: phy: samsung: Enable runtime power management on usb2phy usb: phy: samsung: Enable runtime power management on usb3phy usb: phy: samsung: Add support for external reference clock usb: phy: samsung: Add support for PHY ref_clk gpio usb: phy: samsung: Add support for PHY refclk switching drivers/usb/dwc3/core.c| 59 ++-- drivers/usb/dwc3/dwc3-exynos.c | 12 +++ drivers/usb/host/xhci-plat.c |6 ++ drivers/usb/phy/phy-samsung-usb.c | 26 +++ drivers/usb/phy/phy-samsung-usb.h |1 + drivers/usb/phy/phy-samsung-usb2.c |5 ++ drivers/usb/phy/phy-samsung-usb3.c | 119 +-- include/linux/usb/phy.h| 141 8 files changed, 358 insertions(+), 11 deletions(-) -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 06/11] usb: xhci: Enable runtime pm in xhci-plat
By enabling runtime pm in this driver allows users of xhci-plat to enter into runtime pm. This is not full runtime pm support (AKA xhci-plat doesn't actually power anything off when in runtime suspend mode) but, just basic enablement. Signed-off-by: Vivek Gautam CC: Doug Anderson --- drivers/usb/host/xhci-plat.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index df90fe5..b10573e 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -12,6 +12,7 @@ */ #include +#include #include #include @@ -149,6 +150,9 @@ static int xhci_plat_probe(struct platform_device *pdev) if (ret) goto put_usb3_hcd; + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + return 0; put_usb3_hcd: @@ -174,6 +178,8 @@ static int xhci_plat_remove(struct platform_device *dev) struct usb_hcd *hcd = platform_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); + pm_runtime_disable(&dev->dev); + usb_remove_hcd(xhci->shared_hcd); usb_put_hcd(xhci->shared_hcd); -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 07/11] usb: phy: samsung: Enable runtime power management on usb2phy
Enable autosuspending of Samsung usb2.0 PHY Signed-off-by: Vivek Gautam --- drivers/usb/phy/phy-samsung-usb2.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/usb/phy/phy-samsung-usb2.c b/drivers/usb/phy/phy-samsung-usb2.c index 45ffe03..d378fe9 100644 --- a/drivers/usb/phy/phy-samsung-usb2.c +++ b/drivers/usb/phy/phy-samsung-usb2.c @@ -423,6 +423,9 @@ static int samsung_usb2phy_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sphy); + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + return usb_add_phy(&sphy->phy, USB_PHY_TYPE_USB2); } @@ -432,6 +435,8 @@ static int samsung_usb2phy_remove(struct platform_device *pdev) usb_remove_phy(&sphy->phy); + pm_runtime_disable(&pdev->dev); + if (sphy->pmuregs) iounmap(sphy->pmuregs); if (sphy->sysreg) -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 09/11] usb: phy: samsung: Add support for external reference clock
The PHY controller can choose between ref_pad_clk (XusbXTI-external PLL), or EXTREFCLK (XXTI-internal clock crystal) to generate the required clock. Adding the provision for ref_pad_clk here. Signed-off-by: Vivek Gautam --- drivers/usb/phy/phy-samsung-usb3.c | 46 +++ 1 files changed, 40 insertions(+), 6 deletions(-) diff --git a/drivers/usb/phy/phy-samsung-usb3.c b/drivers/usb/phy/phy-samsung-usb3.c index a713585..8afef9d 100644 --- a/drivers/usb/phy/phy-samsung-usb3.c +++ b/drivers/usb/phy/phy-samsung-usb3.c @@ -33,7 +33,7 @@ /* * Sets the phy clk as EXTREFCLK (XXTI) which is internal clock from clock core. */ -static u32 samsung_usb3phy_set_refclk(struct samsung_usbphy *sphy) +static u32 samsung_usb3phy_set_refclk_int(struct samsung_usbphy *sphy) { u32 reg; u32 refclk; @@ -66,7 +66,22 @@ static u32 samsung_usb3phy_set_refclk(struct samsung_usbphy *sphy) return reg; } -static int samsung_exynos5_usb3phy_enable(struct samsung_usbphy *sphy) +/* + * Sets the phy clk as ref_pad_clk (XusbXTI) which is clock from external PLL. + */ +static u32 samsung_usb3phy_set_refclk_ext(void) +{ + u32 reg; + + reg = PHYCLKRST_REFCLKSEL_PAD_REFCLK | + PHYCLKRST_FSEL_PAD_100MHZ | + PHYCLKRST_MPLL_MULTIPLIER_100MHZ_REF; + + return reg; +} + +static int samsung_exynos5_usb3phy_enable(struct samsung_usbphy *sphy, + bool use_ext_clk) { void __iomem *regs = sphy->regs; u32 phyparam0; @@ -81,7 +96,10 @@ static int samsung_exynos5_usb3phy_enable(struct samsung_usbphy *sphy) phyparam0 = readl(regs + EXYNOS5_DRD_PHYPARAM0); /* Select PHY CLK source */ - phyparam0 &= ~PHYPARAM0_REF_USE_PAD; + if (use_ext_clk) + phyparam0 |= PHYPARAM0_REF_USE_PAD; + else + phyparam0 &= ~PHYPARAM0_REF_USE_PAD; /* Set Loss-of-Signal Detector sensitivity */ phyparam0 &= ~PHYPARAM0_REF_LOSLEVEL_MASK; phyparam0 |= PHYPARAM0_REF_LOSLEVEL; @@ -116,7 +134,10 @@ static int samsung_exynos5_usb3phy_enable(struct samsung_usbphy *sphy) /* UTMI Power Control */ writel(PHYUTMI_OTGDISABLE, regs + EXYNOS5_DRD_PHYUTMI); - phyclkrst = samsung_usb3phy_set_refclk(sphy); + if (use_ext_clk) + phyclkrst = samsung_usb3phy_set_refclk_ext(); + else + phyclkrst = samsung_usb3phy_set_refclk_int(sphy); phyclkrst |= PHYCLKRST_PORTRESET | /* Digital power supply in normal operating mode */ @@ -164,7 +185,7 @@ static void samsung_exynos5_usb3phy_disable(struct samsung_usbphy *sphy) writel(phytest, regs + EXYNOS5_DRD_PHYTEST); } -static int samsung_usb3phy_init(struct usb_phy *phy) +static int samsung_exynos5_usb3phy_init(struct usb_phy *phy, bool use_ext_clk) { struct samsung_usbphy *sphy; unsigned long flags; @@ -188,7 +209,7 @@ static int samsung_usb3phy_init(struct usb_phy *phy) samsung_usbphy_set_isolation(sphy, false); /* Initialize usb phy registers */ - samsung_exynos5_usb3phy_enable(sphy); + samsung_exynos5_usb3phy_enable(sphy, use_ext_clk); spin_unlock_irqrestore(&sphy->lock, flags); @@ -199,6 +220,19 @@ static int samsung_usb3phy_init(struct usb_phy *phy) } /* + * The function passed to the usb driver for phy initialization + */ +static int samsung_usb3phy_init(struct usb_phy *phy) +{ + /* +* We start with using PHY refclk from external PLL, +* once runtime suspend for the device is called this +* will change to internal core clock +*/ + return samsung_exynos5_usb3phy_init(phy, true); +} + +/* * The function passed to the usb driver for phy shutdown */ static void samsung_usb3phy_shutdown(struct usb_phy *phy) -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 08/11] usb: phy: samsung: Enable runtime power management on usb3phy
Enable autosuspending of Samsung usb3.0 PHY Signed-off-by: Vivek Gautam --- drivers/usb/phy/phy-samsung-usb3.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/usb/phy/phy-samsung-usb3.c b/drivers/usb/phy/phy-samsung-usb3.c index 54f6418..a713585 100644 --- a/drivers/usb/phy/phy-samsung-usb3.c +++ b/drivers/usb/phy/phy-samsung-usb3.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -287,6 +288,9 @@ static int samsung_usb3phy_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sphy); + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + return usb_add_phy(&sphy->phy, USB_PHY_TYPE_USB3); } @@ -296,6 +300,8 @@ static int samsung_usb3phy_remove(struct platform_device *pdev) usb_remove_phy(&sphy->phy); + pm_runtime_disable(&pdev->dev); + if (sphy->pmuregs) iounmap(sphy->pmuregs); if (sphy->sysreg) -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 05/11] usb: dwc3: exynos: Enable runtime power management
Enabling runtime power management on dwc3-exynos letting dwc3 controller to be autosuspended on exynos platform when not in use. Signed-off-by: Vivek Gautam --- drivers/usb/dwc3/dwc3-exynos.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 1ea7bd8..1ae81a0 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -138,6 +139,11 @@ static int dwc3_exynos_probe(struct platform_device *pdev) exynos->dev = dev; exynos->clk = clk; + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + pm_runtime_forbid(dev); + clk_prepare_enable(exynos->clk); if (node) { @@ -152,10 +158,14 @@ static int dwc3_exynos_probe(struct platform_device *pdev) goto err2; } + pm_runtime_put_sync(dev); + pm_runtime_allow(dev); + return 0; err2: clk_disable_unprepare(clk); + pm_runtime_disable(dev); err1: return ret; } @@ -164,6 +174,8 @@ static int dwc3_exynos_remove(struct platform_device *pdev) { struct dwc3_exynos *exynos = platform_get_drvdata(pdev); + pm_runtime_disable(&pdev->dev); + platform_device_unregister(exynos->usb2_phy); platform_device_unregister(exynos->usb3_phy); device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 01/11] usb: phy: Add APIs for runtime power management
Adding APIs to handle runtime power management on PHY devices. PHY consumers may need to wake-up/suspend PHYs when they work across autosuspend. Signed-off-by: Vivek Gautam --- include/linux/usb/phy.h | 141 +++ 1 files changed, 141 insertions(+), 0 deletions(-) diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 6b5978f..01bf9c1 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -297,4 +297,145 @@ static inline const char *usb_phy_type_string(enum usb_phy_type type) return "UNKNOWN PHY TYPE"; } } + +static inline void usb_phy_autopm_enable(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return; + } + + pm_runtime_enable(x->dev); +} + +static inline void usb_phy_autopm_disable(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return; + } + + pm_runtime_disable(x->dev); +} + +static inline int usb_phy_autopm_get(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return -ENODEV; + } + + return pm_runtime_get(x->dev); +} + +static inline int usb_phy_autopm_get_sync(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return -ENODEV; + } + + return pm_runtime_get_sync(x->dev); +} + +static inline int usb_phy_autopm_put(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return -ENODEV; + } + + return pm_runtime_put(x->dev); +} + +static inline int usb_phy_autopm_put_sync(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return -ENODEV; + } + + return pm_runtime_put_sync(x->dev); +} + +static inline void usb_phy_autopm_allow(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return; + } + + pm_runtime_allow(x->dev); +} + +static inline void usb_phy_autopm_forbid(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return; + } + + pm_runtime_forbid(x->dev); +} + +static inline int usb_phy_autopm_set_active(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return -ENODEV; + } + + return pm_runtime_set_active(x->dev); +} + +static inline void usb_phy_autopm_set_suspended(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return; + } + + pm_runtime_set_suspended(x->dev); +} + +static inline bool usb_phy_autopm_suspended(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return 0; + } + + return pm_runtime_suspended(x->dev); +} + +static inline bool usb_phy_autopm_active(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return 0; + } + + return pm_runtime_active(x->dev); +} + +static inline int usb_phy_autopm_suspend(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return -ENODEV; + } + + return pm_runtime_suspend(x->dev); +} + +static inline int usb_phy_autopm_resume(struct usb_phy *x) +{ + if (!x || !x->dev) { + dev_err(x->dev, "no PHY or attached device available\n"); + return -ENODEV; + } + + return pm_runtime_resume(x->dev); +} + #endif /* __LINUX_USB_PHY_H */ -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 04/11] usb: dwc3: Add runtime power management callbacks
Right now it doesn't handle full runtime suspend/resume functionality. However it allows to handle PHYs' sleep and wakeup across runtime suspend/resume. Signed-off-by: Vivek Gautam --- drivers/usb/dwc3/core.c | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index e250828..65a3adf 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -745,11 +745,54 @@ static int dwc3_resume(struct device *dev) return 0; } +#ifdef CONFIG_PM_RUNTIME +static int dwc3_runtime_suspend(struct device *dev) +{ + struct dwc3 *dwc = dev_get_drvdata(dev); + int ret = 0; + + ret = usb_phy_autopm_put_sync(dwc->usb2_phy); + if (ret) + dev_warn(dev, "Can't autosuspend usb2-phy\n"); + + ret = usb_phy_autopm_put_sync(dwc->usb3_phy); + if (ret) + dev_warn(dev, "Can't autosuspend usb3-phy\n"); + + return ret; +} + +static int dwc3_runtime_resume(struct device *dev) +{ + struct dwc3 *dwc = dev_get_drvdata(dev); + int ret = 0; + + ret = usb_phy_autopm_get_sync(dwc->usb2_phy); + if (ret) { + dev_err(dev, "usb2-phy: get sync failed with err %d\n", ret); + return ret; + } + + ret = usb_phy_autopm_get_sync(dwc->usb3_phy); + if (ret) { + dev_err(dev, "usb3-phy: get sync failed with err %d\n", ret); + return ret; + } + + return ret; +} +#else +#define dwc3_runtime_suspend NULL +#define dwc3_runtime_resumeNULL +#endif + static const struct dev_pm_ops dwc3_dev_pm_ops = { .prepare= dwc3_prepare, .complete = dwc3_complete, SET_SYSTEM_SLEEP_PM_OPS(dwc3_suspend, dwc3_resume) + SET_RUNTIME_PM_OPS(dwc3_runtime_suspend, + dwc3_runtime_resume, NULL) }; #define DWC3_PM_OPS&(dwc3_dev_pm_ops) -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 03/11] usb: dwc3: Enable runtime pm only after PHYs are initialized
Allow dwc3 to enable auto power management only after its PHYs are initialized so that any further PHY handling by dwc3's runtime power management callbacks is fine. Signed-off-by: Vivek Gautam --- drivers/usb/dwc3/core.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 3a6993c..e250828 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -491,15 +491,6 @@ static int dwc3_probe(struct platform_device *pdev) dwc->needs_fifo_resize = of_property_read_bool(node, "tx-fifo-resize"); - /* Setting device state as 'suspended' initially, -* to make sure we know device state prior to -* pm_runtime_enable -*/ - pm_runtime_set_suspended(dev); - pm_runtime_enable(dev); - pm_runtime_get_sync(dev); - pm_runtime_forbid(dev); - dwc3_cache_hwparams(dwc); ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE); @@ -521,6 +512,15 @@ static int dwc3_probe(struct platform_device *pdev) goto err1; } + /* Setting device state as 'suspended' initially, +* to make sure we know device state prior to +* pm_runtime_enable +*/ + pm_runtime_set_suspended(dev); + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + pm_runtime_forbid(dev); + if (IS_ENABLED(CONFIG_USB_DWC3_HOST)) mode = DWC3_MODE_HOST; else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET)) -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 02/11] USB: dwc3: Adjust runtime pm to allow autosuspend
The current code in the dwc3 probe effectively disables runtime pm from ever working because it calls a get() that was never put() until device removal. Change the runtime pm code to match the standard formula and allow runtime pm to function. Signed-off-by: Vivek Gautam CC: Doug Anderson --- drivers/usb/dwc3/core.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index e2325ad..3a6993c 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -491,6 +491,11 @@ static int dwc3_probe(struct platform_device *pdev) dwc->needs_fifo_resize = of_property_read_bool(node, "tx-fifo-resize"); + /* Setting device state as 'suspended' initially, +* to make sure we know device state prior to +* pm_runtime_enable +*/ + pm_runtime_set_suspended(dev); pm_runtime_enable(dev); pm_runtime_get_sync(dev); pm_runtime_forbid(dev); @@ -566,6 +571,7 @@ static int dwc3_probe(struct platform_device *pdev) goto err3; } + pm_runtime_put_sync(dev); pm_runtime_allow(dev); return 0; @@ -595,6 +601,7 @@ err1: err0: dwc3_free_event_buffers(dwc); + pm_runtime_disable(&pdev->dev); return ret; } @@ -606,7 +613,6 @@ static int dwc3_remove(struct platform_device *pdev) usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1); - pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); dwc3_debugfs_exit(dwc); -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v10 0/3] Add DRM FIMD DT support for Exynos4 DT Machines
This patch series adds support for DRM FIMD DT for Exynos4 DT Machines, specifically for Exynos4412 SoC. changes since v9: - dropped the patch "ARM: dts: Add lcd pinctrl node entries for EXYNOS4412 SoC" as the gpios in the newly added nodes "lcd_en" and "lcd_sync" in this patch were already PULLed high by existing "lcd_clk" node. - addressed comments from Sylwester Nawrocki and Thomas Abraham changes since v8: - addressed comments to add missing documentation for clock and clock-names properties as pointed out by Sachin Kamat changes since v7: - rebased to kgene's "for-next" - Migrated to Common Clock Framework - removed the patch "ARM: dts: Add FIMD AUXDATA node entry for exynos4 DT", as migration to Common Clock Framework will NOT need this. - addressed the comments raised by Sachin Kamat changes since v6: - addressed comments and added interrupt-names = "fifo", "vsync", "lcd_sys" in exynos4.dtsi and re-ordered the interrupt numbering to match the order in interrupt combiner IP as suggested by Sylwester Nawrocki . changes since v5: - renamed the fimd binding documentation file name as "samsung-fimd.txt", since it not only talks about exynos display controller but also about previous samsung display controllers. - rephrased an abmigious statement about the interrupt combiner in the fimd binding documentation as pointed out by Sachin Kamat changes since v4: - moved the fimd binding documentation to Documentation/devicetree/bindings/video/ as suggested by Sylwester Nawrocki - added more fimd compatiblity strings in fimd documentation as discussed at https://patchwork.kernel.org/patch/2144861/ with Sylwester Nawrocki and Tomasz Figa - modified compatible string for exynos4 fimd as "exynos4210-fimd" exynos5 fimd as "exynos5250-fimd" to stick to the rule that compatible value should be named after first specific SoC model in which this particular IP version was included as discussed at https://patchwork.kernel.org/patch/2144861/ - documented more about the interrupt combiner and their order as suggested by Sylwester Nawrocki changes since v3: - rebased on http://git.kernel.org/?p=linux/kernel/git/kgene/linux-samsung.git;a=shortlog;h=refs/heads/for-next-next changes since v2: - added alias to 'fimd@11c0' node (reported by: Rahul Sharma ) - removed 'lcd0_data' node as there was already a similar node lcd_data24 (reported by: Jingoo Han - replaced spaces with tabs in display-timing node changes since v1: - added new patch to add FIMD DT binding Documentation - removed patch enabling SAMSUNG_DEV_BACKLIGHT and SAMSUNG_DEV_PMW for mach-exynos4 DT - added 'status' property to fimd DT node Is based on branch kgene's "for-next" https://git.kernel.org/cgit/linux/kernel/git/kgene/linux-samsung.git/log/?h=for-next Vikas Sajjan (3): ARM: dts: Add FIMD node to exynos4 ARM: dts: Add FIMD node and display timing node to exynos4412-origen.dts ARM: dts: Add FIMD DT binding Documentation .../devicetree/bindings/video/samsung-fimd.txt | 65 arch/arm/boot/dts/exynos4.dtsi | 12 arch/arm/boot/dts/exynos4412-origen.dts| 21 +++ 3 files changed, 98 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/samsung-fimd.txt -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v10 1/3] ARM: dts: Add FIMD node to exynos4
This patch adds a common FIMD device node for all Exynos4 SoCs. Signed-off-by: Vikas Sajjan --- arch/arm/boot/dts/exynos4.dtsi | 12 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi index 9ac47d5..59e6730 100644 --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -356,4 +356,16 @@ #dma-requests = <1>; }; }; + + fimd: fimd@11c0 { + compatible = "samsung,exynos4210-fimd"; + interrupt-parent = <&combiner>; + reg = <0x11c0 0x2>; + interrupt-names = "fifo", "vsync", "lcd_sys"; + interrupts = <11 0>, <11 1>, <11 2>; + clocks = <&clock 140>, <&clock 283>; + clock-names = "sclk_fimd", "fimd"; + samsung,power-domain = <&pd_lcd0>; + status = "disabled"; + }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v10 2/3] ARM: dts: Add FIMD node and display timing node to exynos4412-origen.dts
This patch adds FIMD related nodes for the Origen Quad board. Signed-off-by: Vikas Sajjan --- arch/arm/boot/dts/exynos4412-origen.dts | 21 + 1 file changed, 21 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts index a5478bd..cb0c507 100644 --- a/arch/arm/boot/dts/exynos4412-origen.dts +++ b/arch/arm/boot/dts/exynos4412-origen.dts @@ -70,6 +70,27 @@ status = "okay"; }; + fimd@11c0 { + pinctrl-0 = <&lcd_clk &lcd_data24 &pwm1_out>; + pinctrl-names = "default"; + status = "okay"; + }; + + display-timings { + native-mode = <&timing0>; + timing0: timing@0 { + clock-frequency = <5>; + hactive = <1024>; + vactive = <600>; + hfront-porch = <64>; + hback-porch = <16>; + hsync-len = <48>; + vback-porch = <64>; + vfront-porch = <16>; + vsync-len = <3>; + }; + }; + serial@1380 { status = "okay"; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v10 3/3] ARM: dts: Add FIMD DT binding Documentation
Add DT binding documentation for the FIMD IP block found in Samsung SoCs. Signed-off-by: Vikas Sajjan --- .../devicetree/bindings/video/samsung-fimd.txt | 65 1 file changed, 65 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/samsung-fimd.txt diff --git a/Documentation/devicetree/bindings/video/samsung-fimd.txt b/Documentation/devicetree/bindings/video/samsung-fimd.txt new file mode 100644 index 000..1984dbb --- /dev/null +++ b/Documentation/devicetree/bindings/video/samsung-fimd.txt @@ -0,0 +1,65 @@ +Device-Tree bindings for Samsung SoC display controller (FIMD) + +FIMD (Fully Interactive Mobile Display) is the Display Controller for the +Samsung series of SoCs which transfers the image data from a video memory buffer +to an external LCD interface. + +Required properties: +- compatible: value should be one of the following + "samsung,s3c2443-fimd"; /* for S3C24XX SoCs */ + "samsung,s3c6400-fimd"; /* for S3C64XX SoCs */ + "samsung,s5p6440-fimd"; /* for S5P64X0 SoCs */ + "samsung,s5pc100-fimd"; /* for S5PC100 SoC */ + "samsung,s5pv210-fimd"; /* for S5PV210 SoC */ + "samsung,exynos4210-fimd"; /* for Exynos4 SoCs */ + "samsung,exynos5250-fimd"; /* for Exynos5 SoCs */ + +- reg: physical base address of the FIMD and length of memory mapped region + +- interrupt-parent: should be the phandle of the fimd controller's + parent interrupt controller. + +- interrupts: should contain a list of all FIMD IP block interrupts in the +order: FIFO Level, VSYNC, LCD_SYSTEM. The interrupt specifier +format depends on the interrupt controller used. + +- interrupt-names: should contain the interrupt names: "fifo", "vsync", + "lcd_sys", in the same order as they were listed in the interrupts +property. + +- pinctrl-0: pin control group to be used for this controller. + +- pinctrl-names: must contain a "default" entry. + +- clocks: must include clock specifiers corresponding to entries in the + clock-names properties. + +- clock-names: List of clock names sorted in the same order as the clocks + property. Must contain "sclk_fimd" and "fimd". + +Optional Properties: +- samsung,power-domain: a phandle to FIMD power domain node + +Example: + +SoC specific DT entry: + + fimd@11c0 { + compatible = "samsung,exynos4210-fimd"; + interrupt-parent = <&combiner>; + reg = <0x11c0 0x2>; + interrupt-names = "fifo", "vsync", "lcd_sys"; + interrupts = <11 0>, <11 1>, <11 2>; + clocks = <&clock 140>, <&clock 283>; + clock-names = "sclk_fimd", "fimd"; + samsung,power-domain = <&pd_lcd0>; + status = "disabled"; + }; + +Board specific DT entry: + + fimd@11c0 { + pinctrl-0 = <&lcd_clk &lcd_data24 &pwm1_out>; + pinctrl-names = "default"; + status = "okay"; + }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [drm] exynos: hdmi: Remove fecal color
This patch makes the driver less shitty. Signed-off-by: Edward Smietana --- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 6d63f90..e11372c 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1269,7 +1269,7 @@ static void hdmi_conf_init(struct hdmi_context *hdata) } if (hdata->type == HDMI_TYPE13) { - /* choose bluescreen (fecal) color */ + /* choose bluescreen (brown) color */ hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_0, 0x12); hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_1, 0x34); hdmi_reg_writeb(hdata, HDMI_V13_BLUE_SCREEN_2, 0x56); -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v10 2/3] ARM: dts: Add FIMD node and display timing node to exynos4412-origen.dts
On 04/01/2013 04:22 PM, Vikas Sajjan wrote: This patch adds FIMD related nodes for the Origen Quad board. Signed-off-by: Vikas Sajjan --- arch/arm/boot/dts/exynos4412-origen.dts | 21 + 1 file changed, 21 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts index a5478bd..cb0c507 100644 --- a/arch/arm/boot/dts/exynos4412-origen.dts +++ b/arch/arm/boot/dts/exynos4412-origen.dts @@ -70,6 +70,27 @@ status = "okay"; }; + fimd@11c0 { + pinctrl-0 =<&lcd_clk&lcd_data24&pwm1_out>; + pinctrl-names = "default"; + status = "okay"; + }; + + display-timings { + native-mode =<&timing0>; + timing0: timing@0 { I think you could leave out '@0' part, since there is only one node. And if you decide to keep it, then this node should contain 'reg' property AFAICT. Otherwise the series looks good to me. With the above issue addressed feel free to add Reviewed-by: Sylwester Nawrocki + clock-frequency =<5>; + hactive =<1024>; + vactive =<600>; + hfront-porch =<64>; + hback-porch =<16>; + hsync-len =<48>; + vback-porch =<64>; + vfront-porch =<16>; + vsync-len =<3>; + }; + }; + serial@1380 { status = "okay"; }; Thanks, Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] mmc: dwmmc: let device core setup the default pin configuration
Thomas, On Mon, Mar 25, 2013 at 9:56 AM, Doug Anderson wrote: > Are you planning on doing this? I noticed that Chris pulled your > sdhci-s3c change in recently but apparently skipped this one since it > had outstanding comments. Can you address comments and re-send? This > is blocking pinmux dts stuff from landing (I think) and that blocks a > lot of other things from landing. > > The comments are pretty trivial, so I could always fix them and > re-send myself, but it would be better if you could do it... :) I didn't hear anything last week and it's getting pretty late in the process. I'll post something tomorrow if I don't hear from you... -Doug -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH V2] DMA: PL330: Add check if device tree compatible
On Mon, Apr 01, 2013 at 08:13:31AM -0500, Rob Herring wrote: > On Thu, Mar 21, 2013 at 4:39 AM, Vinod Koul wrote: > > On Tue, Mar 05, 2013 at 02:55:31PM +0530, Padmavathi Venna wrote: > >> This patch register the dma controller with generic dma helpers only > >> in DT case. This also adds some extra error handling in the driver. > >> > >> Signed-off-by: Padmavathi Venna > >> Reported-by: Sachin Kamat > > What's the status on this? It is needed for 3.9 to fix pl330 on highbank. Well the status is that submitter has been rude. I had few questions and comments on this patch and they are yet to be addressed. -- ~Vinod > > Rob > > >> --- > >> > >> Based on Vinod Koul next branch. > >> > >> Changes since V1: > >> - return silently when of_dma_controller_register fails, as > >> suggested by Arnd. > >> > >> drivers/dma/pl330.c | 38 +++--- > >> 1 files changed, 27 insertions(+), 11 deletions(-) > >> > >> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c > >> index 7181531..5dbc594 100644 > >> --- a/drivers/dma/pl330.c > >> +++ b/drivers/dma/pl330.c > >> @@ -2882,7 +2882,7 @@ pl330_probe(struct amba_device *adev, const struct > >> amba_id *id) > >> { > >> struct dma_pl330_platdata *pdat; > >> struct dma_pl330_dmac *pdmac; > >> - struct dma_pl330_chan *pch; > >> + struct dma_pl330_chan *pch, *_p; > >> struct pl330_info *pi; > >> struct dma_device *pd; > >> struct resource *res; > >> @@ -2984,7 +2984,16 @@ pl330_probe(struct amba_device *adev, const struct > >> amba_id *id) > >> ret = dma_async_device_register(pd); > >> if (ret) { > >> dev_err(&adev->dev, "unable to register DMAC\n"); > >> - goto probe_err2; > >> + goto probe_err3; > >> + } > >> + > >> + if (adev->dev.of_node) { > >> + ret = of_dma_controller_register(adev->dev.of_node, > >> + of_dma_pl330_xlate, pdmac); > >> + if (ret) { > >> + dev_err(&adev->dev, > >> + "unable to register DMA to the generic DT DMA > >> helpers\n"); > > Indent? > >> + } > >> } > >> > >> dev_info(&adev->dev, > >> @@ -2995,16 +3004,21 @@ pl330_probe(struct amba_device *adev, const struct > >> amba_id *id) > >> pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan, > >> pi->pcfg.num_peri, pi->pcfg.num_events); > >> > >> - ret = of_dma_controller_register(adev->dev.of_node, > >> - of_dma_pl330_xlate, pdmac); > >> - if (ret) { > >> - dev_err(&adev->dev, > >> - "unable to register DMA to the generic DT DMA helpers\n"); > >> - goto probe_err2; > >> - } > >> - > >> return 0; > >> +probe_err3: > >> + amba_set_drvdata(adev, NULL); > >> > >> + /* Idle the DMAC */ > >> + list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels, > >> + chan.device_node) { > >> + > >> + /* Remove the channel */ > >> + list_del(&pch->chan.device_node); > >> + > >> + /* Flush the channel */ > >> + pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0); > >> + pl330_free_chan_resources(&pch->chan); > > free_chan for error handling in probe? > > > >> + } > >> probe_err2: > >> pl330_del(pi); > >> probe_err1: > >> @@ -3023,8 +3037,10 @@ static int pl330_remove(struct amba_device *adev) > >> if (!pdmac) > >> return 0; > >> > >> - of_dma_controller_free(adev->dev.of_node); > >> + if (adev->dev.of_node) > >> + of_dma_controller_free(adev->dev.of_node); > >> > >> + dma_async_device_unregister(&pdmac->ddma); > >> amba_set_drvdata(adev, NULL); > >> > >> /* Idle the DMAC */ > >> -- > >> 1.7.4.4 > >> -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 2/9] ARM: S3C24XX: Provide regulator to pwm-backlight
The pwm-backlight driver now takes a mandatory regulator that is gotten during driver probe. Initialize a dummy regulator to satisfy this requirement. Signed-off-by: Andrew Chew Acked-by: Alexandre Courbot --- arch/arm/mach-s3c24xx/mach-h1940.c | 8 arch/arm/mach-s3c24xx/mach-rx1950.c | 9 + 2 files changed, 17 insertions(+) diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c index 8dd6601..008be7e 100644 --- a/arch/arm/mach-s3c24xx/mach-h1940.c +++ b/arch/arm/mach-s3c24xx/mach-h1940.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include #include @@ -497,6 +499,9 @@ static void h1940_backlight_exit(struct device *dev) gpio_set_value(H1940_LATCH_MAX1698_nSHUTDOWN, 0); } +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight"); static struct platform_pwm_backlight_data backlight_data = { .pwm_id = 0, @@ -720,6 +725,9 @@ static void __init h1940_init(void) gpio_request(H1940_LATCH_SD_POWER, "SD power"); gpio_direction_output(H1940_LATCH_SD_POWER, 0); + regulator_register_always_on(-1, "backlight-power", +&backlight_supply, 1, 0); + platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); gpio_request(S3C2410_GPA(1), "Red LED blink"); diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c index e4d67a3..f6978b6 100644 --- a/arch/arm/mach-s3c24xx/mach-rx1950.c +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include #include @@ -518,6 +520,10 @@ static int rx1950_backlight_notify(struct device *dev, int brightness) return brightness; } +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight"); + static struct platform_pwm_backlight_data rx1950_backlight_data = { .pwm_id = 0, .max_brightness = 24, @@ -795,6 +801,9 @@ static void __init rx1950_init_machine(void) gpio_direction_output(S3C2410_GPA(4), 0); gpio_direction_output(S3C2410_GPJ(6), 0); + regulator_register_always_on(-1, "backlight-power", +&backlight_supply, 1, 0); + platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices)); i2c_register_board_info(0, rx1950_i2c_devices, -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 8/9] ARM: tegra: Provide regulator to pwm-backlight
The pwm-backlight driver now takes a mandatory regulator that is gotten during driver probe. Initialize a dummy regulator to satisfy this requirement. Signed-off-by: Andrew Chew Acked-by: Alexandre Courbot Acked-by: Stephen Warren --- arch/arm/boot/dts/tegra20-medcom-wide.dts | 1 + arch/arm/boot/dts/tegra20-tamonten.dtsi | 10 ++ 2 files changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/tegra20-medcom-wide.dts b/arch/arm/boot/dts/tegra20-medcom-wide.dts index a2d6d65..90d665e 100644 --- a/arch/arm/boot/dts/tegra20-medcom-wide.dts +++ b/arch/arm/boot/dts/tegra20-medcom-wide.dts @@ -32,6 +32,7 @@ brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; + power-supply = <&backlight_power_reg>; }; sound { diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi b/arch/arm/boot/dts/tegra20-tamonten.dtsi index 6e9d91f..1ea3e42 100644 --- a/arch/arm/boot/dts/tegra20-tamonten.dtsi +++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi @@ -485,5 +485,15 @@ regulator-max-microvolt = <500>; regulator-always-on; }; + + backlight_power_reg: regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "lcd_bl_en"; + regulator-min-microvolt = <330>; + regulator-max-microvolt = <330>; + gpio = <&gpio 13 0>; /* gpio PB5 */ + enable-active-high; + }; }; }; -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 4/9] ARM: EXYNOS: Provide regulator to pwm-backlight
The pwm-backlight driver now takes a mandatory regulator that is gotten during driver probe. Initialize a dummy regulator to satisfy this requirement. Signed-off-by: Andrew Chew Acked-by: Alexandre Courbot --- arch/arm/mach-exynos/mach-nuri.c | 7 +++ arch/arm/plat-samsung/dev-backlight.c | 9 + 2 files changed, 16 insertions(+) diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c index 1ea7973..0223863 100644 --- a/arch/arm/mach-exynos/mach-nuri.c +++ b/arch/arm/mach-exynos/mach-nuri.c @@ -294,6 +294,10 @@ static void nuri_bl_exit(struct device *dev) gpio_free(EXYNOS4_GPE2(3)); } +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight"); + /* nuri pwm backlight */ static struct platform_pwm_backlight_data nuri_backlight_data = { .pwm_id = 0, @@ -1368,6 +1372,9 @@ static void __init nuri_machine_init(void) nuri_ehci_init(); s3c_hsotg_set_platdata(&nuri_hsotg_pdata); + regulator_register_always_on(-1, "backlight-power", +&backlight_supply, 1, 0); + /* Last */ platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); } diff --git a/arch/arm/plat-samsung/dev-backlight.c b/arch/arm/plat-samsung/dev-backlight.c index 5f197dc..23ce16b 100644 --- a/arch/arm/plat-samsung/dev-backlight.c +++ b/arch/arm/plat-samsung/dev-backlight.c @@ -14,12 +14,18 @@ #include #include #include +#include +#include #include #include #include #include +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight"); + static int samsung_bl_init(struct device *dev) { int ret = 0; @@ -37,6 +43,9 @@ static int samsung_bl_init(struct device *dev) /* Configure GPIO pin with specific GPIO function for PWM timer */ s3c_gpio_cfgpin(bl_gpio_info->no, bl_gpio_info->func); + regulator_register_always_on(-1, "backlight-power", +&backlight_supply, 1, 0); + return 0; } -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 9/9] pwm_bl: Add mandatory backlight power regulator
Many backlights need to be explicitly powered. Typically, this is done with a GPIO. For flexibility, we generalize the power mechanism to a regulator. If a power regulator is not needed, then a dummy fixed regulator can be given to the backlight driver. If a GPIO is used to enable the backlight, then a fixed regulator can be instantiated to control the GPIO. The backlight power regulator can be specified in the device tree node for the backlight, or can be done with legacy board setup code in the usual way. Signed-off-by: Andrew Chew Reviewed-by: Alexandre Courbot Tested-by: Peter Ujfalusi --- .../bindings/video/backlight/pwm-backlight.txt | 14 + drivers/video/backlight/pwm_bl.c | 59 ++ 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt index 1e4fc72..efbd799 100644 --- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt +++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt @@ -10,6 +10,11 @@ Required properties: last value in the array represents a 100% duty cycle (brightest). - default-brightness-level: the default brightness level (index into the array defined by the "brightness-levels" property) + - power-supply: A phandle to the regulator device tree node. This + regulator will be turned on and off as the PWM is enabled and disabled. + Many backlights are enabled via a GPIO. In this case, we instantiate + a fixed regulator and give that to power-supply. If a regulator + is not needed, then provide a dummy fixed regulator. Optional properties: - pwm-names: a list of names for the PWM devices specified in the @@ -19,10 +24,19 @@ Optional properties: Example: + bl_en: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "bl-en-supply"; + regulator-boot-on; + gpio = <&some_gpio>; + enable-active-high; + }; + backlight { compatible = "pwm-backlight"; pwms = <&pwm 0 500>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; + power-supply = <&bl_en>; }; diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 1fea627..ddd66d0 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -20,10 +20,13 @@ #include #include #include +#include struct pwm_bl_data { struct pwm_device *pwm; struct device *dev; + boolenabled; + struct regulator*power_supply; unsigned intperiod; unsigned intlth_brightness; unsigned int*levels; @@ -35,6 +38,42 @@ struct pwm_bl_data { void(*exit)(struct device *); }; +static void pwm_backlight_enable(struct backlight_device *bl) +{ + struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); + int ret; + + /* Bail if we are already enabled. */ + if (pb->enabled) + return; + + pwm_enable(pb->pwm); + + ret = regulator_enable(pb->power_supply); + if (ret) + dev_warn(&bl->dev, "Failed to enable regulator: %d", ret); + + pb->enabled = true; +} + +static void pwm_backlight_disable(struct backlight_device *bl) +{ + struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); + int ret; + + /* Bail if we are already disabled. */ + if (!pb->enabled) + return; + + ret = regulator_disable(pb->power_supply); + if (ret) + dev_warn(&bl->dev, "Failed to disable regulator: %d", ret); + + pwm_disable(pb->pwm); + + pb->enabled = false; +} + static int pwm_backlight_update_status(struct backlight_device *bl) { struct pwm_bl_data *pb = bl_get_data(bl); @@ -51,7 +90,7 @@ static int pwm_backlight_update_status(struct backlight_device *bl) if (brightness == 0) { pwm_config(pb->pwm, 0, pb->period); - pwm_disable(pb->pwm); + pwm_backlight_disable(bl); } else { int duty_cycle; @@ -65,7 +104,7 @@ static int pwm_backlight_update_status(struct backlight_device *bl) duty_cycle = pb->lth_brightness + (duty_cycle * (pb->period - pb->lth_brightness) / max); pwm_config(pb->pwm, duty_cycle, pb->period); - pwm_enable(pb->pwm); + pwm_backlight_enable(bl); } if (pb->notify_after) @@ -138,12 +177,6 @@ static int pwm_backlight_parse_dt(struct device *dev, data->max_brightness--; } - /* -* TODO: Most users of this driver use a
[PATCH V6 1/9] ARM: OMAP: board-4430sdp: Provide regulator to pwm-backlight
The pwm-backlight driver now takes a mandatory regulator that is gotten during driver probe. Initialize a dummy regulator to satisfy this requirement. Signed-off-by: Andrew Chew Tested-by: Peter Ujfalusi Acked-by: Alexandre Courbot --- arch/arm/mach-omap2/board-4430sdp.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 35f3ad0..9b03bbd 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -291,6 +291,10 @@ static struct platform_device sdp4430_leds_pwm = { }, }; +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight"); + static struct platform_pwm_backlight_data sdp4430_backlight_data = { .max_brightness = 127, .dft_brightness = 127, @@ -718,6 +722,8 @@ static void __init omap_4430sdp_init(void) omap4_i2c_init(); omap_sfh7741prox_init(); + regulator_register_always_on(-1, "backlight-power", +&backlight_supply, 1, 0); platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); omap_serial_init(); omap_sdrc_init(NULL, NULL); -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 7/9] ARM: vt8500: Provide regulator to pwm-backlight
The pwm-backlight driver now takes a mandatory regulator that is gotten during driver probe. Initialize a dummy regulator to satisfy this requirement. Signed-off-by: Andrew Chew Acked-by: Alexandre Courbot Acked-by: Tony Prisk --- arch/arm/boot/dts/wm8850-w70v2.dts | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/wm8850-w70v2.dts b/arch/arm/boot/dts/wm8850-w70v2.dts index fcc660c..25c96d0 100644 --- a/arch/arm/boot/dts/wm8850-w70v2.dts +++ b/arch/arm/boot/dts/wm8850-w70v2.dts @@ -37,11 +37,20 @@ }; }; + backlight_power: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "backlight-power"; + enable-active-high; + regulator-boot-on; + gpio = <&gpio 0 7 0>; + }; + backlight { compatible = "pwm-backlight"; pwms = <&pwm 0 5 1>;/* duty inverted */ brightness-levels = <0 40 60 80 100 130 190 255>; default-brightness-level = <5>; + power-supply = <&backlight_power>; }; }; -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 5/9] unicore32: Provide regulator to pwm-backlight
The pwm-backlight driver now takes a mandatory regulator that is gotten during driver probe. Initialize a dummy regulator to satisfy this requirement. Signed-off-by: Andrew Chew Acked-by: Alexandre Courbot --- arch/unicore32/kernel/puv3-nb0916.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/unicore32/kernel/puv3-nb0916.c b/arch/unicore32/kernel/puv3-nb0916.c index 181108b..839b536 100644 --- a/arch/unicore32/kernel/puv3-nb0916.c +++ b/arch/unicore32/kernel/puv3-nb0916.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include #include @@ -49,6 +51,10 @@ static struct resource puv3_i2c_resources[] = { } }; +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight"); + static struct platform_pwm_backlight_data nb0916_backlight_data = { .pwm_id = 0, .max_brightness = 100, @@ -111,6 +117,9 @@ int __init mach_nb0916_init(void) platform_device_register_simple("PKUnity-v3-I2C", -1, puv3_i2c_resources, ARRAY_SIZE(puv3_i2c_resources)); + regulator_register_always_on(-1, "backlight-power", +&backlight_supply, 1, 0); + platform_device_register_data(&platform_bus, "pwm-backlight", -1, &nb0916_backlight_data, sizeof(nb0916_backlight_data)); -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 6/9] ARM: mxs: Provide regulator to pwm-backlight
The pwm-backlight driver now takes a mandatory regulator that is gotten during driver probe. Initialize a dummy regulator to satisfy this requirement. Signed-off-by: Andrew Chew Acked-by: Alexandre Courbot Acked-by: Shawn Guo --- arch/arm/boot/dts/imx23-evk.dts | 6 ++ arch/arm/boot/dts/imx28-apf28dev.dts | 6 ++ arch/arm/boot/dts/imx28-cfa10049.dts | 6 ++ arch/arm/boot/dts/imx28-evk.dts | 6 ++ arch/arm/boot/dts/imx28-tx28.dts | 11 +++ 5 files changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts index 035c13f..ce5048e 100644 --- a/arch/arm/boot/dts/imx23-evk.dts +++ b/arch/arm/boot/dts/imx23-evk.dts @@ -95,6 +95,11 @@ regulator-max-microvolt = <330>; gpio = <&gpio1 29 0>; }; + + reg_backlight_power: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "backlight-power"; + }; }; backlight { @@ -102,5 +107,6 @@ pwms = <&pwm 2 500>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; + power-supply = <®_backlight_power>; }; }; diff --git a/arch/arm/boot/dts/imx28-apf28dev.dts b/arch/arm/boot/dts/imx28-apf28dev.dts index 6d8865b..e354dc5 100644 --- a/arch/arm/boot/dts/imx28-apf28dev.dts +++ b/arch/arm/boot/dts/imx28-apf28dev.dts @@ -132,6 +132,11 @@ regulator-max-microvolt = <500>; gpio = <&gpio1 23 1>; }; + + reg_backlight_power: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "backlight-power"; + }; }; leds { @@ -150,5 +155,6 @@ pwms = <&pwm 3 191000>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; + power-supply = <®_backlight_power>; }; }; diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts index a0d3e9f..a6eddd6 100644 --- a/arch/arm/boot/dts/imx28-cfa10049.dts +++ b/arch/arm/boot/dts/imx28-cfa10049.dts @@ -205,6 +205,11 @@ regulator-max-microvolt = <500>; gpio = <&gpio0 7 1>; }; + + reg_backlight_power: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "backlight-power"; + }; }; ahb@8008 { @@ -304,5 +309,6 @@ pwms = <&pwm 3 500>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; + power-supply = <®_backlight_power>; }; }; diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts index 2da316e..7ba7216 100644 --- a/arch/arm/boot/dts/imx28-evk.dts +++ b/arch/arm/boot/dts/imx28-evk.dts @@ -285,6 +285,11 @@ gpio = <&gpio3 8 0>; enable-active-high; }; + + reg_backlight_power: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "backlight-power"; + }; }; sound { @@ -312,5 +317,6 @@ pwms = <&pwm 2 500>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; + power-supply = <®_backlight_power>; }; }; diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts index 37be532..7fa5a44 100644 --- a/arch/arm/boot/dts/imx28-tx28.dts +++ b/arch/arm/boot/dts/imx28-tx28.dts @@ -97,6 +97,16 @@ }; }; + regulators { + compatible = "simple-bus"; + + reg_backlight_power: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "backlight-power"; + }; + }; + + leds { compatible = "gpio-leds"; @@ -112,5 +122,6 @@ pwms = <&pwm 0 500>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <6>; + power-supply = <®_backlight_power>; }; }; -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 0/9] Add mandatory regulator for all users of pwm-backlight.
Many backlights are enabled via GPIO. We can generalize the GPIO to a fixed regulator. The power regulator needs to be mandatory because there was no good way to determine the difference between opting out of the regulator, and probe deferral. This series of patches is intended to add a dummy regulator (or a GPIO regulator) for all users of the pwm-backlight. The last patch in the series will always be the pwm-backlight change to add this mandatory regulator. Patches following up to that patch add the mandatory regulator on a per mach family basis. Once all users of pwm-backlight have been patched, this series can be applied in order to maintain bisectability. All I did in every case was to provide a dummy fixed regulator to pwm-backlight. If your platform actually uses a regulator (or a GPIO) to power the backlight, please either let me know so that I can make the modifications and give you something back to test. Or (better yet), provide me with a tested, alternate patch that I can fold into this patch series. I made sure that where there was a defconfig for an affected board, that it builds. I did not test-build the unicore patch. V6: Minor formatting and stylistic tweaks to pwm-backlight bindings document. mach-tegra: Fixed missing reg property, and fleshed out backlight_power_reg with some real information. V5: Changed the name of the supply from "enable" to "power". Renamed corresponding regulator dt nodes and regulators in board setup files. Backlight regulator nodes renamed to something less generic. mach-mxs: Moved backlight power regulator into top-level regulators node. mach-vt8500: Made the backlight power regulator controlled via <&gpio 0 7 0>. mach-tegra: Moved the backlight power regulator to tegra20-tamonten.dtsi. V3 and earlier versions of this series only had the OMAP patch, which I used for ironing out some early, obvious stuff. V4 and later is the complete patch set. Andrew Chew (9): ARM: OMAP: board-4430sdp: Provide regulator to pwm-backlight ARM: S3C24XX: Provide regulator to pwm-backlight ARM: pxa: Provide regulator to pwm-backlight ARM: EXYNOS: Provide regulator to pwm-backlight unicore32: Provide regulator to pwm-backlight ARM: mxs: Provide regulator to pwm-backlight ARM: vt8500: Provide regulator to pwm-backlight ARM: tegra: Provide regulator to pwm-backlight pwm_bl: Add mandatory backlight power regulator .../bindings/video/backlight/pwm-backlight.txt | 14 + arch/arm/boot/dts/imx23-evk.dts| 6 +++ arch/arm/boot/dts/imx28-apf28dev.dts | 6 +++ arch/arm/boot/dts/imx28-cfa10049.dts | 6 +++ arch/arm/boot/dts/imx28-evk.dts| 6 +++ arch/arm/boot/dts/imx28-tx28.dts | 11 arch/arm/boot/dts/tegra20-medcom-wide.dts | 1 + arch/arm/boot/dts/tegra20-tamonten.dtsi| 10 arch/arm/boot/dts/wm8850-w70v2.dts | 9 arch/arm/mach-exynos/mach-nuri.c | 7 +++ arch/arm/mach-omap2/board-4430sdp.c| 6 +++ arch/arm/mach-pxa/cm-x300.c| 7 +++ arch/arm/mach-pxa/colibri-pxa270-income.c | 8 +++ arch/arm/mach-pxa/ezx.c| 9 arch/arm/mach-pxa/hx4700.c | 8 +++ arch/arm/mach-pxa/lpd270.c | 9 arch/arm/mach-pxa/magician.c | 8 +++ arch/arm/mach-pxa/mainstone.c | 13 - arch/arm/mach-pxa/mioa701.c| 8 +++ arch/arm/mach-pxa/palm27x.c| 8 +++ arch/arm/mach-pxa/palmtc.c | 8 +++ arch/arm/mach-pxa/palmte2.c| 9 arch/arm/mach-pxa/pcm990-baseboard.c | 8 +++ arch/arm/mach-pxa/raumfeld.c | 6 +++ arch/arm/mach-pxa/tavorevb.c | 11 arch/arm/mach-pxa/viper.c | 8 +++ arch/arm/mach-pxa/z2.c | 10 arch/arm/mach-pxa/zylonite.c | 7 +++ arch/arm/mach-s3c24xx/mach-h1940.c | 8 +++ arch/arm/mach-s3c24xx/mach-rx1950.c| 9 arch/arm/plat-samsung/dev-backlight.c | 9 arch/unicore32/kernel/puv3-nb0916.c| 9 drivers/video/backlight/pwm_bl.c | 59 ++ 33 files changed, 310 insertions(+), 11 deletions(-) -- 1.8.1.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH V6 3/9] ARM: pxa: Provide regulator to pwm-backlight
The pwm-backlight driver now takes a mandatory regulator that is gotten during driver probe. Initialize a dummy regulator to satisfy this requirement. Signed-off-by: Andrew Chew Acked-by: Alexandre Courbot Reviewed-by: Marek Vasut --- arch/arm/mach-pxa/cm-x300.c | 7 +++ arch/arm/mach-pxa/colibri-pxa270-income.c | 8 arch/arm/mach-pxa/ezx.c | 9 + arch/arm/mach-pxa/hx4700.c| 8 arch/arm/mach-pxa/lpd270.c| 9 + arch/arm/mach-pxa/magician.c | 8 arch/arm/mach-pxa/mainstone.c | 13 - arch/arm/mach-pxa/mioa701.c | 8 arch/arm/mach-pxa/palm27x.c | 8 arch/arm/mach-pxa/palmtc.c| 8 arch/arm/mach-pxa/palmte2.c | 9 + arch/arm/mach-pxa/pcm990-baseboard.c | 8 arch/arm/mach-pxa/raumfeld.c | 6 ++ arch/arm/mach-pxa/tavorevb.c | 11 +++ arch/arm/mach-pxa/viper.c | 8 arch/arm/mach-pxa/z2.c| 10 ++ arch/arm/mach-pxa/zylonite.c | 7 +++ 17 files changed, 144 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 8091aac..7e1887a 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -305,6 +306,10 @@ static inline void cm_x300_init_lcd(void) {} #endif #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight.0"); + static struct platform_pwm_backlight_data cm_x300_backlight_data = { .pwm_id = 2, .max_brightness = 100, @@ -322,6 +327,8 @@ static struct platform_device cm_x300_backlight_device = { static void cm_x300_init_bl(void) { + regulator_register_always_on(-1, "backlight-power", + &backlight_supply, 1, 0); platform_device_register(&cm_x300_backlight_device); } #else diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c index 2d4a7b4..108f2a7 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-income.c +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include @@ -184,6 +186,10 @@ static inline void income_lcd_init(void) {} * Backlight **/ #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight.0"); + static struct platform_pwm_backlight_data income_backlight_data = { .pwm_id = 0, .max_brightness = 0x3ff, @@ -201,6 +207,8 @@ static struct platform_device income_backlight = { static void __init income_pwm_init(void) { + regulator_register_always_on(-1, "backlight-power", +&backlight_supply, 1, 0); platform_device_register(&income_backlight); } #else diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index dca1070..2b39d5f 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include #include @@ -49,6 +51,10 @@ #define GPIO19_GEN1_CAM_RST19 #define GPIO28_GEN2_CAM_RST28 +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight.0"); + static struct platform_pwm_backlight_data ezx_backlight_data = { .pwm_id = 0, .max_brightness = 1023, @@ -792,6 +798,9 @@ static void __init a780_init(void) platform_device_register(&a780_camera); } + regulator_register_always_on(-1, "backlight-power", +&backlight_supply, 1, 0); + platform_add_devices(ARRAY_AND_SIZE(ezx_devices)); platform_add_devices(ARRAY_AND_SIZE(a780_devices)); } diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index 133109e..b2f444a 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -556,6 +557,10 @@ static struct platform_device hx4700_lcd = { * Backlight */ +/* Dummy regulator for pwm-backlight driver */ +static struct regulator_consumer_supply backlight_supply = + REGULATOR_SUPPLY("power", "pwm-backlight"); + static struct platform_pwm_backlight_data backlig
[PATCH v2 02/13] ARM: convert arm/arm64 arch timer to use CLKSRC_OF init
From: Rob Herring This converts arm and arm64 to use CLKSRC_OF DT based initialization for the arch timer. A new function arch_timer_arch_init is added to allow for arch specific setup. This has a side effect of enabling sched_clock on omap5 and exynos5. There should not be any reason not to use the arch timers for sched_clock. Signed-off-by: Rob Herring Cc: Russell King Cc: Kukjin Kim Cc: Tony Lindgren Cc: Simon Horman Cc: Magnus Damm Cc: Catalin Marinas Cc: Will Deacon Cc: John Stultz Cc: Thomas Gleixner Cc: linux-samsung-soc@vger.kernel.org Cc: linux-o...@vger.kernel.org Cc: linux...@vger.kernel.org --- arch/arm/include/asm/arch_timer.h| 13 + arch/arm/kernel/arch_timer.c | 17 +++-- arch/arm/mach-exynos/mach-exynos5-dt.c |1 - arch/arm/mach-exynos/mct.c |6 -- arch/arm/mach-highbank/highbank.c|5 + arch/arm/mach-omap2/timer.c |5 + arch/arm/mach-shmobile/board-kzm9d.c |1 - arch/arm/mach-shmobile/include/mach/common.h |1 - arch/arm/mach-shmobile/setup-emev2.c |1 - arch/arm/mach-shmobile/setup-r8a7740.c |1 - arch/arm/mach-shmobile/setup-sh7372.c|1 - arch/arm/mach-shmobile/setup-sh73a0.c|1 - arch/arm/mach-shmobile/timer.c |6 -- arch/arm/mach-vexpress/v2m.c |7 ++- arch/arm/mach-virt/virt.c|9 - arch/arm64/include/asm/arch_timer.h |5 + arch/arm64/kernel/time.c |6 -- drivers/clocksource/Kconfig |1 + drivers/clocksource/arm_arch_timer.c | 23 +-- include/clocksource/arm_arch_timer.h |6 -- 20 files changed, 27 insertions(+), 89 deletions(-) diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h index 7ade91d..7c1bfc0 100644 --- a/arch/arm/include/asm/arch_timer.h +++ b/arch/arm/include/asm/arch_timer.h @@ -10,8 +10,7 @@ #include #ifdef CONFIG_ARM_ARCH_TIMER -int arch_timer_of_register(void); -int arch_timer_sched_clock_init(void); +int arch_timer_arch_init(void); /* * These register accessors are marked inline so the compiler can @@ -110,16 +109,6 @@ static inline void __cpuinit arch_counter_set_user_access(void) asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); } -#else -static inline int arch_timer_of_register(void) -{ - return -ENXIO; -} - -static inline int arch_timer_sched_clock_init(void) -{ - return -ENXIO; -} #endif #endif diff --git a/arch/arm/kernel/arch_timer.c b/arch/arm/kernel/arch_timer.c index a7536d4..dc74048 100644 --- a/arch/arm/kernel/arch_timer.c +++ b/arch/arm/kernel/arch_timer.c @@ -39,26 +39,15 @@ static void __init arch_timer_delay_timer_register(void) register_current_timer_delay(&arch_delay_timer); } -int __init arch_timer_of_register(void) -{ - int ret; - - ret = arch_timer_init(); - if (ret) - return ret; - - arch_timer_delay_timer_register(); - - return 0; -} - -int __init arch_timer_sched_clock_init(void) +int __init arch_timer_arch_init(void) { u32 arch_timer_rate = arch_timer_get_rate(); if (arch_timer_rate == 0) return -ENXIO; + arch_timer_delay_timer_register(); + /* Cache the sched_clock multiplier to save a divide in the hot path. */ sched_clock_mult = NSEC_PER_SEC / arch_timer_rate; sched_clock_func = arch_timer_sched_clock; diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c index acaeb14..4d97b43 100644 --- a/arch/arm/mach-exynos/mach-exynos5-dt.c +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c @@ -216,7 +216,6 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") .map_io = exynos5_dt_map_io, .init_machine = exynos5_dt_machine_init, .init_late = exynos_init_late, - .init_time = exynos4_timer_init, .dt_compat = exynos5_dt_compat, .restart= exynos5_restart, .reserve= exynos5_reserve, diff --git a/arch/arm/mach-exynos/mct.c b/arch/arm/mach-exynos/mct.c index c9d6650..04aff6a 100644 --- a/arch/arm/mach-exynos/mct.c +++ b/arch/arm/mach-exynos/mct.c @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -469,11 +468,6 @@ static void __init exynos4_timer_resources(void) void __init exynos4_timer_init(void) { - if (soc_is_exynos5440()) { - arch_timer_of_register(); - return; - } - if ((soc_is_exynos4210()) || (soc_is_exynos5250())) mct_int_type = MCT_INT_SPI; else diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 76c1170..758150e 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b
Re: [PATCH V2] DMA: PL330: Add check if device tree compatible
Hi Vinod, I apologies for the delayed reply. Last week I was out of station and no access to mails. I will send another patch addressing your comments. Thanks Padma On Mon, Apr 1, 2013 at 11:51 PM, Vinod Koul wrote: > > On Mon, Apr 01, 2013 at 08:13:31AM -0500, Rob Herring wrote: > > On Thu, Mar 21, 2013 at 4:39 AM, Vinod Koul wrote: > > > On Tue, Mar 05, 2013 at 02:55:31PM +0530, Padmavathi Venna wrote: > > >> This patch register the dma controller with generic dma helpers only > > >> in DT case. This also adds some extra error handling in the driver. > > >> > > >> Signed-off-by: Padmavathi Venna > > >> Reported-by: Sachin Kamat > > > > What's the status on this? It is needed for 3.9 to fix pl330 on highbank. > Well the status is that submitter has been rude. I had few questions and > comments on this patch and they are yet to be addressed. > > -- > ~Vinod > > > > Rob > > > > >> --- > > >> > > >> Based on Vinod Koul next branch. > > >> > > >> Changes since V1: > > >> - return silently when of_dma_controller_register fails, as > > >> suggested by Arnd. > > >> > > >> drivers/dma/pl330.c | 38 +++--- > > >> 1 files changed, 27 insertions(+), 11 deletions(-) > > >> > > >> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c > > >> index 7181531..5dbc594 100644 > > >> --- a/drivers/dma/pl330.c > > >> +++ b/drivers/dma/pl330.c > > >> @@ -2882,7 +2882,7 @@ pl330_probe(struct amba_device *adev, const struct > > >> amba_id *id) > > >> { > > >> struct dma_pl330_platdata *pdat; > > >> struct dma_pl330_dmac *pdmac; > > >> - struct dma_pl330_chan *pch; > > >> + struct dma_pl330_chan *pch, *_p; > > >> struct pl330_info *pi; > > >> struct dma_device *pd; > > >> struct resource *res; > > >> @@ -2984,7 +2984,16 @@ pl330_probe(struct amba_device *adev, const > > >> struct amba_id *id) > > >> ret = dma_async_device_register(pd); > > >> if (ret) { > > >> dev_err(&adev->dev, "unable to register DMAC\n"); > > >> - goto probe_err2; > > >> + goto probe_err3; > > >> + } > > >> + > > >> + if (adev->dev.of_node) { > > >> + ret = of_dma_controller_register(adev->dev.of_node, > > >> + of_dma_pl330_xlate, pdmac); > > >> + if (ret) { > > >> + dev_err(&adev->dev, > > >> + "unable to register DMA to the generic DT DMA > > >> helpers\n"); > > > Indent? Okey. > > > >> + } > > >> } > > >> > > >> dev_info(&adev->dev, > > >> @@ -2995,16 +3004,21 @@ pl330_probe(struct amba_device *adev, const > > >> struct amba_id *id) > > >> pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan, > > >> pi->pcfg.num_peri, pi->pcfg.num_events); > > >> > > >> - ret = of_dma_controller_register(adev->dev.of_node, > > >> - of_dma_pl330_xlate, pdmac); > > >> - if (ret) { > > >> - dev_err(&adev->dev, > > >> - "unable to register DMA to the generic DT DMA helpers\n"); > > >> - goto probe_err2; > > >> - } > > >> - > > >> return 0; > > >> +probe_err3: > > >> + amba_set_drvdata(adev, NULL); > > >> > > >> + /* Idle the DMAC */ > > >> + list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels, > > >> + chan.device_node) { > > >> + > > >> + /* Remove the channel */ > > >> + list_del(&pch->chan.device_node); > > >> + > > >> + /* Flush the channel */ > > >> + pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0); > > >> + pl330_free_chan_resources(&pch->chan); > > > free_chan for error handling in probe? Will remove this. > > > > > > >> + } > > >> probe_err2: > > >> pl330_del(pi); > > >> probe_err1: > > >> @@ -3023,8 +3037,10 @@ static int pl330_remove(struct amba_device *adev) > > >> if (!pdmac) > > >> return 0; > > >> > > >> - of_dma_controller_free(adev->dev.of_node); > > >> + if (adev->dev.of_node) > > >> + of_dma_controller_free(adev->dev.of_node); > > >> > > >> + dma_async_device_unregister(&pdmac->ddma); > > >> amba_set_drvdata(adev, NULL); > > >> > > >> /* Idle the DMAC */ > > >> -- > > >> 1.7.4.4 > > >> -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 02/13] ARM: convert arm/arm64 arch timer to use CLKSRC_OF init
On Tuesday 02 April 2013 03:51 AM, Rob Herring wrote: > From: Rob Herring > > This converts arm and arm64 to use CLKSRC_OF DT based initialization for > the arch timer. A new function arch_timer_arch_init is added to allow for > arch specific setup. > > This has a side effect of enabling sched_clock on omap5 and exynos5. There > should not be any reason not to use the arch timers for sched_clock. > Absolutely. > Signed-off-by: Rob Herring [..] > arch/arm/mach-omap2/timer.c |5 + Acked-by: Santosh Shilimkar -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] mmc: dwmmc: let device core setup the default pin configuration
With device core now able to setup the default pin configuration, the pin configuration code based on the deprecated Samsung specific gpio bindings is removed. Signed-off-by: Thomas Abraham Acked-by: Linus Walleij Reviewed-by: Doug Anderson Tested-by: Doug Anderson --- Hi Doug, Seungwon, I apologize for the delaying in following up on the review comment. The setup_bus callback support has been removed in this patch. I did intend to retain the support for setup_bus callback in the previous version of this patch since any new platform that might use this driver and need such a callback would have this callback ready for use. But it seems removing the setup_bus callback is preferred, so I am fine with it. Thomas. drivers/mmc/host/dw_mmc-exynos.c | 38 -- drivers/mmc/host/dw_mmc.c| 14 +- drivers/mmc/host/dw_mmc.h|3 --- 3 files changed, 1 insertions(+), 54 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 72fd0f2..467d043 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -152,43 +152,6 @@ static int dw_mci_exynos_parse_dt(struct dw_mci *host) return 0; } -static int dw_mci_exynos_setup_bus(struct dw_mci *host, - struct device_node *slot_np, u8 bus_width) -{ - int idx, gpio, ret; - - if (!slot_np) - return -EINVAL; - - /* cmd + clock + bus-width pins */ - for (idx = 0; idx < NUM_PINS(bus_width); idx++) { - gpio = of_get_gpio(slot_np, idx); - if (!gpio_is_valid(gpio)) { - dev_err(host->dev, "invalid gpio: %d\n", gpio); - return -EINVAL; - } - - ret = devm_gpio_request(host->dev, gpio, "dw-mci-bus"); - if (ret) { - dev_err(host->dev, "gpio [%d] request failed\n", gpio); - return -EBUSY; - } - } - - if (host->pdata->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) - return 0; - - gpio = of_get_named_gpio(slot_np, "samsung,cd-pinmux-gpio", 0); - if (gpio_is_valid(gpio)) { - if (devm_gpio_request(host->dev, gpio, "dw-mci-cd")) - dev_err(host->dev, "gpio [%d] request failed\n", gpio); - } else { - dev_info(host->dev, "cd gpio not available"); - } - - return 0; -} - /* Exynos5250 controller specific capabilities */ static unsigned long exynos5250_dwmmc_caps[4] = { MMC_CAP_UHS_DDR50 | MMC_CAP_1_8V_DDR | @@ -205,7 +168,6 @@ static const struct dw_mci_drv_data exynos5250_drv_data = { .prepare_command= dw_mci_exynos_prepare_command, .set_ios= dw_mci_exynos_set_ios, .parse_dt = dw_mci_exynos_parse_dt, - .setup_bus = dw_mci_exynos_setup_bus, }; static const struct of_device_id dw_mci_exynos_match[] = { diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 9834221..adb1b7d 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1878,7 +1878,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) struct mmc_host *mmc; struct dw_mci_slot *slot; const struct dw_mci_drv_data *drv_data = host->drv_data; - int ctrl_id, ret; + int ctrl_id; u8 bus_width; mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev); @@ -1935,14 +1935,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) else bus_width = 1; - if (drv_data && drv_data->setup_bus) { - struct device_node *slot_np; - slot_np = dw_mci_of_find_slot_node(host->dev, slot->id); - ret = drv_data->setup_bus(host, slot_np, bus_width); - if (ret) - goto err_setup_bus; - } - switch (bus_width) { case 8: mmc->caps |= MMC_CAP_8_BIT_DATA; @@ -2006,10 +1998,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) queue_work(host->card_workqueue, &host->card_work); return 0; - -err_setup_bus: - mmc_free_host(mmc); - return -EINVAL; } static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id) diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 53b8fd9..0b74189 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -190,7 +190,6 @@ extern int dw_mci_resume(struct dw_mci *host); * @prepare_command: handle CMD register extensions. * @set_ios: handle bus specific extensions. * @parse_dt: parse implementation specific device tree properties. - * @setup_bus: initialize io-interface * * Provide controller implementation specific extensions. The usage of this * data structure is fully optional and usage o