video: imxfb: Introduce regulator support.
Subsystems (7)
PATCH v8 1/6 video: imxfb: Introduce regulator support.
This commit is based on the following commit by Fabio Estevam:
4344429 video: mxsfb: Introduce regulator support
--- drivers/video/imxfb.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
drivers/video/imxfb.c +29 -0
@@ -28,6 +28,7 @@#include <linux/cpufreq.h> #include <linux/clk.h> #include <linux/platform_device.h> +#include <linux/regulator/consumer.h> #include <linux/dma-mapping.h> #include <linux/io.h> #include <linux/math64.h>
@@ -145,6 +146,7 @@ struct imxfb_info {struct clk *clk_ipg;struct clk *clk_ahb;struct clk *clk_per; +struct regulator *reg_lcd;enum imxfb_type devtype;bool enabled;
@@ -563,12 +565,23 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)static void imxfb_enable_controller (struct imxfb_info *fbi) { +int ret;if (fbi->enabled)return ;pr_debug ("Enabling LCD controller\n" ); +if (fbi->reg_lcd) { + ret =regulator_enable (fbi->reg_lcd); +if (ret) { +dev_err (&fbi->pdev->dev, +"lcd regulator enable failed with error: %d\n" , + ret); +return ; + } + } +writel (fbi->screen_dma, fbi->regs +LCDC_SSA );/* panning offset 0 (0 pixel offset) */
@@ -597,6 +610,8 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)static void imxfb_disable_controller (struct imxfb_info *fbi) { +int ret; +if (!fbi->enabled)return ;
@@ -613,6 +628,14 @@ static void imxfb_disable_controller(struct imxfb_info *fbi) fbi->enabled = false;writel (0 , fbi->regs +LCDC_RMCR ); + +if (fbi->reg_lcd) { + ret =regulator_disable (fbi->reg_lcd); +if (ret) +dev_err (&fbi->pdev->dev, +"lcd regulator disable failed with error: %d\n" , + ret); + } }static int imxfb_blank (int blank,struct fb_info *info)
@@ -1020,6 +1043,12 @@ static int imxfb_probe(struct platform_device *pdev) goto failed_register; } + fbi->reg_lcd =devm_regulator_get (&pdev->dev,"lcd" ); +if (IS_ERR (fbi->reg_lcd)) { +dev_info (&pdev->dev,"No lcd regulator used.\n" ); + fbi->reg_lcd =NULL ; + } +imxfb_enable_controller (fbi); fbi->pdev = pdev;#ifdef PWMR_BACKLIGHT_AVAILABLE
Signature · 1 line
1.7.9.5
PATCH v8 2/6 video: imxfb: Also add pwmr for the device tree.
pwmr has to be set to get the imxfb backlight work, though pwmr was only configurable trough the platform data.
---
ChangeLog v7->v8:
- Added ACKs.
--- .../devicetree/bindings/video/fsl,imx-fb.txt | 3 +++ drivers/video/imxfb.c | 2 ++ 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/video/fsl,imx-fb.txt +3 -0
@@ -17,6 +17,9 @@ Required nodes: Optional properties: - fsl,dmacr: DMA Control Register value. This is optional. By default, the register is not modified as recommended by the datasheet. +- fsl,pwmr: LCDC PWM Contrast Control Register value. That property is + optional, but defining it is necessary to get the backlight working. If that + property is ommited, the register is zeroed. - fsl,lscr1: LCDC Sharp Configuration Register value. Example:
drivers/video/imxfb.c +2 -0
@@ -833,6 +833,8 @@ static int imxfb_init_fbinfo(struct platform_device *pdev)of_property_read_u32 (np,"fsl,dmacr" , &fbi->dmacr); +of_property_read_u32 (np,"fsl,pwmr" , &fbi->pwmr); +/* These two function pointers could be used by some specific * platforms. */ fbi->lcd_power =NULL ;
Signature · 1 line
1.7.9.5
PATCH v8 3/6 video: Kconfig: Allow more broad selection of the imxfb framebuffer driver.
In reply to Denis CarikliWithout that patch, a user can't select the imxfb driver when the i.MX25 and/or
the i.MX27 device tree board are selected and that no boards that selects IMX_HAVE_PLATFORM_IMX_FB are compiled in.
---
ChangeLog v7->v8:
- Added ACKs.
- Add some CC(Framebuffer maintainers and mailing lists).
- Improved commit message summary.
--- drivers/video/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/Kconfig +1 -1
@@ -363,7 +363,7 @@ config FB_SA1100 config FB_IMX tristate "Freescale i.MX1/21/25/27 LCD support" - depends on FB && IMX_HAVE_PLATFORM_IMX_FB + depends on FB && ARCH_MXC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT
Signature · 1 line
1.7.9.5
PATCH v8 3/6 video: Kconfig: Allow more broad selection of the imxfb framebuffer driver.
Quoted 3 lines · Denis Carikli
Without that patch, a user can't select the imxfb driver when the i.MX25 and/or
the i.MX27 device tree board are selected and that no boards that selectsIMX_HAVE_PLATFORM_IMX_FBare compiled in.
Quoted 42 lines
Cc Rob Herring <[email protected]>Cc Pawel Moll <[email protected]>Cc Mark Rutland <[email protected]>Cc Stephen Warren <[email protected]>Cc Ian Campbell <[email protected]>Cc devicetree at vger.kernel.orgCc Sascha Hauer <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Russell King <[email protected]>Cc Jean-Christophe Plagniol-Villard <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Eric B?nard <[email protected]>Acked-by Shawn Guo <[email protected]>Signed-off-by Denis Carikli <[email protected]>---
ChangeLogv7->v8:
- Added ACKs.
- Add some CC(Framebuffer maintainers and mailing lists).
- Improved commit message summary.--- drivers/video/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/video/Kconfig +1
-1@@ -363,7 +363,7 @@ config FB_SA1100 config FB_IMX tristate "Freescale i.MX1/21/25/27 LCD support" - depends on FB && IMX_HAVE_PLATFORM_IMX_FB + depends on FB && ARCH_MXC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLITSignature · 1 line
1.7.9.5
PATCH v8 4/6 pinctrl: pinctrl-imx: add imx25 pinctrl driver
In reply to Denis CarikliThis is mostly cut and paste from the imx35 pinctrl driver. The data was generated using sed and awk on
arch/arm/plat-mxc/include/mach/iomux-mx25.h.
--- .../bindings/pinctrl/fsl,imx25-pinctrl.txt | 33 ++ arch/arm/boot/dts/imx25-pinfunc.h | 513 ++++++++++++++++++++ arch/arm/boot/dts/imx25.dtsi | 1 + arch/arm/mach-imx/Kconfig | 2 + drivers/pinctrl/Kconfig | 8 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-imx25.c | 351 ++++++++++++++ 7 files changed, 909 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/fsl,imx25-pinctrl.txt create mode 100644 arch/arm/boot/dts/imx25-pinfunc.h create mode 100644 drivers/pinctrl/pinctrl-imx25.c
Documentation/devicetree/bindings/pinctrl/fsl,imx25-pinctrl.txt new file +33 -0
@@ -0,0 +1,33 @@ +* Freescale IMX25 IOMUX Controller + +Please refer to fsl,imx-pinctrl.txt in this directory for common binding part +and usage. + +Required properties: +- compatible: "fsl,imx25-iomuxc" +- fsl,pins: two integers array, represents a group of pins mux and config + setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a + pin working on a specific function, CONFIG is the pad setting value like + pull-up for this pin. Please refer to imx25 datasheet for the valid pad + config settings. + +CONFIG bits definition: +PAD_CTL_DRIVE_VOLAGAGE_18 (1 << 13) +PAD_CTL_DRIVE_VOLAGAGE_33 (0 << 13) +PAD_CTL_HYS (1 << 8) +PAD_CTL_PKE (1 << 7) +PAD_CTL_PUE (1 << 6) +PAD_CTL_PUS_100K_DOWN (0 << 4) +PAD_CTL_PUS_47K_UP (1 << 4) +PAD_CTL_PUS_100K_UP (2 << 4) +PAD_CTL_PUS_22K_UP (3 << 4) +PAD_CTL_ODE_CMOS (0 << 3) +PAD_CTL_ODE_OPENDRAIN (1 << 3) +PAD_CTL_DSE_NOMINAL (0 << 1) +PAD_CTL_DSE_HIGH (1 << 1) +PAD_CTL_DSE_MAX (2 << 1) +PAD_CTL_SRE_FAST (1 << 0) +PAD_CTL_SRE_SLOW (0 << 0) + +Refer to imx25-pinfunc.h in device tree source folder for all available +imx25 PIN_FUNC_ID.
arch/arm/boot/dts/imx25-pinfunc.h new file +513 -0
513 lines not on this page · raw message
arch/arm/boot/dts/imx25.dtsi +1 -0
@@ -10,6 +10,7 @@ */ #include "skeleton.dtsi" +#include "imx25-pinfunc.h" / { aliases {
arch/arm/mach-imx/Kconfig +2 -0
@@ -109,6 +109,8 @@ config SOC_IMX25 select ARCH_MXC_IOMUX_V3 select CPU_ARM926T select MXC_AVIC + select PINCTRL + select PINCTRL_IMX25 config SOC_IMX27 bool
drivers/pinctrl/Kconfig +8 -0
@@ -109,6 +109,14 @@ config PINCTRL_IMX select PINMUX select PINCONF +config PINCTRL_IMX25 + bool "IMX25 pinctrl driver" + depends on OF + depends on SOC_IMX25 + select PINCTRL_IMX + help + Say Y here to enable the imx25 pinctrl driver + config PINCTRL_IMX35 bool "IMX35 pinctrl driver" depends on OF
drivers/pinctrl/Makefile +1 -0
@@ -31,6 +31,7 @@ obj-$(CONFIG_PINCTRL_IMX6SL) += pinctrl-imx6sl.o obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o obj-$(CONFIG_PINCTRL_MXS) += pinctrl-mxs.o obj-$(CONFIG_PINCTRL_IMX23) += pinctrl-imx23.o +obj-$(CONFIG_PINCTRL_IMX25) += pinctrl-imx25.o obj-$(CONFIG_PINCTRL_IMX28) += pinctrl-imx28.o obj-$(CONFIG_PINCTRL_NOMADIK) += pinctrl-nomadik.o obj-$(CONFIG_PINCTRL_STN8815) += pinctrl-nomadik-stn8815.o
drivers/pinctrl/pinctrl-imx25.c new file +351 -0
351 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v8 5/6 ARM: dts: imx25.dtsi: Add some pinmux pins.
In reply to Denis CarikliUart1, fec, i2c1,esdhc1 and audmux were added.
I also added a label to the iomuxc device node like in:
7b7d672 ARM i.MX dts: Consistently add labels to devicenodes
--- arch/arm/boot/dts/imx25.dtsi | 104 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-)
arch/arm/boot/dts/imx25.dtsi +103 -1
@@ -174,9 +174,111 @@ status = "disabled"; }; - iomuxc at 43fac000{ + iomuxc: iomuxc at 43fac000 { compatible = "fsl,imx25-iomuxc"; reg = <0x43fac000 0x4000>; + + audmux { + pinctrl_audmux_1: audmuxgrp-1 { + fsl,pins = < + MX25_PAD_KPP_COL3__AUD5_TXFS 0xe0 + MX25_PAD_KPP_COL2__AUD5_TXC 0xe0 + MX25_PAD_KPP_COL1__AUD5_RXD 0xe0 + MX25_PAD_KPP_COL0__AUD5_TXD 0xe0 + >; + }; + }; + + esdhc1 { + pinctrl_esdhc1_1: esdhc1grp-1 { + fsl,pins = < + MX25_PAD_SD1_CMD__SD1_CMD 0x400000c0 + MX25_PAD_SD1_CLK__SD1_CLK 0x400000c0 + MX25_PAD_SD1_DATA0__SD1_DATA0 0x400000c0 + MX25_PAD_SD1_DATA1__SD1_DATA1 0x400000c0 + MX25_PAD_SD1_DATA2__SD1_DATA2 0x400000c0 + MX25_PAD_SD1_DATA3__SD1_DATA3 0x400000c0 + >; + }; + }; + + fec { + pinctrl_fec_1: fecgrp-1 { + fsl,pins = < + MX25_PAD_FEC_MDC__FEC_MDC 0x80000000 + MX25_PAD_FEC_MDIO__FEC_MDIO 0x400001e0 + MX25_PAD_FEC_TDATA0__FEC_TDATA0 0x80000000 + MX25_PAD_FEC_TDATA1__FEC_TDATA1 0x80000000 + MX25_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000 + MX25_PAD_FEC_RDATA0__FEC_RDATA0 0x80000000 + MX25_PAD_FEC_RDATA1__FEC_RDATA1 0x80000000 + MX25_PAD_FEC_RX_DV__FEC_RX_DV 0x80000000 + MX25_PAD_FEC_TX_CLK__FEC_TX_CLK 0x1c0 + >; + }; + }; + + i2c1 { + pinctrl_i2c1_1: i2c1grp-1 { + fsl,pins = < + MX25_PAD_I2C1_CLK__I2C1_CLK 0x80000000 + MX25_PAD_I2C1_DAT__I2C1_DAT 0x80000000 + >; + }; + }; + + lcdc { + pinctrl_lcdc_1: lcdcgrp-1 { + fsl,pins = < + MX25_PAD_LD0__LD0 0x1 + MX25_PAD_LD1__LD1 0x1 + MX25_PAD_LD2__LD2 0x1 + MX25_PAD_LD3__LD3 0x1 + MX25_PAD_LD4__LD4 0x1 + MX25_PAD_LD5__LD5 0x1 + MX25_PAD_LD6__LD6 0x1 + MX25_PAD_LD7__LD7 0x1 + MX25_PAD_LD8__LD8 0x1 + MX25_PAD_LD9__LD9 0x1 + MX25_PAD_LD10__LD10 0x1 + MX25_PAD_LD11__LD11 0x1 + MX25_PAD_LD12__LD12 0x1 + MX25_PAD_LD13__LD13 0x1 + MX25_PAD_LD14__LD14 0x1 + MX25_PAD_LD15__LD15 0x1 + MX25_PAD_GPIO_E__LD16 0x1 + MX25_PAD_GPIO_F__LD17 0x1 + + MX25_PAD_HSYNC__HSYNC 0x80000000 + MX25_PAD_VSYNC__VSYNC 0x80000000 + MX25_PAD_LSCLK__LSCLK 0x80000000 + MX25_PAD_OE_ACD__OE_ACD 0x80000000 + MX25_PAD_CONTRAST__CONTRAST 0x80000000 + >; + }; + }; + + uart1 { + pinctrl_uart1_1: uart1grp-1 { + fsl,pins = < + MX25_PAD_UART1_RTS__UART1_RTS 0xe0 + MX25_PAD_UART1_CTS__UART1_CTS 0xe0 + MX25_PAD_UART1_TXD__UART1_TXD 0x80000000 + MX25_PAD_UART1_RXD__UART1_RXD 0xc0 + >; + }; + }; + + uart2 { + pinctrl_uart2_1: uart2grp-1 { + fsl,pins = < + MX25_PAD_UART2_RXD__UART2_RXD 0x80000000 + MX25_PAD_UART2_TXD__UART2_TXD 0x80000000 + MX25_PAD_UART2_RTS__UART2_RTS 0x80000000 + MX25_PAD_UART2_CTS__UART2_CTS 0x80000000 + >; + }; + }; }; audmux: audmux at 43fb0000 {
Signature · 1 line
1.7.9.5
PATCH v8 6/6 ARM: dts: Add support for the cpuimx25 board from Eukrea and its baseboard.
In reply to Denis CarikliThe following devices/functionalities were added:
* Main and secondary UARTs.
* i2c and the pcf8563 device.
* CMO-QVGA(With backlight), DVI-VGA and DVI-SVGA displays
* Ethernet.
* NAND.
* The BP1 button.
* The LED.
* Watchdog
* SD.
--- arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi | 53 +++++++++ .../imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts | 63 +++++++++++ .../imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts | 50 +++++++++ .../imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts | 50 +++++++++ .../boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts | 116 ++++++++++++++++++++ 5 files changed, 332 insertions(+) create mode 100644 arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi create mode 100644 arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts create mode 100644 arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts create mode 100644 arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts create mode 100644 arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi new file +53 -0
@@ -0,0 +1,53 @@ +/* + * Copyright 2013 Eukr?a Electromatique <[email protected]> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include "imx25.dtsi" + +/ { + model = "Eukrea CPUIMX25"; + compatible = "eukrea,cpuimx25", "fsl,imx25"; + + memory { + reg = <0x80000000 0x4000000>; /* 64M */ + }; +}; + +&fec { + phy-mode = "rmii"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fec_1>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1_1>; + status = "okay"; + + pcf8563 at 51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; +}; + +&nfc { + nand-bus-width = <8>; + nand-ecc-mode = "hw"; + nand-on-flash-bbt; + status = "okay"; +};
arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts new file +63 -0
63 lines not on this page · raw message
arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts new file +50 -0
50 lines not on this page · raw message
arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts new file +50 -0
50 lines not on this page · raw message
arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts new file +116 -0
116 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v8 1/6 video: imxfb: Introduce regulator support.
In reply to Denis CarikliQuoted 36 lines · Denis Carikli
This commit is based on the following commit by Fabio Estevam:
4344429 video: mxsfb: Introduce regulator supportCc Fabio Estevam <[email protected]>Cc Sascha Hauer <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc Jean-Christophe Plagniol-Villard <[email protected]>Cc Tomi Valkeinen <[email protected]>Cc linux-fbdev at vger.kernel.orgCc Eric B?nard <[email protected]>Signed-off-by Denis Carikli <[email protected]>--- drivers/video/imxfb.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)drivers/video/imxfb.c +2
-0@@ -28,6 +28,7 @@#include <linux/cpufreq.h> #include <linux/clk.h> #include <linux/platform_device.h> +#include <linux/regulator/consumer.h> #include <linux/dma-mapping.h> #include <linux/io.h> #include <linux/math64.h> @@ -145,6 +146,7 @@ struct imxfb_info {struct clk *clk_ipg;struct clk *clk_ahb;struct clk *clk_per; +struct regulator *reg_lcd;enum imxfb_type devtype;bool enabled;
drivers/video/imxfb.c static void imxfb_exit_backlight(struct imxfb_info *fbi) · line 568
Quoted 4 lines
drivers/video/imxfb.c +1
-0@@ -563,12 +565,23 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)static void imxfb_enable_controller (struct imxfb_info *fbi) { +int ret;
return the error so you can return it in imxfb_blank
Quoted 30 lines
drivers/video/imxfb.c +12
-0if (fbi->enabled)return ;pr_debug ("Enabling LCD controller\n" ); +if (fbi->reg_lcd) { + ret =regulator_enable (fbi->reg_lcd); +if (ret) { +dev_err (&fbi->pdev->dev, +"lcd regulator enable failed with error: %d\n" , + ret); +return ; + } + } +writel (fbi->screen_dma, fbi->regs +LCDC_SSA );/* panning offset 0 (0 pixel offset) */ @@ -597,6 +610,8 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)static void imxfb_disable_controller (struct imxfb_info *fbi) { +int ret; +if (!fbi->enabled)return ;@@ -613,6 +628,14 @@ static void imxfb_disable_controller(struct imxfb_info *fbi) fbi->enabled = false;
drivers/video/imxfb.c static void imxfb_disable_controller(struct imxfb_info *fbi) · line 638
Quoted 10 lines
drivers/video/imxfb.c +8
-0writel (0 , fbi->regs +LCDC_RMCR ); + +if (fbi->reg_lcd) { + ret =regulator_disable (fbi->reg_lcd); +if (ret) +dev_err (&fbi->pdev->dev, +"lcd regulator disable failed with error: %d\n" , + ret); + }
ditto here
Quoted 19 lines
drivers/video/imxfb.c +6
-0}static int imxfb_blank (int blank,struct fb_info *info)@@ -1020,6 +1043,12 @@ static int imxfb_probe(struct platform_device *pdev) goto failed_register; } + fbi->reg_lcd =devm_regulator_get (&pdev->dev,"lcd" ); +if (IS_ERR (fbi->reg_lcd)) { +dev_info (&pdev->dev,"No lcd regulator used.\n" ); + fbi->reg_lcd =NULL ; + } +imxfb_enable_controller (fbi); fbi->pdev = pdev;#ifdef PWMR_BACKLIGHT_AVAILABLE Signature · 1 line
1.7.9.5