Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pxa27x_keypad.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/input/matrix_keypad.h>
#include <linux/slab.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <mach/hardware.h>
#include <linux/platform_data/keypad-pxa27x.h>

Go to the source code of this file.

Data Structures

struct  pxa27x_keypad
 

Macros

#define KPC   0x0000 /* Keypad Control register */
 
#define KPDK   0x0008 /* Keypad Direct Key register */
 
#define KPREC   0x0010 /* Keypad Rotary Encoder register */
 
#define KPMK   0x0018 /* Keypad Matrix Key register */
 
#define KPAS   0x0020 /* Keypad Automatic Scan register */
 
#define KPASMKP0   0x0028
 
#define KPASMKP1   0x0030
 
#define KPASMKP2   0x0038
 
#define KPASMKP3   0x0040
 
#define KPKDI   0x0048
 
#define KPC_MKRN(n)   ((((n) - 1) & 0x7) << 26) /* matrix key row number */
 
#define KPC_MKCN(n)   ((((n) - 1) & 0x7) << 23) /* matrix key column number */
 
#define KPC_DKN(n)   ((((n) - 1) & 0x7) << 6) /* direct key number */
 
#define KPC_AS   (0x1 << 30) /* Automatic Scan bit */
 
#define KPC_ASACT   (0x1 << 29) /* Automatic Scan on Activity */
 
#define KPC_MI   (0x1 << 22) /* Matrix interrupt bit */
 
#define KPC_IMKP   (0x1 << 21) /* Ignore Multiple Key Press */
 
#define KPC_MS(n)   (0x1 << (13 + (n))) /* Matrix scan line 'n' */
 
#define KPC_MS_ALL   (0xff << 13)
 
#define KPC_ME   (0x1 << 12) /* Matrix Keypad Enable */
 
#define KPC_MIE   (0x1 << 11) /* Matrix Interrupt Enable */
 
#define KPC_DK_DEB_SEL   (0x1 << 9) /* Direct Keypad Debounce Select */
 
#define KPC_DI   (0x1 << 5) /* Direct key interrupt bit */
 
#define KPC_RE_ZERO_DEB   (0x1 << 4) /* Rotary Encoder Zero Debounce */
 
#define KPC_REE1   (0x1 << 3) /* Rotary Encoder1 Enable */
 
#define KPC_REE0   (0x1 << 2) /* Rotary Encoder0 Enable */
 
#define KPC_DE   (0x1 << 1) /* Direct Keypad Enable */
 
#define KPC_DIE   (0x1 << 0) /* Direct Keypad interrupt Enable */
 
#define KPDK_DKP   (0x1 << 31)
 
#define KPDK_DK(n)   ((n) & 0xff)
 
#define KPREC_OF1   (0x1 << 31)
 
#define kPREC_UF1   (0x1 << 30)
 
#define KPREC_OF0   (0x1 << 15)
 
#define KPREC_UF0   (0x1 << 14)
 
#define KPREC_RECOUNT0(n)   ((n) & 0xff)
 
#define KPREC_RECOUNT1(n)   (((n) >> 16) & 0xff)
 
#define KPMK_MKP   (0x1 << 31)
 
#define KPAS_SO   (0x1 << 31)
 
#define KPASMKPx_SO   (0x1 << 31)
 
#define KPAS_MUKP(n)   (((n) >> 26) & 0x1f)
 
#define KPAS_RP(n)   (((n) >> 4) & 0xf)
 
#define KPAS_CP(n)   ((n) & 0xf)
 
#define KPASMKP_MKC_MASK   (0xff)
 
#define keypad_readl(off)   __raw_readl(keypad->mmio_base + (off))
 
#define keypad_writel(off, v)   __raw_writel((v), keypad->mmio_base + (off))
 
#define MAX_MATRIX_KEY_NUM   (MAX_MATRIX_KEY_ROWS * MAX_MATRIX_KEY_COLS)
 
#define MAX_KEYPAD_KEYS   (MAX_MATRIX_KEY_NUM + MAX_DIRECT_KEY_NUM)
 
#define DEFAULT_KPREC   (0x007f007f)
 

Functions

 MODULE_ALIAS ("platform:pxa27x-keypad")
 
 module_platform_driver (pxa27x_keypad_driver)
 
 MODULE_DESCRIPTION ("PXA27x Keypad Controller Driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DEFAULT_KPREC   (0x007f007f)

Definition at line 249 of file pxa27x_keypad.c.

#define keypad_readl (   off)    __raw_readl(keypad->mmio_base + (off))

Definition at line 96 of file pxa27x_keypad.c.

#define keypad_writel (   off,
  v 
)    __raw_writel((v), keypad->mmio_base + (off))

Definition at line 97 of file pxa27x_keypad.c.

#define KPAS   0x0020 /* Keypad Automatic Scan register */

Definition at line 43 of file pxa27x_keypad.c.

#define KPAS_CP (   n)    ((n) & 0xf)

Definition at line 92 of file pxa27x_keypad.c.

#define KPAS_MUKP (   n)    (((n) >> 26) & 0x1f)

Definition at line 90 of file pxa27x_keypad.c.

#define KPAS_RP (   n)    (((n) >> 4) & 0xf)

Definition at line 91 of file pxa27x_keypad.c.

#define KPAS_SO   (0x1 << 31)

Definition at line 87 of file pxa27x_keypad.c.

#define KPASMKP0   0x0028

Definition at line 46 of file pxa27x_keypad.c.

#define KPASMKP1   0x0030

Definition at line 47 of file pxa27x_keypad.c.

#define KPASMKP2   0x0038

Definition at line 48 of file pxa27x_keypad.c.

#define KPASMKP3   0x0040

Definition at line 49 of file pxa27x_keypad.c.

#define KPASMKP_MKC_MASK   (0xff)

Definition at line 94 of file pxa27x_keypad.c.

#define KPASMKPx_SO   (0x1 << 31)

Definition at line 88 of file pxa27x_keypad.c.

#define KPC   0x0000 /* Keypad Control register */

Definition at line 39 of file pxa27x_keypad.c.

#define KPC_AS   (0x1 << 30) /* Automatic Scan bit */

Definition at line 57 of file pxa27x_keypad.c.

#define KPC_ASACT   (0x1 << 29) /* Automatic Scan on Activity */

Definition at line 58 of file pxa27x_keypad.c.

#define KPC_DE   (0x1 << 1) /* Direct Keypad Enable */

Definition at line 72 of file pxa27x_keypad.c.

#define KPC_DI   (0x1 << 5) /* Direct key interrupt bit */

Definition at line 68 of file pxa27x_keypad.c.

#define KPC_DIE   (0x1 << 0) /* Direct Keypad interrupt Enable */

Definition at line 73 of file pxa27x_keypad.c.

#define KPC_DK_DEB_SEL   (0x1 << 9) /* Direct Keypad Debounce Select */

Definition at line 67 of file pxa27x_keypad.c.

#define KPC_DKN (   n)    ((((n) - 1) & 0x7) << 6) /* direct key number */

Definition at line 55 of file pxa27x_keypad.c.

#define KPC_IMKP   (0x1 << 21) /* Ignore Multiple Key Press */

Definition at line 60 of file pxa27x_keypad.c.

#define KPC_ME   (0x1 << 12) /* Matrix Keypad Enable */

Definition at line 65 of file pxa27x_keypad.c.

#define KPC_MI   (0x1 << 22) /* Matrix interrupt bit */

Definition at line 59 of file pxa27x_keypad.c.

#define KPC_MIE   (0x1 << 11) /* Matrix Interrupt Enable */

Definition at line 66 of file pxa27x_keypad.c.

#define KPC_MKCN (   n)    ((((n) - 1) & 0x7) << 23) /* matrix key column number */

Definition at line 54 of file pxa27x_keypad.c.

#define KPC_MKRN (   n)    ((((n) - 1) & 0x7) << 26) /* matrix key row number */

Definition at line 53 of file pxa27x_keypad.c.

#define KPC_MS (   n)    (0x1 << (13 + (n))) /* Matrix scan line 'n' */

Definition at line 62 of file pxa27x_keypad.c.

#define KPC_MS_ALL   (0xff << 13)

Definition at line 63 of file pxa27x_keypad.c.

#define KPC_RE_ZERO_DEB   (0x1 << 4) /* Rotary Encoder Zero Debounce */

Definition at line 69 of file pxa27x_keypad.c.

#define KPC_REE0   (0x1 << 2) /* Rotary Encoder0 Enable */

Definition at line 71 of file pxa27x_keypad.c.

#define KPC_REE1   (0x1 << 3) /* Rotary Encoder1 Enable */

Definition at line 70 of file pxa27x_keypad.c.

#define KPDK   0x0008 /* Keypad Direct Key register */

Definition at line 40 of file pxa27x_keypad.c.

#define KPDK_DK (   n)    ((n) & 0xff)

Definition at line 76 of file pxa27x_keypad.c.

#define KPDK_DKP   (0x1 << 31)

Definition at line 75 of file pxa27x_keypad.c.

#define KPKDI   0x0048

Definition at line 50 of file pxa27x_keypad.c.

#define KPMK   0x0018 /* Keypad Matrix Key register */

Definition at line 42 of file pxa27x_keypad.c.

#define KPMK_MKP   (0x1 << 31)

Definition at line 86 of file pxa27x_keypad.c.

#define KPREC   0x0010 /* Keypad Rotary Encoder register */

Definition at line 41 of file pxa27x_keypad.c.

#define KPREC_OF0   (0x1 << 15)

Definition at line 80 of file pxa27x_keypad.c.

#define KPREC_OF1   (0x1 << 31)

Definition at line 78 of file pxa27x_keypad.c.

#define KPREC_RECOUNT0 (   n)    ((n) & 0xff)

Definition at line 83 of file pxa27x_keypad.c.

#define KPREC_RECOUNT1 (   n)    (((n) >> 16) & 0xff)

Definition at line 84 of file pxa27x_keypad.c.

#define KPREC_UF0   (0x1 << 14)

Definition at line 81 of file pxa27x_keypad.c.

#define kPREC_UF1   (0x1 << 30)

Definition at line 79 of file pxa27x_keypad.c.

#define MAX_KEYPAD_KEYS   (MAX_MATRIX_KEY_NUM + MAX_DIRECT_KEY_NUM)

Definition at line 100 of file pxa27x_keypad.c.

#define MAX_MATRIX_KEY_NUM   (MAX_MATRIX_KEY_ROWS * MAX_MATRIX_KEY_COLS)

Definition at line 99 of file pxa27x_keypad.c.

Function Documentation

MODULE_ALIAS ( "platform:pxa27x-keypad"  )
MODULE_DESCRIPTION ( "PXA27x Keypad Controller Driver"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( pxa27x_keypad_driver  )