#include <linux/err.h>
#include <linux/hwmon.h>
#include <linux/thermal.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#define TP_CTRL0 …
#define TP_CTRL1 …
#define TP_CTRL2 …
#define TP_CTRL3 …
#define TP_INT_FIFOC …
#define TP_INT_FIFOS …
#define TP_TPR …
#define TP_CDAT …
#define TEMP_DATA …
#define TP_DATA …
#define ADC_FIRST_DLY(x) …
#define ADC_FIRST_DLY_MODE(x) …
#define ADC_CLK_SEL(x) …
#define ADC_CLK_DIV(x) …
#define FS_DIV(x) …
#define T_ACQ(x) …
#define STYLUS_UP_DEBOUN(x) …
#define STYLUS_UP_DEBOUN_EN(x) …
#define TOUCH_PAN_CALI_EN(x) …
#define TP_DUAL_EN(x) …
#define TP_MODE_EN(x) …
#define TP_ADC_SELECT(x) …
#define ADC_CHAN_SELECT(x) …
#define SUN6I_TP_MODE_EN(x) …
#define TP_SENSITIVE_ADJUST(x) …
#define TP_MODE_SELECT(x) …
#define PRE_MEA_EN(x) …
#define PRE_MEA_THRE_CNT(x) …
#define FILTER_EN(x) …
#define FILTER_TYPE(x) …
#define TEMP_IRQ_EN(x) …
#define OVERRUN_IRQ_EN(x) …
#define DATA_IRQ_EN(x) …
#define TP_DATA_XY_CHANGE(x) …
#define FIFO_TRIG(x) …
#define DATA_DRQ_EN(x) …
#define FIFO_FLUSH(x) …
#define TP_UP_IRQ_EN(x) …
#define TP_DOWN_IRQ_EN(x) …
#define TEMP_DATA_PENDING …
#define FIFO_OVERRUN_PENDING …
#define FIFO_DATA_PENDING …
#define TP_IDLE_FLG …
#define TP_UP_PENDING …
#define TP_DOWN_PENDING …
#define TEMP_ENABLE(x) …
#define TEMP_PERIOD(x) …
struct sun4i_ts_data { … };
static void sun4i_ts_irq_handle_input(struct sun4i_ts_data *ts, u32 reg_val)
{ … }
static irqreturn_t sun4i_ts_irq(int irq, void *dev_id)
{ … }
static int sun4i_ts_open(struct input_dev *dev)
{ … }
static void sun4i_ts_close(struct input_dev *dev)
{ … }
static int sun4i_get_temp(const struct sun4i_ts_data *ts, int *temp)
{ … }
static int sun4i_get_tz_temp(struct thermal_zone_device *tz, int *temp)
{ … }
static const struct thermal_zone_device_ops sun4i_ts_tz_ops = …;
static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
char *buf)
{ … }
static ssize_t show_temp_label(struct device *dev,
struct device_attribute *devattr, char *buf)
{ … }
static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL);
static DEVICE_ATTR(temp1_label, S_IRUGO, show_temp_label, NULL);
static struct attribute *sun4i_ts_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int sun4i_ts_probe(struct platform_device *pdev)
{ … }
static void sun4i_ts_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id sun4i_ts_of_match[] = …;
MODULE_DEVICE_TABLE(of, sun4i_ts_of_match);
static struct platform_driver sun4i_ts_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;