Skip to content

Commit

Permalink
msm: ipa: Add a option to allow IPA wakelocks
Browse files Browse the repository at this point in the history
Signed-off-by: Lau <laststandrighthere@gmail.com>
Change-Id: Ie1552b5eb27cb17bb1effe472cd4fb0ca674b350
  • Loading branch information
laststandrighthere authored and ekkusa committed Sep 15, 2023
1 parent 0fd4324 commit d100c54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/platform/msm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ config IPA
Kernel and user-space processes can call the IPA driver
to configure IPA core.

config IPA_WAKELOCK
bool
default n
help
Allow IPA to adquire wakelocks.

config RMNET_IPA
tristate "IPA RMNET WWAN Network Device"
depends on IPA && MSM_QMI_INTERFACE
Expand Down
5 changes: 5 additions & 0 deletions drivers/platform/msm/ipa/ipa_v2/ipa.c
Original file line number Diff line number Diff line change
Expand Up @@ -3481,6 +3481,7 @@ void ipa2_dec_client_disable_clks(struct ipa_active_client_logging_info *id)
ipa_active_clients_unlock();
}

#ifdef CONFIG_IPA_WAKELOCK
/**
* ipa_inc_acquire_wakelock() - Increase active clients counter, and
* acquire wakelock if necessary
Expand Down Expand Up @@ -3524,6 +3525,10 @@ void ipa_dec_release_wakelock(enum ipa_wakelock_ref_client ref_client)
ipa_ctx->wakelock_ref_cnt.cnt, ref_client);
spin_unlock_irqrestore(&ipa_ctx->wakelock_ref_cnt.spinlock, flags);
}
#else
void ipa_inc_acquire_wakelock(enum ipa_wakelock_ref_client ref_client) {}
void ipa_dec_release_wakelock(enum ipa_wakelock_ref_client ref_client) {}
#endif

static int ipa_setup_bam_cfg(const struct ipa_plat_drv_res *res)
{
Expand Down
5 changes: 5 additions & 0 deletions drivers/platform/msm/ipa/ipa_v3/ipa.c
Original file line number Diff line number Diff line change
Expand Up @@ -4173,6 +4173,7 @@ void ipa3_dec_client_disable_clks_no_block(
&ipa_dec_clients_disable_clks_on_wq_work);
}

#ifdef CONFIG_IPA_WAKELOCK
/**
* ipa3_inc_acquire_wakelock() - Increase active clients counter, and
* acquire wakelock if necessary
Expand Down Expand Up @@ -4217,6 +4218,10 @@ void ipa3_dec_release_wakelock(void)
spin_unlock_irqrestore(&ipa3_ctx->wakelock_ref_cnt.spinlock, flags);
#endif
}
#else
void ipa3_inc_acquire_wakelock(void) {}
void ipa3_dec_release_wakelock(void) {}
#endif

int ipa3_set_clock_plan_from_pm(int idx)
{
Expand Down

0 comments on commit d100c54

Please sign in to comment.