Skip to contentSkip to conversation

video: imxfb: Introduce regulator support.

PATCH Superseded Denis Carikli 3 participants 13 messages Dec 5, 2013 – Dec 6, 2013

Subsystems (3)

v13 of 14 Superseded Latest is v14 →

lore
Share & tools
lore
#0 lore raw

PATCH v13 1/4 video: imxfb: Introduce regulator support.

This commit is based on the following commit by Fabio Estevam:
4344429 video: mxsfb: Introduce regulator support

Cc Fabio Estevam <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc linux-fbdev at vger.kernel.org
Cc Eric B?nard <[email protected]>

---
ChangeLog v9->v10:
- Added a return 0; at the end of imxfb_disable_controller.

ChangeLog v8->v9:
- return an error if regulator_{enable,disable} fails in imxfb_{enable,disable}_controller, and use it.

---
 drivers/video/imxfb.c |   55 ++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 43 insertions(+), 12 deletions(-)
drivers/video/imxfb.c +43 -12
index 44ee678..57d3b81 100644
@@ -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;
 
@@ -561,14 +563,25 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)
 }
 #endif
 
-static void imxfb_enable_controller(struct imxfb_info *fbi)
+static int imxfb_enable_controller(struct imxfb_info *fbi)
 {
+	int ret;
 
 	if (fbi->enabled)
-		return;
+		return 0;
 
 	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 ret;
+		}
+	}
+
 	writel(fbi->screen_dma, fbi->regs + LCDC_SSA);
 
 	/* panning offset 0 (0 pixel offset)        */
@@ -593,12 +606,16 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)
 		fbi->backlight_power(1);
 	if (fbi->lcd_power)
 		fbi->lcd_power(1);
+
+	return 0;
 }
 
-static void imxfb_disable_controller(struct imxfb_info *fbi)
+static int imxfb_disable_controller(struct imxfb_info *fbi)
 {
+	int ret;
+
 	if (!fbi->enabled)
-		return;
+		return 0;
 
 	pr_debug("Disabling LCD controller\n");
 
@@ -613,6 +630,17 @@ 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);
+			return ret;
+	}
+
+	return 0;
 }
 
 static int imxfb_blank(int blank, struct fb_info *info)
@@ -626,13 +654,12 @@ static int imxfb_blank(int blank, struct fb_info *info)
 	case FB_BLANK_VSYNC_SUSPEND:
 	case FB_BLANK_HSYNC_SUSPEND:
 	case FB_BLANK_NORMAL:
-		imxfb_disable_controller(fbi);
-		break;
+		return imxfb_disable_controller(fbi);
 
 	case FB_BLANK_UNBLANK:
-		imxfb_enable_controller(fbi);
-		break;
+		return imxfb_enable_controller(fbi);
 	}
+
 	return 0;
 }
 
@@ -734,8 +761,7 @@ static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
 
 	pr_debug("%s\n", __func__);
 
-	imxfb_disable_controller(fbi);
-	return 0;
+	return imxfb_disable_controller(fbi);
 }
 
 static int imxfb_resume(struct platform_device *dev)
@@ -745,8 +771,7 @@ static int imxfb_resume(struct platform_device *dev)
 
 	pr_debug("%s\n", __func__);
 
-	imxfb_enable_controller(fbi);
-	return 0;
+	return imxfb_enable_controller(fbi);
 }
 #else
 #define imxfb_suspend	NULL
@@ -1020,6 +1045,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
#1 lore raw

PATCH v13 2/4 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.

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.org
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc linux-fbdev at vger.kernel.org
Cc Sascha Hauer <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Eric B?nard <[email protected]>
---
 .../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
index 46da08d..ac457ae 100644
@@ -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
index 57d3b81..17a46a7 100644
@@ -835,6 +835,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
maintainer
#3 lore raw

PATCH v13 2/4 video: imxfb: Also add pwmr for the device tree.

In reply to Denis Carikli
Quoted 28 lines · Denis Carikli

pwmr has to be set to get the imxfb backlight work, though pwmr was only configurable trough the platform data.

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.org
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc linux-fbdev at vger.kernel.org
Cc Sascha Hauer <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Eric B?nard <[email protected]>
---
 .../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 +0 -0
index 46da08d..ac457ae 100644

Documentation/devicetree/bindings/video/fsl,imx-fb.txt Required nodes: · line 22

Quoted 6 lines
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.

Why isn't this implemented as a backlight driver? Static devicetree provided values is very limiting.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#4 lore raw

Re: [PATCHv13][ 2/4] video: imxfb: Also add pwmr for the device tree.

Quoted 24 lines · Denis Carikli
Quoted 23 lines

pwmr has to be set to get the imxfb backlight work, though pwmr was only configurable trough the platform data.

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.org
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc linux-fbdev at vger.kernel.org
Cc Sascha Hauer <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Eric B?nard <[email protected]>
---
 .../devicetree/bindings/video/fsl,imx-fb.txt       |    3 +++
 drivers/video/imxfb.c                              |    2 ++
 2 files changed, 5 insertions(+)
Quoted 14 lines

Documentation/devicetree/bindings/video/fsl,imx-fb.txt Required nodes: · line 22

Quoted 11 lines
Documentation/devicetree/bindings/video/fsl,imx-fb.txt +3 -0
index 46da08d..ac457ae 100644
@@ -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.

Why isn't this implemented as a backlight driver? Static devicetree provided values is very limiting.

Let's understand the terminology.
This register should be renamed according to the datasheet, i.e. LPCCR. As I pointed out earlier, it is NOT control the backlight, this is a contrast control. Yes, it works as PWM, but nothing do with the backlight subsystem.
Yes, we can make a driver for this PWM, but how are we going to control it? I misunderstood something?

---

maintainer
#5 lore raw

PATCH v13 2/4 video: imxfb: Also add pwmr for the device tree.

Quoted 19 lines · Alexander Shiyan
Quoted 4 lines
Quoted 4 lines
 .../devicetree/bindings/video/fsl,imx-fb.txt       |    3 +++
 drivers/video/imxfb.c                              |    2 ++
 2 files changed, 5 insertions(+)
Quoted 14 lines

Documentation/devicetree/bindings/video/fsl,imx-fb.txt Required nodes: · line 22

Quoted 11 lines
Documentation/devicetree/bindings/video/fsl,imx-fb.txt +3 -0
index 46da08d..ac457ae 100644
@@ -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.

Why isn't this implemented as a backlight driver? Static devicetree provided values is very limiting.

Quoted 6 lines

Let's understand the terminology.
This register should be renamed according to the datasheet, i.e. LPCCR. As I pointed out earlier, it is NOT control the backlight, this is a contrast control. Yes, it works as PWM, but nothing do with the backlight subsystem.
Yes, we can make a driver for this PWM, but how are we going to control it? I misunderstood something?

I stumbled upon 'get the backlight working' which implied for me that it should be a backlight driver. But you're right and now I remember we talked about this already.

I still think this should be something adjustable, not static data. Maybe we could change the wording to something like "This property provides the default value for the contrast control register" since even if we add driver support for controlling the contrast we still want to have a sane default.

BTW the contrast could be controlled with a lcd_device (see lcd_device_register) which seems to be very easy to implement.

SaschaMaybe we could change the wording to something like "This property provides the default value for the contrast control register" since even if we add driver support for controlling the contrast we still want to have a sane default.

BTW the contrast could be controlled with a lcd_device (see lcd_device_register) which seems to be very easy to implement.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw

Re: [PATCHv13][ 2/4] video: imxfb: Also add pwmr for the device tree.

Quoted 1 line · Alexander Shiyan

...

Quoted 16 lines
Quoted 9 lines
Quoted 8 lines

Documentation/devicetree/bindings/video/fsl,imx-fb.txt Required nodes: · line 22

Quoted 5 lines

- fsl,dmacr: DMA Control Register value. This is optional. By default, the

Documentation/devicetree/bindings/video/fsl,imx-fb.txt +3 -0
 	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.

Why isn't this implemented as a backlight driver? Static devicetree provided values is very limiting.

Quoted 6 lines

Let's understand the terminology.
This register should be renamed according to the datasheet, i.e. LPCCR. As I pointed out earlier, it is NOT control the backlight, this is a contrast control. Yes, it works as PWM, but nothing do with the backlight subsystem.
Yes, we can make a driver for this PWM, but how are we going to control it? I misunderstood something?

Quoted 3 lines

I stumbled upon 'get the backlight working' which implied for me that it should be a backlight driver. But you're right and now I remember we talked about this already.

Hallelujah.

Quoted 5 lines

I still think this should be something adjustable, not static data. Maybe we could change the wording to something like "This property provides the default value for the contrast control register" since even if we add driver support for controlling the contrast we still want to have a sane default.

Sounds good.

Quoted 2 lines

BTW the contrast could be controlled with a lcd_device (see lcd_device_register) which seems to be very easy to implement.

Address of register is placed within LCD area, so we cannot use this memory region, I think is no so easy as you say....

---

maintainer
#7 lore raw

PATCH v13 2/4 video: imxfb: Also add pwmr for the device tree.

Quoted 30 lines · Alexander Shiyan
Quoted 1 line · Alexander Shiyan

...

Quoted 16 lines
Quoted 9 lines
Quoted 8 lines

Documentation/devicetree/bindings/video/fsl,imx-fb.txt Required nodes: · line 22

Quoted 5 lines

- fsl,dmacr: DMA Control Register value. This is optional. By default, the

Documentation/devicetree/bindings/video/fsl,imx-fb.txt +3 -0
 	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.

Why isn't this implemented as a backlight driver? Static devicetree provided values is very limiting.

Quoted 6 lines

Let's understand the terminology.
This register should be renamed according to the datasheet, i.e. LPCCR. As I pointed out earlier, it is NOT control the backlight, this is a contrast control. Yes, it works as PWM, but nothing do with the backlight subsystem.
Yes, we can make a driver for this PWM, but how are we going to control it? I misunderstood something?

Quoted 3 lines

I stumbled upon 'get the backlight working' which implied for me that it should be a backlight driver. But you're right and now I remember we talked about this already.

Hallelujah.

Quoted 5 lines

I still think this should be something adjustable, not static data. Maybe we could change the wording to something like "This property provides the default value for the contrast control register" since even if we add driver support for controlling the contrast we still want to have a sane default.

Quoted 7 lines

Sounds good.

Quoted 2 lines

BTW the contrast could be controlled with a lcd_device (see lcd_device_register) which seems to be very easy to implement.

Address of register is placed within LCD area, so we cannot use this memory region, I think is no so easy as you say....

We do not need a separate driver for this. Look for example at drivers/video/bf537-lq035.c, it just calls lcd_device_register() in its probe function.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#8 lore raw

Re: [PATCHv13][ 2/4] video: imxfb: Also add pwmr for the device tree.

Quoted 35 lines
Quoted 35 lines
Quoted 1 line · Alexander Shiyan

...

Quoted 16 lines
Quoted 9 lines
Quoted 8 lines

Documentation/devicetree/bindings/video/fsl,imx-fb.txt Required nodes: · line 22

Quoted 5 lines

- fsl,dmacr: DMA Control Register value. This is optional. By default, the

Documentation/devicetree/bindings/video/fsl,imx-fb.txt +3 -0
 	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.

Why isn't this implemented as a backlight driver? Static devicetree provided values is very limiting.

Quoted 6 lines

Let's understand the terminology.
This register should be renamed according to the datasheet, i.e. LPCCR. As I pointed out earlier, it is NOT control the backlight, this is a contrast control. Yes, it works as PWM, but nothing do with the backlight subsystem.
Yes, we can make a driver for this PWM, but how are we going to control it? I misunderstood something?

Quoted 3 lines

I stumbled upon 'get the backlight working' which implied for me that it should be a backlight driver. But you're right and now I remember we talked about this already.

Hallelujah.

Quoted 5 lines

I still think this should be something adjustable, not static data. Maybe we could change the wording to something like "This property provides the default value for the contrast control register" since even if we add driver support for controlling the contrast we still want to have a sane default.

Sounds good.

Quoted 2 lines

BTW the contrast could be controlled with a lcd_device (see lcd_device_register) which seems to be very easy to implement.

Quoted 6 lines
Quoted 2 lines

Address of register is placed within LCD area, so we cannot use this memory region, I think is no so easy as you say....

We do not need a separate driver for this. Look for example at drivers/video/bf537-lq035.c, it just calls lcd_device_register() in its probe function.

Nice. Seems this example even can handle LCD power regulator from "[1/4] video: imxfb: Introduce regulator support."

---

#9 lore raw

PATCH v13 3/4 video: Kconfig: Allow more broad selection of the imxfb framebuffer driver.

In reply to 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 selects IMX_HAVE_PLATFORM_IMX_FB are compiled in.

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.org
Cc Sascha Hauer <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc linux-fbdev at vger.kernel.org
Cc Eric B?nard <[email protected]>

---
ChangeLog v10->v11:
- moved my signed-off-by.

ChangeLog v8->v9:
- Added Jean-Christophe PLAGNIOL-VILLARD's ACK.

---
 drivers/video/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/Kconfig +1 -1
index 4f2e1b3..22adaee 100644
@@ -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
maintainer
#10 lore raw

PATCH v13 3/4 video: Kconfig: Allow more broad selection of the imxfb framebuffer driver.

Quoted 4 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 selects IMX_HAVE_PLATFORM_IMX_FB are compiled in.

Quoted 16 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.org
Cc Sascha Hauer <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Russell King <[email protected]>
Cc Jean-Christophe Plagniol-Villard <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Cc linux-fbdev at vger.kernel.org
Cc Eric B?nard <[email protected]>

Sascha

Quoted 27 lines

---
ChangeLog v10->v11:
- moved my signed-off-by.

ChangeLog v8->v9:
- Added Jean-Christophe PLAGNIOL-VILLARD's ACK.

---
 drivers/video/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/Kconfig +1 -1
index 4f2e1b3..22adaee 100644
@@ -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
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#11 lore raw

PATCH v13 4/4 ARM: dts: imx25: mbimxsd25: Add displays support.

In reply to Denis Carikli

The CMO-QVGA(With backlight), DVI-VGA and DVI-SVGA displays were added.

Cc Shawn Guo <[email protected]>
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.org
Cc Sascha Hauer <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc Eric B?nard <[email protected]>

---
ChangeLog v10->v13:
- This patch is the display part splitted out from the patch adding support for the cpuimx25(and its baseboard).
- Shawn Guo was added to the Cc list.
- The regulator part was updated to match the current style.
- The new GPIO defines are now used in the dts(i).

---
 .../imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts  |   72 ++++++++++++++++++++
 .../imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts  |   45 ++++++++++++
 .../imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts   |   45 ++++++++++++
 3 files changed, 162 insertions(+)
 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
arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts new file +72 -0
new file mode 100644
index 0000000..0df7e9e
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+#include "imx25-eukrea-mbimxsd25-baseboard.dts"
+
+/ {
+	model = "Eukrea MBIMXSD25 with the CMO-QVGA Display";
+	compatible = "eukrea,mbimxsd25-baseboard-cmo-qvga", "eukrea,mbimxsd25-baseboard", "eukrea,cpuimx25", "fsl,imx25";
+
+	cmo_qvga: display {
+		model = "CMO-QVGA";
+		bits-per-pixel = <16>;
+		fsl,pcr = <0xcad08b80>;
+		bus-width = <18>;
+		native-mode = <&qvga_timings>;
+		display-timings {
+			qvga_timings: 320x240 {
+				clock-frequency = <6500000>;
+				hactive = <320>;
+				vactive = <240>;
+				hback-porch = <30>;
+				hfront-porch = <38>;
+				vback-porch = <20>;
+				vfront-porch = <3>;
+				hsync-len = <15>;
+				vsync-len = <4>;
+			};
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reg_lcd_3v3: regulator at 0 {
+			compatible = "regulator-fixed";
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_reg_lcd_3v3>;
+			regulator-name = "lcd-3v3";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>;
+			enable-active-high;
+		};
+	};
+};
+
+&iomuxc {
+	imx25-eukrea-mbimxsd25-baseboard-cmo-qvga {
+		pinctrl_reg_lcd_3v3: reg_lcd_3v3 {
+			fsl,pins = <MX25_PAD_PWM__GPIO_1_26 0x80000000>;
+		};
+	};
+};
+
+&lcdc {
+	display = <&cmo_qvga>;
+	fsl,pwmr = <0x00a903ff>;
+	lcd-supply = <&reg_lcd_3v3>;
+	status = "okay";
+};
arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts new file +45 -0

45 lines not on this page · raw message

arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#12 lore raw

PATCH v13 1/4 video: imxfb: Introduce regulator support.

In reply to Denis Carikli

drivers/video/imxfb.c static int imxfb_probe(struct platform_device *pdev) · line 1050

Quoted 8 lines · Denis Carikli

This commit is based on the following commit by Fabio Estevam:

drivers/video/imxfb.c +3 -0
@@ -1020,6 +1045,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");

Please remove this log spam or at least reduce it to dev_dbg. That's the typical message to which our customers keep asking us whether that's something they have to care about.

Also, you should check for -EPROBE_DEFER here and return it in this case.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |