From: linjh Date: Thu, 27 Sep 2012 09:48:13 +0000 (+0800) Subject: phonepad: commit phonepad(i30) exp gpio define X-Git-Tag: firefly_0821_release~8538 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f38439c12e335f04da8a53e4fbdd6a6cc301d92c;p=firefly-linux-kernel-4.4.55.git phonepad: commit phonepad(i30) exp gpio define [reference file] new file: include/linux/gpio_exp_callpad.h --- diff --git a/include/linux/gpio_exp_callpad.h b/include/linux/gpio_exp_callpad.h new file mode 100755 index 000000000000..298882d6fc72 --- /dev/null +++ b/include/linux/gpio_exp_callpad.h @@ -0,0 +1,43 @@ +#ifndef GPIO_EXP_CALLPAD_H +#define GPIO_EXP_CALLPAD_H + +#define GPIOEXP_INT_TRIGGER_FALLING 0x01 +#define GPIOEXP_INT_TRIGGER_RISING 0x02 +#define GPIOEXP_INT_TRIGGER_MASK (GPIOEXP_INT_TRIGGER_FALLING | GPIOEXP_INT_TRIGGER_RISING) + +enum gpioexp_port_pin_num +{ + //P0 + GPIOEXP_P0_0 = 0, + GPIOEXP_P0_1, + GPIOEXP_P0_2, + GPIOEXP_P0_3, + GPIOEXP_P0_4, + GPIOEXP_P0_5, + GPIOEXP_P0_6, + GPIOEXP_P0_7, + + //P1 + GPIOEXP_P1_0, + GPIOEXP_P1_1, + GPIOEXP_P1_2, + GPIOEXP_P1_3, + GPIOEXP_P1_4, + GPIOEXP_P1_5, + GPIOEXP_P1_6, + GPIOEXP_P1_7, + GPIOEXP_PIN_MAX, +}; + +typedef void (*gpioexp_int_handler_t)(void *data); + + +extern int gpioexp_set_direction(unsigned gpio, int is_in); +extern int gpioexp_set_output_level(unsigned gpio, int value); +extern int gpioexp_read_input_level(unsigned gpio); +extern int gpioexp_request_irq(unsigned int irq, gpioexp_int_handler_t handler, unsigned long flags); +extern int gpioexp_free_irq(unsigned int irq); +extern int gpioexp_enable_irq(unsigned int irq); +extern int gpioexp_disable_irq(unsigned int irq); + +#endif