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)  * LM8333 keypad driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (C) 2012 Wolfram Sang, Pengutronix <kernel@pengutronix.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/i2c.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/input/matrix_keypad.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/input/lm8333.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #define LM8333_FIFO_READ		0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #define LM8333_DEBOUNCE			0x22
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #define LM8333_READ_INT			0xD0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #define LM8333_ACTIVE			0xE4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #define LM8333_READ_ERROR		0xF0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define LM8333_KEYPAD_IRQ		(1 << 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define LM8333_ERROR_IRQ		(1 << 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define LM8333_ERROR_KEYOVR		0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define LM8333_ERROR_FIFOOVR		0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define LM8333_FIFO_TRANSFER_SIZE	16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #define LM8333_NUM_ROWS		8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #define LM8333_NUM_COLS		16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #define LM8333_ROW_SHIFT	4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) struct lm8333 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	struct i2c_client *client;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	struct input_dev *input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	unsigned short keycodes[LM8333_NUM_ROWS << LM8333_ROW_SHIFT];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) /* The accessors try twice because the first access may be needed for wakeup */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #define LM8333_READ_RETRIES 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) int lm8333_read8(struct lm8333 *lm8333, u8 cmd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	int retries = 0, ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		ret = i2c_smbus_read_byte_data(lm8333->client, cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	} while (ret < 0 && retries++ < LM8333_READ_RETRIES);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) int lm8333_write8(struct lm8333 *lm8333, u8 cmd, u8 val)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	int retries = 0, ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		ret = i2c_smbus_write_byte_data(lm8333->client, cmd, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	} while (ret < 0 && retries++ < LM8333_READ_RETRIES);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) int lm8333_read_block(struct lm8333 *lm8333, u8 cmd, u8 len, u8 *buf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	int retries = 0, ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		ret = i2c_smbus_read_i2c_block_data(lm8333->client,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 						    cmd, len, buf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	} while (ret < 0 && retries++ < LM8333_READ_RETRIES);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) static void lm8333_key_handler(struct lm8333 *lm8333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	struct input_dev *input = lm8333->input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	u8 keys[LM8333_FIFO_TRANSFER_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	u8 code, pressed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	int i, ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	ret = lm8333_read_block(lm8333, LM8333_FIFO_READ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 				LM8333_FIFO_TRANSFER_SIZE, keys);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	if (ret != LM8333_FIFO_TRANSFER_SIZE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		dev_err(&lm8333->client->dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 			"Error %d while reading FIFO\n", ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	for (i = 0; i < LM8333_FIFO_TRANSFER_SIZE && keys[i]; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		pressed = keys[i] & 0x80;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		code = keys[i] & 0x7f;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		input_event(input, EV_MSC, MSC_SCAN, code);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		input_report_key(input, lm8333->keycodes[code], pressed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	input_sync(input);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) static irqreturn_t lm8333_irq_thread(int irq, void *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	struct lm8333 *lm8333 = data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	u8 status = lm8333_read8(lm8333, LM8333_READ_INT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	if (!status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		return IRQ_NONE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	if (status & LM8333_ERROR_IRQ) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		u8 err = lm8333_read8(lm8333, LM8333_READ_ERROR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		if (err & (LM8333_ERROR_KEYOVR | LM8333_ERROR_FIFOOVR)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 			u8 dummy[LM8333_FIFO_TRANSFER_SIZE];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 			lm8333_read_block(lm8333, LM8333_FIFO_READ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 					LM8333_FIFO_TRANSFER_SIZE, dummy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		dev_err(&lm8333->client->dev, "Got error %02x\n", err);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	if (status & LM8333_KEYPAD_IRQ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		lm8333_key_handler(lm8333);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	return IRQ_HANDLED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) static int lm8333_probe(struct i2c_client *client,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 				  const struct i2c_device_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	const struct lm8333_platform_data *pdata =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 			dev_get_platdata(&client->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	struct lm8333 *lm8333;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	struct input_dev *input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	int err, active_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	if (!pdata)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	active_time = pdata->active_time ?: 500;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	if (active_time / 3 <= pdata->debounce_time / 3) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		dev_err(&client->dev, "Active time not big enough!\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	lm8333 = kzalloc(sizeof(*lm8333), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	input = input_allocate_device();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	if (!lm8333 || !input) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		err = -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		goto free_mem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	lm8333->client = client;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	lm8333->input = input;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	input->name = client->name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	input->dev.parent = &client->dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	input->id.bustype = BUS_I2C;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	input_set_capability(input, EV_MSC, MSC_SCAN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	err = matrix_keypad_build_keymap(pdata->matrix_data, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 					 LM8333_NUM_ROWS, LM8333_NUM_COLS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 					 lm8333->keycodes, input);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		goto free_mem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	if (pdata->debounce_time) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		err = lm8333_write8(lm8333, LM8333_DEBOUNCE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 				    pdata->debounce_time / 3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 		if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 			dev_warn(&client->dev, "Unable to set debounce time\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	if (pdata->active_time) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 		err = lm8333_write8(lm8333, LM8333_ACTIVE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 				    pdata->active_time / 3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 		if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 			dev_warn(&client->dev, "Unable to set active time\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	err = request_threaded_irq(client->irq, NULL, lm8333_irq_thread,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 				   "lm8333", lm8333);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		goto free_mem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	err = input_register_device(input);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		goto free_irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	i2c_set_clientdata(client, lm8333);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)  free_irq:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	free_irq(client->irq, lm8333);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)  free_mem:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	input_free_device(input);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	kfree(lm8333);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) static int lm8333_remove(struct i2c_client *client)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	struct lm8333 *lm8333 = i2c_get_clientdata(client);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	free_irq(client->irq, lm8333);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	input_unregister_device(lm8333->input);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	kfree(lm8333);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) static const struct i2c_device_id lm8333_id[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	{ "lm8333", 0 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	{ }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) MODULE_DEVICE_TABLE(i2c, lm8333_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) static struct i2c_driver lm8333_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	.driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		.name		= "lm8333",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	.probe		= lm8333_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	.remove		= lm8333_remove,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	.id_table	= lm8333_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) module_i2c_driver(lm8333_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) MODULE_AUTHOR("Wolfram Sang <kernel@pengutronix.de>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) MODULE_DESCRIPTION("LM8333 keyboard driver");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) MODULE_LICENSE("GPL v2");