linux/drivers/input/touchscreen/wm97xx-core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * wm97xx-core.c  --  Touch screen driver core for Wolfson WM9705, WM9712
 *                    and WM9713 AC97 Codecs.
 *
 * Copyright 2003, 2004, 2005, 2006, 2007, 2008 Wolfson Microelectronics PLC.
 * Author: Liam Girdwood <[email protected]>
 * Parts Copyright : Ian Molton <[email protected]>
 *                   Andrew Zabolotny <[email protected]>
 *                   Russell King <[email protected]>
 *
 * Notes:
 *
 *  Features:
 *       - supports WM9705, WM9712, WM9713
 *       - polling mode
 *       - continuous mode (arch-dependent)
 *       - adjustable rpu/dpp settings
 *       - adjustable pressure current
 *       - adjustable sample settle delay
 *       - 4 and 5 wire touchscreens (5 wire is WM9712 only)
 *       - pen down detection
 *       - battery monitor
 *       - sample AUX adcs
 *       - power management
 *       - codec GPIO
 *       - codec event notification
 * Todo
 *       - Support for async sampling control for noisy LCDs.
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/proc_fs.h>
#include <linux/pm.h>
#include <linux/interrupt.h>
#include <linux/bitops.h>
#include <linux/mfd/wm97xx.h>
#include <linux/workqueue.h>
#include <linux/wm97xx.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/slab.h>

#define TS_NAME
#define WM_CORE_VERSION
#define DEFAULT_PRESSURE


/*
 * Touchscreen absolute values
 *
 * These parameters are used to help the input layer discard out of
 * range readings and reduce jitter etc.
 *
 *   o min, max:- indicate the min and max values your touch screen returns
 *   o fuzz:- use a higher number to reduce jitter
 *
 * The default values correspond to Mainstone II in QVGA mode
 *
 * Please read
 * Documentation/input/input-programming.rst for more details.
 */

static int abs_x[3] =;
module_param_array();
MODULE_PARM_DESC();

static int abs_y[3] =;
module_param_array();
MODULE_PARM_DESC();

static int abs_p[3] =;
module_param_array();
MODULE_PARM_DESC();

/*
 * wm97xx IO access, all IO locking done by AC97 layer
 */
int wm97xx_reg_read(struct wm97xx *wm, u16 reg)
{}
EXPORT_SYMBOL_GPL();

void wm97xx_reg_write(struct wm97xx *wm, u16 reg, u16 val)
{}
EXPORT_SYMBOL_GPL();

/**
 * wm97xx_read_aux_adc - Read the aux adc.
 * @wm: wm97xx device.
 * @adcsel: codec ADC to be read
 *
 * Reads the selected AUX ADC.
 */

int wm97xx_read_aux_adc(struct wm97xx *wm, u16 adcsel)
{}
EXPORT_SYMBOL_GPL();

/**
 * wm97xx_get_gpio - Get the status of a codec GPIO.
 * @wm: wm97xx device.
 * @gpio: gpio
 *
 * Get the status of a codec GPIO pin
 */

enum wm97xx_gpio_status wm97xx_get_gpio(struct wm97xx *wm, u32 gpio)
{}
EXPORT_SYMBOL_GPL();

/**
 * wm97xx_set_gpio - Set the status of a codec GPIO.
 * @wm: wm97xx device.
 * @gpio: gpio
 * @status: status
 *
 * Set the status of a codec GPIO pin
 */

void wm97xx_set_gpio(struct wm97xx *wm, u32 gpio,
				enum wm97xx_gpio_status status)
{}
EXPORT_SYMBOL_GPL();

/*
 * Codec GPIO pin configuration, this sets pin direction, polarity,
 * stickyness and wake up.
 */
void wm97xx_config_gpio(struct wm97xx *wm, u32 gpio, enum wm97xx_gpio_dir dir,
		   enum wm97xx_gpio_pol pol, enum wm97xx_gpio_sticky sticky,
		   enum wm97xx_gpio_wake wake)
{}
EXPORT_SYMBOL_GPL();

/*
 * Configure the WM97XX_PRP value to use while system is suspended.
 * If a value other than 0 is set then WM97xx pen detection will be
 * left enabled in the configured mode while the system is in suspend,
 * the device has users and suspend has not been disabled via the
 * wakeup sysfs entries.
 *
 * @wm:   WM97xx device to configure
 * @mode: WM97XX_PRP value to configure while suspended
 */
void wm97xx_set_suspend_mode(struct wm97xx *wm, u16 mode)
{}
EXPORT_SYMBOL_GPL();

/*
 * Codec PENDOWN irq handler
 *
 */
static irqreturn_t wm97xx_pen_interrupt(int irq, void *dev_id)
{}

/*
 * initialise pen IRQ handler and workqueue
 */
static int wm97xx_init_pen_irq(struct wm97xx *wm)
{}

static int wm97xx_read_samples(struct wm97xx *wm)
{}

/*
* The touchscreen sample reader.
*/
static void wm97xx_ts_reader(struct work_struct *work)
{}

/**
 * wm97xx_ts_input_open - Open the touch screen input device.
 * @idev:	Input device to be opened.
 *
 * Called by the input sub system to open a wm97xx touchscreen device.
 * Starts the touchscreen thread and touch digitiser.
 */
static int wm97xx_ts_input_open(struct input_dev *idev)
{}

/**
 * wm97xx_ts_input_close - Close the touch screen input device.
 * @idev:	Input device to be closed.
 *
 * Called by the input sub system to close a wm97xx touchscreen
 * device.  Kills the touchscreen thread and stops the touch
 * digitiser.
 */

static void wm97xx_ts_input_close(struct input_dev *idev)
{}

static int wm97xx_register_touch(struct wm97xx *wm)
{}

static void wm97xx_unregister_touch(struct wm97xx *wm)
{}

static int _wm97xx_probe(struct wm97xx *wm)
{}

static void wm97xx_remove_battery(struct wm97xx *wm)
{}

static int wm97xx_add_battery(struct wm97xx *wm,
			      struct wm97xx_batt_pdata *pdata)
{}

static int wm97xx_probe(struct device *dev)
{}

static int wm97xx_remove(struct device *dev)
{}

static int wm97xx_mfd_probe(struct platform_device *pdev)
{}

static void wm97xx_mfd_remove(struct platform_device *pdev)
{}

static int wm97xx_suspend(struct device *dev)
{}

static int wm97xx_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume);

/*
 * Machine specific operations
 */
int wm97xx_register_mach_ops(struct wm97xx *wm,
			     struct wm97xx_mach_ops *mach_ops)
{}
EXPORT_SYMBOL_GPL();

void wm97xx_unregister_mach_ops(struct wm97xx *wm)
{}
EXPORT_SYMBOL_GPL();

static struct device_driver wm97xx_driver =;

static struct platform_driver wm97xx_mfd_driver =;

static int __init wm97xx_init(void)
{}

static void __exit wm97xx_exit(void)
{}

module_init();
module_exit(wm97xx_exit);

/* Module information */
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();