#include <linux/device.h>
#include <linux/delay.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/spi/ad7877.h>
#include <linux/module.h>
#include <asm/irq.h>
#define TS_PEN_UP_TIMEOUT …
#define MAX_SPI_FREQ_HZ …
#define MAX_12BIT …
#define AD7877_REG_ZEROS …
#define AD7877_REG_CTRL1 …
#define AD7877_REG_CTRL2 …
#define AD7877_REG_ALERT …
#define AD7877_REG_AUX1HIGH …
#define AD7877_REG_AUX1LOW …
#define AD7877_REG_BAT1HIGH …
#define AD7877_REG_BAT1LOW …
#define AD7877_REG_BAT2HIGH …
#define AD7877_REG_BAT2LOW …
#define AD7877_REG_TEMP1HIGH …
#define AD7877_REG_TEMP1LOW …
#define AD7877_REG_SEQ0 …
#define AD7877_REG_SEQ1 …
#define AD7877_REG_DAC …
#define AD7877_REG_NONE1 …
#define AD7877_REG_EXTWRITE …
#define AD7877_REG_XPLUS …
#define AD7877_REG_YPLUS …
#define AD7877_REG_Z2 …
#define AD7877_REG_aux1 …
#define AD7877_REG_aux2 …
#define AD7877_REG_aux3 …
#define AD7877_REG_bat1 …
#define AD7877_REG_bat2 …
#define AD7877_REG_temp1 …
#define AD7877_REG_temp2 …
#define AD7877_REG_Z1 …
#define AD7877_REG_GPIOCTRL1 …
#define AD7877_REG_GPIOCTRL2 …
#define AD7877_REG_GPIODATA …
#define AD7877_REG_NONE2 …
#define AD7877_REG_NONE3 …
#define AD7877_SEQ_YPLUS_BIT …
#define AD7877_SEQ_XPLUS_BIT …
#define AD7877_SEQ_Z2_BIT …
#define AD7877_SEQ_AUX1_BIT …
#define AD7877_SEQ_AUX2_BIT …
#define AD7877_SEQ_AUX3_BIT …
#define AD7877_SEQ_BAT1_BIT …
#define AD7877_SEQ_BAT2_BIT …
#define AD7877_SEQ_TEMP1_BIT …
#define AD7877_SEQ_TEMP2_BIT …
#define AD7877_SEQ_Z1_BIT …
enum { … };
#define AD7877_DAC_CONF …
#define AD7877_EXTW_GPIO_3_CONF …
#define AD7877_EXTW_GPIO_DATA …
#define AD7877_TMR(x) …
#define AD7877_REF(x) …
#define AD7877_POL(x) …
#define AD7877_FCD(x) …
#define AD7877_PM(x) …
#define AD7877_ACQ(x) …
#define AD7877_AVG(x) …
#define AD7877_SER …
#define AD7877_DFR …
#define AD7877_MODE_NOC …
#define AD7877_MODE_SCC …
#define AD7877_MODE_SEQ0 …
#define AD7877_MODE_SEQ1 …
#define AD7877_CHANADD(x) …
#define AD7877_READADD(x) …
#define AD7877_WRITEADD(x) …
#define AD7877_READ_CHAN(x) …
#define AD7877_MM_SEQUENCE …
struct ser_req { … };
struct ad7877 { … };
static bool gpio3;
module_param(gpio3, bool, 0);
MODULE_PARM_DESC(…) …;
static int ad7877_read(struct spi_device *spi, u16 reg)
{ … }
static int ad7877_write(struct spi_device *spi, u16 reg, u16 val)
{ … }
static int ad7877_read_adc(struct spi_device *spi, unsigned command)
{ … }
static int ad7877_process_data(struct ad7877 *ts)
{ … }
static inline void ad7877_ts_event_release(struct ad7877 *ts)
{ … }
static void ad7877_timer(struct timer_list *t)
{ … }
static irqreturn_t ad7877_irq(int irq, void *handle)
{ … }
static void ad7877_disable(void *data)
{ … }
static void ad7877_enable(struct ad7877 *ts)
{ … }
#define SHOW(name) …
SHOW(…)
SHOW(…)
SHOW(…)
SHOW(…)
SHOW(…)
SHOW(…)
SHOW(…)
static ssize_t ad7877_disable_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t ad7877_disable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(disable, 0664, ad7877_disable_show, ad7877_disable_store);
static ssize_t ad7877_dac_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t ad7877_dac_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(dac, 0664, ad7877_dac_show, ad7877_dac_store);
static ssize_t ad7877_gpio3_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t ad7877_gpio3_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(gpio3, 0664, ad7877_gpio3_show, ad7877_gpio3_store);
static ssize_t ad7877_gpio4_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t ad7877_gpio4_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(gpio4, 0664, ad7877_gpio4_show, ad7877_gpio4_store);
static struct attribute *ad7877_attributes[] = …;
static umode_t ad7877_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{ … }
static const struct attribute_group ad7877_group = …;
__ATTRIBUTE_GROUPS(…);
static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877 *ts)
{ … }
static int ad7877_probe(struct spi_device *spi)
{ … }
static int ad7877_suspend(struct device *dev)
{ … }
static int ad7877_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);
static struct spi_driver ad7877_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;