mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
Revert "soc: qcom: rpmh-rsc: Clear active mode configuration for wake TCS"
This reverts commit e65ee5ad89.
This is a preparation change for merging android-5.4.54 into
msm-5.4 branch. Revert this change to continue using existing
driver that is already supporting same functionality being
added in this change.
Change-Id: I84e2a4da6b396bddb5c5780fd7c1899f475ce208
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
This commit is contained in:
parent
a82c408278
commit
944e9a969f
1 changed files with 23 additions and 54 deletions
|
|
@ -202,42 +202,6 @@ static const struct tcs_request *get_req_from_tcs(struct rsc_drv *drv,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void __tcs_set_trigger(struct rsc_drv *drv, int tcs_id, bool trigger)
|
||||
{
|
||||
u32 enable;
|
||||
|
||||
/*
|
||||
* HW req: Clear the DRV_CONTROL and enable TCS again
|
||||
* While clearing ensure that the AMC mode trigger is cleared
|
||||
* and then the mode enable is cleared.
|
||||
*/
|
||||
enable = read_tcs_reg(drv, RSC_DRV_CONTROL, tcs_id, 0);
|
||||
enable &= ~TCS_AMC_MODE_TRIGGER;
|
||||
write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
|
||||
enable &= ~TCS_AMC_MODE_ENABLE;
|
||||
write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
|
||||
|
||||
if (trigger) {
|
||||
/* Enable the AMC mode on the TCS and then trigger the TCS */
|
||||
enable = TCS_AMC_MODE_ENABLE;
|
||||
write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
|
||||
enable |= TCS_AMC_MODE_TRIGGER;
|
||||
write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
|
||||
}
|
||||
}
|
||||
|
||||
static void enable_tcs_irq(struct rsc_drv *drv, int tcs_id, bool enable)
|
||||
{
|
||||
u32 data;
|
||||
|
||||
data = read_tcs_reg(drv, RSC_DRV_IRQ_ENABLE, 0, 0);
|
||||
if (enable)
|
||||
data |= BIT(tcs_id);
|
||||
else
|
||||
data &= ~BIT(tcs_id);
|
||||
write_tcs_reg(drv, RSC_DRV_IRQ_ENABLE, 0, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* tcs_tx_done: TX Done interrupt handler
|
||||
*/
|
||||
|
|
@ -274,14 +238,6 @@ static irqreturn_t tcs_tx_done(int irq, void *p)
|
|||
}
|
||||
|
||||
trace_rpmh_tx_done(drv, i, req, err);
|
||||
|
||||
/*
|
||||
* If wake tcs was re-purposed for sending active
|
||||
* votes, clear AMC trigger & enable modes and
|
||||
* disable interrupt for this TCS
|
||||
*/
|
||||
if (!drv->tcs[ACTIVE_TCS].num_tcs)
|
||||
__tcs_set_trigger(drv, i, false);
|
||||
skip:
|
||||
/* Reclaim the TCS */
|
||||
write_tcs_reg(drv, RSC_DRV_CMD_ENABLE, i, 0);
|
||||
|
|
@ -289,13 +245,6 @@ skip:
|
|||
write_tcs_reg(drv, RSC_DRV_IRQ_CLEAR, 0, BIT(i));
|
||||
spin_lock(&drv->lock);
|
||||
clear_bit(i, drv->tcs_in_use);
|
||||
/*
|
||||
* Disable interrupt for WAKE TCS to avoid being
|
||||
* spammed with interrupts coming when the solver
|
||||
* sends its wake votes.
|
||||
*/
|
||||
if (!drv->tcs[ACTIVE_TCS].num_tcs)
|
||||
enable_tcs_irq(drv, i, false);
|
||||
spin_unlock(&drv->lock);
|
||||
if (req)
|
||||
rpmh_tx_done(req, err);
|
||||
|
|
@ -337,6 +286,28 @@ static void __tcs_buffer_write(struct rsc_drv *drv, int tcs_id, int cmd_id,
|
|||
write_tcs_reg(drv, RSC_DRV_CMD_ENABLE, tcs_id, cmd_enable);
|
||||
}
|
||||
|
||||
static void __tcs_trigger(struct rsc_drv *drv, int tcs_id)
|
||||
{
|
||||
u32 enable;
|
||||
|
||||
/*
|
||||
* HW req: Clear the DRV_CONTROL and enable TCS again
|
||||
* While clearing ensure that the AMC mode trigger is cleared
|
||||
* and then the mode enable is cleared.
|
||||
*/
|
||||
enable = read_tcs_reg(drv, RSC_DRV_CONTROL, tcs_id, 0);
|
||||
enable &= ~TCS_AMC_MODE_TRIGGER;
|
||||
write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
|
||||
enable &= ~TCS_AMC_MODE_ENABLE;
|
||||
write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
|
||||
|
||||
/* Enable the AMC mode on the TCS and then trigger the TCS */
|
||||
enable = TCS_AMC_MODE_ENABLE;
|
||||
write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
|
||||
enable |= TCS_AMC_MODE_TRIGGER;
|
||||
write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable);
|
||||
}
|
||||
|
||||
static int check_for_req_inflight(struct rsc_drv *drv, struct tcs_group *tcs,
|
||||
const struct tcs_request *msg)
|
||||
{
|
||||
|
|
@ -407,12 +378,10 @@ static int tcs_write(struct rsc_drv *drv, const struct tcs_request *msg)
|
|||
|
||||
tcs->req[tcs_id - tcs->offset] = msg;
|
||||
set_bit(tcs_id, drv->tcs_in_use);
|
||||
if (msg->state == RPMH_ACTIVE_ONLY_STATE && tcs->type != ACTIVE_TCS)
|
||||
enable_tcs_irq(drv, tcs_id, true);
|
||||
spin_unlock(&drv->lock);
|
||||
|
||||
__tcs_buffer_write(drv, tcs_id, 0, msg);
|
||||
__tcs_set_trigger(drv, tcs_id, true);
|
||||
__tcs_trigger(drv, tcs_id);
|
||||
|
||||
done_write:
|
||||
spin_unlock_irqrestore(&tcs->lock, flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue