linux/drivers/input/keyboard/stmpe-keypad.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) ST-Ericsson SA 2010
 *
 * Author: Rabin Vincent <[email protected]> for ST-Ericsson
 */

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/input/matrix_keypad.h>
#include <linux/mfd/stmpe.h>

/* These are at the same addresses in all STMPE variants */
#define STMPE_KPC_COL
#define STMPE_KPC_ROW_MSB
#define STMPE_KPC_ROW_LSB
#define STMPE_KPC_CTRL_MSB
#define STMPE_KPC_CTRL_LSB
#define STMPE_KPC_COMBI_KEY_0
#define STMPE_KPC_COMBI_KEY_1
#define STMPE_KPC_COMBI_KEY_2
#define STMPE_KPC_DATA_BYTE0
#define STMPE_KPC_DATA_BYTE1
#define STMPE_KPC_DATA_BYTE2
#define STMPE_KPC_DATA_BYTE3
#define STMPE_KPC_DATA_BYTE4

#define STMPE_KPC_CTRL_LSB_SCAN
#define STMPE_KPC_CTRL_LSB_DEBOUNCE
#define STMPE_KPC_CTRL_MSB_SCAN_COUNT

#define STMPE_KPC_ROW_MSB_ROWS

#define STMPE_KPC_DATA_UP
#define STMPE_KPC_DATA_ROW
#define STMPE_KPC_DATA_COL
#define STMPE_KPC_DATA_NOKEY_MASK

#define STMPE_KEYPAD_MAX_DEBOUNCE
#define STMPE_KEYPAD_MAX_SCAN_COUNT

#define STMPE_KEYPAD_MAX_ROWS
#define STMPE_KEYPAD_MAX_COLS
#define STMPE_KEYPAD_ROW_SHIFT
#define STMPE_KEYPAD_KEYMAP_MAX_SIZE


#define STMPE1601_NUM_DATA
#define STMPE2401_NUM_DATA
#define STMPE2403_NUM_DATA

/* Make sure it covers all cases above */
#define MAX_NUM_DATA

/**
 * struct stmpe_keypad_variant - model-specific attributes
 * @auto_increment: whether the KPC_DATA_BYTE register address
 *		    auto-increments on multiple read
 * @set_pullup: whether the pins need to have their pull-ups set
 * @num_data: number of data bytes
 * @num_normal_data: number of normal keys' data bytes
 * @max_cols: maximum number of columns supported
 * @max_rows: maximum number of rows supported
 * @col_gpios: bitmask of gpios which can be used for columns
 * @row_gpios: bitmask of gpios which can be used for rows
 */
struct stmpe_keypad_variant {};

static const struct stmpe_keypad_variant stmpe_keypad_variants[] =;

/**
 * struct stmpe_keypad - STMPE keypad state container
 * @stmpe: pointer to parent STMPE device
 * @input: spawned input device
 * @variant: STMPE variant
 * @debounce_ms: debounce interval, in ms.  Maximum is
 *		 %STMPE_KEYPAD_MAX_DEBOUNCE.
 * @scan_count: number of key scanning cycles to confirm key data.
 *		Maximum is %STMPE_KEYPAD_MAX_SCAN_COUNT.
 * @no_autorepeat: disable key autorepeat
 * @rows: bitmask for the rows
 * @cols: bitmask for the columns
 * @keymap: the keymap
 */
struct stmpe_keypad {};

static int stmpe_keypad_read_data(struct stmpe_keypad *keypad, u8 *data)
{}

static irqreturn_t stmpe_keypad_irq(int irq, void *dev)
{}

static int stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad)
{}

static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad)
{}

static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad,
					u32 used_rows, u32 used_cols)
{}

static int stmpe_keypad_probe(struct platform_device *pdev)
{}

static void stmpe_keypad_remove(struct platform_device *pdev)
{}

static struct platform_driver stmpe_keypad_driver =;
module_platform_driver();

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