Commit b62ea411 authored by Martin Kaiser's avatar Martin Kaiser Committed by Bartlomiej Zolnierkiewicz

video: fbdev: imxfb: support AUS mode

Some displays require setting AUS mode in the LDCD AUS Mode Control
Register to work with the imxfb driver. Like the value of the Panel
Configuration Register, the AUS mode setting depends on the display
mode.

Allow setting AUS mode from the device tree by adding a boolean
property. Make this property optional to keep the DT ABI stable.
AUS mode can be set only on imx21 and compatible chipsets.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 0cb51f65
...@@ -117,6 +117,9 @@ ...@@ -117,6 +117,9 @@
#define IMXFB_LSCR1_DEFAULT 0x00120300 #define IMXFB_LSCR1_DEFAULT 0x00120300
#define LCDC_LAUSCR 0x80
#define LAUSCR_AUS_MODE (1<<31)
/* Used fb-mode. Can be set on kernel command line, therefore file-static. */ /* Used fb-mode. Can be set on kernel command line, therefore file-static. */
static const char *fb_mode; static const char *fb_mode;
...@@ -158,6 +161,7 @@ struct imxfb_info { ...@@ -158,6 +161,7 @@ struct imxfb_info {
dma_addr_t dbar2; dma_addr_t dbar2;
u_int pcr; u_int pcr;
u_int lauscr;
u_int pwmr; u_int pwmr;
u_int lscr1; u_int lscr1;
u_int dmacr; u_int dmacr;
...@@ -422,6 +426,11 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -422,6 +426,11 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
pcr |= imxfb_mode->pcr & ~(0x3f | (7 << 25)); pcr |= imxfb_mode->pcr & ~(0x3f | (7 << 25));
fbi->pcr = pcr; fbi->pcr = pcr;
/*
* The LCDC AUS Mode Control Register does not exist on imx1.
*/
if (!is_imx1_fb(fbi) && imxfb_mode->aus_mode)
fbi->lauscr = LAUSCR_AUS_MODE;
/* /*
* Copy the RGB parameters for this display * Copy the RGB parameters for this display
...@@ -638,6 +647,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf ...@@ -638,6 +647,9 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
if (fbi->dmacr) if (fbi->dmacr)
writel(fbi->dmacr, fbi->regs + LCDC_DMACR); writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
if (fbi->lauscr)
writel(fbi->lauscr, fbi->regs + LCDC_LAUSCR);
return 0; return 0;
} }
...@@ -734,6 +746,11 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np, ...@@ -734,6 +746,11 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
imxfb_mode->bpp = bpp; imxfb_mode->bpp = bpp;
imxfb_mode->pcr = pcr; imxfb_mode->pcr = pcr;
/*
* fsl,aus-mode is optional
*/
imxfb_mode->aus_mode = of_property_read_bool(np, "fsl,aus-mode");
return 0; return 0;
} }
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
struct imx_fb_videomode { struct imx_fb_videomode {
struct fb_videomode mode; struct fb_videomode mode;
u32 pcr; u32 pcr;
bool aus_mode;
unsigned char bpp; unsigned char bpp;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment