Skip to content

Commit

Permalink
techpack: use power efficient workingqueues
Browse files Browse the repository at this point in the history
(cherry picked from commit 75ed04dc1f7e7da565e41b7190fb44f078c5b4d6)
(cherry picked from commit a23fc1d9e2a6166dde561c6e5cf8f1e09e0a5c0c)
(cherry picked from commit efed5ad0c48e83e66b4be7f33147aa192e47e498)
  • Loading branch information
freak07 authored and AbhinandAK350 committed Jan 26, 2022
1 parent 4c97cc4 commit 5e706e8
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions techpack/audio/asoc/codecs/msm_sdw/msm_sdw_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static int __msm_sdw_reg_read(struct msm_sdw_priv *msm_sdw, unsigned short reg,
((u8 *)dest)[i] = temp;
}
msm_sdw->int_mclk1_enabled = true;
schedule_delayed_work(&msm_sdw->disable_int_mclk1_work, 50);
queue_delayed_work(system_power_efficient_wq, &msm_sdw->disable_int_mclk1_work, 50);
goto unlock_exit;
}
for (i = 0; i < bytes; i++) {
Expand Down Expand Up @@ -419,7 +419,7 @@ static int __msm_sdw_reg_write(struct msm_sdw_priv *msm_sdw, unsigned short reg,
ret = msm_sdw_ahb_write_device(msm_sdw, reg + (4 * i),
&((u8 *)src)[i]);
msm_sdw->int_mclk1_enabled = true;
schedule_delayed_work(&msm_sdw->disable_int_mclk1_work, 50);
queue_delayed_work(system_power_efficient_wq, &msm_sdw->disable_int_mclk1_work, 50);
goto unlock_exit;
}
for (i = 0; i < bytes; i++)
Expand Down
6 changes: 3 additions & 3 deletions techpack/audio/asoc/codecs/sdm660_cdc/msm-digital-cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static int msm_digcdc_clock_control(bool flag)
}
pr_debug("enabled digital codec core clk\n");
atomic_set(&pdata->int_mclk0_enabled, true);
schedule_delayed_work(&pdata->disable_int_mclk0_work,
queue_delayed_work(system_power_efficient_wq,&pdata->disable_int_mclk0_work,
50);
}
} else {
Expand Down Expand Up @@ -1017,13 +1017,13 @@ static int msm_dig_cdc_codec_enable_dec(struct snd_soc_dapm_widget *w,
/* enable HPF */
snd_soc_update_bits(codec, tx_mux_ctl_reg, 0x08, 0x00);

schedule_delayed_work(
queue_delayed_work(system_power_efficient_wq,
&msm_dig_cdc->tx_mute_dwork[decimator - 1].dwork,
msecs_to_jiffies(tx_unmute_delay));
if (tx_hpf_work[decimator - 1].tx_hpf_cut_of_freq !=
CF_MIN_3DB_150HZ) {

schedule_delayed_work(&tx_hpf_work[decimator - 1].dwork,
queue_delayed_work(system_power_efficient_wq, &tx_hpf_work[decimator - 1].dwork,
msecs_to_jiffies(300));
}
/* apply the digital gain after the decimator is enabled*/
Expand Down
4 changes: 2 additions & 2 deletions techpack/audio/asoc/codecs/wcd-mbhc-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ static irqreturn_t wcd_mbhc_btn_press_handler(int irq, void *data)
}
mbhc->buttons_pressed |= mask;
mbhc->mbhc_cb->lock_sleep(mbhc, true);
if (schedule_delayed_work(&mbhc->mbhc_btn_dwork,
if (queue_delayed_work(system_power_efficient_wq, &mbhc->mbhc_btn_dwork,
msecs_to_jiffies(400)) == 0) {
WARN(1, "Button pressed twice without release event\n");
mbhc->mbhc_cb->lock_sleep(mbhc, false);
Expand Down Expand Up @@ -1874,7 +1874,7 @@ int wcd_mbhc_start(struct wcd_mbhc *mbhc, struct wcd_mbhc_config *mbhc_cfg)
rc = wcd_mbhc_initialise(mbhc);
} else {
if (!mbhc->mbhc_fw || !mbhc->mbhc_cal)
schedule_delayed_work(&mbhc->mbhc_firmware_dwork,
queue_delayed_work(system_power_efficient_wq, &mbhc->mbhc_firmware_dwork,
usecs_to_jiffies(FW_READ_TIMEOUT));
else
pr_err("%s: Skipping to read mbhc fw, 0x%pK %pK\n",
Expand Down
2 changes: 1 addition & 1 deletion techpack/audio/asoc/codecs/wcd-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ static int wcd_spi_clk_ctrl(struct spi_device *spi,
* flags.
*/
if (flags == WCD_SPI_CLK_FLAG_DELAYED) {
schedule_delayed_work(&wcd_spi->clk_dwork,
queue_delayed_work(system_power_efficient_wq, &wcd_spi->clk_dwork,
msecs_to_jiffies(WCD_SPI_CLK_OFF_TIMER_MS));
} else {
ret = wcd_spi_clk_disable(spi);
Expand Down
8 changes: 4 additions & 4 deletions techpack/audio/asoc/codecs/wcd9335.c
Original file line number Diff line number Diff line change
Expand Up @@ -4155,7 +4155,7 @@ static int tasha_codec_enable_spk_anc(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
ret = tasha_codec_enable_anc(w, kcontrol, event);
schedule_delayed_work(&tasha->spk_anc_dwork.dwork,
queue_delayed_work(system_power_efficient_wq, &tasha->spk_anc_dwork.dwork,
msecs_to_jiffies(spk_anc_en_delay));
break;
case SND_SOC_DAPM_POST_PMD:
Expand Down Expand Up @@ -5758,11 +5758,11 @@ static int tasha_codec_enable_dec(struct snd_soc_dapm_widget *w,
snd_soc_write(codec, WCD9335_MBHC_ZDET_RAMP_CTL, 0x03);
}
/* schedule work queue to Remove Mute */
schedule_delayed_work(&tasha->tx_mute_dwork[decimator].dwork,
queue_delayed_work(system_power_efficient_wq, &tasha->tx_mute_dwork[decimator].dwork,
msecs_to_jiffies(tx_unmute_delay));
if (tasha->tx_hpf_work[decimator].hpf_cut_off_freq !=
CF_MIN_3DB_150HZ)
schedule_delayed_work(
queue_delayed_work(system_power_efficient_wq,
&tasha->tx_hpf_work[decimator].dwork,
msecs_to_jiffies(300));
/* apply gain after decimator is enabled */
Expand Down Expand Up @@ -12042,7 +12042,7 @@ static int tasha_dig_core_power_collapse(struct tasha_priv *tasha,

if (req_state == POWER_COLLAPSE) {
if (tasha->power_active_ref == 0) {
schedule_delayed_work(&tasha->power_gate_work,
queue_delayed_work(system_power_efficient_wq, &tasha->power_gate_work,
msecs_to_jiffies(dig_core_collapse_timer * 1000));
}
} else if (req_state == POWER_RESUME) {
Expand Down
8 changes: 4 additions & 4 deletions techpack/audio/asoc/codecs/wcd934x/wcd934x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,7 @@ static int tavil_codec_enable_spkr_anc(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
ret = tavil_codec_enable_anc(w, kcontrol, event);
schedule_delayed_work(&tavil->spk_anc_dwork.dwork,
queue_delayed_work(system_power_efficient_wq, &tavil->spk_anc_dwork.dwork,
msecs_to_jiffies(spk_anc_en_delay));
break;
case SND_SOC_DAPM_POST_PMD:
Expand Down Expand Up @@ -4459,11 +4459,11 @@ static int tavil_codec_enable_dec(struct snd_soc_dapm_widget *w,
snd_soc_update_bits(codec, hpf_gate_reg, 0x02, 0x00);
}
/* schedule work queue to Remove Mute */
schedule_delayed_work(&tavil->tx_mute_dwork[decimator].dwork,
queue_delayed_work(system_power_efficient_wq, &tavil->tx_mute_dwork[decimator].dwork,
msecs_to_jiffies(tx_unmute_delay));
if (tavil->tx_hpf_work[decimator].hpf_cut_off_freq !=
CF_MIN_3DB_150HZ)
schedule_delayed_work(
queue_delayed_work(system_power_efficient_wq,
&tavil->tx_hpf_work[decimator].dwork,
msecs_to_jiffies(300));
/* apply gain after decimator is enabled */
Expand Down Expand Up @@ -8996,7 +8996,7 @@ static int tavil_dig_core_power_collapse(struct tavil_priv *tavil,

if (req_state == POWER_COLLAPSE) {
if (tavil->power_active_ref == 0) {
schedule_delayed_work(&tavil->power_gate_work,
queue_delayed_work(system_power_efficient_wq, &tavil->power_gate_work,
msecs_to_jiffies(dig_core_collapse_timer * 1000));
}
} else if (req_state == POWER_RESUME) {
Expand Down
4 changes: 2 additions & 2 deletions techpack/audio/asoc/codecs/wsa881x.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ static void wsa881x_ocp_ctl_work(struct work_struct *work)
else
snd_soc_update_bits(codec, WSA881X_SPKR_OCP_CTL, 0xC0, 0xC0);

schedule_delayed_work(&wsa881x->ocp_ctl_work,
queue_delayed_work(system_power_efficient_wq, &wsa881x->ocp_ctl_work,
msecs_to_jiffies(wsa881x_ocp_poll_timer_sec * 1000));
}

Expand Down Expand Up @@ -972,7 +972,7 @@ static int wsa881x_spkr_pa_event(struct snd_soc_dapm_widget *w,
0x07, 0x01);
wsa881x_visense_adc_ctrl(codec, ENABLE);
}
schedule_delayed_work(&wsa881x->ocp_ctl_work,
queue_delayed_work(system_power_efficient_wq, &wsa881x->ocp_ctl_work,
msecs_to_jiffies(WSA881X_OCP_CTL_TIMER_SEC * 1000));
/* Force remove group */
swr_remove_from_group(wsa881x->swr_slave,
Expand Down
4 changes: 2 additions & 2 deletions techpack/audio/dsp/avtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static int32_t aprv2_core_fn_q(struct apr_client_data *data, void *priv)
avtimer.core_handle_q = NULL;
avtimer.avtimer_open_cnt = 0;
atomic_set(&avtimer.adsp_ready, 0);
schedule_delayed_work(&avtimer.ssr_dwork,
queue_delayed_work(system_power_efficient_wq, &avtimer.ssr_dwork,
msecs_to_jiffies(SSR_WAKETIME));
break;
}
Expand Down Expand Up @@ -297,7 +297,7 @@ static void reset_work(struct work_struct *work)
}
pr_debug("%s:Q6 not ready-retry after sometime\n", __func__);
if (--avtimer.num_retries > 0) {
schedule_delayed_work(&avtimer.ssr_dwork,
queue_delayed_work(system_power_efficient_wq, &avtimer.ssr_dwork,
msecs_to_jiffies(Q6_READY_RETRY));
} else {
pr_err("%s: Q6 failed responding after multiple retries\n",
Expand Down

0 comments on commit 5e706e8

Please sign in to comment.