linux/drivers/input/keyboard/adp5589-keys.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Description:  keypad driver for ADP5589, ADP5585
 *		 I2C QWERTY Keypad and IO Expander
 * Bugs: Enter bugs at http://blackfin.uclinux.org/
 *
 * Copyright (C) 2010-2011 Analog Devices Inc.
 */

#include <linux/bitops.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/workqueue.h>
#include <linux/errno.h>
#include <linux/pm.h>
#include <linux/pm_wakeirq.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/i2c.h>
#include <linux/gpio/driver.h>
#include <linux/slab.h>

#include <linux/input/adp5589.h>

/* ADP5589/ADP5585 Common Registers */
#define ADP5589_5_ID
#define ADP5589_5_INT_STATUS
#define ADP5589_5_STATUS
#define ADP5589_5_FIFO_1
#define ADP5589_5_FIFO_2
#define ADP5589_5_FIFO_3
#define ADP5589_5_FIFO_4
#define ADP5589_5_FIFO_5
#define ADP5589_5_FIFO_6
#define ADP5589_5_FIFO_7
#define ADP5589_5_FIFO_8
#define ADP5589_5_FIFO_9
#define ADP5589_5_FIFO_10
#define ADP5589_5_FIFO_11
#define ADP5589_5_FIFO_12
#define ADP5589_5_FIFO_13
#define ADP5589_5_FIFO_14
#define ADP5589_5_FIFO_15
#define ADP5589_5_FIFO_16
#define ADP5589_5_GPI_INT_STAT_A
#define ADP5589_5_GPI_INT_STAT_B

/* ADP5589 Registers */
#define ADP5589_GPI_INT_STAT_C
#define ADP5589_GPI_STATUS_A
#define ADP5589_GPI_STATUS_B
#define ADP5589_GPI_STATUS_C
#define ADP5589_RPULL_CONFIG_A
#define ADP5589_RPULL_CONFIG_B
#define ADP5589_RPULL_CONFIG_C
#define ADP5589_RPULL_CONFIG_D
#define ADP5589_RPULL_CONFIG_E
#define ADP5589_GPI_INT_LEVEL_A
#define ADP5589_GPI_INT_LEVEL_B
#define ADP5589_GPI_INT_LEVEL_C
#define ADP5589_GPI_EVENT_EN_A
#define ADP5589_GPI_EVENT_EN_B
#define ADP5589_GPI_EVENT_EN_C
#define ADP5589_GPI_INTERRUPT_EN_A
#define ADP5589_GPI_INTERRUPT_EN_B
#define ADP5589_GPI_INTERRUPT_EN_C
#define ADP5589_DEBOUNCE_DIS_A
#define ADP5589_DEBOUNCE_DIS_B
#define ADP5589_DEBOUNCE_DIS_C
#define ADP5589_GPO_DATA_OUT_A
#define ADP5589_GPO_DATA_OUT_B
#define ADP5589_GPO_DATA_OUT_C
#define ADP5589_GPO_OUT_MODE_A
#define ADP5589_GPO_OUT_MODE_B
#define ADP5589_GPO_OUT_MODE_C
#define ADP5589_GPIO_DIRECTION_A
#define ADP5589_GPIO_DIRECTION_B
#define ADP5589_GPIO_DIRECTION_C
#define ADP5589_UNLOCK1
#define ADP5589_UNLOCK2
#define ADP5589_EXT_LOCK_EVENT
#define ADP5589_UNLOCK_TIMERS
#define ADP5589_LOCK_CFG
#define ADP5589_RESET1_EVENT_A
#define ADP5589_RESET1_EVENT_B
#define ADP5589_RESET1_EVENT_C
#define ADP5589_RESET2_EVENT_A
#define ADP5589_RESET2_EVENT_B
#define ADP5589_RESET_CFG
#define ADP5589_PWM_OFFT_LOW
#define ADP5589_PWM_OFFT_HIGH
#define ADP5589_PWM_ONT_LOW
#define ADP5589_PWM_ONT_HIGH
#define ADP5589_PWM_CFG
#define ADP5589_CLOCK_DIV_CFG
#define ADP5589_LOGIC_1_CFG
#define ADP5589_LOGIC_2_CFG
#define ADP5589_LOGIC_FF_CFG
#define ADP5589_LOGIC_INT_EVENT_EN
#define ADP5589_POLL_PTIME_CFG
#define ADP5589_PIN_CONFIG_A
#define ADP5589_PIN_CONFIG_B
#define ADP5589_PIN_CONFIG_C
#define ADP5589_PIN_CONFIG_D
#define ADP5589_GENERAL_CFG
#define ADP5589_INT_EN

/* ADP5585 Registers */
#define ADP5585_GPI_STATUS_A
#define ADP5585_GPI_STATUS_B
#define ADP5585_RPULL_CONFIG_A
#define ADP5585_RPULL_CONFIG_B
#define ADP5585_RPULL_CONFIG_C
#define ADP5585_RPULL_CONFIG_D
#define ADP5585_GPI_INT_LEVEL_A
#define ADP5585_GPI_INT_LEVEL_B
#define ADP5585_GPI_EVENT_EN_A
#define ADP5585_GPI_EVENT_EN_B
#define ADP5585_GPI_INTERRUPT_EN_A
#define ADP5585_GPI_INTERRUPT_EN_B
#define ADP5585_DEBOUNCE_DIS_A
#define ADP5585_DEBOUNCE_DIS_B
#define ADP5585_GPO_DATA_OUT_A
#define ADP5585_GPO_DATA_OUT_B
#define ADP5585_GPO_OUT_MODE_A
#define ADP5585_GPO_OUT_MODE_B
#define ADP5585_GPIO_DIRECTION_A
#define ADP5585_GPIO_DIRECTION_B
#define ADP5585_RESET1_EVENT_A
#define ADP5585_RESET1_EVENT_B
#define ADP5585_RESET1_EVENT_C
#define ADP5585_RESET2_EVENT_A
#define ADP5585_RESET2_EVENT_B
#define ADP5585_RESET_CFG
#define ADP5585_PWM_OFFT_LOW
#define ADP5585_PWM_OFFT_HIGH
#define ADP5585_PWM_ONT_LOW
#define ADP5585_PWM_ONT_HIGH
#define ADP5585_PWM_CFG
#define ADP5585_LOGIC_CFG
#define ADP5585_LOGIC_FF_CFG
#define ADP5585_LOGIC_INT_EVENT_EN
#define ADP5585_POLL_PTIME_CFG
#define ADP5585_PIN_CONFIG_A
#define ADP5585_PIN_CONFIG_B
#define ADP5585_PIN_CONFIG_D
#define ADP5585_GENERAL_CFG
#define ADP5585_INT_EN

/* ID Register */
#define ADP5589_5_DEVICE_ID_MASK
#define ADP5589_5_MAN_ID_MASK
#define ADP5589_5_MAN_ID_SHIFT
#define ADP5589_5_MAN_ID

/* GENERAL_CFG Register */
#define OSC_EN
#define CORE_CLK(x)
#define LCK_TRK_LOGIC
#define LCK_TRK_GPI
#define INT_CFG
#define RST_CFG

/* INT_EN Register */
#define LOGIC2_IEN
#define LOGIC1_IEN
#define LOCK_IEN
#define OVRFLOW_IEN
#define GPI_IEN
#define EVENT_IEN

/* Interrupt Status Register */
#define LOGIC2_INT
#define LOGIC1_INT
#define LOCK_INT
#define OVRFLOW_INT
#define GPI_INT
#define EVENT_INT

/* STATUS Register */
#define LOGIC2_STAT
#define LOGIC1_STAT
#define LOCK_STAT
#define KEC

/* PIN_CONFIG_D Register */
#define C4_EXTEND_CFG
#define R4_EXTEND_CFG

/* LOCK_CFG */
#define LOCK_EN

#define PTIME_MASK
#define LTIME_MASK

/* Key Event Register xy */
#define KEY_EV_PRESSED
#define KEY_EV_MASK

#define KEYP_MAX_EVENT
#define ADP5589_MAXGPIO
#define ADP5585_MAXGPIO

enum {};

struct adp_constants {};

struct adp5589_kpad {};

/*
 *  ADP5589 / ADP5585 derivative / variant handling
 */


/* ADP5589 */

static unsigned char adp5589_bank(unsigned char offset)
{}

static unsigned char adp5589_bit(unsigned char offset)
{}

static unsigned char adp5589_reg(unsigned char reg)
{}

static const struct adp_constants const_adp5589 =;

/* ADP5585 */

static unsigned char adp5585_bank(unsigned char offset)
{}

static unsigned char adp5585_bit(unsigned char offset)
{}

static const unsigned char adp5585_reg_lut[] =;

static unsigned char adp5585_reg(unsigned char reg)
{}

static const struct adp_constants const_adp5585 =;

static int adp5589_read(struct i2c_client *client, u8 reg)
{}

static int adp5589_write(struct i2c_client *client, u8 reg, u8 val)
{}

#ifdef CONFIG_GPIOLIB
static int adp5589_gpio_get_value(struct gpio_chip *chip, unsigned off)
{}

static void adp5589_gpio_set_value(struct gpio_chip *chip,
				   unsigned off, int val)
{}

static int adp5589_gpio_direction_input(struct gpio_chip *chip, unsigned off)
{}

static int adp5589_gpio_direction_output(struct gpio_chip *chip,
					 unsigned off, int val)
{}

static int adp5589_build_gpiomap(struct adp5589_kpad *kpad,
				const struct adp5589_kpad_platform_data *pdata)
{}

static int adp5589_gpio_add(struct adp5589_kpad *kpad)
{}
#else
static inline int adp5589_gpio_add(struct adp5589_kpad *kpad)
{
	return 0;
}
#endif

static void adp5589_report_switches(struct adp5589_kpad *kpad,
				    int key, int key_val)
{}

static void adp5589_report_events(struct adp5589_kpad *kpad, int ev_cnt)
{}

static irqreturn_t adp5589_irq(int irq, void *handle)
{}

static int adp5589_get_evcode(struct adp5589_kpad *kpad, unsigned short key)
{}

static int adp5589_setup(struct adp5589_kpad *kpad)
{}

static void adp5589_report_switch_state(struct adp5589_kpad *kpad)
{}

static int adp5589_keypad_add(struct adp5589_kpad *kpad, unsigned int revid)
{}

static void adp5589_clear_config(void *data)
{}

static int adp5589_probe(struct i2c_client *client)
{}

static int adp5589_suspend(struct device *dev)
{}

static int adp5589_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(adp5589_dev_pm_ops, adp5589_suspend, adp5589_resume);

static const struct i2c_device_id adp5589_id[] =;

MODULE_DEVICE_TABLE(i2c, adp5589_id);

static struct i2c_driver adp5589_driver =;

module_i2c_driver();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();