aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-03-22 10:17:00 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-04 06:08:07 -0400
commitfd3871aa5c0d108b89858263254b49d9bca2dc53 (patch)
tree1ad17a56ceb4f35e76cb8525f709cc9a8877f9e3
parent46574c72c701e45da1e0a2e944df885fcd2db668 (diff)
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 c2a945183a5d..baf213cdbe3d 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,
487 * Dimensions 487 * Dimensions
488 */ 488 */
489 489
490 if (par->rotation & 1) { 490 switch (var->rotate) {
491 var->xres = panel->h; 491 case FB_ROTATE_UR:
492 var->yres = panel->w; 492 case FB_ROTATE_UD:
493 } else {
494 var->xres = panel->w; 493 var->xres = panel->w;
495 var->yres = panel->h; 494 var->yres = panel->h;
495 break;
496 case FB_ROTATE_CW:
497 case FB_ROTATE_CCW:
498 var->xres = panel->h;
499 var->yres = panel->w;
500 break;
501 default:
502 dev_dbg(dev, "Invalid rotation request\n");
503 return -EINVAL;
496 } 504 }
497 505
498 var->xres_virtual = var->xres; 506 var->xres_virtual = var->xres;
@@ -534,8 +542,15 @@ static int auok190xfb_set_par(struct fb_info *info)
534{ 542{
535 struct auok190xfb_par *par = info->par; 543 struct auok190xfb_par *par = info->par;
536 544
545 par->rotation = info->var.rotate;
537 auok190xfb_set_fix(info); 546 auok190xfb_set_fix(info);
538 547
548 /* reinit the controller to honor the rotation */
549 par->init(par);
550
551 /* wait for init to complete */
552 par->board->wait_for_rdy(par);
553
539 return 0; 554 return 0;
540} 555}
541 556
@@ -1030,7 +1045,7 @@ int auok190x_common_probe(struct platform_device *pdev,
1030 panel = &panel_table[board->resolution]; 1045 panel = &panel_table[board->resolution];
1031 1046
1032 par->resolution = board->resolution; 1047 par->resolution = board->resolution;
1033 par->rotation = board->rotation; 1048 par->rotation = 0;
1034 1049
1035 /* videomemory handling */ 1050 /* videomemory handling */
1036 1051
diff --git a/include/video/auo_k190xfb.h b/include/video/auo_k190xfb.h
index 609efe8c686e..ad7bc51bee9a 100644
--- a/include/video/auo_k190xfb.h
+++ b/include/video/auo_k190xfb.h
@@ -98,7 +98,6 @@ struct auok190x_board {
98 int gpio_nbusy; 98 int gpio_nbusy;
99 99
100 int resolution; 100 int resolution;
101 int rotation;
102 int quirks; 101 int quirks;
103 int fps; 102 int fps;
104}; 103};