Enable pinctrl support for mach-mxs
Subsystems (13)
cover Enable pinctrl support for mach-mxs
With pinctrl-mxs driver (DT only) applied on pinctrl tree, the mxs device tree conversion can start basing on that support. This series adopts pinctrl support for mxs device drivers with a dummy pinctrl state provided for non-DT boot, so that the pinctrl call in the device drivers will be bypassed for non-DT probe while it starts working for DT probe.
To ease the merge process, I would like to ask Arnd and Olof to pull pinctrl tree as a dependency in arm-soc and have this series go through arm-soc.
Regards,
Shawn
Shawn Guo (9):
ARM: mxs: enable pinctrl dummy states
serial: amba-pl011: adopt pinctrl support
serial: mxs-auart: adopt pinctrl support
mmc: mxs-mmc: adopt pinctrl support
mtd: nand: gpmi: adopt pinctrl support
i2c: mxs: adopt pinctrl support
ASoC: mxs-saif: adopt pinctrl support
video: mxsfb: adopt pinctrl support
ARM: mxs: enable pinctrl support
arch/arm/Kconfig | 1 + arch/arm/mach-mxs/Kconfig | 2 ++ arch/arm/mach-mxs/include/mach/common.h | 2 ++ arch/arm/mach-mxs/mach-apx4devkit.c | 2 ++ arch/arm/mach-mxs/mach-m28evk.c | 2 ++ arch/arm/mach-mxs/mach-mx23evk.c | 2 ++ arch/arm/mach-mxs/mach-mx28evk.c | 2 ++ arch/arm/mach-mxs/mach-stmp378x_devb.c | 2 ++ arch/arm/mach-mxs/mach-tx28.c | 2 ++ arch/arm/mach-mxs/mm.c | 11 +++++++++++ drivers/i2c/busses/i2c-mxs.c | 6 ++++++ drivers/mmc/host/mxs-mmc.c | 8 ++++++++ drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 9 +++++++++ drivers/tty/serial/amba-pl011.c | 8 ++++++++ drivers/tty/serial/mxs-auart.c | 8 ++++++++ drivers/video/mxsfb.c | 9 +++++++++ sound/soc/mxs/mxs-saif.c | 8 ++++++++ 17 files changed, 84 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.5.4
PATCH 1/9 ARM: mxs: enable pinctrl dummy states
The mxs pinctrl driver will only support DT probe. That said, the mxs device drivers can only get pinctrl state from pinctrl subsystem when the drivers get probed from device tree.
Before converting the whole mxs platform support over to device tree, we need to enable pinctrl dummy states for those non-DT board files to ensure the pinctrl API adopted by mxs device drivers will work for both DT and non-DT probe.
Instead of calling pinctrl_provide_dummies() directly in every board file, the patch introduces soc specific calls mx23_soc_init() and mx28_soc_init() for boards' .init_machine hook to invoke, so that any soc specific setup for non-DT boot only can be added there.
--- arch/arm/mach-mxs/include/mach/common.h | 2 ++ arch/arm/mach-mxs/mach-apx4devkit.c | 2 ++ arch/arm/mach-mxs/mach-m28evk.c | 2 ++ arch/arm/mach-mxs/mach-mx23evk.c | 2 ++ arch/arm/mach-mxs/mach-mx28evk.c | 2 ++ arch/arm/mach-mxs/mach-stmp378x_devb.c | 2 ++ arch/arm/mach-mxs/mach-tx28.c | 2 ++ arch/arm/mach-mxs/mm.c | 11 +++++++++++ 8 files changed, 25 insertions(+), 0 deletions(-)
arch/arm/mach-mxs/include/mach/common.h +2 -0
@@ -19,11 +19,13 @@ extern void mxs_timer_init(struct clk *, int);extern void mxs_restart (char ,const char *);extern int mxs_saif_clkmux_select (unsigned int clkmux); +extern void mx23_soc_init (void );extern int mx23_register_gpios (void );extern int mx23_clocks_init (void );extern void mx23_map_io (void );extern void mx23_init_irq (void ); +extern void mx28_soc_init (void );extern int mx28_register_gpios (void );extern int mx28_clocks_init (void );extern void mx28_map_io (void );
arch/arm/mach-mxs/mach-apx4devkit.c +2 -0
@@ -207,6 +207,8 @@ static int apx4devkit_phy_fixup(struct phy_device *phy)static void __init apx4devkit_init (void ) { +mx28_soc_init (); +mxs_iomux_setup_multiple_pads (apx4devkit_pads,ARRAY_SIZE (apx4devkit_pads));
arch/arm/mach-mxs/mach-m28evk.c +2 -0
@@ -319,6 +319,8 @@ static struct mxs_mmc_platform_data m28evk_mmc_pdata[] __initdata = {static void __init m28evk_init (void ) { +mx28_soc_init (); +mxs_iomux_setup_multiple_pads (m28evk_pads,ARRAY_SIZE (m28evk_pads));mx28_add_duart ();
arch/arm/mach-mxs/mach-mx23evk.c +2 -0
@@ -141,6 +141,8 @@ static void __init mx23evk_init(void) {int ret; +mx23_soc_init (); +mxs_iomux_setup_multiple_pads (mx23evk_pads,ARRAY_SIZE (mx23evk_pads));mx23_add_duart ();
arch/arm/mach-mxs/mach-mx28evk.c +2 -0
@@ -413,6 +413,8 @@ static void __init mx28evk_init(void) {int ret; +mx28_soc_init (); +mxs_iomux_setup_multiple_pads (mx28evk_pads,ARRAY_SIZE (mx28evk_pads));mx28_add_duart ();
arch/arm/mach-mxs/mach-stmp378x_devb.c +2 -0
@@ -85,6 +85,8 @@ static void __init stmp378x_dvb_init(void) {int ret; +mx23_soc_init (); +mxs_iomux_setup_multiple_pads (stmp378x_dvb_pads,ARRAY_SIZE (stmp378x_dvb_pads));
arch/arm/mach-mxs/mach-tx28.c +2 -0
@@ -146,6 +146,8 @@ static struct mxs_mmc_platform_data tx28_mmc0_pdata __initdata = {static void __init tx28_stk5v3_init (void ) { +mx28_soc_init (); +mxs_iomux_setup_multiple_pads (tx28_stk5v3_pads,ARRAY_SIZE (tx28_stk5v3_pads));
arch/arm/mach-mxs/mm.c +11 -0
@@ -13,6 +13,7 @@#include <linux/mm.h> #include <linux/init.h> +#include <linux/pinctrl/machine.h> #include <asm/mach/map.h>
@@ -61,3 +62,13 @@ void __init mx28_init_irq(void) {icoll_init_irq (); } + +void __init mx23_soc_init (void ) +{ +pinctrl_provide_dummies (); +} + +void __init mx28_soc_init (void ) +{ +pinctrl_provide_dummies (); +}
Signature · 1 line
1.7.5.4
PATCH 2/9 serial: amba-pl011: adopt pinctrl support
In reply to Shawn Guo--- drivers/tty/serial/amba-pl011.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/tty/serial/amba-pl011.c +8 -0
@@ -52,6 +52,7 @@#include <linux/scatterlist.h> #include <linux/delay.h> #include <linux/types.h> +#include <linux/pinctrl/consumer.h> #include <asm/io.h> #include <asm/sizes.h>
@@ -1916,6 +1917,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) {struct uart_amba_port *uap;struct vendor_data *vendor = id->data; +struct pinctrl *pinctrl;void __iomem *base;int i, ret;
@@ -1940,6 +1942,12 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) goto free; } + pinctrl =devm_pinctrl_get_select_default (&dev->dev); +if (IS_ERR (pinctrl)) { + ret =PTR_ERR (pinctrl); + goto unmap; + } + uap->clk =clk_get (&dev->dev,NULL );if (IS_ERR (uap->clk)) { ret =PTR_ERR (uap->clk);
Signature · 1 line
1.7.5.4
PATCH 2/9 serial: amba-pl011: adopt pinctrl support
Quoted 2 lines · Shawn Guo
Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Shawn Guo <[email protected]>
Looks fine.
Quoted 45 lines
--- drivers/tty/serial/amba-pl011.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)drivers/tty/serial/amba-pl011.c +8
-0@@ -52,6 +52,7 @@#include <linux/scatterlist.h> #include <linux/delay.h> #include <linux/types.h> +#include <linux/pinctrl/consumer.h> #include <asm/io.h> #include <asm/sizes.h> @@ -1916,6 +1917,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) {struct uart_amba_port *uap;struct vendor_data *vendor = id->data; +struct pinctrl *pinctrl;void __iomem *base;int i, ret;@@ -1940,6 +1942,12 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) goto free; } + pinctrl =devm_pinctrl_get_select_default (&dev->dev); +if (IS_ERR (pinctrl)) { + ret =PTR_ERR (pinctrl); + goto unmap; + } + uap->clk =clk_get (&dev->dev,NULL );if (IS_ERR (uap->clk)) { ret =PTR_ERR (uap->clk);Signature · 7 lines
1.7.5.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/9 serial: amba-pl011: adopt pinctrl support
In reply to Shawn GuoQuoted 5 lines · Shawn Guo
Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Shawn Guo <[email protected]>---
?drivers/tty/serial/amba-pl011.c | ? ?8 ++++++++
?1 files changed, 8 insertions(+), 0 deletions(-)
Cool, I like this.
Yours,
Linus Walleij
PATCH 3/9 serial: mxs-auart: adopt pinctrl support
In reply to Shawn Guo--- drivers/tty/serial/mxs-auart.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/tty/serial/mxs-auart.c +8 -0
@@ -32,6 +32,7 @@#include <linux/clk.h> #include <linux/delay.h> #include <linux/io.h> +#include <linux/pinctrl/consumer.h> #include <asm/cacheflush.h>
@@ -678,6 +679,7 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)u32 version;int ret =0 ;struct resource *r; +struct pinctrl *pinctrl; s =kzalloc (sizeof (struct mxs_auart_port ),GFP_KERNEL );if (!s) {
@@ -685,6 +687,12 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev) goto out; } + pinctrl =devm_pinctrl_get_select_default (&pdev->dev); +if (IS_ERR (pinctrl)) { + ret =PTR_ERR (pinctrl); + goto out_free; + } + s->clk =clk_get (&pdev->dev,NULL );if (IS_ERR (s->clk)) { ret =PTR_ERR (s->clk);
Signature · 1 line
1.7.5.4
PATCH 4/9 mmc: mxs-mmc: adopt pinctrl support
In reply to Shawn Guo--- drivers/mmc/host/mxs-mmc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/mmc/host/mxs-mmc.c +8 -0
@@ -39,6 +39,7 @@#include <linux/regulator/consumer.h> #include <linux/module.h> #include <linux/fsl/mxs-dma.h> +#include <linux/pinctrl/consumer.h> #include <mach/mxs.h> #include <mach/common.h>
@@ -682,6 +683,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)struct mmc_host *mmc;struct resource *iores, *dmares, *r;struct mxs_mmc_platform_data *pdata; +struct pinctrl *pinctrl;int ret =0 , irq_err, irq_dma;dma_cap_mask_t mask;
@@ -719,6 +721,12 @@ static int mxs_mmc_probe(struct platform_device *pdev) host->irq = irq_err; host->sdio_irq_en =0 ; + pinctrl =devm_pinctrl_get_select_default (&pdev->dev); +if (IS_ERR (pinctrl)) { + ret =PTR_ERR (pinctrl); + goto out_iounmap; + } + host->clk =clk_get (&pdev->dev,NULL );if (IS_ERR (host->clk)) { ret =PTR_ERR (host->clk);
Signature · 1 line
1.7.5.4
PATCH 4/9 mmc: mxs-mmc: adopt pinctrl support
Hi,
Patch looks fine -- perhaps you could copy the explanation about the dummy pinctrl state for non-DT boards from your series introduction into this commit message, since the commit messages go into git and the series description doesn't? Thanks.
Quoted 29 lines · Shawn Guo
Cc Chris Ball <[email protected]>Signed-off-by Shawn Guo <[email protected]>--- drivers/mmc/host/mxs-mmc.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)drivers/mmc/host/mxs-mmc.c +2
-0@@ -39,6 +39,7 @@#include <linux/regulator/consumer.h> #include <linux/module.h> #include <linux/fsl/mxs-dma.h> +#include <linux/pinctrl/consumer.h> #include <mach/mxs.h> #include <mach/common.h> @@ -682,6 +683,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)struct mmc_host *mmc;struct resource *iores, *dmares, *r;struct mxs_mmc_platform_data *pdata; +struct pinctrl *pinctrl;int ret =0 , irq_err, irq_dma;dma_cap_mask_t mask;@@ -719,6 +721,12 @@ static int mxs_mmc_probe(struct platform_device *pdev) host->irq = irq_err; host->sdio_irq_en =0 ;
drivers/mmc/host/mxs-mmc.c static int mxs_mmc_probe(struct platform_device *pdev) · line 732
Quoted 10 lines
drivers/mmc/host/mxs-mmc.c +6
-0+ pinctrl =devm_pinctrl_get_select_default (&pdev->dev); +if (IS_ERR (pinctrl)) { + ret =PTR_ERR (pinctrl); + goto out_iounmap; + } + host->clk =clk_get (&pdev->dev,NULL );if (IS_ERR (host->clk)) { ret =PTR_ERR (host->clk);
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
PATCH 4/9 mmc: mxs-mmc: adopt pinctrl support
Quoted 7 lines · Chris Ball
Hi,
Patch looks fine -- perhaps you could copy the explanation about the dummy pinctrl state for non-DT boards from your series introduction into this commit message, since the commit messages go into git and the series description doesn't? Thanks.
Yeah, I thought about doing that. But after a second thought, I did not do because I think device drivers should not care about these underneath details. Pinctrl subsystem and platform should just sort these out and make them invisible to device drivers.
Quoted 2 lines
Acked-by Chris Ball <[email protected]>
Thanks, Chris.
Signature · 2 lines
Regards, Shawn
PATCH 5/9 mtd: nand: gpmi: adopt pinctrl support
In reply to Shawn Guo--- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +9 -0
@@ -24,6 +24,7 @@#include <linux/module.h> #include <linux/mtd/gpmi-nand.h> #include <linux/mtd/partitions.h> +#include <linux/pinctrl/consumer.h> #include "gpmi-nand.h" /* add our owner bbt descriptor */
@@ -476,6 +477,7 @@ acquire_err:static int __devinit acquire_resources (struct gpmi_nand_data *this) {struct resources *res = &this->resources; +struct pinctrl *pinctrl;int ret; ret =acquire_register_block (this,GPMI_NAND_GPMI_REGS_ADDR_RES_NAME );
@@ -494,6 +496,12 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)if (ret) goto exit_dma_channels; + pinctrl =devm_pinctrl_get_select_default (&pdev->dev); +if (IS_ERR (pinctrl)) { + ret =PTR_ERR (pinctrl); + goto exit_pin; + } + res->clock =clk_get (&this->pdev->dev,NULL );if (IS_ERR (res->clock)) {pr_err ("can not get the clock\n" );
@@ -503,6 +511,7 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)return 0 ; exit_clock: +exit_pin:release_dma_channels (this); exit_dma_channels:release_bch_irq (this);
Signature · 1 line
1.7.5.4
PATCH 6/9 i2c: mxs: adopt pinctrl support
In reply to Shawn Guo--- drivers/i2c/busses/i2c-mxs.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c-mxs.c +6 -0
@@ -26,6 +26,7 @@#include <linux/platform_device.h> #include <linux/jiffies.h> #include <linux/io.h> +#include <linux/pinctrl/consumer.h> #include <mach/common.h>
@@ -323,10 +324,15 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct mxs_i2c_dev *i2c;struct i2c_adapter *adap; +struct pinctrl *pinctrl;struct resource *res;resource_size_t res_size;int err, irq; + pinctrl =devm_pinctrl_get_select_default (dev); +if (IS_ERR (pinctrl)) +return PTR_ERR (pinctrl); + i2c =devm_kzalloc (dev,sizeof (struct mxs_i2c_dev ),GFP_KERNEL );if (!i2c)return -ENOMEM ;
Signature · 1 line
1.7.5.4
PATCH 7/9 ASoC: mxs-saif: adopt pinctrl support
In reply to Shawn Guo--- sound/soc/mxs/mxs-saif.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
sound/soc/mxs/mxs-saif.c +8 -0
@@ -25,6 +25,7 @@#include <linux/delay.h> #include <linux/time.h> #include <linux/fsl/mxs-dma.h> +#include <linux/pinctrl/consumer.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h>
@@ -625,6 +626,7 @@ static int mxs_saif_probe(struct platform_device *pdev)struct resource *iores, *dmares;struct mxs_saif *saif;struct mxs_saif_platform_data *pdata; +struct pinctrl *pinctrl;int ret =0 ;if (pdev->id >=ARRAY_SIZE (mxs_saif))
@@ -650,6 +652,12 @@ static int mxs_saif_probe(struct platform_device *pdev) saif->master_id = saif->id; } + pinctrl =devm_pinctrl_get_select_default (&pdev->dev); +if (IS_ERR (pinctrl)) { + ret =PTR_ERR (pinctrl); +return ret; + } + saif->clk =clk_get (&pdev->dev,NULL );if (IS_ERR (saif->clk)) { ret =PTR_ERR (saif->clk);
Signature · 1 line
1.7.5.4
PATCH 8/9 video: mxsfb: adopt pinctrl support
In reply to Shawn Guo--- drivers/video/mxsfb.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/video/mxsfb.c +9 -0
@@ -45,6 +45,7 @@#include <linux/clk.h> #include <linux/dma-mapping.h> #include <linux/io.h> +#include <linux/pinctrl/consumer.h> #include <mach/mxsfb.h> #define REG_SET 4
@@ -756,6 +757,7 @@ static int __devinit mxsfb_probe(struct platform_device *pdev)struct mxsfb_info *host;struct fb_info *fb_info;struct fb_modelist *modelist; +struct pinctrl *pinctrl;int i, ret;if (!pdata) {
@@ -793,6 +795,12 @@ static int __devinit mxsfb_probe(struct platform_device *pdev) host->devdata = &mxsfb_devdata[pdev->id_entry->driver_data]; + pinctrl =devm_pinctrl_get_select_default (&pdev->dev); +if (IS_ERR (pinctrl)) { + ret =PTR_ERR (pinctrl); + goto error_getpin; + } + host->clk =clk_get (&host->pdev->dev,NULL );if (IS_ERR (host->clk)) { ret =PTR_ERR (host->clk);
@@ -848,6 +856,7 @@ error_init_fb: error_pseudo_pallette:clk_put (host->clk); error_getclock: +error_getpin:iounmap (host->base); error_ioremap:framebuffer_release (fb_info);
Signature · 1 line
1.7.5.4
PATCH 9/9 ARM: mxs: enable pinctrl support
In reply to Shawn Guo--- arch/arm/Kconfig | 1 + arch/arm/mach-mxs/Kconfig | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/Kconfig +1 -0
@@ -469,6 +469,7 @@ config ARCH_MXS select CLKDEV_LOOKUP select CLKSRC_MMIO select HAVE_CLK_PREPARE + select PINCTRL help Support for Freescale MXS-based family of processors
arch/arm/mach-mxs/Kconfig +2 -0
@@ -9,11 +9,13 @@ config SOC_IMX23 bool select CPU_ARM926T select HAVE_PWM + select PINCTRL_IMX23 config SOC_IMX28 bool select CPU_ARM926T select HAVE_PWM + select PINCTRL_IMX28 comment "MXS platforms:"
Signature · 1 line
1.7.5.4