Skip to content

Commit e53c18d

Browse files
Linus Walleijdtor
authored andcommitted
Input: omap-keypad - drop optional GPIO support
The driver supports passing some GPIO lines for rows and columns through the driver data, but there is no in-kernel user of this. Further the use seems convoluted because the GPIO lines are unused in the driver, then explicitly free:ed when removing it without being requested when probing it, which is assymetric and just a recepie for disaster. Remove the support for these unused GPIOs, if need be support can be reestablished in an organized fashion using GPIO descriptors. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20231129-descriptors-input-v1-3-9433162914a3@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 1ba05c9 commit e53c18d

2 files changed

Lines changed: 1 addition & 21 deletions

File tree

drivers/input/keyboard/omap-keypad.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <linux/mutex.h>
2222
#include <linux/errno.h>
2323
#include <linux/slab.h>
24-
#include <linux/gpio.h>
2524
#include <linux/platform_data/gpio-omap.h>
2625
#include <linux/platform_data/keypad-omap.h>
2726
#include <linux/soc/ti/omap1-io.h>
@@ -49,9 +48,6 @@ struct omap_kp {
4948

5049
static DECLARE_TASKLET_DISABLED_OLD(kp_tasklet, omap_kp_tasklet);
5150

52-
static unsigned int *row_gpios;
53-
static unsigned int *col_gpios;
54-
5551
static irqreturn_t omap_kp_interrupt(int irq, void *dev_id)
5652
{
5753
/* disable keyboard interrupt and schedule for handling */
@@ -180,7 +176,7 @@ static int omap_kp_probe(struct platform_device *pdev)
180176
struct omap_kp *omap_kp;
181177
struct input_dev *input_dev;
182178
struct omap_kp_platform_data *pdata = dev_get_platdata(&pdev->dev);
183-
int i, col_idx, row_idx, ret;
179+
int ret;
184180
unsigned int row_shift, keycodemax;
185181

186182
if (!pdata->rows || !pdata->cols || !pdata->keymap_data) {
@@ -209,17 +205,9 @@ static int omap_kp_probe(struct platform_device *pdev)
209205
if (pdata->delay)
210206
omap_kp->delay = pdata->delay;
211207

212-
if (pdata->row_gpios && pdata->col_gpios) {
213-
row_gpios = pdata->row_gpios;
214-
col_gpios = pdata->col_gpios;
215-
}
216-
217208
omap_kp->rows = pdata->rows;
218209
omap_kp->cols = pdata->cols;
219210

220-
col_idx = 0;
221-
row_idx = 0;
222-
223211
timer_setup(&omap_kp->timer, omap_kp_timer, 0);
224212

225213
/* get the irq and init timer*/
@@ -276,11 +264,6 @@ static int omap_kp_probe(struct platform_device *pdev)
276264
err3:
277265
device_remove_file(&pdev->dev, &dev_attr_enable);
278266
err2:
279-
for (i = row_idx - 1; i >= 0; i--)
280-
gpio_free(row_gpios[i]);
281-
for (i = col_idx - 1; i >= 0; i--)
282-
gpio_free(col_gpios[i]);
283-
284267
kfree(omap_kp);
285268
input_free_device(input_dev);
286269

include/linux/platform_data/keypad-omap.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ struct omap_kp_platform_data {
1919
bool rep;
2020
unsigned long delay;
2121
bool dbounce;
22-
/* specific to OMAP242x*/
23-
unsigned int *row_gpios;
24-
unsigned int *col_gpios;
2522
};
2623

2724
/* Group (0..3) -- when multiple keys are pressed, only the

0 commit comments

Comments
 (0)