Skip to content

Commit aef01aa

Browse files
committed
Input: matrix-keypad - switch to using generic device properties
Instead of being OF-specific, let's switch to using generic device properties, which will make this code usable on ACPI, device tree and legacy boards that use property sets. As part of the change let's rename matrix_keypad_parse_of_params() to matrix_keypad_parse_properties(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent b1fe0cf commit aef01aa

File tree

12 files changed

+73
-84
lines changed

12 files changed

+73
-84
lines changed

drivers/input/keyboard/bcm-keypad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int bcm_kp_matrix_key_parse_dt(struct bcm_kp *kp)
213213
/* Initialize the KPCR Keypad Configuration Register */
214214
kp->kpcr = KPCR_STATUSFILTERENABLE | KPCR_COLFILTERENABLE;
215215

216-
error = matrix_keypad_parse_of_params(dev, &kp->n_rows, &kp->n_cols);
216+
error = matrix_keypad_parse_properties(dev, &kp->n_rows, &kp->n_cols);
217217
if (error) {
218218
dev_err(dev, "failed to parse kp params\n");
219219
return error;

drivers/input/keyboard/cros_ec_keyb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
229229
ckdev = devm_kzalloc(dev, sizeof(*ckdev), GFP_KERNEL);
230230
if (!ckdev)
231231
return -ENOMEM;
232-
err = matrix_keypad_parse_of_params(dev, &ckdev->rows, &ckdev->cols);
232+
233+
err = matrix_keypad_parse_properties(dev, &ckdev->rows, &ckdev->cols);
233234
if (err)
234235
return err;
235236

drivers/input/keyboard/lpc32xx-keys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int lpc32xx_parse_dt(struct device *dev,
145145
u32 rows = 0, columns = 0;
146146
int err;
147147

148-
err = matrix_keypad_parse_of_params(dev, &rows, &columns);
148+
err = matrix_keypad_parse_properties(dev, &rows, &columns);
149149
if (err)
150150
return err;
151151
if (rows != columns) {

drivers/input/keyboard/omap4-keypad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ static int omap4_keypad_parse_dt(struct device *dev,
223223
struct device_node *np = dev->of_node;
224224
int err;
225225

226-
err = matrix_keypad_parse_of_params(dev, &keypad_data->rows,
227-
&keypad_data->cols);
226+
err = matrix_keypad_parse_properties(dev, &keypad_data->rows,
227+
&keypad_data->cols);
228228
if (err)
229229
return err;
230230

drivers/input/keyboard/pmic8xxx-keypad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev)
515515
int rc;
516516
unsigned int ctrl_val;
517517

518-
rc = matrix_keypad_parse_of_params(&pdev->dev, &rows, &cols);
518+
rc = matrix_keypad_parse_properties(&pdev->dev, &rows, &cols);
519519
if (rc)
520520
return rc;
521521

drivers/input/keyboard/pxa27x_keypad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int pxa27x_keypad_matrix_key_parse_dt(struct pxa27x_keypad *keypad,
126126
u32 rows, cols;
127127
int error;
128128

129-
error = matrix_keypad_parse_of_params(dev, &rows, &cols);
129+
error = matrix_keypad_parse_properties(dev, &rows, &cols);
130130
if (error)
131131
return error;
132132

drivers/input/keyboard/st-keyscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ static int keypad_matrix_key_parse_dt(struct st_keyscan *keypad_data)
106106
struct device_node *np = dev->of_node;
107107
int error;
108108

109-
error = matrix_keypad_parse_of_params(dev, &keypad_data->n_rows,
110-
&keypad_data->n_cols);
109+
error = matrix_keypad_parse_properties(dev, &keypad_data->n_rows,
110+
&keypad_data->n_cols);
111111
if (error) {
112112
dev_err(dev, "failed to parse keypad params\n");
113113
return error;

drivers/input/keyboard/stmpe-keypad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static int stmpe_keypad_probe(struct platform_device *pdev)
354354
input->id.bustype = BUS_I2C;
355355
input->dev.parent = &pdev->dev;
356356

357-
error = matrix_keypad_parse_of_params(&pdev->dev, &rows, &cols);
357+
error = matrix_keypad_parse_properties(&pdev->dev, &rows, &cols);
358358
if (error)
359359
return error;
360360

drivers/input/keyboard/tca8418_keypad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
295295
struct device_node *np = dev->of_node;
296296
int err;
297297

298-
err = matrix_keypad_parse_of_params(dev, &rows, &cols);
298+
err = matrix_keypad_parse_properties(dev, &rows, &cols);
299299
if (err)
300300
return err;
301301
rep = of_property_read_bool(np, "keypad,autorepeat");

drivers/input/keyboard/twl4030_keypad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ static int twl4030_kp_probe(struct platform_device *pdev)
374374
kp->autorepeat = pdata->rep;
375375
keymap_data = pdata->keymap_data;
376376
} else {
377-
error = matrix_keypad_parse_of_params(&pdev->dev, &kp->n_rows,
378-
&kp->n_cols);
377+
error = matrix_keypad_parse_properties(&pdev->dev, &kp->n_rows,
378+
&kp->n_cols);
379379
if (error)
380380
return error;
381381

0 commit comments

Comments
 (0)