linux/drivers/input/keyboard/pxa27x_keypad.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * linux/drivers/input/keyboard/pxa27x_keypad.c
 *
 * Driver for the pxa27x matrix keyboard controller.
 *
 * Created:	Feb 22, 2007
 * Author:	Rodolfo Giometti <[email protected]>
 *
 * Based on a previous implementations by Kevin O'Connor
 * <kevin_at_koconnor.net> and Alex Osborne <[email protected]> and
 * on some suggestions by Nicolas Pitre <[email protected]>.
 */


#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/io.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/input/matrix_keypad.h>
#include <linux/slab.h>
#include <linux/of.h>

#include <linux/platform_data/keypad-pxa27x.h>
/*
 * Keypad Controller registers
 */
#define KPC
#define KPDK
#define KPREC
#define KPMK
#define KPAS

/* Keypad Automatic Scan Multiple Key Presser register 0-3 */
#define KPASMKP0
#define KPASMKP1
#define KPASMKP2
#define KPASMKP3
#define KPKDI

/* bit definitions */
#define KPC_MKRN(n)
#define KPC_MKCN(n)
#define KPC_DKN(n)

#define KPC_AS
#define KPC_ASACT
#define KPC_MI
#define KPC_IMKP

#define KPC_MS(n)
#define KPC_MS_ALL

#define KPC_ME
#define KPC_MIE
#define KPC_DK_DEB_SEL
#define KPC_DI
#define KPC_RE_ZERO_DEB
#define KPC_REE1
#define KPC_REE0
#define KPC_DE
#define KPC_DIE

#define KPDK_DKP
#define KPDK_DK(n)

#define KPREC_OF1
#define kPREC_UF1
#define KPREC_OF0
#define KPREC_UF0

#define KPREC_RECOUNT0(n)
#define KPREC_RECOUNT1(n)

#define KPMK_MKP
#define KPAS_SO
#define KPASMKPx_SO

#define KPAS_MUKP(n)
#define KPAS_RP(n)
#define KPAS_CP(n)

#define KPASMKP_MKC_MASK

#define keypad_readl(off)
#define keypad_writel(off, v)

#define MAX_MATRIX_KEY_NUM
#define MAX_KEYPAD_KEYS

struct pxa27x_keypad {};

#ifdef CONFIG_OF
static int pxa27x_keypad_matrix_key_parse_dt(struct pxa27x_keypad *keypad,
				struct pxa27x_keypad_platform_data *pdata)
{}

static int pxa27x_keypad_direct_key_parse_dt(struct pxa27x_keypad *keypad,
				struct pxa27x_keypad_platform_data *pdata)
{}

static int pxa27x_keypad_rotary_parse_dt(struct pxa27x_keypad *keypad,
				struct pxa27x_keypad_platform_data *pdata)
{}

static int pxa27x_keypad_build_keycode_from_dt(struct pxa27x_keypad *keypad)
{}

#else

static int pxa27x_keypad_build_keycode_from_dt(struct pxa27x_keypad *keypad)
{
	dev_info(keypad->input_dev->dev.parent, "missing platform data\n");

	return -EINVAL;
}

#endif

static int pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
{}

static void pxa27x_keypad_scan_matrix(struct pxa27x_keypad *keypad)
{}

#define DEFAULT_KPREC

static inline int rotary_delta(uint32_t kprec)
{}

static void report_rotary_event(struct pxa27x_keypad *keypad, int r, int delta)
{}

static void pxa27x_keypad_scan_rotary(struct pxa27x_keypad *keypad)
{}

static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad)
{}

static void clear_wakeup_event(struct pxa27x_keypad *keypad)
{}

static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id)
{}

static void pxa27x_keypad_config(struct pxa27x_keypad *keypad)
{}

static int pxa27x_keypad_open(struct input_dev *dev)
{}

static void pxa27x_keypad_close(struct input_dev *dev)
{}

static int pxa27x_keypad_suspend(struct device *dev)
{}

static int pxa27x_keypad_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops,
				pxa27x_keypad_suspend, pxa27x_keypad_resume);


static int pxa27x_keypad_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_OF
static const struct of_device_id pxa27x_keypad_dt_match[] =;
MODULE_DEVICE_TABLE(of, pxa27x_keypad_dt_match);
#endif

static struct platform_driver pxa27x_keypad_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();
/* work with hotplug and coldplug */
MODULE_ALIAS();