Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
stmpe.h File Reference
#include <linux/mutex.h>

Go to the source code of this file.

Data Structures

struct  stmpe
 
struct  stmpe_keypad_platform_data
 
struct  stmpe_gpio_platform_data
 
struct  stmpe_ts_platform_data
 
struct  stmpe_platform_data
 

Macros

#define STMPE_GPIO_NOREQ_811_TOUCH   (0xf0)
 
#define STMPE_NR_INTERNAL_IRQS   9
 
#define STMPE_INT_GPIO(x)   (STMPE_NR_INTERNAL_IRQS + (x))
 
#define STMPE_NR_GPIOS   24
 
#define STMPE_NR_IRQS   STMPE_INT_GPIO(STMPE_NR_GPIOS)
 

Enumerations

enum  stmpe_block {
  STMPE_BLOCK_GPIO = 1 << 0, STMPE_BLOCK_KEYPAD = 1 << 1, STMPE_BLOCK_TOUCHSCREEN = 1 << 2, STMPE_BLOCK_ADC = 1 << 3,
  STMPE_BLOCK_PWM = 1 << 4, STMPE_BLOCK_ROTATOR = 1 << 5
}
 
enum  stmpe_partnum {
  STMPE610, STMPE801, STMPE811, STMPE1601,
  STMPE2401, STMPE2403, STMPE_NBR_PARTS
}
 
enum  {
  STMPE_IDX_CHIP_ID, STMPE_IDX_ICR_LSB, STMPE_IDX_IER_LSB, STMPE_IDX_ISR_MSB,
  STMPE_IDX_GPMR_LSB, STMPE_IDX_GPSR_LSB, STMPE_IDX_GPCR_LSB, STMPE_IDX_GPDR_LSB,
  STMPE_IDX_GPEDR_MSB, STMPE_IDX_GPRER_LSB, STMPE_IDX_GPFER_LSB, STMPE_IDX_GPAFR_U_MSB,
  STMPE_IDX_IEGPIOR_LSB, STMPE_IDX_ISGPIOR_MSB, STMPE_IDX_MAX
}
 

Functions

int stmpe_reg_write (struct stmpe *stmpe, u8 reg, u8 data)
 
int stmpe_reg_read (struct stmpe *stmpe, u8 reg)
 
int stmpe_block_read (struct stmpe *stmpe, u8 reg, u8 length, u8 *values)
 
int stmpe_block_write (struct stmpe *stmpe, u8 reg, u8 length, const u8 *values)
 
int stmpe_set_bits (struct stmpe *stmpe, u8 reg, u8 mask, u8 val)
 
int stmpe_set_altfunc (struct stmpe *stmpe, u32 pins, enum stmpe_block block)
 
int stmpe_enable (struct stmpe *stmpe, unsigned int blocks)
 
int stmpe_disable (struct stmpe *stmpe, unsigned int blocks)
 

Macro Definition Documentation

#define STMPE_GPIO_NOREQ_811_TOUCH   (0xf0)

Definition at line 126 of file stmpe.h.

#define STMPE_INT_GPIO (   x)    (STMPE_NR_INTERNAL_IRQS + (x))

Definition at line 220 of file stmpe.h.

#define STMPE_NR_GPIOS   24

Definition at line 222 of file stmpe.h.

#define STMPE_NR_INTERNAL_IRQS   9

Definition at line 219 of file stmpe.h.

#define STMPE_NR_IRQS   STMPE_INT_GPIO(STMPE_NR_GPIOS)

Definition at line 223 of file stmpe.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
STMPE_IDX_CHIP_ID 
STMPE_IDX_ICR_LSB 
STMPE_IDX_IER_LSB 
STMPE_IDX_ISR_MSB 
STMPE_IDX_GPMR_LSB 
STMPE_IDX_GPSR_LSB 
STMPE_IDX_GPCR_LSB 
STMPE_IDX_GPDR_LSB 
STMPE_IDX_GPEDR_MSB 
STMPE_IDX_GPRER_LSB 
STMPE_IDX_GPFER_LSB 
STMPE_IDX_GPAFR_U_MSB 
STMPE_IDX_IEGPIOR_LSB 
STMPE_IDX_ISGPIOR_MSB 
STMPE_IDX_MAX 

Definition at line 38 of file stmpe.h.

Enumerator:
STMPE_BLOCK_GPIO 
STMPE_BLOCK_KEYPAD 
STMPE_BLOCK_TOUCHSCREEN 
STMPE_BLOCK_ADC 
STMPE_BLOCK_PWM 
STMPE_BLOCK_ROTATOR 

Definition at line 15 of file stmpe.h.

Enumerator:
STMPE610 
STMPE801 
STMPE811 
STMPE1601 
STMPE2401 
STMPE2403 
STMPE_NBR_PARTS 

Definition at line 24 of file stmpe.h.

Function Documentation

int stmpe_block_read ( struct stmpe stmpe,
u8  reg,
u8  length,
u8 values 
)

stmpe_block_read() - read multiple STMPE registers : Device to read from : First register : Number of registers : Buffer to write to

Definition at line 195 of file stmpe.c.

int stmpe_block_write ( struct stmpe stmpe,
u8  reg,
u8  length,
const u8 values 
)

stmpe_block_write() - write multiple STMPE registers : Device to write to : First register : Number of registers : Values to write

Definition at line 214 of file stmpe.c.

int stmpe_disable ( struct stmpe stmpe,
unsigned int  blocks 
)

stmpe_disable - disable blocks on an STMPE device : Device to work on : Mask of blocks (enum stmpe_block values) to enable

Definition at line 122 of file stmpe.c.

int stmpe_enable ( struct stmpe stmpe,
unsigned int  blocks 
)

stmpe_enable - enable blocks on an STMPE device : Device to work on : Mask of blocks (enum stmpe_block values) to enable

Definition at line 105 of file stmpe.c.

int stmpe_reg_read ( struct stmpe stmpe,
u8  reg 
)

stmpe_reg_read() - read a single STMPE register : Device to read from : Register to read

Definition at line 139 of file stmpe.c.

int stmpe_reg_write ( struct stmpe stmpe,
u8  reg,
u8  val 
)

stmpe_reg_write() - write a single STMPE register : Device to write to : Register to write : Value to write

Definition at line 157 of file stmpe.c.

int stmpe_set_altfunc ( struct stmpe stmpe,
u32  pins,
enum stmpe_block  block 
)

stmpe_set_altfunc()- set the alternate function for STMPE pins : Device to configure : Bitmask of pins to affect : block to enable alternate functions for

is assumed to have a bit set for each of the bits whose alternate function is to be changed, numbered according to the GPIOXY numbers.

If the GPIO module is not enabled, this function automatically enables it in order to perform the change.

Definition at line 239 of file stmpe.c.

int stmpe_set_bits ( struct stmpe stmpe,
u8  reg,
u8  mask,
u8  val 
)

stmpe_set_bits() - set the value of a bitfield in a STMPE register : Device to write to : Register to write : Mask of bits to set : Value to set

Definition at line 176 of file stmpe.c.