mfd: wm8994: remove dead legacy-gpio code
Subsystems (3)
PATCH 1/1 mfd: wm8994: remove dead legacy-gpio code
From: Arnd Bergmann <[email protected]>
The old-style gpio handling in wm8994 came from a commit 7c8844481a1c ("mfd: wm8994: Emulate level triggered interrupts if required") in linux-3.11, but nothing in the kernel ever set the 'irq_gpio' member in the wm8994_pdata structure, so this was always dead code.
Remove it now to reduce the dependency on the legacy gpio interfaces.
--- drivers/mfd/wm8994-irq.c | 94 ++------------------------------ include/linux/mfd/wm8994/pdata.h | 5 -- 2 files changed, 4 insertions(+), 95 deletions(-)
drivers/mfd/wm8994-irq.c +4 -90
@@ -135,53 +135,9 @@ static const struct regmap_irq_chip wm8994_irq_chip = { .runtime_pm = true, }; -static void wm8994_edge_irq_enable (struct irq_data *data) -{ -} - -static void wm8994_edge_irq_disable (struct irq_data *data) -{ -} - -static struct irq_chip wm8994_edge_irq_chip = { - .name ="wm8994_edge" , - .irq_disable = wm8994_edge_irq_disable, - .irq_enable = wm8994_edge_irq_enable, -}; - -static irqreturn_t wm8994_edge_irq (int irq,void *data) -{ -struct wm8994 *wm8994 = data; - -while (gpio_get_value_cansleep (wm8994->pdata.irq_gpio)) -handle_nested_irq (irq_find_mapping (wm8994->edge_irq,0 )); - -return IRQ_HANDLED ; -} - -static int wm8994_edge_irq_map (struct irq_domain *h,unsigned int virq, -irq_hw_number_t hw) -{ -struct wm8994 *wm8994 = h->host_data; - -irq_set_chip_data (virq, wm8994); -irq_set_chip_and_handler (virq, &wm8994_edge_irq_chip, handle_edge_irq); -irq_set_nested_thread (virq,1 ); -irq_set_noprobe (virq); - -return 0 ; -} - -static const struct irq_domain_ops wm8994_edge_irq_ops = { - .map = wm8994_edge_irq_map, - .xlate = irq_domain_xlate_twocell, -}; -int wm8994_irq_init (struct wm8994 *wm8994) {int ret; -unsigned long irqflags; -struct wm8994_pdata *pdata = &wm8994->pdata;if (!wm8994->irq) { dev_warn(wm8994->dev,
@@ -190,53 +146,11 @@ int wm8994_irq_init(struct wm8994 *wm8994)return 0 ; } -/* select user or default irq flags */ - irqflags =IRQF_TRIGGER_HIGH |IRQF_ONESHOT ; -if (pdata->irq_flags) - irqflags = pdata->irq_flags; -/* use a GPIO for edge triggered controllers */ -if (irqflags & (IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING )) { -if (gpio_to_irq (pdata->irq_gpio) != wm8994->irq) { -dev_warn (wm8994->dev,"IRQ %d is not GPIO %d (%d)\n" , - wm8994->irq, pdata->irq_gpio, -gpio_to_irq (pdata->irq_gpio)); - wm8994->irq =gpio_to_irq (pdata->irq_gpio); - } - - ret =devm_gpio_request_one (wm8994->dev, pdata->irq_gpio, -GPIOF_IN ,"WM8994 IRQ" ); - -if (ret !=0 ) { -dev_err (wm8994->dev,"Failed to get IRQ GPIO: %d\n" , - ret); -return ret; - } - - wm8994->edge_irq =irq_domain_create_linear (NULL ,1 , &wm8994_edge_irq_ops, wm8994); - - ret =regmap_add_irq_chip (wm8994->regmap, -irq_create_mapping (wm8994->edge_irq, -0 ), -IRQF_ONESHOT , - wm8994->irq_base, &wm8994_irq_chip, - &wm8994->irq_data); -if (ret !=0 ) { -dev_err (wm8994->dev,"Failed to get IRQ: %d\n" , - ret); -return ret; - } - - ret =request_threaded_irq (wm8994->irq, -NULL , wm8994_edge_irq, - irqflags, -"WM8994 edge" , wm8994); - }else { - ret =regmap_add_irq_chip (wm8994->regmap, wm8994->irq, - irqflags, - wm8994->irq_base, &wm8994_irq_chip, - &wm8994->irq_data); - } + ret =regmap_add_irq_chip (wm8994->regmap, wm8994->irq, +IRQF_TRIGGER_HIGH |IRQF_ONESHOT , + wm8994->irq_base, &wm8994_irq_chip, + &wm8994->irq_data);if (ret !=0 ) {dev_err (wm8994->dev,"Failed to register IRQ chip: %d\n" , ret);
include/linux/mfd/wm8994/pdata.h +0 -5
@@ -226,11 +226,6 @@ struct wm8994_pdata {* lines is mastered. */ int max_channels_clocked[WM8994_NUM_AIF]; - -/** -* GPIO for the IRQ pin if host only supports edge triggering -*/ - int irq_gpio; };#endif
Signature · 1 line
2.39.5
Quoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The old-style gpio handling in wm8994 came from a commit
7c8844481a1c("mfd: wm8994: Emulate level triggered interrupts if required") in linux-3.11, but nothing in the kernel ever set the 'irq_gpio' member in thewm8994_pdatastructure, so this was always dead code.Remove it now to reduce the dependency on the legacy gpio interfaces.
Reviewed-by Bartosz Golaszewski <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Yours,
Linus Walleij
Quoted 7 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The old-style gpio handling in wm8994 came from a commit
7c8844481a1c("mfd: wm8994: Emulate level triggered interrupts if required") in linux-3.11, but nothing in the kernel ever set the 'irq_gpio' member in thewm8994_pdatastructure, so this was always dead code.
Quoted 5 lines
Remove it now to reduce the dependency on the legacy gpio interfaces.
Reviewed-by Bartosz Golaszewski <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>---
wm8994 predates me a little so not really sure if this had users out of tree or not. But the part is probably old enough we can risk it here.
Thanks,
Charles
Re: (subset) [PATCH] mfd: wm8994: remove dead legacy-gpio code
In reply to Arnd BergmannQuoted 8 lines · Arnd Bergmann
The old-style gpio handling in wm8994 came from a commit
7c8844481a1c("mfd: wm8994: Emulate level triggered interrupts if required") in linux-3.11, but nothing in the kernel ever set the 'irq_gpio' member in thewm8994_pdatastructure, so this was always dead code.Remove it now to reduce the dependency on the legacy gpio interfaces.
[...]
Applied, thanks!
[1/1] mfd: wm8994: remove dead legacy-gpio code
commit: b0feaf240c31d48f6b2e74da2a604cfecce6c3c1
--
Lee Jones [李琼斯]