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.

mfd: arizona: Make legacy gpiolib interface optional

The only machine that still uses the old gpio number based interface
is the wlf_cragg_6410 board file. In order to remove the dependency
on the interfaces, add #ifdef blocks here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250808151822.536879-13-arnd@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Arnd Bergmann and committed by
Lee Jones
9c5ad837 a5b03d81

+26 -2
+4 -1
drivers/mfd/arizona-irq.c
··· 136 136 dev_err(arizona->dev, 137 137 "Failed to read main IRQ status: %d\n", ret); 138 138 } 139 - 139 + #ifdef CONFIG_GPIOLIB_LEGACY 140 140 /* 141 141 * Poll the IRQ pin status to see if we're really done 142 142 * if the interrupt controller can't do it for us. ··· 150 150 !gpio_get_value_cansleep(arizona->pdata.irq_gpio)) { 151 151 poll = true; 152 152 } 153 + #endif 153 154 } while (poll); 154 155 155 156 pm_runtime_put_autosuspend(arizona->dev); ··· 350 349 goto err_map_main_irq; 351 350 } 352 351 352 + #ifdef CONFIG_GPIOLIB_LEGACY 353 353 /* Used to emulate edge trigger and to work around broken pinmux */ 354 354 if (arizona->pdata.irq_gpio) { 355 355 if (gpio_to_irq(arizona->pdata.irq_gpio) != arizona->irq) { ··· 370 368 arizona->pdata.irq_gpio = 0; 371 369 } 372 370 } 371 + #endif 373 372 374 373 ret = request_threaded_irq(arizona->irq, NULL, arizona_irq_thread, 375 374 flags, "arizona", arizona);
+6
include/linux/mfd/arizona/pdata.h
··· 117 117 /** Check for line output with HPDET method */ 118 118 bool hpdet_acc_id_line; 119 119 120 + #ifdef CONFIG_GPIOLIB_LEGACY 120 121 /** GPIO used for mic isolation with HPDET */ 121 122 int hpdet_id_gpio; 123 + #endif 122 124 123 125 /** Channel to use for headphone detection */ 124 126 unsigned int hpdet_channel; ··· 131 129 /** Extra debounce timeout used during initial mic detection (ms) */ 132 130 unsigned int micd_detect_debounce; 133 131 132 + #ifdef CONFIG_GPIOLIB_LEGACY 134 133 /** GPIO for mic detection polarity */ 135 134 int micd_pol_gpio; 135 + #endif 136 136 137 137 /** Mic detect ramp rate */ 138 138 unsigned int micd_bias_start_time; ··· 188 184 /** Haptic actuator type */ 189 185 unsigned int hap_act; 190 186 187 + #ifdef CONFIG_GPIOLIB_LEGACY 191 188 /** GPIO for primary IRQ (used for edge triggered emulation) */ 192 189 int irq_gpio; 190 + #endif 193 191 194 192 /** General purpose switch control */ 195 193 unsigned int gpsw;
+16 -1
sound/soc/codecs/arizona-jack.c
··· 461 461 bool *mic) 462 462 { 463 463 struct arizona *arizona = info->arizona; 464 + #ifdef CONFIG_GPIOLIB_LEGACY 464 465 int id_gpio = arizona->pdata.hpdet_id_gpio; 466 + #else 467 + int id_gpio = 0; 468 + #endif 465 469 466 470 if (!arizona->pdata.hpdet_acc_id) 467 471 return 0; ··· 476 472 */ 477 473 info->hpdet_res[info->num_hpdet_res++] = *reading; 478 474 475 + #ifdef CONFIG_GPIOLIB_LEGACY 479 476 /* Only check the mic directly if we didn't already ID it */ 480 477 if (id_gpio && info->num_hpdet_res == 1) { 481 478 dev_dbg(arizona->dev, "Measuring mic\n"); ··· 494 489 ARIZONA_HP_POLL, ARIZONA_HP_POLL); 495 490 return -EAGAIN; 496 491 } 492 + #endif 497 493 498 494 /* OK, got both. Now, compare... */ 499 495 dev_dbg(arizona->dev, "HPDET measured %d %d\n", ··· 535 529 { 536 530 struct arizona_priv *info = data; 537 531 struct arizona *arizona = info->arizona; 532 + #ifdef CONFIG_GPIOLIB_LEGACY 538 533 int id_gpio = arizona->pdata.hpdet_id_gpio; 534 + #endif 539 535 int ret, reading, state, report; 540 536 bool mic = false; 541 537 ··· 593 585 594 586 arizona_extcon_hp_clamp(info, false); 595 587 588 + #ifdef CONFIG_GPIOLIB_LEGACY 596 589 if (id_gpio) 597 590 gpio_set_value_cansleep(id_gpio, 0); 591 + #endif 598 592 599 593 /* If we have a mic then reenable MICDET */ 600 594 if (state && (mic || info->mic)) ··· 1327 1317 regmap_update_bits(arizona->regmap, ARIZONA_GP_SWITCH_1, 1328 1318 ARIZONA_SW1_MODE_MASK, arizona->pdata.gpsw); 1329 1319 1320 + #ifdef CONFIG_GPIOLIB_LEGACY 1330 1321 if (pdata->micd_pol_gpio > 0) { 1331 1322 if (info->micd_modes[0].gpio) 1332 1323 mode = GPIOF_OUT_INIT_HIGH; ··· 1343 1332 } 1344 1333 1345 1334 info->micd_pol_gpio = gpio_to_desc(pdata->micd_pol_gpio); 1346 - } else { 1335 + } else 1336 + #endif 1337 + { 1347 1338 if (info->micd_modes[0].gpio) 1348 1339 mode = GPIOD_OUT_HIGH; 1349 1340 else ··· 1366 1353 } 1367 1354 } 1368 1355 1356 + #ifdef CONFIG_GPIOLIB_LEGACY 1369 1357 if (arizona->pdata.hpdet_id_gpio > 0) { 1370 1358 ret = devm_gpio_request_one(dev, arizona->pdata.hpdet_id_gpio, 1371 1359 GPIOF_OUT_INIT_LOW, ··· 1378 1364 return ret; 1379 1365 } 1380 1366 } 1367 + #endif 1381 1368 1382 1369 return 0; 1383 1370 }