summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-03-22 15:17:00 +0100
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-04 13:08:07 +0300
commitfd3871aa5c0d108b89858263254b49d9bca2dc53 (patch)
tree1ad17a56ceb4f35e76cb8525f709cc9a8877f9e3
parent46574c72c701e45da1e0a2e944df885fcd2db668 (diff)
downloadlinux-3.10-fd3871aa5c0d108b89858263254b49d9bca2dc53.tar.gz
linux-3.10-fd3871aa5c0d108b89858263254b49d9bca2dc53.tar.bz2
linux-3.10-fd3871aa5c0d108b89858263254b49d9bca2dc53.zip
AUO-K190x: add framebuffer rotation support
Change the driver to use the framebuffer rotation functions to be able to change the rotation at runtime. This also removes the setting of the rotation via the platform data. Signed-off-by: Heiko Stübner <heiko@sntech.de> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/auo_k190x.c25
-rw-r--r--include/video/auo_k190xfb.h1
2 files changed, 20 insertions, 6 deletions
diff --git a/drivers/video/auo_k190x.c b/drivers/video/auo_k190x.c
index c2a945183a5..baf213cdbe3 100644
--- a/drivers/video/auo_k190x.c
+++ b/drivers/video/auo_k190x.c
@@ -487,12 +487,20 @@ static int auok190xfb_check_var(struct fb_var_screeninfo *var,
* Dimensions
*/
- if (par->rotation & 1) {
- var->xres = panel->h;
- var->yres = panel->w;
- } else {
+ switch (var->rotate) {
+ case FB_ROTATE_UR:
+ case FB_ROTATE_UD:
var->xres = panel->w;
var->yres = panel->h;
+ break;
+ case FB_ROTATE_CW:
+ case FB_ROTATE_CCW:
+ var->xres = panel->h;
+ var->yres = panel->w;
+ break;
+ default:
+ dev_dbg(dev, "Invalid rotation request\n");
+ return -EINVAL;
}
var->xres_virtual = var->xres;
@@ -534,8 +542,15 @@ static int auok190xfb_set_par(struct fb_info *info)
{
struct auok190xfb_par *par = info->par;
+ par->rotation = info->var.rotate;
auok190xfb_set_fix(info);
+ /* reinit the controller to honor the rotation */
+ par->init(par);
+
+ /* wait for init to complete */
+ par->board->wait_for_rdy(par);
+
return 0;
}
@@ -1030,7 +1045,7 @@ int auok190x_common_probe(struct platform_device *pdev,
panel = &panel_table[board->resolution];
par->resolution = board->resolution;
- par->rotation = board->rotation;
+ par->rotation = 0;
/* videomemory handling */
diff --git a/include/video/auo_k190xfb.h b/include/video/auo_k190xfb.h
index 609efe8c686..ad7bc51bee9 100644
--- a/include/video/auo_k190xfb.h
+++ b/include/video/auo_k190xfb.h
@@ -98,7 +98,6 @@ struct auok190x_board {
int gpio_nbusy;
int resolution;
- int rotation;
int quirks;
int fps;
};