From: "Heiko Stübner" <heiko@sntech.de>
To: linux-fbdev@vger.kernel.org
Subject: [PATCH 8/9] AUO-K190x: add framebuffer rotation support
Date: Fri, 22 Mar 2013 14:17:00 +0000 [thread overview]
Message-ID: <201303221517.01056.heiko@sntech.de> (raw)
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>
---
drivers/video/auo_k190x.c | 25 ++++++++++++++++++++-----
include/video/auo_k190xfb.h | 1 -
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/video/auo_k190x.c b/drivers/video/auo_k190x.c
index 69abb9c..87cff5b 100644
--- a/drivers/video/auo_k190x.c
+++ b/drivers/video/auo_k190x.c
@@ -486,12 +486,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;
@@ -533,8 +541,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;
}
@@ -1029,7 +1044,7 @@ int __devinit 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 609efe8..ad7bc51 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;
};
--
1.7.2.3
reply other threads:[~2013-03-22 14:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=201303221517.01056.heiko@sntech.de \
--to=heiko@sntech.de \
--cc=linux-fbdev@vger.kernel.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