Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (C) ST-Ericsson SA 2010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/input/matrix_keypad.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/mfd/stmpe.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) /* These are at the same addresses in all STMPE variants */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #define STMPE_KPC_COL			0x60
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #define STMPE_KPC_ROW_MSB		0x61
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #define STMPE_KPC_ROW_LSB		0x62
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define STMPE_KPC_CTRL_MSB		0x63
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define STMPE_KPC_CTRL_LSB		0x64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define STMPE_KPC_COMBI_KEY_0		0x65
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #define STMPE_KPC_COMBI_KEY_1		0x66
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define STMPE_KPC_COMBI_KEY_2		0x67
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define STMPE_KPC_DATA_BYTE0		0x68
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #define STMPE_KPC_DATA_BYTE1		0x69
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define STMPE_KPC_DATA_BYTE2		0x6a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #define STMPE_KPC_DATA_BYTE3		0x6b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #define STMPE_KPC_DATA_BYTE4		0x6c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define STMPE_KPC_CTRL_LSB_SCAN		(0x1 << 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #define STMPE_KPC_CTRL_LSB_DEBOUNCE	(0x7f << 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) #define STMPE_KPC_CTRL_MSB_SCAN_COUNT	(0xf << 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #define STMPE_KPC_ROW_MSB_ROWS		0xff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define STMPE_KPC_DATA_UP		(0x1 << 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #define STMPE_KPC_DATA_ROW		(0xf << 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) #define STMPE_KPC_DATA_COL		(0x7 << 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #define STMPE_KPC_DATA_NOKEY_MASK	0x78
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #define STMPE_KEYPAD_MAX_DEBOUNCE	127
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) #define STMPE_KEYPAD_MAX_SCAN_COUNT	15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) #define STMPE_KEYPAD_MAX_ROWS		8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) #define STMPE_KEYPAD_MAX_COLS		8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) #define STMPE_KEYPAD_ROW_SHIFT		3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) #define STMPE_KEYPAD_KEYMAP_MAX_SIZE \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	(STMPE_KEYPAD_MAX_ROWS * STMPE_KEYPAD_MAX_COLS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) #define STMPE1601_NUM_DATA	5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) #define STMPE2401_NUM_DATA	3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) #define STMPE2403_NUM_DATA	5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) /* Make sure it covers all cases above */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) #define MAX_NUM_DATA		5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)  * struct stmpe_keypad_variant - model-specific attributes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)  * @auto_increment: whether the KPC_DATA_BYTE register address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  *		    auto-increments on multiple read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  * @set_pullup: whether the pins need to have their pull-ups set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  * @num_data: number of data bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)  * @num_normal_data: number of normal keys' data bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)  * @max_cols: maximum number of columns supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)  * @max_rows: maximum number of rows supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)  * @col_gpios: bitmask of gpios which can be used for columns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)  * @row_gpios: bitmask of gpios which can be used for rows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) struct stmpe_keypad_variant {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	bool		auto_increment;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	bool		set_pullup;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	int		num_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	int		num_normal_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	int		max_cols;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	int		max_rows;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	unsigned int	col_gpios;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	unsigned int	row_gpios;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) static const struct stmpe_keypad_variant stmpe_keypad_variants[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	[STMPE1601] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		.auto_increment		= true,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		.num_data		= STMPE1601_NUM_DATA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		.num_normal_data	= 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		.max_cols		= 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		.max_rows		= 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		.col_gpios		= 0x000ff,	/* GPIO 0 - 7 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		.row_gpios		= 0x0ff00,	/* GPIO 8 - 15 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	[STMPE2401] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		.auto_increment		= false,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		.set_pullup		= true,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		.num_data		= STMPE2401_NUM_DATA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		.num_normal_data	= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		.max_cols		= 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		.max_rows		= 12,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		.col_gpios		= 0x0000ff,	/* GPIO 0 - 7*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		.row_gpios		= 0x1f7f00,	/* GPIO 8-14, 16-20 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	[STMPE2403] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		.auto_increment		= true,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		.set_pullup		= true,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 		.num_data		= STMPE2403_NUM_DATA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		.num_normal_data	= 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		.max_cols		= 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		.max_rows		= 12,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		.col_gpios		= 0x0000ff,	/* GPIO 0 - 7*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		.row_gpios		= 0x1fef00,	/* GPIO 8-14, 16-20 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)  * struct stmpe_keypad - STMPE keypad state container
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  * @stmpe: pointer to parent STMPE device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  * @input: spawned input device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  * @variant: STMPE variant
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  * @debounce_ms: debounce interval, in ms.  Maximum is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)  *		 %STMPE_KEYPAD_MAX_DEBOUNCE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)  * @scan_count: number of key scanning cycles to confirm key data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)  *		Maximum is %STMPE_KEYPAD_MAX_SCAN_COUNT.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)  * @no_autorepeat: disable key autorepeat
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)  * @rows: bitmask for the rows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)  * @cols: bitmask for the columns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)  * @keymap: the keymap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) struct stmpe_keypad {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	struct stmpe *stmpe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	struct input_dev *input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	const struct stmpe_keypad_variant *variant;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	unsigned int debounce_ms;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	unsigned int scan_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	bool no_autorepeat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	unsigned int rows;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	unsigned int cols;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	unsigned short keymap[STMPE_KEYPAD_KEYMAP_MAX_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) static int stmpe_keypad_read_data(struct stmpe_keypad *keypad, u8 *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	const struct stmpe_keypad_variant *variant = keypad->variant;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	struct stmpe *stmpe = keypad->stmpe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	if (variant->auto_increment)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		return stmpe_block_read(stmpe, STMPE_KPC_DATA_BYTE0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 					variant->num_data, data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	for (i = 0; i < variant->num_data; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		ret = stmpe_reg_read(stmpe, STMPE_KPC_DATA_BYTE0 + i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 			return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		data[i] = ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) static irqreturn_t stmpe_keypad_irq(int irq, void *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	struct stmpe_keypad *keypad = dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	struct input_dev *input = keypad->input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	const struct stmpe_keypad_variant *variant = keypad->variant;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	u8 fifo[MAX_NUM_DATA];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	ret = stmpe_keypad_read_data(keypad, fifo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		return IRQ_NONE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	for (i = 0; i < variant->num_normal_data; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		u8 data = fifo[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		int row = (data & STMPE_KPC_DATA_ROW) >> 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		int col = data & STMPE_KPC_DATA_COL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		int code = MATRIX_SCAN_CODE(row, col, STMPE_KEYPAD_ROW_SHIFT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		bool up = data & STMPE_KPC_DATA_UP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		if ((data & STMPE_KPC_DATA_NOKEY_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 			== STMPE_KPC_DATA_NOKEY_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		input_event(input, EV_MSC, MSC_SCAN, code);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		input_report_key(input, keypad->keymap[code], !up);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		input_sync(input);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	return IRQ_HANDLED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) static int stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	const struct stmpe_keypad_variant *variant = keypad->variant;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	unsigned int col_gpios = variant->col_gpios;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	unsigned int row_gpios = variant->row_gpios;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	struct stmpe *stmpe = keypad->stmpe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	u8 pureg = stmpe->regs[STMPE_IDX_GPPUR_LSB];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	unsigned int pins = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	unsigned int pu_pins = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	 * Figure out which pins need to be set to the keypad alternate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	 * function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	 * {cols,rows}_gpios are bitmasks of which pins on the chip can be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	 * for the keypad.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	 * keypad->{cols,rows} are a bitmask of which pins (of the ones useable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	 * for the keypad) are used on the board.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	for (i = 0; i < variant->max_cols; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 		int num = __ffs(col_gpios);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		if (keypad->cols & (1 << i)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 			pins |= 1 << num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 			pu_pins |= 1 << num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 		col_gpios &= ~(1 << num);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	for (i = 0; i < variant->max_rows; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 		int num = __ffs(row_gpios);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		if (keypad->rows & (1 << i))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 			pins |= 1 << num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 		row_gpios &= ~(1 << num);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	ret = stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	 * On STMPE24xx, set pin bias to pull-up on all keypad input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	 * pins (columns), this incidentally happen to be maximum 8 pins
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	 * and placed at GPIO0-7 so only the LSB of the pull up register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	 * ever needs to be written.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	if (variant->set_pullup) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 		u8 val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 		ret = stmpe_reg_read(stmpe, pureg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 		if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 			return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 		/* Do not touch unused pins, may be used for GPIO */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 		val = ret & ~pu_pins;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 		val |= pu_pins;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 		ret = stmpe_reg_write(stmpe, pureg, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	const struct stmpe_keypad_variant *variant = keypad->variant;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	struct stmpe *stmpe = keypad->stmpe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	if (keypad->debounce_ms > STMPE_KEYPAD_MAX_DEBOUNCE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	if (keypad->scan_count > STMPE_KEYPAD_MAX_SCAN_COUNT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	ret = stmpe_enable(stmpe, STMPE_BLOCK_KEYPAD);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 	ret = stmpe_keypad_altfunc_init(keypad);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	ret = stmpe_reg_write(stmpe, STMPE_KPC_COL, keypad->cols);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	ret = stmpe_reg_write(stmpe, STMPE_KPC_ROW_LSB, keypad->rows);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	if (variant->max_rows > 8) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 		ret = stmpe_set_bits(stmpe, STMPE_KPC_ROW_MSB,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 				     STMPE_KPC_ROW_MSB_ROWS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 				     keypad->rows >> 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 		if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 			return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 	ret = stmpe_set_bits(stmpe, STMPE_KPC_CTRL_MSB,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 			     STMPE_KPC_CTRL_MSB_SCAN_COUNT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 			     keypad->scan_count << 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 	if (ret < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 	return stmpe_set_bits(stmpe, STMPE_KPC_CTRL_LSB,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 			      STMPE_KPC_CTRL_LSB_SCAN |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 			      STMPE_KPC_CTRL_LSB_DEBOUNCE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 			      STMPE_KPC_CTRL_LSB_SCAN |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 			      (keypad->debounce_ms << 1));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 					u32 used_rows, u32 used_cols)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	int row, col;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	for (row = 0; row < used_rows; row++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 		for (col = 0; col < used_cols; col++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 			int code = MATRIX_SCAN_CODE(row, col,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 						    STMPE_KEYPAD_ROW_SHIFT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 			if (keypad->keymap[code] != KEY_RESERVED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 				keypad->rows |= 1 << row;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 				keypad->cols |= 1 << col;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) static int stmpe_keypad_probe(struct platform_device *pdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 	struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 	struct device_node *np = pdev->dev.of_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 	struct stmpe_keypad *keypad;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 	struct input_dev *input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	u32 rows;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 	u32 cols;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	int error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 	int irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 	irq = platform_get_irq(pdev, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	if (irq < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 		return irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 	keypad = devm_kzalloc(&pdev->dev, sizeof(struct stmpe_keypad),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 			      GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 	if (!keypad)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 	keypad->stmpe = stmpe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 	keypad->variant = &stmpe_keypad_variants[stmpe->partnum];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	of_property_read_u32(np, "debounce-interval", &keypad->debounce_ms);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	of_property_read_u32(np, "st,scan-count", &keypad->scan_count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 	keypad->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 	input = devm_input_allocate_device(&pdev->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 	if (!input)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 	input->name = "STMPE keypad";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 	input->id.bustype = BUS_I2C;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 	input->dev.parent = &pdev->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	error = matrix_keypad_parse_properties(&pdev->dev, &rows, &cols);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 	if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 		return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	error = matrix_keypad_build_keymap(NULL, NULL, rows, cols,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 					   keypad->keymap, input);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 	if (error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 		return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	input_set_capability(input, EV_MSC, MSC_SCAN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 	if (!keypad->no_autorepeat)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 		__set_bit(EV_REP, input->evbit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 	stmpe_keypad_fill_used_pins(keypad, rows, cols);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 	keypad->input = input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	error = stmpe_keypad_chip_init(keypad);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 	if (error < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 		return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	error = devm_request_threaded_irq(&pdev->dev, irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 					  NULL, stmpe_keypad_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 					  IRQF_ONESHOT, "stmpe-keypad", keypad);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 	if (error) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 		dev_err(&pdev->dev, "unable to get irq: %d\n", error);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 		return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	error = input_register_device(input);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	if (error) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 		dev_err(&pdev->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 			"unable to register input device: %d\n", error);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 		return error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	platform_set_drvdata(pdev, keypad);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) static int stmpe_keypad_remove(struct platform_device *pdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 	struct stmpe_keypad *keypad = platform_get_drvdata(pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) static struct platform_driver stmpe_keypad_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	.driver.name	= "stmpe-keypad",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	.driver.owner	= THIS_MODULE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 	.probe		= stmpe_keypad_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 	.remove		= stmpe_keypad_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) module_platform_driver(stmpe_keypad_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) MODULE_LICENSE("GPL v2");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) MODULE_DESCRIPTION("STMPExxxx keypad driver");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) MODULE_AUTHOR("Rabin Vincent <rabin.vincent@stericsson.com>");