Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
tca8418_keypad.c File Reference
#include <linux/types.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/tca8418_keypad.h>

Go to the source code of this file.

Data Structures

struct  tca8418_keypad
 

Macros

#define TCA8418_MAX_ROWS   8
 
#define TCA8418_MAX_COLS   10
 
#define REG_CFG   0x01
 
#define REG_INT_STAT   0x02
 
#define REG_KEY_LCK_EC   0x03
 
#define REG_KEY_EVENT_A   0x04
 
#define REG_KEY_EVENT_B   0x05
 
#define REG_KEY_EVENT_C   0x06
 
#define REG_KEY_EVENT_D   0x07
 
#define REG_KEY_EVENT_E   0x08
 
#define REG_KEY_EVENT_F   0x09
 
#define REG_KEY_EVENT_G   0x0A
 
#define REG_KEY_EVENT_H   0x0B
 
#define REG_KEY_EVENT_I   0x0C
 
#define REG_KEY_EVENT_J   0x0D
 
#define REG_KP_LCK_TIMER   0x0E
 
#define REG_UNLOCK1   0x0F
 
#define REG_UNLOCK2   0x10
 
#define REG_GPIO_INT_STAT1   0x11
 
#define REG_GPIO_INT_STAT2   0x12
 
#define REG_GPIO_INT_STAT3   0x13
 
#define REG_GPIO_DAT_STAT1   0x14
 
#define REG_GPIO_DAT_STAT2   0x15
 
#define REG_GPIO_DAT_STAT3   0x16
 
#define REG_GPIO_DAT_OUT1   0x17
 
#define REG_GPIO_DAT_OUT2   0x18
 
#define REG_GPIO_DAT_OUT3   0x19
 
#define REG_GPIO_INT_EN1   0x1A
 
#define REG_GPIO_INT_EN2   0x1B
 
#define REG_GPIO_INT_EN3   0x1C
 
#define REG_KP_GPIO1   0x1D
 
#define REG_KP_GPIO2   0x1E
 
#define REG_KP_GPIO3   0x1F
 
#define REG_GPI_EM1   0x20
 
#define REG_GPI_EM2   0x21
 
#define REG_GPI_EM3   0x22
 
#define REG_GPIO_DIR1   0x23
 
#define REG_GPIO_DIR2   0x24
 
#define REG_GPIO_DIR3   0x25
 
#define REG_GPIO_INT_LVL1   0x26
 
#define REG_GPIO_INT_LVL2   0x27
 
#define REG_GPIO_INT_LVL3   0x28
 
#define REG_DEBOUNCE_DIS1   0x29
 
#define REG_DEBOUNCE_DIS2   0x2A
 
#define REG_DEBOUNCE_DIS3   0x2B
 
#define REG_GPIO_PULL1   0x2C
 
#define REG_GPIO_PULL2   0x2D
 
#define REG_GPIO_PULL3   0x2E
 
#define CFG_AI   BIT(7)
 
#define CFG_GPI_E_CFG   BIT(6)
 
#define CFG_OVR_FLOW_M   BIT(5)
 
#define CFG_INT_CFG   BIT(4)
 
#define CFG_OVR_FLOW_IEN   BIT(3)
 
#define CFG_K_LCK_IEN   BIT(2)
 
#define CFG_GPI_IEN   BIT(1)
 
#define CFG_KE_IEN   BIT(0)
 
#define INT_STAT_CAD_INT   BIT(4)
 
#define INT_STAT_OVR_FLOW_INT   BIT(3)
 
#define INT_STAT_K_LCK_INT   BIT(2)
 
#define INT_STAT_GPI_INT   BIT(1)
 
#define INT_STAT_K_INT   BIT(0)
 
#define KEY_LCK_EC_KEC   0x7
 
#define KEY_EVENT_CODE   0x7f
 
#define KEY_EVENT_VALUE   0x80
 

Functions

 MODULE_DEVICE_TABLE (i2c, tca8418_id)
 
 subsys_initcall (tca8418_keypad_init)
 
 module_exit (tca8418_keypad_exit)
 
 MODULE_AUTHOR ("Kyle Manna <[email protected]>")
 
 MODULE_DESCRIPTION ("Keypad driver for TCA8418")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define CFG_AI   BIT(7)

Definition at line 92 of file tca8418_keypad.c.

#define CFG_GPI_E_CFG   BIT(6)

Definition at line 93 of file tca8418_keypad.c.

#define CFG_GPI_IEN   BIT(1)

Definition at line 98 of file tca8418_keypad.c.

#define CFG_INT_CFG   BIT(4)

Definition at line 95 of file tca8418_keypad.c.

#define CFG_K_LCK_IEN   BIT(2)

Definition at line 97 of file tca8418_keypad.c.

#define CFG_KE_IEN   BIT(0)

Definition at line 99 of file tca8418_keypad.c.

#define CFG_OVR_FLOW_IEN   BIT(3)

Definition at line 96 of file tca8418_keypad.c.

#define CFG_OVR_FLOW_M   BIT(5)

Definition at line 94 of file tca8418_keypad.c.

#define INT_STAT_CAD_INT   BIT(4)

Definition at line 101 of file tca8418_keypad.c.

#define INT_STAT_GPI_INT   BIT(1)

Definition at line 104 of file tca8418_keypad.c.

#define INT_STAT_K_INT   BIT(0)

Definition at line 105 of file tca8418_keypad.c.

#define INT_STAT_K_LCK_INT   BIT(2)

Definition at line 103 of file tca8418_keypad.c.

#define INT_STAT_OVR_FLOW_INT   BIT(3)

Definition at line 102 of file tca8418_keypad.c.

#define KEY_EVENT_CODE   0x7f

Definition at line 109 of file tca8418_keypad.c.

#define KEY_EVENT_VALUE   0x80

Definition at line 110 of file tca8418_keypad.c.

#define KEY_LCK_EC_KEC   0x7

Definition at line 108 of file tca8418_keypad.c.

#define REG_CFG   0x01

Definition at line 44 of file tca8418_keypad.c.

#define REG_DEBOUNCE_DIS1   0x29

Definition at line 84 of file tca8418_keypad.c.

#define REG_DEBOUNCE_DIS2   0x2A

Definition at line 85 of file tca8418_keypad.c.

#define REG_DEBOUNCE_DIS3   0x2B

Definition at line 86 of file tca8418_keypad.c.

#define REG_GPI_EM1   0x20

Definition at line 75 of file tca8418_keypad.c.

#define REG_GPI_EM2   0x21

Definition at line 76 of file tca8418_keypad.c.

#define REG_GPI_EM3   0x22

Definition at line 77 of file tca8418_keypad.c.

#define REG_GPIO_DAT_OUT1   0x17

Definition at line 66 of file tca8418_keypad.c.

#define REG_GPIO_DAT_OUT2   0x18

Definition at line 67 of file tca8418_keypad.c.

#define REG_GPIO_DAT_OUT3   0x19

Definition at line 68 of file tca8418_keypad.c.

#define REG_GPIO_DAT_STAT1   0x14

Definition at line 63 of file tca8418_keypad.c.

#define REG_GPIO_DAT_STAT2   0x15

Definition at line 64 of file tca8418_keypad.c.

#define REG_GPIO_DAT_STAT3   0x16

Definition at line 65 of file tca8418_keypad.c.

#define REG_GPIO_DIR1   0x23

Definition at line 78 of file tca8418_keypad.c.

#define REG_GPIO_DIR2   0x24

Definition at line 79 of file tca8418_keypad.c.

#define REG_GPIO_DIR3   0x25

Definition at line 80 of file tca8418_keypad.c.

#define REG_GPIO_INT_EN1   0x1A

Definition at line 69 of file tca8418_keypad.c.

#define REG_GPIO_INT_EN2   0x1B

Definition at line 70 of file tca8418_keypad.c.

#define REG_GPIO_INT_EN3   0x1C

Definition at line 71 of file tca8418_keypad.c.

#define REG_GPIO_INT_LVL1   0x26

Definition at line 81 of file tca8418_keypad.c.

#define REG_GPIO_INT_LVL2   0x27

Definition at line 82 of file tca8418_keypad.c.

#define REG_GPIO_INT_LVL3   0x28

Definition at line 83 of file tca8418_keypad.c.

#define REG_GPIO_INT_STAT1   0x11

Definition at line 60 of file tca8418_keypad.c.

#define REG_GPIO_INT_STAT2   0x12

Definition at line 61 of file tca8418_keypad.c.

#define REG_GPIO_INT_STAT3   0x13

Definition at line 62 of file tca8418_keypad.c.

#define REG_GPIO_PULL1   0x2C

Definition at line 87 of file tca8418_keypad.c.

#define REG_GPIO_PULL2   0x2D

Definition at line 88 of file tca8418_keypad.c.

#define REG_GPIO_PULL3   0x2E

Definition at line 89 of file tca8418_keypad.c.

#define REG_INT_STAT   0x02

Definition at line 45 of file tca8418_keypad.c.

#define REG_KEY_EVENT_A   0x04

Definition at line 47 of file tca8418_keypad.c.

#define REG_KEY_EVENT_B   0x05

Definition at line 48 of file tca8418_keypad.c.

#define REG_KEY_EVENT_C   0x06

Definition at line 49 of file tca8418_keypad.c.

#define REG_KEY_EVENT_D   0x07

Definition at line 50 of file tca8418_keypad.c.

#define REG_KEY_EVENT_E   0x08

Definition at line 51 of file tca8418_keypad.c.

#define REG_KEY_EVENT_F   0x09

Definition at line 52 of file tca8418_keypad.c.

#define REG_KEY_EVENT_G   0x0A

Definition at line 53 of file tca8418_keypad.c.

#define REG_KEY_EVENT_H   0x0B

Definition at line 54 of file tca8418_keypad.c.

#define REG_KEY_EVENT_I   0x0C

Definition at line 55 of file tca8418_keypad.c.

#define REG_KEY_EVENT_J   0x0D

Definition at line 56 of file tca8418_keypad.c.

#define REG_KEY_LCK_EC   0x03

Definition at line 46 of file tca8418_keypad.c.

#define REG_KP_GPIO1   0x1D

Definition at line 72 of file tca8418_keypad.c.

#define REG_KP_GPIO2   0x1E

Definition at line 73 of file tca8418_keypad.c.

#define REG_KP_GPIO3   0x1F

Definition at line 74 of file tca8418_keypad.c.

#define REG_KP_LCK_TIMER   0x0E

Definition at line 57 of file tca8418_keypad.c.

#define REG_UNLOCK1   0x0F

Definition at line 58 of file tca8418_keypad.c.

#define REG_UNLOCK2   0x10

Definition at line 59 of file tca8418_keypad.c.

#define TCA8418_MAX_COLS   10

Definition at line 41 of file tca8418_keypad.c.

#define TCA8418_MAX_ROWS   8

Definition at line 40 of file tca8418_keypad.c.

Function Documentation

MODULE_AUTHOR ( "Kyle Manna <[email protected]>"  )
MODULE_DESCRIPTION ( "Keypad driver for TCA8418"  )
MODULE_DEVICE_TABLE ( i2c  ,
tca8418_id   
)
module_exit ( tca8418_keypad_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( tca8418_keypad_init  )