@@ -271,55 +271,6 @@ static int matrix_keypad_resume(struct device *dev)
271271static DEFINE_SIMPLE_DEV_PM_OPS (matrix_keypad_pm_ops ,
272272 matrix_keypad_suspend , matrix_keypad_resume ) ;
273273
274- static int matrix_keypad_init_pdata_gpio (struct platform_device * pdev ,
275- const struct matrix_keypad_platform_data * pdata ,
276- struct matrix_keypad * keypad )
277- {
278- int i , err ;
279-
280- keypad -> num_col_gpios = pdata -> num_col_gpios ;
281- keypad -> num_row_gpios = pdata -> num_row_gpios ;
282-
283- /* initialized strobe lines as outputs, activated */
284- for (i = 0 ; i < pdata -> num_col_gpios ; i ++ ) {
285- err = devm_gpio_request (& pdev -> dev ,
286- pdata -> col_gpios [i ], "matrix_kbd_col" );
287- if (err ) {
288- dev_err (& pdev -> dev ,
289- "failed to request GPIO%d for COL%d\n" ,
290- pdata -> col_gpios [i ], i );
291- return err ;
292- }
293-
294- keypad -> col_gpios [i ] = gpio_to_desc (pdata -> col_gpios [i ]);
295-
296- if (pdata -> active_low ^ gpiod_is_active_low (keypad -> col_gpios [i ]))
297- gpiod_toggle_active_low (keypad -> col_gpios [i ]);
298-
299- gpiod_direction_output (keypad -> col_gpios [i ], 1 );
300- }
301-
302- for (i = 0 ; i < pdata -> num_row_gpios ; i ++ ) {
303- err = devm_gpio_request (& pdev -> dev ,
304- pdata -> row_gpios [i ], "matrix_kbd_row" );
305- if (err ) {
306- dev_err (& pdev -> dev ,
307- "failed to request GPIO%d for ROW%d\n" ,
308- pdata -> row_gpios [i ], i );
309- return err ;
310- }
311-
312- keypad -> row_gpios [i ] = gpio_to_desc (pdata -> row_gpios [i ]);
313-
314- if (pdata -> active_low ^ gpiod_is_active_low (keypad -> row_gpios [i ]))
315- gpiod_toggle_active_low (keypad -> row_gpios [i ]);
316-
317- gpiod_direction_input (keypad -> row_gpios [i ]);
318- }
319-
320- return 0 ;
321- }
322-
323274static int matrix_keypad_init_gpio (struct platform_device * pdev ,
324275 struct matrix_keypad * keypad )
325276{
@@ -420,11 +371,8 @@ static int matrix_keypad_setup_interrupts(struct platform_device *pdev,
420371
421372static int matrix_keypad_probe (struct platform_device * pdev )
422373{
423- const struct matrix_keypad_platform_data * pdata =
424- dev_get_platdata (& pdev -> dev );
425374 struct matrix_keypad * keypad ;
426375 struct input_dev * input_dev ;
427- bool autorepeat ;
428376 bool wakeup ;
429377 int err ;
430378
@@ -448,16 +396,7 @@ static int matrix_keypad_probe(struct platform_device *pdev)
448396 device_property_read_u32 (& pdev -> dev , "col-scan-delay-us" ,
449397 & keypad -> col_scan_delay_us );
450398
451- if (pdata ) {
452- keypad -> col_scan_delay_us = pdata -> col_scan_delay_us ;
453- keypad -> debounce_ms = pdata -> debounce_ms ;
454- keypad -> drive_inactive_cols = pdata -> drive_inactive_cols ;
455- }
456-
457- if (pdata )
458- err = matrix_keypad_init_pdata_gpio (pdev , pdata , keypad );
459- else
460- err = matrix_keypad_init_gpio (pdev , keypad );
399+ err = matrix_keypad_init_gpio (pdev , keypad );
461400 if (err )
462401 return err ;
463402
@@ -472,8 +411,7 @@ static int matrix_keypad_probe(struct platform_device *pdev)
472411 input_dev -> open = matrix_keypad_start ;
473412 input_dev -> close = matrix_keypad_stop ;
474413
475- err = matrix_keypad_build_keymap (pdata ? pdata -> keymap_data : NULL ,
476- NULL ,
414+ err = matrix_keypad_build_keymap (NULL , NULL ,
477415 keypad -> num_row_gpios ,
478416 keypad -> num_col_gpios ,
479417 NULL , input_dev );
@@ -482,11 +420,7 @@ static int matrix_keypad_probe(struct platform_device *pdev)
482420 return - ENOMEM ;
483421 }
484422
485- autorepeat = !device_property_read_bool (& pdev -> dev ,
486- "linux,no-autorepeat" );
487- if (autorepeat && pdata -> no_autorepeat )
488- autorepeat = false;
489- if (autorepeat )
423+ if (!device_property_read_bool (& pdev -> dev , "linux,no-autorepeat" ))
490424 __set_bit (EV_REP , input_dev -> evbit );
491425
492426 input_set_capability (input_dev , EV_MSC , MSC_SCAN );
@@ -499,8 +433,6 @@ static int matrix_keypad_probe(struct platform_device *pdev)
499433 wakeup = device_property_read_bool (& pdev -> dev , "wakeup-source" ) ||
500434 /* legacy */
501435 device_property_read_bool (& pdev -> dev , "linux,wakeup" );
502- if (!wakeup && pdata )
503- wakeup = pdata -> wakeup ;
504436 device_init_wakeup (& pdev -> dev , wakeup );
505437
506438 platform_set_drvdata (pdev , keypad );
0 commit comments