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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * File: drivers/input/keyboard/adp5588_keys.c
 * Description:  keypad driver for ADP5588 and ADP5587
 *		 I2C QWERTY Keypad and IO Expander
 * Bugs: Enter bugs at http://blackfin.uclinux.org/
 *
 * Copyright (C) 2008-2010 Analog Devices Inc.
 */

#include <linux/bits.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/matrix_keypad.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/ktime.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/timekeeping.h>

#define DEV_ID
#define CFG
#define INT_STAT
#define KEY_LCK_EC_STAT
#define KEY_EVENTA
#define KEY_EVENTB
#define KEY_EVENTC
#define KEY_EVENTD
#define KEY_EVENTE
#define KEY_EVENTF
#define KEY_EVENTG
#define KEY_EVENTH
#define KEY_EVENTI
#define KEY_EVENTJ
#define KP_LCK_TMR
#define UNLOCK1
#define UNLOCK2
#define GPIO_INT_STAT1
#define GPIO_INT_STAT2
#define GPIO_INT_STAT3
#define GPIO_DAT_STAT1
#define GPIO_DAT_STAT2
#define GPIO_DAT_STAT3
#define GPIO_DAT_OUT1
#define GPIO_DAT_OUT2
#define GPIO_DAT_OUT3
#define GPIO_INT_EN1
#define GPIO_INT_EN2
#define GPIO_INT_EN3
#define KP_GPIO1
#define KP_GPIO2
#define KP_GPIO3
#define GPI_EM1
#define GPI_EM2
#define GPI_EM3
#define GPIO_DIR1
#define GPIO_DIR2
#define GPIO_DIR3
#define GPIO_INT_LVL1
#define GPIO_INT_LVL2
#define GPIO_INT_LVL3
#define DEBOUNCE_DIS1
#define DEBOUNCE_DIS2
#define DEBOUNCE_DIS3
#define GPIO_PULL1
#define GPIO_PULL2
#define GPIO_PULL3
#define CMP_CFG_STAT
#define CMP_CONFG_SENS1
#define CMP_CONFG_SENS2
#define CMP1_LVL2_TRIP
#define CMP1_LVL2_HYS
#define CMP1_LVL3_TRIP
#define CMP1_LVL3_HYS
#define CMP2_LVL2_TRIP
#define CMP2_LVL2_HYS
#define CMP2_LVL3_TRIP
#define CMP2_LVL3_HYS
#define CMP1_ADC_DAT_R1
#define CMP1_ADC_DAT_R2
#define CMP2_ADC_DAT_R1
#define CMP2_ADC_DAT_R2

#define ADP5588_DEVICE_ID_MASK

 /* Configuration Register1 */
#define ADP5588_AUTO_INC
#define ADP5588_GPIEM_CFG
#define ADP5588_OVR_FLOW_M
#define ADP5588_INT_CFG
#define ADP5588_OVR_FLOW_IEN
#define ADP5588_K_LCK_IM
#define ADP5588_GPI_IEN
#define ADP5588_KE_IEN

/* Interrupt Status Register */
#define ADP5588_CMP2_INT
#define ADP5588_CMP1_INT
#define ADP5588_OVR_FLOW_INT
#define ADP5588_K_LCK_INT
#define ADP5588_GPI_INT
#define ADP5588_KE_INT

/* Key Lock and Event Counter Register */
#define ADP5588_K_LCK_EN
#define ADP5588_LCK21
#define ADP5588_KEC

#define ADP5588_MAXGPIO
#define ADP5588_BANK(offs)
#define ADP5588_BIT(offs)

/* Put one of these structures in i2c_board_info platform_data */

/*
 * 128 so it fits matrix-keymap maximum number of keys when the full
 * 10cols * 8rows are used.
 */
#define ADP5588_KEYMAPSIZE

#define GPI_PIN_ROW0
#define GPI_PIN_ROW1
#define GPI_PIN_ROW2
#define GPI_PIN_ROW3
#define GPI_PIN_ROW4
#define GPI_PIN_ROW5
#define GPI_PIN_ROW6
#define GPI_PIN_ROW7
#define GPI_PIN_COL0
#define GPI_PIN_COL1
#define GPI_PIN_COL2
#define GPI_PIN_COL3
#define GPI_PIN_COL4
#define GPI_PIN_COL5
#define GPI_PIN_COL6
#define GPI_PIN_COL7
#define GPI_PIN_COL8
#define GPI_PIN_COL9

#define GPI_PIN_ROW_BASE
#define GPI_PIN_ROW_END
#define GPI_PIN_COL_BASE
#define GPI_PIN_COL_END

#define GPI_PIN_BASE
#define GPI_PIN_END

#define ADP5588_ROWS_MAX
#define ADP5588_COLS_MAX

#define ADP5588_GPIMAPSIZE_MAX

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

#define KP_SEL(x)

#define KEYP_MAX_EVENT

/*
 * Early pre 4.0 Silicon required to delay readout by at least 25ms,
 * since the Event Counter Register updated 25ms after the interrupt
 * asserted.
 */
#define WA_DELAYED_READOUT_REVID(rev)
#define WA_DELAYED_READOUT_TIME

#define ADP5588_INVALID_HWIRQ

struct adp5588_kpad {};

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

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

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

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

static int adp5588_gpio_set_config(struct gpio_chip *chip,  unsigned int off,
				   unsigned long config)
{}

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

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

static int adp5588_build_gpiomap(struct adp5588_kpad *kpad)
{}

static void adp5588_irq_bus_lock(struct irq_data *d)
{}

static void adp5588_irq_bus_sync_unlock(struct irq_data *d)
{}

static void adp5588_irq_mask(struct irq_data *d)
{}

static void adp5588_irq_unmask(struct irq_data *d)
{}

static int adp5588_irq_set_type(struct irq_data *d, unsigned int type)
{}

static const struct irq_chip adp5588_irq_chip =;

static int adp5588_gpio_add(struct adp5588_kpad *kpad)
{}

static unsigned long adp5588_gpiomap_get_hwirq(struct device *dev,
					       const u8 *map, unsigned int gpio,
					       unsigned int ngpios)
{}

static void adp5588_gpio_irq_handle(struct adp5588_kpad *kpad, int key_val,
				    int key_press)
{}

static void adp5588_report_events(struct adp5588_kpad *kpad, int ev_cnt)
{}

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

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

static int adp5588_setup(struct adp5588_kpad *kpad)
{}

static int adp5588_fw_parse(struct adp5588_kpad *kpad)
{}

static int adp5588_probe(struct i2c_client *client)
{}

static void adp5588_remove(struct i2c_client *client)
{}

static int adp5588_suspend(struct device *dev)
{}

static int adp5588_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(adp5588_dev_pm_ops, adp5588_suspend, adp5588_resume);

static const struct i2c_device_id adp5588_id[] =;
MODULE_DEVICE_TABLE(i2c, adp5588_id);

static const struct of_device_id adp5588_of_match[] =;
MODULE_DEVICE_TABLE(of, adp5588_of_match);

static struct i2c_driver adp5588_driver =;

module_i2c_driver();

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