From patchwork Thu Jul 14 13:27:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 974492 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6E7eSUc019427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 Jul 2011 07:40:49 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QhGVs-0000iN-UM; Thu, 14 Jul 2011 07:39:13 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QhGVs-00048V-3d; Thu, 14 Jul 2011 07:39:12 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QhGUh-0003rt-BE for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2011 07:38:03 +0000 Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LOB0034ABUT6MH0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2011 16:37:53 +0900 (KST) X-AuditID: cbfee61a-b7c53ae000002dc1-9a-4e1e9cd1e3a3 Received: from epmmp1 ( [203.254.227.16]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 2E.89.11713.1DC9E1E4; Thu, 14 Jul 2011 16:37:53 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LOB00FOKBUT2D@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2011 16:37:53 +0900 (KST) Date: Thu, 14 Jul 2011 09:27:14 -0400 From: Ajay Kumar Subject: [PATCH 4/6] ARM: S5P64X0: Add GPIO and SPCON settings for LCD In-reply-to: <1310650036-28836-1-git-send-email-ajaykumar.rs@samsung.com> To: kgene.kim@samsung.com, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, lethal@linux-sh.org, jg1.han@samsung.com Message-id: <1310650036-28836-5-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 1.7.0.4 References: <1310650036-28836-1-git-send-email-ajaykumar.rs@samsung.com> X-Brightmail-Tracker: AAAAAA== X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110714_033759_775430_6890E13F X-CRM114-Status: GOOD ( 20.02 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [203.254.224.25 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 2.4 DATE_IN_FUTURE_03_06 Date: is 3 to 6 hours after Received: date X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 14 Jul 2011 07:40:49 +0000 (UTC) This patch adds: o GPIO lines settings(HSYNC, VSYNC, VCLK and VD) for LCD. o Function to select type of LCD interface (RGB/i80) Signed-off-by: Ajay Kumar --- arch/arm/mach-s5p64x0/Kconfig | 6 +++ arch/arm/mach-s5p64x0/Makefile | 1 + arch/arm/mach-s5p64x0/include/mach/regs-gpio.h | 4 ++ arch/arm/mach-s5p64x0/setup-fb.c | 48 ++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/fb.h | 14 +++++++ 5 files changed, 73 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5p64x0/setup-fb.c diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig index 017af4c..2ca5ac0 100644 --- a/arch/arm/mach-s5p64x0/Kconfig +++ b/arch/arm/mach-s5p64x0/Kconfig @@ -21,6 +21,12 @@ config CPU_S5P6450 help Enable S5P6450 CPU support +config S5P64X0_SETUP_FB + bool + help + Common setup code for S5P64X0 based boards with a LCD display + through RGB interface. + config S5P64X0_SETUP_I2C1 bool help diff --git a/arch/arm/mach-s5p64x0/Makefile b/arch/arm/mach-s5p64x0/Makefile index ae6bf6f..43698c6 100644 --- a/arch/arm/mach-s5p64x0/Makefile +++ b/arch/arm/mach-s5p64x0/Makefile @@ -28,3 +28,4 @@ obj-y += dev-audio.o obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o +obj-$(CONFIG_S5P64X0_SETUP_FB) += setup-fb.o diff --git a/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h b/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h index 0953ef6..2f07cbd 100644 --- a/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h +++ b/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h @@ -34,4 +34,8 @@ #define S5P6450_GPQ_BASE (S5P_VA_GPIO + 0x0180) #define S5P6450_GPS_BASE (S5P_VA_GPIO + 0x0300) +#define S5P64X0_SPCON0 (S5P_VA_GPIO + 0x1A0) +#define S5P64X0_SPCON0_LCD_SEL_MASK (0x3 << 0) +#define S5P64X0_SPCON0_LCD_SEL_RGB (0x1 << 0) + #endif /* __ASM_ARCH_REGS_GPIO_H */ diff --git a/arch/arm/mach-s5p64x0/setup-fb.c b/arch/arm/mach-s5p64x0/setup-fb.c new file mode 100644 index 0000000..3e8ffad --- /dev/null +++ b/arch/arm/mach-s5p64x0/setup-fb.c @@ -0,0 +1,48 @@ +/* linux/arch/arm/mach-s5p64x0/setup-fb.c + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd. + * http://www.samsung.com/ + * + * Base S5P64X0 GPIO setup information for LCD framebuffer + * + * GPIO settings for LCD on any other board based on s5p64x0 + * should go in this file. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include +#include + +#include +#include + +#include +#include + +void s5p64x0_fb_init(int lcd_interface_type) +{ + unsigned int cfg; + + /* select TFT LCD type (RGB I/F) */ + cfg = readl(S5P64X0_SPCON0); + cfg &= ~S5P64X0_SPCON0_LCD_SEL_MASK; + cfg |= lcd_interface_type; + writel(cfg, S5P64X0_SPCON0); +} + +void s5p64x0_fb_gpio_setup_24bpp(void) +{ + unsigned int cfg; + + cfg = readl(S5P64X0_SYS_ID) & 0xf0000; + if (cfg == 0x40000) { + s3c_gpio_cfgrange_nopull(S5P6440_GPI(0), 16, S3C_GPIO_SFN(2)); + s3c_gpio_cfgrange_nopull(S5P6440_GPJ(0), 12, S3C_GPIO_SFN(2)); + } else if (cfg == 0x50000) { + s3c_gpio_cfgrange_nopull(S5P6450_GPI(0), 16, S3C_GPIO_SFN(2)); + s3c_gpio_cfgrange_nopull(S5P6450_GPJ(0), 12, S3C_GPIO_SFN(2)); + } +} diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h index cb3ca3a..8147c59 100644 --- a/arch/arm/plat-samsung/include/plat/fb.h +++ b/arch/arm/plat-samsung/include/plat/fb.h @@ -94,4 +94,18 @@ extern void s5pc100_fb_gpio_setup_24bpp(void); */ extern void s5pv210_fb_gpio_setup_24bpp(void); +/** + * s5p64x0_fb_init() - Common setup function for LCD + * + * Select LCD I/F configuration-RGB style or i80 style + */ +extern void s5p64x0_fb_init(int lcd_interface_type); + +/** + * s5p64x0_fb_gpio_setup_24bpp() - Common GPIO setup function for LCD + * + * Initialise the GPIO for a LCD display on the RGB interface. + */ +extern void s5p64x0_fb_gpio_setup_24bpp(void); + #endif /* __PLAT_S3C_FB_H */