ARM: pxa168: added keypad support

Signed-off-by: Mark F. Brown <mark.brown314@gmail.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
This commit is contained in:
Mark F. Brown 2010-09-03 18:28:07 -04:00 committed by Eric Miao
parent 4a2490eac8
commit 6d109465fb
4 changed files with 18 additions and 1 deletions

View File

@ -289,4 +289,11 @@
#define GPIO86_PWM1_OUT MFP_CFG(GPIO86, AF2) #define GPIO86_PWM1_OUT MFP_CFG(GPIO86, AF2)
#define GPIO86_PWM2_OUT MFP_CFG(GPIO86, AF3) #define GPIO86_PWM2_OUT MFP_CFG(GPIO86, AF3)
/* Keypad */
#define GPIO109_KP_MKIN1 MFP_CFG(GPIO109, AF7)
#define GPIO110_KP_MKIN0 MFP_CFG(GPIO110, AF7)
#define GPIO111_KP_MKOUT7 MFP_CFG(GPIO111, AF7)
#define GPIO112_KP_MKOUT6 MFP_CFG(GPIO112, AF7)
#define GPIO121_KP_MKIN4 MFP_CFG(GPIO121, AF7)
#endif /* __ASM_MACH_MFP_PXA168_H */ #endif /* __ASM_MACH_MFP_PXA168_H */

View File

@ -11,6 +11,7 @@ extern void __init pxa168_init_irq(void);
#include <plat/i2c.h> #include <plat/i2c.h>
#include <plat/pxa3xx_nand.h> #include <plat/pxa3xx_nand.h>
#include <video/pxa168fb.h> #include <video/pxa168fb.h>
#include <plat/pxa27x_keypad.h>
extern struct pxa_device_desc pxa168_device_uart1; extern struct pxa_device_desc pxa168_device_uart1;
extern struct pxa_device_desc pxa168_device_uart2; extern struct pxa_device_desc pxa168_device_uart2;
@ -27,6 +28,7 @@ extern struct pxa_device_desc pxa168_device_ssp4;
extern struct pxa_device_desc pxa168_device_ssp5; extern struct pxa_device_desc pxa168_device_ssp5;
extern struct pxa_device_desc pxa168_device_nand; extern struct pxa_device_desc pxa168_device_nand;
extern struct pxa_device_desc pxa168_device_fb; extern struct pxa_device_desc pxa168_device_fb;
extern struct pxa_device_desc pxa168_device_keypad;
static inline int pxa168_add_uart(int id) static inline int pxa168_add_uart(int id)
{ {
@ -105,4 +107,9 @@ static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi)); return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
} }
static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
{
return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
}
#endif /* __ASM_MACH_PXA168_H */ #endif /* __ASM_MACH_PXA168_H */

View File

@ -77,6 +77,7 @@ static APBC_CLK(ssp2, PXA168_SSP2, 4, 0);
static APBC_CLK(ssp3, PXA168_SSP3, 4, 0); static APBC_CLK(ssp3, PXA168_SSP3, 4, 0);
static APBC_CLK(ssp4, PXA168_SSP4, 4, 0); static APBC_CLK(ssp4, PXA168_SSP4, 4, 0);
static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); static APBC_CLK(ssp5, PXA168_SSP5, 4, 0);
static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
static APMU_CLK(nand, NAND, 0x01db, 208000000); static APMU_CLK(nand, NAND, 0x01db, 208000000);
static APMU_CLK(lcd, LCD, 0x7f, 312000000); static APMU_CLK(lcd, LCD, 0x7f, 312000000);
@ -98,6 +99,7 @@ static struct clk_lookup pxa168_clkregs[] = {
INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL),
INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
}; };
static int __init pxa168_init(void) static int __init pxa168_init(void)
@ -150,3 +152,4 @@ PXA168_DEVICE(ssp3, "pxa168-ssp", 2, SSP3, 0xd401f000, 0x40, 56, 57);
PXA168_DEVICE(ssp4, "pxa168-ssp", 3, SSP4, 0xd4020000, 0x40, 58, 59); PXA168_DEVICE(ssp4, "pxa168-ssp", 3, SSP4, 0xd4020000, 0x40, 58, 59);
PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61); PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61);
PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8); PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);

View File

@ -338,7 +338,7 @@ config KEYBOARD_OPENCORES
config KEYBOARD_PXA27x config KEYBOARD_PXA27x
tristate "PXA27x/PXA3xx keypad support" tristate "PXA27x/PXA3xx keypad support"
depends on PXA27x || PXA3xx depends on PXA27x || PXA3xx || ARCH_MMP
help help
Enable support for PXA27x/PXA3xx keypad controller. Enable support for PXA27x/PXA3xx keypad controller.