Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ti_tscadc.c File Reference
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/input/ti_tscadc.h>
#include <linux/delay.h>

Go to the source code of this file.

Data Structures

struct  tscadc
 

Macros

#define REG_IRQEOI   0x020
 
#define REG_RAWIRQSTATUS   0x024
 
#define REG_IRQSTATUS   0x028
 
#define REG_IRQENABLE   0x02C
 
#define REG_IRQWAKEUP   0x034
 
#define REG_CTRL   0x040
 
#define REG_ADCFSM   0x044
 
#define REG_CLKDIV   0x04C
 
#define REG_SE   0x054
 
#define REG_IDLECONFIG   0x058
 
#define REG_CHARGECONFIG   0x05C
 
#define REG_CHARGEDELAY   0x060
 
#define REG_STEPCONFIG(n)   (0x64 + ((n - 1) * 8))
 
#define REG_STEPDELAY(n)   (0x68 + ((n - 1) * 8))
 
#define REG_STEPCONFIG13   0x0C4
 
#define REG_STEPDELAY13   0x0C8
 
#define REG_STEPCONFIG14   0x0CC
 
#define REG_STEPDELAY14   0x0D0
 
#define REG_FIFO0CNT   0xE4
 
#define REG_FIFO1THR   0xF4
 
#define REG_FIFO0   0x100
 
#define REG_FIFO1   0x200
 
#define IRQWKUP_ENB   BIT(0)
 
#define STPENB_STEPENB   0x7FFF
 
#define IRQENB_FIFO1THRES   BIT(5)
 
#define IRQENB_PENUP   BIT(9)
 
#define STEPCONFIG_MODE_HWSYNC   0x2
 
#define STEPCONFIG_SAMPLES_AVG   (1 << 4)
 
#define STEPCONFIG_XPP   (1 << 5)
 
#define STEPCONFIG_XNN   (1 << 6)
 
#define STEPCONFIG_YPP   (1 << 7)
 
#define STEPCONFIG_YNN   (1 << 8)
 
#define STEPCONFIG_XNP   (1 << 9)
 
#define STEPCONFIG_YPN   (1 << 10)
 
#define STEPCONFIG_INM   (1 << 18)
 
#define STEPCONFIG_INP   (1 << 20)
 
#define STEPCONFIG_INP_5   (1 << 21)
 
#define STEPCONFIG_FIFO1   (1 << 26)
 
#define STEPCONFIG_OPENDLY   0xff
 
#define STEPCONFIG_Z1   (3 << 19)
 
#define STEPIDLE_INP   (1 << 22)
 
#define STEPCHARGE_RFP   (1 << 12)
 
#define STEPCHARGE_INM   (1 << 15)
 
#define STEPCHARGE_INP   (1 << 19)
 
#define STEPCHARGE_RFM   (1 << 23)
 
#define STEPCHARGE_DELAY   0x1
 
#define CNTRLREG_TSCSSENB   (1 << 0)
 
#define CNTRLREG_STEPID   (1 << 1)
 
#define CNTRLREG_STEPCONFIGWRT   (1 << 2)
 
#define CNTRLREG_4WIRE   (1 << 5)
 
#define CNTRLREG_5WIRE   (1 << 6)
 
#define CNTRLREG_8WIRE   (3 << 5)
 
#define CNTRLREG_TSCENB   (1 << 7)
 
#define ADCFSM_STEPID   0x10
 
#define SEQ_SETTLE   275
 
#define ADC_CLK   3000000
 
#define MAX_12BIT   ((1 << 12) - 1)
 
#define TSCADC_DELTA_X   15
 
#define TSCADC_DELTA_Y   15
 

Functions

 module_platform_driver (ti_tsc_driver)
 
 MODULE_DESCRIPTION ("TI touchscreen controller driver")
 
 MODULE_AUTHOR ("Rachna Patil <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ADC_CLK   3000000

Definition at line 88 of file ti_tscadc.c.

#define ADCFSM_STEPID   0x10

Definition at line 85 of file ti_tscadc.c.

#define CNTRLREG_4WIRE   (1 << 5)

Definition at line 81 of file ti_tscadc.c.

#define CNTRLREG_5WIRE   (1 << 6)

Definition at line 82 of file ti_tscadc.c.

#define CNTRLREG_8WIRE   (3 << 5)

Definition at line 83 of file ti_tscadc.c.

#define CNTRLREG_STEPCONFIGWRT   (1 << 2)

Definition at line 80 of file ti_tscadc.c.

#define CNTRLREG_STEPID   (1 << 1)

Definition at line 79 of file ti_tscadc.c.

#define CNTRLREG_TSCENB   (1 << 7)

Definition at line 84 of file ti_tscadc.c.

#define CNTRLREG_TSCSSENB   (1 << 0)

Definition at line 78 of file ti_tscadc.c.

#define IRQENB_FIFO1THRES   BIT(5)

Definition at line 56 of file ti_tscadc.c.

#define IRQENB_PENUP   BIT(9)

Definition at line 57 of file ti_tscadc.c.

#define IRQWKUP_ENB   BIT(0)

Definition at line 54 of file ti_tscadc.c.

#define MAX_12BIT   ((1 << 12) - 1)

Definition at line 89 of file ti_tscadc.c.

#define REG_ADCFSM   0x044

Definition at line 36 of file ti_tscadc.c.

#define REG_CHARGECONFIG   0x05C

Definition at line 40 of file ti_tscadc.c.

#define REG_CHARGEDELAY   0x060

Definition at line 41 of file ti_tscadc.c.

#define REG_CLKDIV   0x04C

Definition at line 37 of file ti_tscadc.c.

#define REG_CTRL   0x040

Definition at line 35 of file ti_tscadc.c.

#define REG_FIFO0   0x100

Definition at line 50 of file ti_tscadc.c.

#define REG_FIFO0CNT   0xE4

Definition at line 48 of file ti_tscadc.c.

#define REG_FIFO1   0x200

Definition at line 51 of file ti_tscadc.c.

#define REG_FIFO1THR   0xF4

Definition at line 49 of file ti_tscadc.c.

#define REG_IDLECONFIG   0x058

Definition at line 39 of file ti_tscadc.c.

#define REG_IRQENABLE   0x02C

Definition at line 33 of file ti_tscadc.c.

#define REG_IRQEOI   0x020

Definition at line 30 of file ti_tscadc.c.

#define REG_IRQSTATUS   0x028

Definition at line 32 of file ti_tscadc.c.

#define REG_IRQWAKEUP   0x034

Definition at line 34 of file ti_tscadc.c.

#define REG_RAWIRQSTATUS   0x024

Definition at line 31 of file ti_tscadc.c.

#define REG_SE   0x054

Definition at line 38 of file ti_tscadc.c.

#define REG_STEPCONFIG (   n)    (0x64 + ((n - 1) * 8))

Definition at line 42 of file ti_tscadc.c.

#define REG_STEPCONFIG13   0x0C4

Definition at line 44 of file ti_tscadc.c.

#define REG_STEPCONFIG14   0x0CC

Definition at line 46 of file ti_tscadc.c.

#define REG_STEPDELAY (   n)    (0x68 + ((n - 1) * 8))

Definition at line 43 of file ti_tscadc.c.

#define REG_STEPDELAY13   0x0C8

Definition at line 45 of file ti_tscadc.c.

#define REG_STEPDELAY14   0x0D0

Definition at line 47 of file ti_tscadc.c.

#define SEQ_SETTLE   275

Definition at line 87 of file ti_tscadc.c.

#define STEPCHARGE_DELAY   0x1

Definition at line 77 of file ti_tscadc.c.

#define STEPCHARGE_INM   (1 << 15)

Definition at line 74 of file ti_tscadc.c.

#define STEPCHARGE_INP   (1 << 19)

Definition at line 75 of file ti_tscadc.c.

#define STEPCHARGE_RFM   (1 << 23)

Definition at line 76 of file ti_tscadc.c.

#define STEPCHARGE_RFP   (1 << 12)

Definition at line 73 of file ti_tscadc.c.

#define STEPCONFIG_FIFO1   (1 << 26)

Definition at line 69 of file ti_tscadc.c.

#define STEPCONFIG_INM   (1 << 18)

Definition at line 66 of file ti_tscadc.c.

#define STEPCONFIG_INP   (1 << 20)

Definition at line 67 of file ti_tscadc.c.

#define STEPCONFIG_INP_5   (1 << 21)

Definition at line 68 of file ti_tscadc.c.

#define STEPCONFIG_MODE_HWSYNC   0x2

Definition at line 58 of file ti_tscadc.c.

#define STEPCONFIG_OPENDLY   0xff

Definition at line 70 of file ti_tscadc.c.

#define STEPCONFIG_SAMPLES_AVG   (1 << 4)

Definition at line 59 of file ti_tscadc.c.

#define STEPCONFIG_XNN   (1 << 6)

Definition at line 61 of file ti_tscadc.c.

#define STEPCONFIG_XNP   (1 << 9)

Definition at line 64 of file ti_tscadc.c.

#define STEPCONFIG_XPP   (1 << 5)

Definition at line 60 of file ti_tscadc.c.

#define STEPCONFIG_YNN   (1 << 8)

Definition at line 63 of file ti_tscadc.c.

#define STEPCONFIG_YPN   (1 << 10)

Definition at line 65 of file ti_tscadc.c.

#define STEPCONFIG_YPP   (1 << 7)

Definition at line 62 of file ti_tscadc.c.

#define STEPCONFIG_Z1   (3 << 19)

Definition at line 71 of file ti_tscadc.c.

#define STEPIDLE_INP   (1 << 22)

Definition at line 72 of file ti_tscadc.c.

#define STPENB_STEPENB   0x7FFF

Definition at line 55 of file ti_tscadc.c.

#define TSCADC_DELTA_X   15

Definition at line 90 of file ti_tscadc.c.

#define TSCADC_DELTA_Y   15

Definition at line 91 of file ti_tscadc.c.

Function Documentation

MODULE_AUTHOR ( "Rachna Patil <[email protected]>"  )
MODULE_DESCRIPTION ( "TI touchscreen controller driver )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( ti_tsc_driver  )