mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] imx-ipu-fb: Add board specific hook to enable display
Date: Thu, 24 Jun 2010 17:03:04 +0200	[thread overview]
Message-ID: <1277391785-15380-1-git-send-email-eric@eukrea.com> (raw)

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/mach-imx/include/mach/imx-ipu-fb.h |    2 ++
 drivers/video/imx-ipu-fb.c                  |    8 ++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
index 53c6d26..dd65b04 100644
--- a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
+++ b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
@@ -28,6 +28,8 @@ struct imx_ipu_fb_platform_data {
 	const struct fb_videomode	*mode;
 	unsigned char		bpp;
 	void __iomem		*framebuffer;
+	/** hook to enable backlight and stuff */
+	void			(*enable)(int enable);
 };
 
 #endif /* __MACH_IMX_IPU_FB_H__ */
diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index 6d1eb5e..8994da4 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -36,6 +36,8 @@
 struct ipu_fb_info {
 	void __iomem		*regs;
 
+	void			(*enable)(int enable);
+
 	struct fb_info		info;
 	struct device_d		*dev;
 };
@@ -828,6 +830,8 @@ static void ipu_fb_enable(struct fb_info *info)
 	 * Linux driver calls sdc_set_brightness() here again,
 	 * once is enough for us
 	 */
+	if (fbi->enable)
+		fbi->enable(1);
 }
 
 static void ipu_fb_disable(struct fb_info *info)
@@ -835,6 +839,9 @@ static void ipu_fb_disable(struct fb_info *info)
 	struct ipu_fb_info *fbi = info->priv;
 	u32 reg;
 
+	if (fbi->enable)
+		fbi->enable(0);
+
 	reg = reg_read(fbi, SDC_COM_CONF);
 	reg &= ~SDC_COM_BG_EN;
 	reg_write(fbi, reg, SDC_COM_CONF);
@@ -866,6 +873,7 @@ static int imxfb_probe(struct device_d *dev)
 	info->yres = pdata->mode->yres;
 	info->bits_per_pixel = pdata->bpp;
 	info->fbops = &imxfb_ops;
+	fbi->enable = pdata->enable;
 
 	dev_info(dev, "i.MX Framebuffer driver\n");
 
-- 
1.6.3.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2010-06-24 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 15:03 Eric Bénard [this message]
2010-06-24 15:03 ` [PATCH 2/2] imx-ipu-fb: do not enable framebuffer on startup Eric Bénard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1277391785-15380-1-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox