[ARM] pxa: add pxa27x_keypad device and pxa_set_keypad_info()
authoreric miao <eric.miao@marvell.com>
Wed, 23 Jan 2008 05:39:13 +0000 (13:39 +0800)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 19 Apr 2008 10:29:05 +0000 (11:29 +0100)
also update the clk definitions in pxa27x and pxa3xx.

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/devices.h
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa3xx.c
include/asm-arm/arch-pxa/pxa27x_keypad.h

index bfccb80ac8eff129d62aaccd02469fbec7b504de..3665e242f1f9afcecc46ac9da1a56ecb6ea3f29f 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/arch/irda.h>
 #include <asm/arch/i2c.h>
 #include <asm/arch/ohci.h>
+#include <asm/arch/pxa27x_keypad.h>
 
 #include "devices.h"
 
@@ -396,6 +397,31 @@ struct platform_device pxa25x_device_assp = {
 
 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 
+static struct resource pxa27x_resource_keypad[] = {
+       [0] = {
+               .start  = 0x41500000,
+               .end    = 0x4150004c,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_KEYPAD,
+               .end    = IRQ_KEYPAD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device pxa27x_device_keypad = {
+       .name           = "pxa27x-keypad",
+       .id             = -1,
+       .resource       = pxa27x_resource_keypad,
+       .num_resources  = ARRAY_SIZE(pxa27x_resource_keypad),
+};
+
+void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
+{
+       pxa_register_device(&pxa27x_device_keypad, info);
+}
+
 static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
 
 static struct resource pxa27x_resource_ohci[] = {
index 96c7c890906852789bf016d0d26d51ab58c930f9..fcab017f27eef62b4d03203b8667d15df926caaf 100644 (file)
@@ -14,6 +14,7 @@ extern struct platform_device pxa_device_rtc;
 
 extern struct platform_device pxa27x_device_i2c_power;
 extern struct platform_device pxa27x_device_ohci;
+extern struct platform_device pxa27x_device_keypad;
 
 extern struct platform_device pxa25x_device_ssp;
 extern struct platform_device pxa25x_device_nssp;
index b230af22ae057f3880882c8b74cd77f7bdee09ff..f910fe57fcc1cba0c9cfda25f3a01c4683ab6d0f 100644 (file)
@@ -152,7 +152,7 @@ static struct clk pxa27x_clks[] = {
 
        INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev),
        INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev),
-       INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, NULL),
+       INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev),
 
        INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
        INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
index 85b1df3f69c9b3744763001c20660aa522f2c6df..dc8d5ee9f286684c404c60d7315db15e1db3ae5e 100644 (file)
@@ -233,6 +233,7 @@ static struct clk pxa3xx_clks[] = {
        PXA3xx_CKEN("I2CCLK", I2C,  32842000, 0, &pxa_device_i2c.dev),
        PXA3xx_CKEN("UDCCLK", UDC,  48000000, 5, &pxa_device_udc.dev),
        PXA3xx_CKEN("USBCLK", USBH, 48000000, 0, &pxa27x_device_ohci.dev),
+       PXA3xx_CKEN("KBDCLK", KEYPAD,  32768, 0, &pxa27x_device_keypad.dev),
 
        PXA3xx_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
        PXA3xx_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
index 644f7609b523f7fd617cbf291054e2aae5a991fe..d5a48a96dea73471c3cf22e94d73b4f67131fd5b 100644 (file)
@@ -53,4 +53,6 @@ struct pxa27x_keypad_platform_data {
 
 #define KEY(row, col, val)     (((row) << 28) | ((col) << 24) | (val))
 
+extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
+
 #endif /* __ASM_ARCH_PXA27x_KEYPAD_H */