From patchwork Thu Jul 14 11:11:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102017 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp20895qga; Thu, 14 Jul 2016 04:13:37 -0700 (PDT) X-Received: by 10.98.103.214 with SMTP id t83mr11548756pfj.158.1468494817726; Thu, 14 Jul 2016 04:13:37 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id i187si3723961pfc.211.2016.07.14.04.13.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 04:13:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNeZL-0007Hh-Pf; Thu, 14 Jul 2016 11:12:39 +0000 Received: from mout.kundenserver.de ([212.227.126.135]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bNeZ3-00070e-4B for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2016 11:12:24 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0LjOHr-1aosVE0XOx-00dW5t; Thu, 14 Jul 2016 13:11:51 +0200 From: Arnd Bergmann To: Wan Zongshun Subject: [PATCH 1/7] ARM: nuc900: move regs-ldm.h to video driver Date: Thu, 14 Jul 2016 13:11:29 +0200 Message-Id: <20160714111135.2476095-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:1oCe4odYMTxcqi0V/oZsDyfP2+NG2YStrRMO+RbIUQ14Zz3pEKD JFzKJpSTXzRZpu8hnYfcOhYNMdAYJTwwsVJQgMtCCaiu6sUrT/4CfoEQ9rnaXk010vSYhZS LgnQZPUwSywSXZej6Cuosk/V/3/H3fV7jC+76D1pHJvFwEpd2vzfC818Nn3OzDTI0nPdTNR IekpoATmqHwpBx/OTMAug== X-UI-Out-Filterresults: notjunk:1; V01:K0:gJKnIGTfhNM=:BCHYwZRqSw6Xd7TVgUJKmB JAB0WV1SPO/P9wSArCf0nQCaaNtYBmCll1n8tD0JczuijQCyjz/q+FhJ6Ye4g30py2KCViMvQ hDvdGTqdUO1T9s69guK8getY4J1rw6ti35Zi1yex/RgDcyXmD/K2pT7xwfgP1ABzXlxhANe0v 0WSz0nFW8u96wiFCKEOQpMXVG9pk5WIwOF6Id2eXgMfZmfcemS9uNPfEvhIniK+ZhwsiU19kB ErenYSVvLrpgYhtOZ7Awh9UHc+ADakCIvfPgWkY5L4WdlUL+RjU6lbiiIZP3IseWa/wY2kKjx E6rZgetgH3FwdbEfzj48rPSqXO0Kwj5VNIMkKEyZjw/isSq01+Qk5qXJ1dGJOA4uyfu/MWQwP 0Abx91iuk/VjUSMMk2JrTc+W0N6pNTH4kWUBNr8r6E3EYPw+cEMZUKExhi4mG6A/Vq3AuYu+/ cG3I7xorQybKk1xhjewKJREcbSQJzvFvmj3rM6nNfuqUYYQytnzvPlJsrmXHDWKjAuMRzWNwa mdYg5G0fKR8VrB7tK3CpBnGDiuPiPGUQLXOF7+PJyrls3w6zIy+dnS802OKgUe0uzNKddlaU+ kI3sJz6MLZb6hY9+hx2OPQgxg3Ars6hCX7iC5Vtmx6GxSgGjP6E7C2fqkgyLb8WxKpyINZUaO WjD/uxF1qgIX3si3kY1R5bsFVIjmk8aprp8ZHpEpDxxy2sH05ySoQAL95RdAuLt7G4yo= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160714_041221_588839_CB378108 X-CRM114-Status: GOOD ( 16.70 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.135 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.135 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Wan Zongshun , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org This is one of only three nuc900 drivers that use mach/*.h headers, and it's fairly easy to avoid if we separate the LCM_DCCS_VA_SRC definition that is needed for platform data from the other registers: The global mach/regs-ldm.h file becomes a local nuc900fb-regs.h header, and is only used by that one driver, while the LCM_DCCS_VA_SRC enum gets moved into the platform_data header that uses it, to let the device definition see the values. The only other reference to a header in the framebuffer driver is for the pin configuration, and we can simply avoid that by passing the address along with the data and mask. Signed-off-by: Arnd Bergmann --- arch/arm/mach-w90x900/dev.c | 3 ++- .../regs-ldm.h => drivers/video/fbdev/nuc900fb-regs.h | 15 --------------- drivers/video/fbdev/nuc900fb.c | 8 +++----- drivers/video/fbdev/nuc900fb.h | 1 - include/linux/platform_data/video-nuc900fb.h | 14 +++++++++++++- 5 files changed, 18 insertions(+), 23 deletions(-) rename arch/arm/mach-w90x900/include/mach/regs-ldm.h => drivers/video/fbdev/nuc900fb-regs.h (94%) -- 2.9.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c index e65a80a1ac75..ea84f053bcd3 100644 --- a/arch/arm/mach-w90x900/dev.c +++ b/arch/arm/mach-w90x900/dev.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include "cpu.h" @@ -455,8 +454,10 @@ static struct nuc900fb_mach_info nuc900_fb_info = { #endif .num_displays = ARRAY_SIZE(nuc900_lcd_info), .default_display = 0, + .gpio_dir_addr = W90X900_VA_GPIO + 0x54, .gpio_dir = 0x00000004, .gpio_dir_mask = 0xFFFFFFFD, + .gpio_data_addr = W90X900_VA_GPIO + 0x58, .gpio_data = 0x00000004, .gpio_data_mask = 0xFFFFFFFD, }; diff --git a/arch/arm/mach-w90x900/include/mach/regs-ldm.h b/drivers/video/fbdev/nuc900fb-regs.h similarity index 94% rename from arch/arm/mach-w90x900/include/mach/regs-ldm.h rename to drivers/video/fbdev/nuc900fb-regs.h index e9d480a5b232..c6ba567bb11f 100644 --- a/arch/arm/mach-w90x900/include/mach/regs-ldm.h +++ b/drivers/video/fbdev/nuc900fb-regs.h @@ -1,6 +1,4 @@ /* - * arch/arm/mach-w90x900/include/mach/regs-serial.h - * * Copyright (c) 2009 Nuvoton technology corporation * All rights reserved. * @@ -19,8 +17,6 @@ #ifndef __ASM_ARM_W90X900_REGS_LDM_H #define __ASM_ARM_W90X900_REGS_LDM_H -#include - /* Display Controller Control/Status Register */ #define REG_LCM_DCCS (0x00) @@ -33,17 +29,6 @@ #define LCM_DCCS_FIELD_INTR (1 << 6) #define LCM_DCCS_SINGLE (1 << 7) -enum LCM_DCCS_VA_SRC { - LCM_DCCS_VA_SRC_YUV422 = (0 << 8), - LCM_DCCS_VA_SRC_YCBCR422 = (1 << 8), - LCM_DCCS_VA_SRC_RGB888 = (2 << 8), - LCM_DCCS_VA_SRC_RGB666 = (3 << 8), - LCM_DCCS_VA_SRC_RGB565 = (4 << 8), - LCM_DCCS_VA_SRC_RGB444LOW = (5 << 8), - LCM_DCCS_VA_SRC_RGB444HIGH = (7 << 8) -}; - - /* Display Device Control Register */ #define REG_LCM_DEV_CTRL (0x04) diff --git a/drivers/video/fbdev/nuc900fb.c b/drivers/video/fbdev/nuc900fb.c index 6680edae4696..d29777d85518 100644 --- a/drivers/video/fbdev/nuc900fb.c +++ b/drivers/video/fbdev/nuc900fb.c @@ -35,11 +35,9 @@ #include #include -#include -#include -#include #include +#include "nuc900fb-regs.h" #include "nuc900fb.h" @@ -373,9 +371,9 @@ static int nuc900fb_init_registers(struct fb_info *info) writel(0, regs + REG_LCM_DEV_CTRL); /* config gpio output */ - modify_gpio(W90X900_VA_GPIO + 0x54, mach_info->gpio_dir, + modify_gpio(mach_info->gpio_dir_addr, mach_info->gpio_dir, mach_info->gpio_dir_mask); - modify_gpio(W90X900_VA_GPIO + 0x58, mach_info->gpio_data, + modify_gpio(mach_info->gpio_data_addr, mach_info->gpio_data, mach_info->gpio_data_mask); return 0; diff --git a/drivers/video/fbdev/nuc900fb.h b/drivers/video/fbdev/nuc900fb.h index 9a1ca6dbb6b2..a904ef17c122 100644 --- a/drivers/video/fbdev/nuc900fb.h +++ b/drivers/video/fbdev/nuc900fb.h @@ -15,7 +15,6 @@ #ifndef __NUC900FB_H #define __NUC900FB_H -#include #include enum nuc900_lcddrv_type { diff --git a/include/linux/platform_data/video-nuc900fb.h b/include/linux/platform_data/video-nuc900fb.h index cec5ece765ed..dbce9dd7a294 100644 --- a/include/linux/platform_data/video-nuc900fb.h +++ b/include/linux/platform_data/video-nuc900fb.h @@ -38,10 +38,20 @@ struct nuc900fb_hw { unsigned int lcd_va_stuff; }; +enum LCM_DCCS_VA_SRC { + LCM_DCCS_VA_SRC_YUV422 = (0 << 8), + LCM_DCCS_VA_SRC_YCBCR422 = (1 << 8), + LCM_DCCS_VA_SRC_RGB888 = (2 << 8), + LCM_DCCS_VA_SRC_RGB666 = (3 << 8), + LCM_DCCS_VA_SRC_RGB565 = (4 << 8), + LCM_DCCS_VA_SRC_RGB444LOW = (5 << 8), + LCM_DCCS_VA_SRC_RGB444HIGH = (7 << 8) +}; + /* LCD Display Description */ struct nuc900fb_display { /* LCD Image type */ - unsigned type; + enum LCM_DCCS_VA_SRC type; /* LCD Screen Size */ unsigned short width; @@ -72,8 +82,10 @@ struct nuc900fb_mach_info { unsigned num_displays; unsigned default_display; /* GPIO Setting Info */ + void __iomem *gpio_dir_addr; unsigned gpio_dir; unsigned gpio_dir_mask; + void __iomem *gpio_data_addr; unsigned gpio_data; unsigned gpio_data_mask; };