#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/regmap.h>
#include <linux/of.h>
#include <linux/input/matrix_keypad.h>
#define PM8XXX_MAX_ROWS …
#define PM8XXX_MAX_COLS …
#define PM8XXX_ROW_SHIFT …
#define PM8XXX_MATRIX_MAX_SIZE …
#define PM8XXX_MIN_ROWS …
#define PM8XXX_MIN_COLS …
#define MAX_SCAN_DELAY …
#define MIN_SCAN_DELAY …
#define MAX_ROW_HOLD_DELAY …
#define MIN_ROW_HOLD_DELAY …
#define MAX_DEBOUNCE_TIME …
#define MIN_DEBOUNCE_TIME …
#define KEYP_CTRL …
#define KEYP_CTRL_EVNTS …
#define KEYP_CTRL_EVNTS_MASK …
#define KEYP_CTRL_SCAN_COLS_SHIFT …
#define KEYP_CTRL_SCAN_COLS_MIN …
#define KEYP_CTRL_SCAN_COLS_BITS …
#define KEYP_CTRL_SCAN_ROWS_SHIFT …
#define KEYP_CTRL_SCAN_ROWS_MIN …
#define KEYP_CTRL_SCAN_ROWS_BITS …
#define KEYP_CTRL_KEYP_EN …
#define KEYP_SCAN …
#define KEYP_SCAN_READ_STATE …
#define KEYP_SCAN_DBOUNCE_SHIFT …
#define KEYP_SCAN_PAUSE_SHIFT …
#define KEYP_SCAN_ROW_HOLD_SHIFT …
#define KEYP_TEST …
#define KEYP_TEST_CLEAR_RECENT_SCAN …
#define KEYP_TEST_CLEAR_OLD_SCAN …
#define KEYP_TEST_READ_RESET …
#define KEYP_TEST_DTEST_EN …
#define KEYP_TEST_ABORT_READ …
#define KEYP_TEST_DBG_SELECT_SHIFT …
#define KEYP_RECENT_DATA …
#define KEYP_OLD_DATA …
#define KEYP_CLOCK_FREQ …
struct pmic8xxx_kp { … };
static u8 pmic8xxx_col_state(struct pmic8xxx_kp *kp, u8 col)
{ … }
static int pmic8xxx_chk_sync_read(struct pmic8xxx_kp *kp)
{ … }
static int pmic8xxx_kp_read_data(struct pmic8xxx_kp *kp, u16 *state,
u16 data_reg, int read_rows)
{ … }
static int pmic8xxx_kp_read_matrix(struct pmic8xxx_kp *kp, u16 *new_state,
u16 *old_state)
{ … }
static void __pmic8xxx_kp_scan_matrix(struct pmic8xxx_kp *kp, u16 *new_state,
u16 *old_state)
{ … }
static bool pmic8xxx_detect_ghost_keys(struct pmic8xxx_kp *kp, u16 *new_state)
{ … }
static int pmic8xxx_kp_scan_matrix(struct pmic8xxx_kp *kp, unsigned int events)
{ … }
static irqreturn_t pmic8xxx_kp_stuck_irq(int irq, void *data)
{ … }
static irqreturn_t pmic8xxx_kp_irq(int irq, void *data)
{ … }
static int pmic8xxx_kpd_init(struct pmic8xxx_kp *kp,
struct platform_device *pdev)
{ … }
static int pmic8xxx_kp_enable(struct pmic8xxx_kp *kp)
{ … }
static int pmic8xxx_kp_disable(struct pmic8xxx_kp *kp)
{ … }
static int pmic8xxx_kp_open(struct input_dev *dev)
{ … }
static void pmic8xxx_kp_close(struct input_dev *dev)
{ … }
static int pmic8xxx_kp_probe(struct platform_device *pdev)
{ … }
static int pmic8xxx_kp_suspend(struct device *dev)
{ … }
static int pmic8xxx_kp_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops,
pmic8xxx_kp_suspend, pmic8xxx_kp_resume);
static const struct of_device_id pm8xxx_match_table[] = …;
MODULE_DEVICE_TABLE(of, pm8xxx_match_table);
static struct platform_driver pmic8xxx_kp_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;
MODULE_AUTHOR(…) …;