[s3c6410] Keypad device driver 포팅

기존 falinux linux kernel에는 keypad 드라이버가 제거되어 있다.
삼성에서 만든 keypad 드라이버를 구해서 커널 소스에 포함 시킨 후 keypad device에서 사용하는 변수들을 소스 파일들에 포함 시켜 주면 된다.
포함 시켜줘야할 변수들
  • arch/arm/plat-s3c64xx/devs.c
static struct resource s3c_keypad_resource[] = {
    [0] = {
         .start = S3C_PA_KEYPAD,
         .end  = S3C_PA_KEYPAD+ S3C_SZ_KEYPAD - 1,
         .flags = IORESOURCE_MEM,
    },
    [1] = {
        .start = IRQ_KEYPAD,
        .end  = IRQ_KEYPAD,
        .flags = IORESOURCE_IRQ,
    }
};

struct platform_device s3c_device_keypad = {
    .name                = "s3c-keypad",
    .id                     = -1,
    .num_resources    = ARRAY_SIZE(s3c_keypad_resource),
    .resource            = s3c_keypad_resource,
};
EXPORT_SYMBOL(s3c_device_keypad);
  • arch/arm/mach-s3c6410/mach-ezs3c6410.c
static struct platform_device *ezs3c6410_devices[] __initdata = {
                                   :
                                   :
    &s3c_device_keypad,
                                   :
                                   :
};
  • arch/arm/plat-s3c/include/plat/devs.h
                                  :
extern struct platform_device s3c_device_usbgadget;
extern struct platform_device s3c_device_keypad;
                                  :

Kconfig, Makefile에 keypad관련 내용을 추가하고 make menuconfig을 이용해서 선택한 후에 컴파일 하면 된다.