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

Go to the source code of this file.

Data Structures

struct  ad7879
 

Macros

#define AD7879_REG_ZEROS   0
 
#define AD7879_REG_CTRL1   1
 
#define AD7879_REG_CTRL2   2
 
#define AD7879_REG_CTRL3   3
 
#define AD7879_REG_AUX1HIGH   4
 
#define AD7879_REG_AUX1LOW   5
 
#define AD7879_REG_TEMP1HIGH   6
 
#define AD7879_REG_TEMP1LOW   7
 
#define AD7879_REG_XPLUS   8
 
#define AD7879_REG_YPLUS   9
 
#define AD7879_REG_Z1   10
 
#define AD7879_REG_Z2   11
 
#define AD7879_REG_AUXVBAT   12
 
#define AD7879_REG_TEMP   13
 
#define AD7879_REG_REVID   14
 
#define AD7879_TMR(x)   ((x & 0xFF) << 0)
 
#define AD7879_ACQ(x)   ((x & 0x3) << 8)
 
#define AD7879_MODE_NOC   (0 << 10) /* Do not convert */
 
#define AD7879_MODE_SCC   (1 << 10) /* Single channel conversion */
 
#define AD7879_MODE_SEQ0   (2 << 10) /* Sequence 0 in Slave Mode */
 
#define AD7879_MODE_SEQ1   (3 << 10) /* Sequence 1 in Master Mode */
 
#define AD7879_MODE_INT   (1 << 15) /* PENIRQ disabled INT enabled */
 
#define AD7879_FCD(x)   ((x & 0x3) << 0)
 
#define AD7879_RESET   (1 << 4)
 
#define AD7879_MFS(x)   ((x & 0x3) << 5)
 
#define AD7879_AVG(x)   ((x & 0x3) << 7)
 
#define AD7879_SER   (1 << 9) /* non-differential */
 
#define AD7879_DFR   (0 << 9) /* differential */
 
#define AD7879_GPIOPOL   (1 << 10)
 
#define AD7879_GPIODIR   (1 << 11)
 
#define AD7879_GPIO_DATA   (1 << 12)
 
#define AD7879_GPIO_EN   (1 << 13)
 
#define AD7879_PM(x)   ((x & 0x3) << 14)
 
#define AD7879_PM_SHUTDOWN   (0)
 
#define AD7879_PM_DYN   (1)
 
#define AD7879_PM_FULLON   (2)
 
#define AD7879_TEMPMASK_BIT   (1<<15)
 
#define AD7879_AUXVBATMASK_BIT   (1<<14)
 
#define AD7879_INTMODE_BIT   (1<<13)
 
#define AD7879_GPIOALERTMASK_BIT   (1<<12)
 
#define AD7879_AUXLOW_BIT   (1<<11)
 
#define AD7879_AUXHIGH_BIT   (1<<10)
 
#define AD7879_TEMPLOW_BIT   (1<<9)
 
#define AD7879_TEMPHIGH_BIT   (1<<8)
 
#define AD7879_YPLUS_BIT   (1<<7)
 
#define AD7879_XPLUS_BIT   (1<<6)
 
#define AD7879_Z1_BIT   (1<<5)
 
#define AD7879_Z2_BIT   (1<<4)
 
#define AD7879_AUX_BIT   (1<<3)
 
#define AD7879_VBAT_BIT   (1<<2)
 
#define AD7879_TEMP_BIT   (1<<1)
 
#define MAX_12BIT   ((1<<12)-1)
 
#define TS_PEN_UP_TIMEOUT   msecs_to_jiffies(50)
 

Enumerations

enum  {
  AD7879_SEQ_XPOS = 0, AD7879_SEQ_YPOS = 1, AD7879_SEQ_Z1 = 2, AD7879_SEQ_Z2 = 3,
  AD7879_NR_SENSE = 4
}
 

Functions

 SIMPLE_DEV_PM_OPS (ad7879_pm_ops, ad7879_suspend, ad7879_resume)
 
 EXPORT_SYMBOL (ad7879_pm_ops)
 
struct ad7879ad7879_probe (struct device *dev, u8 devid, unsigned int irq, const struct ad7879_bus_ops *bops)
 
 EXPORT_SYMBOL (ad7879_probe)
 
void ad7879_remove (struct ad7879 *ts)
 
 EXPORT_SYMBOL (ad7879_remove)
 
 MODULE_AUTHOR ("Michael Hennerich <[email protected]>")
 
 MODULE_DESCRIPTION ("AD7879(-1) touchscreen Driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define AD7879_ACQ (   x)    ((x & 0x3) << 8)

Definition at line 57 of file ad7879.c.

#define AD7879_AUX_BIT   (1<<3)

Definition at line 93 of file ad7879.c.

#define AD7879_AUXHIGH_BIT   (1<<10)

Definition at line 86 of file ad7879.c.

#define AD7879_AUXLOW_BIT   (1<<11)

Definition at line 85 of file ad7879.c.

#define AD7879_AUXVBATMASK_BIT   (1<<14)

Definition at line 82 of file ad7879.c.

#define AD7879_AVG (   x)    ((x & 0x3) << 7)

Definition at line 68 of file ad7879.c.

#define AD7879_DFR   (0 << 9) /* differential */

Definition at line 70 of file ad7879.c.

#define AD7879_FCD (   x)    ((x & 0x3) << 0)

Definition at line 65 of file ad7879.c.

#define AD7879_GPIO_DATA   (1 << 12)

Definition at line 73 of file ad7879.c.

#define AD7879_GPIO_EN   (1 << 13)

Definition at line 74 of file ad7879.c.

#define AD7879_GPIOALERTMASK_BIT   (1<<12)

Definition at line 84 of file ad7879.c.

#define AD7879_GPIODIR   (1 << 11)

Definition at line 72 of file ad7879.c.

#define AD7879_GPIOPOL   (1 << 10)

Definition at line 71 of file ad7879.c.

#define AD7879_INTMODE_BIT   (1<<13)

Definition at line 83 of file ad7879.c.

#define AD7879_MFS (   x)    ((x & 0x3) << 5)

Definition at line 67 of file ad7879.c.

#define AD7879_MODE_INT   (1 << 15) /* PENIRQ disabled INT enabled */

Definition at line 62 of file ad7879.c.

#define AD7879_MODE_NOC   (0 << 10) /* Do not convert */

Definition at line 58 of file ad7879.c.

#define AD7879_MODE_SCC   (1 << 10) /* Single channel conversion */

Definition at line 59 of file ad7879.c.

#define AD7879_MODE_SEQ0   (2 << 10) /* Sequence 0 in Slave Mode */

Definition at line 60 of file ad7879.c.

#define AD7879_MODE_SEQ1   (3 << 10) /* Sequence 1 in Master Mode */

Definition at line 61 of file ad7879.c.

#define AD7879_PM (   x)    ((x & 0x3) << 14)

Definition at line 75 of file ad7879.c.

#define AD7879_PM_DYN   (1)

Definition at line 77 of file ad7879.c.

#define AD7879_PM_FULLON   (2)

Definition at line 78 of file ad7879.c.

#define AD7879_PM_SHUTDOWN   (0)

Definition at line 76 of file ad7879.c.

#define AD7879_REG_AUX1HIGH   4

Definition at line 43 of file ad7879.c.

#define AD7879_REG_AUX1LOW   5

Definition at line 44 of file ad7879.c.

#define AD7879_REG_AUXVBAT   12

Definition at line 51 of file ad7879.c.

#define AD7879_REG_CTRL1   1

Definition at line 40 of file ad7879.c.

#define AD7879_REG_CTRL2   2

Definition at line 41 of file ad7879.c.

#define AD7879_REG_CTRL3   3

Definition at line 42 of file ad7879.c.

#define AD7879_REG_REVID   14

Definition at line 53 of file ad7879.c.

#define AD7879_REG_TEMP   13

Definition at line 52 of file ad7879.c.

#define AD7879_REG_TEMP1HIGH   6

Definition at line 45 of file ad7879.c.

#define AD7879_REG_TEMP1LOW   7

Definition at line 46 of file ad7879.c.

#define AD7879_REG_XPLUS   8

Definition at line 47 of file ad7879.c.

#define AD7879_REG_YPLUS   9

Definition at line 48 of file ad7879.c.

#define AD7879_REG_Z1   10

Definition at line 49 of file ad7879.c.

#define AD7879_REG_Z2   11

Definition at line 50 of file ad7879.c.

#define AD7879_REG_ZEROS   0

Definition at line 39 of file ad7879.c.

#define AD7879_RESET   (1 << 4)

Definition at line 66 of file ad7879.c.

#define AD7879_SER   (1 << 9) /* non-differential */

Definition at line 69 of file ad7879.c.

#define AD7879_TEMP_BIT   (1<<1)

Definition at line 95 of file ad7879.c.

#define AD7879_TEMPHIGH_BIT   (1<<8)

Definition at line 88 of file ad7879.c.

#define AD7879_TEMPLOW_BIT   (1<<9)

Definition at line 87 of file ad7879.c.

#define AD7879_TEMPMASK_BIT   (1<<15)

Definition at line 81 of file ad7879.c.

#define AD7879_TMR (   x)    ((x & 0xFF) << 0)

Definition at line 56 of file ad7879.c.

#define AD7879_VBAT_BIT   (1<<2)

Definition at line 94 of file ad7879.c.

#define AD7879_XPLUS_BIT   (1<<6)

Definition at line 90 of file ad7879.c.

#define AD7879_YPLUS_BIT   (1<<7)

Definition at line 89 of file ad7879.c.

#define AD7879_Z1_BIT   (1<<5)

Definition at line 91 of file ad7879.c.

#define AD7879_Z2_BIT   (1<<4)

Definition at line 92 of file ad7879.c.

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

Definition at line 105 of file ad7879.c.

#define TS_PEN_UP_TIMEOUT   msecs_to_jiffies(50)

Definition at line 106 of file ad7879.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
AD7879_SEQ_XPOS 
AD7879_SEQ_YPOS 
AD7879_SEQ_Z1 
AD7879_SEQ_Z2 
AD7879_NR_SENSE 

Definition at line 97 of file ad7879.c.

Function Documentation

struct ad7879* ad7879_probe ( struct device dev,
u8  devid,
unsigned int  irq,
const struct ad7879_bus_ops bops 
)
read

Definition at line 495 of file ad7879.c.

void ad7879_remove ( struct ad7879 ts)

Definition at line 642 of file ad7879.c.

EXPORT_SYMBOL ( ad7879_pm_ops  )
EXPORT_SYMBOL ( ad7879_probe  )
EXPORT_SYMBOL ( ad7879_remove  )
MODULE_AUTHOR ( "Michael Hennerich <[email protected]>"  )
MODULE_DESCRIPTION ( "AD7879(-1) touchscreen Driver"  )
MODULE_LICENSE ( "GPL"  )
SIMPLE_DEV_PM_OPS ( ad7879_pm_ops  ,
ad7879_suspend  ,
ad7879_resume   
)