📄 full-h1940-2.6.21.patch
字号:
diff --git a/Makefile b/Makefileindex d970cb1..1ea6235 100644--- a/Makefile+++ b/Makefile@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 21-EXTRAVERSION =+EXTRAVERSION = -h1940 NAME = Nocturnal Monster Puppy # *DOCUMENTATION*@@ -182,8 +182,8 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile -ARCH ?= $(SUBARCH)-CROSS_COMPILE ?=+ARCH ?= arm+CROSS_COMPILE ?= arm-linux- # Architecture as present in compile.h UTS_MACHINE := $(ARCH)diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.Sindex ae89cdd..0ff174e 100644--- a/arch/arm/kernel/calls.S+++ b/arch/arm/kernel/calls.S@@ -231,7 +231,7 @@ CALL(sys_mincore) /* 220 */ CALL(sys_madvise) CALL(ABI(sys_fcntl64, sys_oabi_fcntl64))- CALL(sys_ni_syscall) /* TUX */+ CALL(sys_mhelper) /* TUX */ CALL(sys_ni_syscall) CALL(sys_gettid) /* 225 */ CALL(ABI(sys_readahead, sys_oabi_readahead))diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.cindex 7b81296..67f5e48 100644--- a/arch/arm/mach-s3c2410/mach-bast.c+++ b/arch/arm/mach-s3c2410/mach-bast.c@@ -411,6 +411,7 @@ static struct s3c2410_platform_i2c bast_i2c_info = { static struct s3c2410fb_mach_info __initdata bast_lcd_info = {+ .type = S3C2410_LCDCON1_TFT, .width = 640, .height = 480, diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.cindex d052ab2..11332da 100644--- a/arch/arm/mach-s3c2410/mach-h1940.c+++ b/arch/arm/mach-s3c2410/mach-h1940.c@@ -32,12 +32,18 @@ #include <asm/arch/regs-serial.h> #include <asm/arch/regs-lcd.h> #include <asm/arch/regs-gpio.h>+#include <asm/arch/regs-timer.h> #include <asm/arch/regs-clock.h>+#include <asm/arch/irqs.h> #include <asm/arch/h1940.h> #include <asm/arch/h1940-latch.h> #include <asm/arch/fb.h> #include <asm/arch/udc.h>+#include <asm/arch/ts.h>+#include <asm/arch/lcd.h>+#include <asm/arch/mmc.h>+#include <asm/arch/buttons.h> #include <asm/plat-s3c24xx/clock.h> #include <asm/plat-s3c24xx/devs.h>@@ -129,12 +135,54 @@ static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = { }; +static struct s3c2410_ts_mach_info h1940_ts_cfg __initdata = {+ .delay = 10000,+ .presc = 49,+ .oversampling_shift = 2,+};++static struct s3c24xx_mmc_platdata h1940_mmc_cfg = {+ .gpio_detect = S3C2410_GPF5,+}; /** * Set lcd on or off **/++static void h1940_backlight_power(int on)+{+ s3c2410_gpio_setpin(S3C2410_GPB0, 0);+ s3c2410_gpio_pullup(S3C2410_GPB0, 0);++ s3c2410_gpio_cfgpin(S3C2410_GPB0,+ (on) ? S3C2410_GPB0_TOUT0 : S3C2410_GPB0_OUTP);+}++static void h1940_lcd_power(int on)+{+ int value;++ if (!on) {+ /* set to 3ec */+ s3c2410_gpio_setpin(S3C2410_GPC0, 0);+ /* wait for 3ac */+ do {+ value = s3c2410_gpio_getpin(S3C2410_GPC6);+ } while (value);+ /* set to 38c */+ s3c2410_gpio_setpin(S3C2410_GPC5, 0);+ }+ else {+ /* Set to 3ac */+ s3c2410_gpio_setpin(S3C2410_GPC5, 1);+ /* Set to 3ad */+ s3c2410_gpio_setpin(S3C2410_GPC0, 1);+ }+}+ static struct s3c2410fb_mach_info h1940_lcdcfg __initdata = { .fixed_syncs= 1,+ .type= S3C2410_LCDCON1_TFT, .regs={ .lcdcon1= S3C2410_LCDCON1_TFT16BPP | \ S3C2410_LCDCON1_TFT | \@@ -173,6 +221,72 @@ static struct s3c2410fb_mach_info h1940_lcdcfg __initdata = { .bpp= {16,16,16}, }; +static void h1940_set_brightness(int tcmpb0)+{+ unsigned long tcfg0;+ unsigned long tcfg1;+ unsigned long tcon;++ /* configure power on/off */+ h1940_backlight_power(tcmpb0 ? 1 : 0);+++ tcfg0=readl(S3C2410_TCFG0);+ tcfg1=readl(S3C2410_TCFG1);++ tcfg0 &= ~S3C2410_TCFG_PRESCALER0_MASK;+ tcfg0 |= 0x18;++ tcfg1 &= ~S3C2410_TCFG1_MUX0_MASK;+ tcfg1 |= S3C2410_TCFG1_MUX0_DIV2;++ writel(tcfg0, S3C2410_TCFG0);+ writel(tcfg1, S3C2410_TCFG1);+ writel(0x31, S3C2410_TCNTB(0));++ tcon = readl(S3C2410_TCON);+ tcon &= ~0x0F;+ tcon |= S3C2410_TCON_T0RELOAD;+ tcon |= S3C2410_TCON_T0MANUALUPD;++ writel(tcon, S3C2410_TCON);+ writel(0x31, S3C2410_TCNTB(0));+ writel(tcmpb0, S3C2410_TCMPB(0));++ /* start the timer running */+ tcon |= S3C2410_TCON_T0START;+ tcon &= ~S3C2410_TCON_T0MANUALUPD;+ writel(tcon, S3C2410_TCON);+}++static struct s3c2410_bl_mach_info h1940_blcfg __initdata = {++ .backlight_max = 0x2c,+ .backlight_default = 0x16,+ .backlight_power = h1940_backlight_power,+ .set_brightness = h1940_set_brightness,+ .lcd_power = h1940_lcd_power+};++static struct s3c_button h1940_butts[] = {+ DECLARE_BUTTON( S3C2410_GPF0, KEY_POWER, "Power", 1 ),+ DECLARE_BUTTON( S3C2410_GPF6, KEY_ENTER, "Select", 1 ),+ DECLARE_BUTTON( S3C2410_GPF7, KEY_RO, "Record", 0 ),+ DECLARE_BUTTON( S3C2410_GPG0, KEY_F9, "Calendar", 0 ),+ DECLARE_BUTTON( S3C2410_GPG2, KEY_F10, "Contacts", 0 ),+ DECLARE_BUTTON( S3C2410_GPG3, KEY_F11, "Mail", 0 ),+ DECLARE_BUTTON( S3C2410_GPG6, KEY_LEFT, "Left_arrow", 0 ),+ DECLARE_BUTTON( S3C2410_GPG7, KEY_F12, "Home", 0 ),+ DECLARE_BUTTON( S3C2410_GPG8, KEY_RIGHT, "Right_arrow", 0 ),+ DECLARE_BUTTON( S3C2410_GPG9, KEY_UP, "Up_arrow", 0 ),+ DECLARE_BUTTON( S3C2410_GPG10, KEY_DOWN, "Down_arrow", 0 ),+};++static struct s3c_butt_mach_info h1940_butt_cfg __initdata = {+ .buttons = h1940_butts,+ .size = ARRAY_SIZE(h1940_butts),+};+ static struct platform_device s3c_device_leds = { .name = "h1940-leds", .id = -1,@@ -181,11 +295,16 @@ static struct platform_device s3c_device_leds = { static struct platform_device *h1940_devices[] __initdata = { &s3c_device_usb, &s3c_device_lcd,+ &s3c_device_bl, &s3c_device_wdt, &s3c_device_i2c, &s3c_device_iis,+ &s3c_device_sdi, &s3c_device_usbgadget, &s3c_device_leds,+ &s3c_device_ts,+ &s3c_device_buttons,+ &s3c_device_nand, }; static struct s3c24xx_board h1940_board __initdata = {@@ -218,7 +337,12 @@ static void __init h1940_init(void) u32 tmp; s3c24xx_fb_set_platdata(&h1940_lcdcfg);+ set_s3c2410ts_info(&h1940_ts_cfg);+ set_s3c2410bl_info(&h1940_blcfg); s3c24xx_udc_set_platdata(&h1940_udc_cfg);+ s3c24xx_butt_set_platdata(&h1940_butt_cfg);++ s3c24xx_sdi_set_platdata(&h1940_mmc_cfg); /* Turn off suspend on both USB ports, and switch the * selectable USB port to USB device mode. */diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.cindex ae1d0a8..98dd078 100644--- a/arch/arm/mach-s3c2440/mach-rx3715.c+++ b/arch/arm/mach-s3c2440/mach-rx3715.c@@ -110,6 +110,7 @@ static struct s3c2410_uartcfg rx3715_uartcfgs[] = { /* framebuffer lcd controller information */ static struct s3c2410fb_mach_info rx3715_lcdcfg __initdata = {+ .type = S3C2410_LCDCON1_TFT, .regs = { .lcdcon1 = S3C2410_LCDCON1_TFT16BPP | \ S3C2410_LCDCON1_TFT | \diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.cindex c17eb5b..c66a094 100644--- a/arch/arm/mach-s3c2440/mach-smdk2440.c+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c@@ -104,7 +104,8 @@ static struct s3c2410_uartcfg smdk2440_uartcfgs[] __initdata = { /* LCD driver info */ static struct s3c2410fb_mach_info smdk2440_lcd_cfg __initdata = {- .regs = {+ .type = S3C2410_LCDCON1_TFT,+ .regs = { .lcdcon1 = S3C2410_LCDCON1_TFT16BPP | S3C2410_LCDCON1_TFT |diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.cindex 0fe53b3..f9106f1 100644--- a/arch/arm/plat-s3c24xx/devs.c+++ b/arch/arm/plat-s3c24xx/devs.c@@ -30,6 +30,10 @@ #include <asm/arch/regs-serial.h> #include <asm/arch/udc.h>+#include <asm/arch/ts.h>+#include <asm/arch/lcd.h>+#include <asm/arch/mmc.h>+#include <asm/arch/buttons.h> #include <asm/plat-s3c24xx/devs.h> #include <asm/plat-s3c24xx/cpu.h>@@ -187,6 +191,22 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) } } +struct platform_device s3c_device_bl = {+ .name = "s3c2410-bl",+ .id = -1,+};++EXPORT_SYMBOL(s3c_device_bl);++static struct s3c2410_bl_mach_info s3c2410bl_info;++void __init set_s3c2410bl_info(struct s3c2410_bl_mach_info *hard_s3c2410bl_info)+{+ memcpy(&s3c2410bl_info,hard_s3c2410bl_info,sizeof(struct s3c2410_bl_mach_info));+ s3c_device_bl.dev.platform_data = &s3c2410bl_info;+}+EXPORT_SYMBOL(set_s3c2410bl_info);+ /* NAND Controller */ static struct resource s3c_nand_resource[] = {@@ -206,6 +226,44 @@ struct platform_device s3c_device_nand = { EXPORT_SYMBOL(s3c_device_nand); +/* Touchscreen */+struct platform_device s3c_device_ts = {+ .name = "s3c2410-ts",+ .id = -1,+};++EXPORT_SYMBOL(s3c_device_ts);++static struct s3c2410_ts_mach_info s3c2410ts_info;++void __init set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)+{+ memcpy(&s3c2410ts_info,hard_s3c2410ts_info,sizeof(struct s3c2410_ts_mach_info));+ s3c_device_ts.dev.platform_data = &s3c2410ts_info;+}+EXPORT_SYMBOL(set_s3c2410ts_info);++/* 'Keyboard' */+struct platform_device s3c_device_buttons = {+ .name = "s3c-buttons",+ .id = -1,+};++EXPORT_SYMBOL(s3c_device_buttons);++void __init s3c24xx_butt_set_platdata(struct s3c_butt_mach_info *pd)+{+ struct s3c_butt_mach_info *npd;++ npd = kmalloc(sizeof(*npd), GFP_KERNEL);+ if (npd) {+ memcpy(npd, pd, sizeof(*npd));+ s3c_device_buttons.dev.platform_data = npd;+ } else {+ printk(KERN_ERR "no memory for buttons platform data\n");+ }+}+ /* USB Device (Gadget)*/ static struct resource s3c_usbgadget_resource[] = {@@ -244,7 +302,6 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) } } - /* Watchdog */ static struct resource s3c_wdt_resource[] = {@@ -402,6 +459,20 @@ struct platform_device s3c_device_sdi = { EXPORT_SYMBOL(s3c_device_sdi); +void __init s3c24xx_sdi_set_platdata(struct s3c24xx_mmc_platdata *pd)+{+ struct s3c24xx_mmc_platdata *npd;++ npd = kmalloc(sizeof(*npd), GFP_KERNEL);+ if (npd) {+ memcpy(npd, pd, sizeof(*npd));+ s3c_device_sdi.dev.platform_data = npd;+ } else {+ printk(KERN_ERR "no memory for sdi platform data\n");+ }+}++ /* SPI (0) */ static struct resource s3c_spi0_resource[] = {diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfigindex f17e9c7..8bb06f2 100644--- a/drivers/input/keyboard/Kconfig+++ b/drivers/input/keyboard/Kconfig@@ -214,6 +214,15 @@ config KEYBOARD_AAED2000 To compile this driver as a module, choose M here: the module will be called aaed2000_kbd. +config S3C_BUTTONS+ tristate "s3c2410 buttons"+ depends on ARCH_S3C2410+ default y + help++ To compile this driver as a module, choose M here: the + module will be called s3c2410_buttons.ko.+ config KEYBOARD_GPIO tristate "GPIO Buttons" depends on GENERIC_GPIOdiff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefileindex 586a0fe..de2af23 100644--- a/drivers/input/keyboard/Makefile+++ b/drivers/input/keyboard/Makefile@@ -18,5 +18,6 @@ obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o+obj-$(CONFIG_S3C_BUTTONS) += s3c_buttons.o obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o diff --git a/drivers/input/keyboard/s3c_buttons.c b/drivers/input/keyboard/s3c_buttons.cnew file mode 100644index 0000000..85a361f--- /dev/null+++ b/drivers/input/keyboard/s3c_buttons.c@@ -0,0 +1,219 @@+/*+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by+ * the Free Software Foundation; either version 2 of the License, or+ * (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ * GNU General Public License for more details.+ *+ * You should have received a copy of the GNU General Public License+ * along with this program; if not, write to the Free Software+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+ *+ * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org>+ * Samsung S3C2410 keyboard support+ *+ * Based on various pxa ipaq drivers.+ * + */++#include <linux/errno.h>+#include <linux/kernel.h>+#include <linux/module.h>+#include <linux/slab.h>+#include <linux/input.h>+#include <linux/init.h>+#include <linux/delay.h>+#include <linux/interrupt.h>+#include <linux/platform_device.h>+#include <asm/io.h>+#include <asm/irq.h>++#include <asm/arch/regs-gpio.h>+#include <asm/arch/buttons.h>++/* For id.version */+#define DRV_VERSION 0x0001+#define DRV_NAME "s3c-buttons"++#define REPEAT_DELAY HZ/10++MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");+MODULE_DESCRIPTION("s3c24xx buttons driver");+MODULE_LICENSE("GPL");++struct s3c_buttons_private {+ struct device *parent;+ struct input_dev *dev;+ spinlock_t lock;+ int count;+ int shift; +};++static struct s3c_buttons_private priv;++static irqreturn_t s3c_but_keyevent(int irq, void *dev)+{+ struct s3c_button *button = (struct s3c_button *)dev;+ int down;++ if (!button)+ return IRQ_HANDLED;++ down = !(s3c2410_gpio_getpin(button->pin));++ /* the power button of the ipaq are tricky. They send 'released'+ * events even when the button are already released. The work-around+ * is to proceed only if the state changed.+ */+ if (button->last_state == down)+ return IRQ_HANDLED;++ button->last_state = down;+ + dev_dbg(priv.parent, "%s button %s\n", button->name,+ down ? "pressed" : "released");++ input_report_key(priv.dev, button->keycode, down);+ input_sync(priv.dev);++ if (down)+ mod_timer(&button->timer, jiffies + REPEAT_DELAY);++ return IRQ_HANDLED;+}++static void s3c_but_timer_callback(unsigned long data)+{+ struct s3c_button *button = (struct s3c_button *) data;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -