Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: matrix_keypad - remove support for clustered interrupt

There are no users of this functionality in the mainline kernel (it was
only available to boards using platform data and not device tree).
Remove it to simplify the code.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240805014710.1961677-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+24 -41
+24 -41
drivers/input/keyboard/matrix_keypad.c
··· 29 29 unsigned int row_shift; 30 30 31 31 unsigned int row_irqs[MATRIX_MAX_ROWS]; 32 - unsigned int num_row_irqs; 33 32 DECLARE_BITMAP(wakeup_enabled_irqs, MATRIX_MAX_ROWS); 34 33 35 34 uint32_t last_key_state[MATRIX_MAX_COLS]; ··· 87 88 { 88 89 int i; 89 90 90 - for (i = 0; i < keypad->num_row_irqs; i++) 91 + for (i = 0; i < keypad->pdata->num_row_gpios; i++) 91 92 enable_irq(keypad->row_irqs[i]); 92 93 } 93 94 ··· 95 96 { 96 97 int i; 97 98 98 - for (i = 0; i < keypad->num_row_irqs; i++) 99 + for (i = 0; i < keypad->pdata->num_row_gpios; i++) 99 100 disable_irq_nosync(keypad->row_irqs[i]); 100 101 } 101 102 ··· 224 225 { 225 226 int i; 226 227 227 - for_each_clear_bit(i, keypad->wakeup_enabled_irqs, keypad->num_row_irqs) 228 + for_each_clear_bit(i, keypad->wakeup_enabled_irqs, 229 + keypad->pdata->num_row_gpios) 228 230 if (enable_irq_wake(keypad->row_irqs[i]) == 0) 229 231 __set_bit(i, keypad->wakeup_enabled_irqs); 230 232 } ··· 234 234 { 235 235 int i; 236 236 237 - for_each_set_bit(i, keypad->wakeup_enabled_irqs, keypad->num_row_irqs) { 237 + for_each_set_bit(i, keypad->wakeup_enabled_irqs, 238 + keypad->pdata->num_row_gpios) { 238 239 disable_irq_wake(keypad->row_irqs[i]); 239 240 __clear_bit(i, keypad->wakeup_enabled_irqs); 240 241 } ··· 303 302 gpio_direction_input(pdata->row_gpios[i]); 304 303 } 305 304 306 - if (pdata->clustered_irq > 0) { 307 - err = devm_request_any_context_irq(&pdev->dev, 308 - pdata->clustered_irq, 309 - matrix_keypad_interrupt, 310 - pdata->clustered_irq_flags, 311 - "matrix-keypad", keypad); 312 - if (err < 0) { 305 + for (i = 0; i < pdata->num_row_gpios; i++) { 306 + irq = gpio_to_irq(pdata->row_gpios[i]); 307 + if (irq < 0) { 308 + err = irq; 313 309 dev_err(&pdev->dev, 314 - "Unable to acquire clustered interrupt\n"); 310 + "Unable to convert GPIO line %i to irq: %d\n", 311 + pdata->row_gpios[i], err); 315 312 return err; 316 313 } 317 314 318 - keypad->row_irqs[0] = pdata->clustered_irq; 319 - keypad->num_row_irqs = 1; 320 - } else { 321 - for (i = 0; i < pdata->num_row_gpios; i++) { 322 - irq = gpio_to_irq(pdata->row_gpios[i]); 323 - if (irq < 0) { 324 - err = irq; 325 - dev_err(&pdev->dev, 326 - "Unable to convert GPIO line %i to irq: %d\n", 327 - pdata->row_gpios[i], err); 328 - return err; 329 - } 330 - 331 - err = devm_request_any_context_irq(&pdev->dev, 332 - irq, 333 - matrix_keypad_interrupt, 334 - IRQF_TRIGGER_RISING | 335 - IRQF_TRIGGER_FALLING, 336 - "matrix-keypad", keypad); 337 - if (err < 0) { 338 - dev_err(&pdev->dev, 339 - "Unable to acquire interrupt for GPIO line %i\n", 340 - pdata->row_gpios[i]); 341 - return err; 342 - } 343 - 344 - keypad->row_irqs[i] = irq; 315 + err = devm_request_any_context_irq(&pdev->dev, 316 + irq, 317 + matrix_keypad_interrupt, 318 + IRQF_TRIGGER_RISING | 319 + IRQF_TRIGGER_FALLING, 320 + "matrix-keypad", keypad); 321 + if (err < 0) { 322 + dev_err(&pdev->dev, 323 + "Unable to acquire interrupt for GPIO line %i\n", 324 + pdata->row_gpios[i]); 325 + return err; 345 326 } 346 327 347 - keypad->num_row_irqs = pdata->num_row_gpios; 328 + keypad->row_irqs[i] = irq; 348 329 } 349 330 350 331 /* initialized as disabled - enabled by input->open */