diff options
author | Alex Elder <elder@linaro.org> | 2020-09-17 12:39:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-18 17:47:07 -0700 |
commit | 2b09841c7e57c34dc11741ffd3696e91b81bcd79 (patch) | |
tree | 75b48478ea5f59fdcc3a9ee3abd48ff5f787ad39 /drivers/net/ipa/ipa.h | |
parent | 0305b709906e755d7fbdeccd9c2539442ebd1ead (diff) |
net: ipa: replace ipa->suspend_ref with a flag bit
We take a clock reference in ipa_config() in order to prevent the
the IPA clock from being shutdown until a power management suspend
request arrives. An atomic field in the IPA structure records
whether that extra reference had been taken.
Rather than using an atomic to represent a Boolean value, define
a new flags bitmap, and define a "clock held" flag to represent
whether the extra clock reference has been taken.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa.h')
-rw-r--r-- | drivers/net/ipa/ipa.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/ipa/ipa.h b/drivers/net/ipa/ipa.h index 407fee841a9a..e02fe979b645 100644 --- a/drivers/net/ipa/ipa.h +++ b/drivers/net/ipa/ipa.h @@ -28,14 +28,24 @@ struct ipa_smp2p; struct ipa_interrupt; /** + * enum ipa_flag - IPA state flags + * @IPA_FLAG_CLOCK_HELD: Whether IPA clock is held to prevent suspend + * @IPA_FLAG_COUNT: Number of defined IPA flags + */ +enum ipa_flag { + IPA_FLAG_CLOCK_HELD, + IPA_FLAG_COUNT, /* Last; not a flag */ +}; + +/** * struct ipa - IPA information * @gsi: Embedded GSI structure + * @flags: Boolean state flags * @version: IPA hardware version * @pdev: Platform device * @modem_rproc: Remoteproc handle for modem subsystem * @smp2p: SMP2P information * @clock: IPA clocking information - * @suspend_ref: Whether clock reference preventing suspend taken * @table_addr: DMA address of filter/route table content * @table_virt: Virtual address of filter/route table content * @interrupt: IPA Interrupt information @@ -70,6 +80,7 @@ struct ipa_interrupt; */ struct ipa { struct gsi gsi; + DECLARE_BITMAP(flags, IPA_FLAG_COUNT); enum ipa_version version; struct platform_device *pdev; struct rproc *modem_rproc; @@ -77,7 +88,6 @@ struct ipa { void *notifier; struct ipa_smp2p *smp2p; struct ipa_clock *clock; - atomic_t suspend_ref; dma_addr_t table_addr; __le64 *table_virt; |