From patchwork Fri Mar 22 14:17:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 2320501 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 951C0DFE82 for ; Fri, 22 Mar 2013 14:17:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933267Ab3CVORG (ORCPT ); Fri, 22 Mar 2013 10:17:06 -0400 Received: from gloria.sntech.de ([95.129.55.99]:40398 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932116Ab3CVORE (ORCPT ); Fri, 22 Mar 2013 10:17:04 -0400 Received: from 146-52-57-5-dynip.superkabel.de ([146.52.57.5] helo=marty.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1UJ2mE-00082q-Hb; Fri, 22 Mar 2013 15:17:02 +0100 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Florian Tobias Schandinat Subject: [PATCH 8/9] AUO-K190x: add framebuffer rotation support Date: Fri, 22 Mar 2013 15:17:00 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) Cc: Tomi Valkeinen , "linux-fbdev" References: <201303221512.28604.heiko@sntech.de> In-Reply-To: <201303221512.28604.heiko@sntech.de> MIME-Version: 1.0 Message-Id: <201303221517.01056.heiko@sntech.de> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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 --- 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; };