GPIO_113、GPIO_114不能完成控制

beijingluoyi 发布于 2012/06/20 13:05
阅读 511
收藏 0

下面是内核的Log信息:
[    2.931274] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,button->gpio=18
[    2.939636] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_request:error=0
[    2.948455] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_direction_input:error=0
[    2.957946] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_to_irq:irq=178
[    2.966674] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=18,chip->base=0,chip->get(chip,gpio-chip->base)=1
[    2.977172] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_get_value:ret=1
[    2.986053] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,button->gpio=19
[    2.994384] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_request:error=0
[    3.003173] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_direction_input:error=0
[    3.012695] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_to_irq:irq=179
[    3.021392] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=19,chip->base=0,chip->get(chip,gpio-chip->base)=1
[    3.031921] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_get_value:ret=1
[    3.040740] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,button->gpio=113
[    3.049163] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_request:error=0
[    3.057952] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_direction_input:error=0
[    3.067474] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_to_irq:irq=273
[    3.076171] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=113,chip->base=96,chip->get(chip,gpio-chip->base)=0
[    3.086853] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_get_value:ret=0
[    3.095672] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,button->gpio=114
[    3.104095] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_request:error=0
[    3.112884] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_direction_input:error=0
[    3.122406] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_to_irq:irq=274
[    3.131103] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=114,chip->base=96,chip->get(chip,gpio-chip->base)=0
[    3.141784] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_setup_key,gpio_get_value:ret=0
[    3.151000] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    3.158264] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=18,chip->base=0,chip->get(chip,gpio-chip->base)=1
[    3.168853] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=18,chip->base=0,chip->get(chip,gpio-chip->base)=1
[    3.179412] LY:2:drivers/input/keyboard/gpio_keys.c,gpio_keys_report_event,gpio_get_value:value=1
[    3.188690] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_report_event,gpio_keys_report_event:state=0,type=0,code=102,gpio=18
[    3.200897] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=19,chip->base=0,chip->get(chip,gpio-chip->base)=1
[    3.211456] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=19,chip->base=0,chip->get(chip,gpio-chip->base)=1
[    3.222015] LY:2:drivers/input/keyboard/gpio_keys.c,gpio_keys_report_event,gpio_get_value:value=1
[    3.231292] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_report_event,gpio_keys_report_event:state=0,type=0,code=158,gpio=19
[    3.243499] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=113,chip->base=96,chip->get(chip,gpio-chip->base)=0
[    3.254241] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=113,chip->base=96,chip->get(chip,gpio-chip->base)=0
[    3.264984] LY:2:drivers/input/keyboard/gpio_keys.c,gpio_keys_report_event,gpio_get_value:value=0
[    3.274261] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_report_event,gpio_keys_report_event:state=1,type=0,code=115,gpio=113
[    3.286560] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=114,chip->base=96,chip->get(chip,gpio-chip->base)=0
[    3.297302] LY:::drivers/gpio/gpiolib.c,__gpio_get_value,gpio=114,chip->base=96,chip->get(chip,gpio-chip->base)=0
[    3.308013] LY:2:drivers/input/keyboard/gpio_keys.c,gpio_keys_report_event,gpio_get_value:value=0
[    3.317321] LY:::drivers/input/keyboard/gpio_keys.c,gpio_keys_report_event,gpio_keys_report_event:state=1,type=0,code=114,gpio=114

GPIO_18、GPIO_19默认情况下获取到的电平为高,但GPIO_113、GPIO_114在内核驱动里所获取到的电平为低(用gpio_get_value函数获取),但在硬件电路上表笔测到的GPIO113、GPIO_114为高,已经将CAM驱动的配置Disabled掉防止csi2_dx1/csi2_dy0的影响,而且硬件电路中没确定没有使用GPIO113/114的情况。

cat /proc/interrutpts
178:          5        GPIO  home
179:          5        GPIO  back
273:          0        GPIO  sound_plus
274:          0        GPIO  sound_minus
当按按键后发现GPIO_113/114没有变化。


GPIO18/19/113/114的使用如下:
static struct gpio_keys_button gpio_buttons[] = {

        {
                .code                   = KEY_HOME,
                .gpio                   = 18,
                .desc                   = "home",
                .active_low             = true,
        },
        {
                .code                   = KEY_BACK,
                .gpio                   = 19,
                .desc                   = "back",
                .active_low             = true,
        },
        {
                .code                   = KEY_VOLUMEUP,
                .gpio                   = 113,
                .desc                   = "sound_plus",
                .active_low             = true,
        },
        {
                .code                   = KEY_VOLUMEDOWN,
                .gpio                   = 114,
                .desc                   = "sound_minus",
                .active_low             = true,
        },
};
HOME/BACK的功能用GPIO_18/19已经实现。

加载中
返回顶部
顶部