From patchwork Tue Feb 5 13:35:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 2097781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id B740E3FC23 for ; Tue, 5 Feb 2013 13:39:51 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U2iiH-0000Sp-Av; Tue, 05 Feb 2013 13:37:29 +0000 Received: from mail-lb0-f172.google.com ([209.85.217.172]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U2ihz-0000NY-2h for linux-arm-kernel@lists.infradead.org; Tue, 05 Feb 2013 13:37:13 +0000 Received: by mail-lb0-f172.google.com with SMTP id n8so225251lbj.31 for ; Tue, 05 Feb 2013 05:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=xWWTGmz8bRjTng1C7gHTKGnTlHJETTE/6dopEQccIXY=; b=Vxfzd06tzbtMyBa/VfRvwBNCbxNcSW05Rg2ZeGgJG8CiTon7MuA8+ijR6RcctCC2Qe ywbLKGoIjsmJEBZ5J1fqfVipYSWPz0KQ3E6NG8b2vD7+DKwkIrxQ/5Yg/HF7D3PaPzqS AVVmJcLQ5ZXV6vl6U5dAkR3RQQpFsOYdRosWS3AOYI9QfYpHVgCu0IUWFuNZaY9NNXyZ Pj7i+RnTswlXYMbP7UAYDAyPCbFqwcEgNE7nH80jYWxxH80DUS59DnMkIgLGoK4GMt/q ou3FuRNbbcei5z7DpGbdr0EQcehIOPZ1Qtn3he4yzHlhpnJvScTWJb+Q+rvqa5+6S9ja APKA== X-Received: by 10.152.144.164 with SMTP id sn4mr22892187lab.57.1360071428941; Tue, 05 Feb 2013 05:37:08 -0800 (PST) Received: from xi.lan (c83-179-13-247.cust.tele2.se. [83.179.13.247]) by mx.google.com with ESMTPS id gu8sm10970143lab.6.2013.02.05.05.37.06 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Feb 2013 05:37:07 -0800 (PST) Received: from johan by xi.lan with local (Exim 4.80.1) (envelope-from ) id 1U2ige-00014T-J5; Tue, 05 Feb 2013 14:35:48 +0100 From: Johan Hovold To: Nicolas Ferre Subject: [PATCH 4/5] atmel_lcdfb: move lcdcon2 register access to compute_hozval Date: Tue, 5 Feb 2013 14:35:14 +0100 Message-Id: <1360071315-4032-5-git-send-email-jhovold@gmail.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1360071315-4032-1-git-send-email-jhovold@gmail.com> References: <20130129135435.GN7360@game.jcrosoft.org> <1360071315-4032-1-git-send-email-jhovold@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130205_083711_363147_20C0E9F0 X-CRM114-Status: GOOD ( 11.45 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.172 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jhovold[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: linux-fbdev@vger.kernel.org, Florian Tobias Schandinat , Johan Hovold , Peter Korsgaard , Haavard Skinnemoen , Jean-Christophe PLAGNIOL-VILLARD , Andrew Victor , linux-arm-kernel@lists.infradead.org, Hans-Christian Egtvedt X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Pass atmel_lcd_info structure to compute_hozval and only do the register access on SOCs that actually use it. This will also simplify the removal of the cpu_is macros. Signed-off-by: Johan Hovold --- drivers/video/atmel_lcdfb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 93910e3..347bab2 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -193,14 +193,17 @@ static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = { .accel = FB_ACCEL_NONE, }; -static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2) +static unsigned long compute_hozval(struct atmel_lcdfb_info *sinfo, + unsigned long xres) { + unsigned long lcdcon2; unsigned long value; if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10() || cpu_is_at32ap7000())) return xres; + lcdcon2 = lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2); value = xres; if ((lcdcon2 & ATMEL_LCDC_DISTYPE) != ATMEL_LCDC_DISTYPE_TFT) { /* STN display */ @@ -590,8 +593,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) lcdc_writel(sinfo, ATMEL_LCDC_TIM2, value); /* Horizontal value (aka line size) */ - hozval_linesz = compute_hozval(info->var.xres, - lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2)); + hozval_linesz = compute_hozval(sinfo, info->var.xres); /* Display size */ value = (hozval_linesz - 1) << ATMEL_LCDC_HOZVAL_OFFSET;