net: ipa: kill ipa_interrupt_add()
The dynamic assignment of IPA interrupt handlers isn't needed; we only handle three IPA interrupt types, and their handler functions are now assigned directly. We can get rid of ipa_interrupt_add() and ipa_interrupt_remove() now, because they serve no purpose. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
482ae3a993
commit
8d8d3f1a3e
|
@ -30,6 +30,8 @@
|
|||
#include "ipa_uc.h"
|
||||
#include "ipa_interrupt.h"
|
||||
|
||||
typedef void (*ipa_irq_handler_t)(struct ipa *ipa, enum ipa_irq_id irq_id);
|
||||
|
||||
/**
|
||||
* struct ipa_interrupt - IPA interrupt information
|
||||
* @ipa: IPA pointer
|
||||
|
@ -225,20 +227,6 @@ void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt)
|
|||
ipa_interrupt_process(interrupt, IPA_IRQ_TX_SUSPEND);
|
||||
}
|
||||
|
||||
/* Add a handler for an IPA interrupt */
|
||||
void ipa_interrupt_add(struct ipa_interrupt *interrupt,
|
||||
enum ipa_irq_id ipa_irq, ipa_irq_handler_t handler)
|
||||
{
|
||||
WARN_ON(ipa_irq >= IPA_IRQ_COUNT);
|
||||
}
|
||||
|
||||
/* Remove the handler for an IPA interrupt type */
|
||||
void
|
||||
ipa_interrupt_remove(struct ipa_interrupt *interrupt, enum ipa_irq_id ipa_irq)
|
||||
{
|
||||
WARN_ON(ipa_irq >= IPA_IRQ_COUNT);
|
||||
}
|
||||
|
||||
/* Configure the IPA interrupt framework */
|
||||
struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa)
|
||||
{
|
||||
|
|
|
@ -13,39 +13,6 @@ struct ipa;
|
|||
struct ipa_interrupt;
|
||||
enum ipa_irq_id;
|
||||
|
||||
/**
|
||||
* typedef ipa_irq_handler_t - IPA interrupt handler function type
|
||||
* @ipa: IPA pointer
|
||||
* @irq_id: interrupt type
|
||||
*
|
||||
* Callback function registered by ipa_interrupt_add() to handle a specific
|
||||
* IPA interrupt type
|
||||
*/
|
||||
typedef void (*ipa_irq_handler_t)(struct ipa *ipa, enum ipa_irq_id irq_id);
|
||||
|
||||
/**
|
||||
* ipa_interrupt_add() - Register a handler for an IPA interrupt type
|
||||
* @interrupt: IPA interrupt structure
|
||||
* @irq_id: IPA interrupt type
|
||||
* @handler: Handler function for the interrupt
|
||||
*
|
||||
* Add a handler for an IPA interrupt and enable it. IPA interrupt
|
||||
* handlers are run in threaded interrupt context, so are allowed to
|
||||
* block.
|
||||
*/
|
||||
void ipa_interrupt_add(struct ipa_interrupt *interrupt, enum ipa_irq_id irq_id,
|
||||
ipa_irq_handler_t handler);
|
||||
|
||||
/**
|
||||
* ipa_interrupt_remove() - Remove the handler for an IPA interrupt type
|
||||
* @interrupt: IPA interrupt structure
|
||||
* @irq_id: IPA interrupt type
|
||||
*
|
||||
* Remove an IPA interrupt handler and disable it.
|
||||
*/
|
||||
void ipa_interrupt_remove(struct ipa_interrupt *interrupt,
|
||||
enum ipa_irq_id irq_id);
|
||||
|
||||
/**
|
||||
* ipa_interrupt_suspend_enable - Enable TX_SUSPEND for an endpoint
|
||||
* @interrupt: IPA interrupt structure
|
||||
|
|
|
@ -325,15 +325,11 @@ int ipa_power_setup(struct ipa *ipa)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ipa_interrupt_add(ipa->interrupt, IPA_IRQ_TX_SUSPEND,
|
||||
ipa_power_suspend_handler);
|
||||
ipa_interrupt_enable(ipa, IPA_IRQ_TX_SUSPEND);
|
||||
|
||||
ret = device_init_wakeup(&ipa->pdev->dev, true);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND);
|
||||
ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -342,7 +338,6 @@ void ipa_power_teardown(struct ipa *ipa)
|
|||
{
|
||||
(void)device_init_wakeup(&ipa->pdev->dev, false);
|
||||
ipa_interrupt_disable(ipa, IPA_IRQ_TX_SUSPEND);
|
||||
ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_TX_SUSPEND);
|
||||
}
|
||||
|
||||
/* Initialize IPA power management */
|
||||
|
|
|
@ -182,13 +182,9 @@ void ipa_uc_interrupt_handler(struct ipa *ipa, enum ipa_irq_id irq_id)
|
|||
/* Configure the IPA microcontroller subsystem */
|
||||
void ipa_uc_config(struct ipa *ipa)
|
||||
{
|
||||
struct ipa_interrupt *interrupt = ipa->interrupt;
|
||||
|
||||
ipa->uc_powered = false;
|
||||
ipa->uc_loaded = false;
|
||||
ipa_interrupt_add(interrupt, IPA_IRQ_UC_0, ipa_uc_interrupt_handler);
|
||||
ipa_interrupt_enable(ipa, IPA_IRQ_UC_0);
|
||||
ipa_interrupt_add(interrupt, IPA_IRQ_UC_1, ipa_uc_interrupt_handler);
|
||||
ipa_interrupt_enable(ipa, IPA_IRQ_UC_1);
|
||||
}
|
||||
|
||||
|
@ -198,9 +194,7 @@ void ipa_uc_deconfig(struct ipa *ipa)
|
|||
struct device *dev = &ipa->pdev->dev;
|
||||
|
||||
ipa_interrupt_disable(ipa, IPA_IRQ_UC_1);
|
||||
ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_1);
|
||||
ipa_interrupt_disable(ipa, IPA_IRQ_UC_0);
|
||||
ipa_interrupt_remove(ipa->interrupt, IPA_IRQ_UC_0);
|
||||
if (ipa->uc_loaded)
|
||||
ipa_power_retention(ipa, false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue