|
@@ -417,8 +417,6 @@ static int swrm_request_hw_vote(struct swr_mstr_ctrl *swrm,
|
|
if (!swrm->dev_up) {
|
|
if (!swrm->dev_up) {
|
|
dev_dbg(swrm->dev, "%s: device is down or SSR state\n",
|
|
dev_dbg(swrm->dev, "%s: device is down or SSR state\n",
|
|
__func__);
|
|
__func__);
|
|
- trace_printk("%s: device is down or SSR state\n",
|
|
|
|
- __func__);
|
|
|
|
mutex_unlock(&swrm->devlock);
|
|
mutex_unlock(&swrm->devlock);
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
}
|
|
}
|
|
@@ -449,8 +447,6 @@ static int swrm_request_hw_vote(struct swr_mstr_ctrl *swrm,
|
|
if (!swrm->dev_up) {
|
|
if (!swrm->dev_up) {
|
|
dev_dbg(swrm->dev, "%s: device is down or SSR state\n",
|
|
dev_dbg(swrm->dev, "%s: device is down or SSR state\n",
|
|
__func__);
|
|
__func__);
|
|
- trace_printk("%s: device is down or SSR state\n",
|
|
|
|
- __func__);
|
|
|
|
mutex_unlock(&swrm->devlock);
|
|
mutex_unlock(&swrm->devlock);
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
}
|
|
}
|
|
@@ -479,8 +475,6 @@ static int swrm_request_hw_vote(struct swr_mstr_ctrl *swrm,
|
|
mutex_unlock(&swrm->devlock);
|
|
mutex_unlock(&swrm->devlock);
|
|
dev_dbg(swrm->dev, "%s: hw_clk_en: %d audio_core_clk_en: %d\n",
|
|
dev_dbg(swrm->dev, "%s: hw_clk_en: %d audio_core_clk_en: %d\n",
|
|
__func__, swrm->hw_core_clk_en, swrm->aud_core_clk_en);
|
|
__func__, swrm->hw_core_clk_en, swrm->aud_core_clk_en);
|
|
- trace_printk("%s: hw_clk_en: %d audio_core_clk_en: %d\n",
|
|
|
|
- __func__, swrm->hw_core_clk_en, swrm->aud_core_clk_en);
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -548,8 +542,6 @@ static int swrm_clk_request(struct swr_mstr_ctrl *swrm, bool enable)
|
|
}
|
|
}
|
|
swrm->clk_ref_count++;
|
|
swrm->clk_ref_count++;
|
|
if (swrm->clk_ref_count == 1) {
|
|
if (swrm->clk_ref_count == 1) {
|
|
- trace_printk("%s: clock enable count %d\n",
|
|
|
|
- __func__, swrm->clk_ref_count);
|
|
|
|
ret = swrm->clk(swrm->handle, true);
|
|
ret = swrm->clk(swrm->handle, true);
|
|
if (ret) {
|
|
if (ret) {
|
|
dev_err_ratelimited(swrm->dev,
|
|
dev_err_ratelimited(swrm->dev,
|
|
@@ -559,8 +551,6 @@ static int swrm_clk_request(struct swr_mstr_ctrl *swrm, bool enable)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (--swrm->clk_ref_count == 0) {
|
|
} else if (--swrm->clk_ref_count == 0) {
|
|
- trace_printk("%s: clock disable count %d\n",
|
|
|
|
- __func__, swrm->clk_ref_count);
|
|
|
|
swrm->clk(swrm->handle, false);
|
|
swrm->clk(swrm->handle, false);
|
|
complete(&swrm->clk_off_complete);
|
|
complete(&swrm->clk_off_complete);
|
|
}
|
|
}
|
|
@@ -2073,7 +2063,6 @@ static irqreturn_t swr_mstr_interrupt(int irq, void *dev)
|
|
struct swr_master *mstr = &swrm->master;
|
|
struct swr_master *mstr = &swrm->master;
|
|
int retry = 5;
|
|
int retry = 5;
|
|
|
|
|
|
- trace_printk("%s enter\n", __func__);
|
|
|
|
if (unlikely(swrm_lock_sleep(swrm) == false)) {
|
|
if (unlikely(swrm_lock_sleep(swrm) == false)) {
|
|
dev_err_ratelimited(swrm->dev, "%s Failed to hold suspend\n", __func__);
|
|
dev_err_ratelimited(swrm->dev, "%s Failed to hold suspend\n", __func__);
|
|
return IRQ_NONE;
|
|
return IRQ_NONE;
|
|
@@ -2100,7 +2089,6 @@ static irqreturn_t swr_mstr_interrupt(int irq, void *dev)
|
|
intr_sts_masked = intr_sts & swrm->intr_mask;
|
|
intr_sts_masked = intr_sts & swrm->intr_mask;
|
|
|
|
|
|
dev_dbg(swrm->dev, "%s: status: 0x%x \n", __func__, intr_sts_masked);
|
|
dev_dbg(swrm->dev, "%s: status: 0x%x \n", __func__, intr_sts_masked);
|
|
- trace_printk("%s: status: 0x%x \n", __func__, intr_sts_masked);
|
|
|
|
handle_irq:
|
|
handle_irq:
|
|
for (i = 0; i < SWRM_INTERRUPT_MAX; i++) {
|
|
for (i = 0; i < SWRM_INTERRUPT_MAX; i++) {
|
|
value = intr_sts_masked & (1 << i);
|
|
value = intr_sts_masked & (1 << i);
|
|
@@ -2139,7 +2127,6 @@ handle_irq:
|
|
handle_nested_irq(
|
|
handle_nested_irq(
|
|
irq_find_mapping(
|
|
irq_find_mapping(
|
|
swr_dev->slave_irq, 0));
|
|
swr_dev->slave_irq, 0));
|
|
- trace_printk("%s: slave_irq_pending\n", __func__);
|
|
|
|
} while (swr_dev->slave_irq_pending && swrm->dev_up);
|
|
} while (swr_dev->slave_irq_pending && swrm->dev_up);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2151,8 +2138,6 @@ handle_irq:
|
|
break;
|
|
break;
|
|
case SWRM_INTERRUPT_STATUS_CHANGE_ENUM_SLAVE_STATUS:
|
|
case SWRM_INTERRUPT_STATUS_CHANGE_ENUM_SLAVE_STATUS:
|
|
status = swr_master_read(swrm, SWRM_MCP_SLV_STATUS);
|
|
status = swr_master_read(swrm, SWRM_MCP_SLV_STATUS);
|
|
- trace_printk("%s: ENUM_SLAVE_STATUS 0x%x, slave_status 0x%x\n", __func__,
|
|
|
|
- status, swrm->slave_status);
|
|
|
|
swrm_enable_slave_irq(swrm);
|
|
swrm_enable_slave_irq(swrm);
|
|
if (status == swrm->slave_status) {
|
|
if (status == swrm->slave_status) {
|
|
dev_dbg(swrm->dev,
|
|
dev_dbg(swrm->dev,
|
|
@@ -2319,8 +2304,6 @@ handle_irq:
|
|
if (intr_sts_masked && !pm_runtime_suspended(swrm->dev)) {
|
|
if (intr_sts_masked && !pm_runtime_suspended(swrm->dev)) {
|
|
dev_dbg(swrm->dev, "%s: new interrupt received 0x%x\n",
|
|
dev_dbg(swrm->dev, "%s: new interrupt received 0x%x\n",
|
|
__func__, intr_sts_masked);
|
|
__func__, intr_sts_masked);
|
|
- trace_printk("%s: new interrupt received 0x%x\n", __func__,
|
|
|
|
- intr_sts_masked);
|
|
|
|
goto handle_irq;
|
|
goto handle_irq;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2334,7 +2317,6 @@ err_audio_hw_vote:
|
|
exit:
|
|
exit:
|
|
mutex_unlock(&swrm->reslock);
|
|
mutex_unlock(&swrm->reslock);
|
|
swrm_unlock_sleep(swrm);
|
|
swrm_unlock_sleep(swrm);
|
|
- trace_printk("%s exit\n", __func__);
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2348,7 +2330,6 @@ static irqreturn_t swrm_wakeup_interrupt(int irq, void *dev)
|
|
return IRQ_NONE;
|
|
return IRQ_NONE;
|
|
}
|
|
}
|
|
|
|
|
|
- trace_printk("%s enter\n", __func__);
|
|
|
|
mutex_lock(&swrm->devlock);
|
|
mutex_lock(&swrm->devlock);
|
|
if (swrm->state == SWR_MSTR_SSR || !swrm->dev_up) {
|
|
if (swrm->state == SWR_MSTR_SSR || !swrm->dev_up) {
|
|
if (swrm->wake_irq > 0) {
|
|
if (swrm->wake_irq > 0) {
|
|
@@ -2387,7 +2368,6 @@ static irqreturn_t swrm_wakeup_interrupt(int irq, void *dev)
|
|
pm_runtime_put_autosuspend(swrm->dev);
|
|
pm_runtime_put_autosuspend(swrm->dev);
|
|
swrm_unlock_sleep(swrm);
|
|
swrm_unlock_sleep(swrm);
|
|
exit:
|
|
exit:
|
|
- trace_printk("%s exit\n", __func__);
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2402,7 +2382,6 @@ static void swrm_wakeup_work(struct work_struct *work)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- trace_printk("%s enter\n", __func__);
|
|
|
|
mutex_lock(&swrm->devlock);
|
|
mutex_lock(&swrm->devlock);
|
|
if (!swrm->dev_up) {
|
|
if (!swrm->dev_up) {
|
|
mutex_unlock(&swrm->devlock);
|
|
mutex_unlock(&swrm->devlock);
|
|
@@ -2418,7 +2397,6 @@ static void swrm_wakeup_work(struct work_struct *work)
|
|
pm_runtime_put_autosuspend(swrm->dev);
|
|
pm_runtime_put_autosuspend(swrm->dev);
|
|
swrm_unlock_sleep(swrm);
|
|
swrm_unlock_sleep(swrm);
|
|
exit:
|
|
exit:
|
|
- trace_printk("%s exit\n", __func__);
|
|
|
|
pm_relax(swrm->dev);
|
|
pm_relax(swrm->dev);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3217,8 +3195,6 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
|
|
|
dev_dbg(dev, "%s: pm_runtime: resume, state:%d\n",
|
|
dev_dbg(dev, "%s: pm_runtime: resume, state:%d\n",
|
|
__func__, swrm->state);
|
|
__func__, swrm->state);
|
|
- trace_printk("%s: pm_runtime: resume, state:%d\n",
|
|
|
|
- __func__, swrm->state);
|
|
|
|
mutex_lock(&swrm->runtime_lock);
|
|
mutex_lock(&swrm->runtime_lock);
|
|
mutex_lock(&swrm->reslock);
|
|
mutex_lock(&swrm->reslock);
|
|
|
|
|
|
@@ -3280,9 +3256,6 @@ static int swrm_runtime_resume(struct device *dev)
|
|
dev_dbg(dev,
|
|
dev_dbg(dev,
|
|
"%s slave device up not implemented\n",
|
|
"%s slave device up not implemented\n",
|
|
__func__);
|
|
__func__);
|
|
- trace_printk(
|
|
|
|
- "%s slave device up not implemented\n",
|
|
|
|
- __func__);
|
|
|
|
ret = 0;
|
|
ret = 0;
|
|
} else if (ret) {
|
|
} else if (ret) {
|
|
dev_err_ratelimited(dev,
|
|
dev_err_ratelimited(dev,
|
|
@@ -3351,8 +3324,6 @@ exit:
|
|
mutex_unlock(&swrm->reslock);
|
|
mutex_unlock(&swrm->reslock);
|
|
mutex_unlock(&swrm->runtime_lock);
|
|
mutex_unlock(&swrm->runtime_lock);
|
|
|
|
|
|
- trace_printk("%s: pm_runtime: resume done, state:%d\n",
|
|
|
|
- __func__, swrm->state);
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3367,8 +3338,6 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
int current_state = 0;
|
|
int current_state = 0;
|
|
struct irq_data *irq_data = NULL;
|
|
struct irq_data *irq_data = NULL;
|
|
|
|
|
|
- trace_printk("%s: pm_runtime: suspend state: %d\n",
|
|
|
|
- __func__, swrm->state);
|
|
|
|
dev_dbg(dev, "%s: pm_runtime: suspend state: %d\n",
|
|
dev_dbg(dev, "%s: pm_runtime: suspend state: %d\n",
|
|
__func__, swrm->state);
|
|
__func__, swrm->state);
|
|
if (swrm->state == SWR_MSTR_SSR_RESET) {
|
|
if (swrm->state == SWR_MSTR_SSR_RESET) {
|
|
@@ -3395,7 +3364,6 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
if ((current_state != SWR_MSTR_SSR) &&
|
|
if ((current_state != SWR_MSTR_SSR) &&
|
|
swrm_is_port_en(&swrm->master)) {
|
|
swrm_is_port_en(&swrm->master)) {
|
|
dev_dbg(dev, "%s ports are enabled\n", __func__);
|
|
dev_dbg(dev, "%s ports are enabled\n", __func__);
|
|
- trace_printk("%s ports are enabled\n", __func__);
|
|
|
|
ret = -EBUSY;
|
|
ret = -EBUSY;
|
|
goto exit;
|
|
goto exit;
|
|
}
|
|
}
|
|
@@ -3415,22 +3383,14 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
dev_dbg_ratelimited(dev,
|
|
dev_dbg_ratelimited(dev,
|
|
"%s slave device down not implemented\n",
|
|
"%s slave device down not implemented\n",
|
|
__func__);
|
|
__func__);
|
|
- trace_printk(
|
|
|
|
- "%s slave device down not implemented\n",
|
|
|
|
- __func__);
|
|
|
|
ret = 0;
|
|
ret = 0;
|
|
} else if (ret) {
|
|
} else if (ret) {
|
|
dev_err_ratelimited(dev,
|
|
dev_err_ratelimited(dev,
|
|
"%s: failed to shutdown swr dev %d\n",
|
|
"%s: failed to shutdown swr dev %d\n",
|
|
__func__, swr_dev->dev_num);
|
|
__func__, swr_dev->dev_num);
|
|
- trace_printk(
|
|
|
|
- "%s: failed to shutdown swr dev %d\n",
|
|
|
|
- __func__, swr_dev->dev_num);
|
|
|
|
goto exit;
|
|
goto exit;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- trace_printk("%s: clk stop mode not supported or SSR exit\n",
|
|
|
|
- __func__);
|
|
|
|
} else {
|
|
} else {
|
|
/* Mask bus clash interrupt */
|
|
/* Mask bus clash interrupt */
|
|
swrm->intr_mask &= ~((u32)0x08);
|
|
swrm->intr_mask &= ~((u32)0x08);
|
|
@@ -3484,8 +3444,6 @@ exit:
|
|
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
|
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
|
mutex_unlock(&swrm->reslock);
|
|
mutex_unlock(&swrm->reslock);
|
|
mutex_unlock(&swrm->runtime_lock);
|
|
mutex_unlock(&swrm->runtime_lock);
|
|
- trace_printk("%s: pm_runtime: suspend done state: %d\n",
|
|
|
|
- __func__, swrm->state);
|
|
|
|
dev_dbg(dev, "%s: pm_runtime: suspend done state: %d\n",
|
|
dev_dbg(dev, "%s: pm_runtime: suspend done state: %d\n",
|
|
__func__, swrm->state);
|
|
__func__, swrm->state);
|
|
pm_runtime_set_autosuspend_delay(dev, auto_suspend_timer);
|
|
pm_runtime_set_autosuspend_delay(dev, auto_suspend_timer);
|
|
@@ -3500,7 +3458,6 @@ static int swrm_device_suspend(struct device *dev)
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
dev_dbg(dev, "%s: swrm state: %d\n", __func__, swrm->state);
|
|
dev_dbg(dev, "%s: swrm state: %d\n", __func__, swrm->state);
|
|
- trace_printk("%s: swrm state: %d\n", __func__, swrm->state);
|
|
|
|
if (!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev)) {
|
|
if (!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev)) {
|
|
ret = swrm_runtime_suspend(dev);
|
|
ret = swrm_runtime_suspend(dev);
|
|
if (!ret) {
|
|
if (!ret) {
|
|
@@ -3519,7 +3476,6 @@ static int swrm_device_down(struct device *dev)
|
|
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
|
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
|
|
|
|
|
dev_dbg(dev, "%s: swrm state: %d\n", __func__, swrm->state);
|
|
dev_dbg(dev, "%s: swrm state: %d\n", __func__, swrm->state);
|
|
- trace_printk("%s: swrm state: %d\n", __func__, swrm->state);
|
|
|
|
|
|
|
|
mutex_lock(&swrm->force_down_lock);
|
|
mutex_lock(&swrm->force_down_lock);
|
|
swrm->state = SWR_MSTR_SSR;
|
|
swrm->state = SWR_MSTR_SSR;
|
|
@@ -3697,7 +3653,6 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case SWR_DEVICE_SSR_DOWN:
|
|
case SWR_DEVICE_SSR_DOWN:
|
|
- trace_printk("%s: swr device down called\n", __func__);
|
|
|
|
mutex_lock(&swrm->mlock);
|
|
mutex_lock(&swrm->mlock);
|
|
mutex_lock(&swrm->devlock);
|
|
mutex_lock(&swrm->devlock);
|
|
swrm->dev_up = false;
|
|
swrm->dev_up = false;
|
|
@@ -3724,7 +3679,6 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
break;
|
|
break;
|
|
case SWR_DEVICE_SSR_UP:
|
|
case SWR_DEVICE_SSR_UP:
|
|
/* wait for clk voting to be zero */
|
|
/* wait for clk voting to be zero */
|
|
- trace_printk("%s: swr device up called\n", __func__);
|
|
|
|
reinit_completion(&swrm->clk_off_complete);
|
|
reinit_completion(&swrm->clk_off_complete);
|
|
if (swrm->clk_ref_count &&
|
|
if (swrm->clk_ref_count &&
|
|
!wait_for_completion_timeout(&swrm->clk_off_complete,
|
|
!wait_for_completion_timeout(&swrm->clk_off_complete,
|
|
@@ -3750,7 +3704,6 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
break;
|
|
break;
|
|
case SWR_DEVICE_DOWN:
|
|
case SWR_DEVICE_DOWN:
|
|
dev_dbg(swrm->dev, "%s: swr master down called\n", __func__);
|
|
dev_dbg(swrm->dev, "%s: swr master down called\n", __func__);
|
|
- trace_printk("%s: swr master down called\n", __func__);
|
|
|
|
mutex_lock(&swrm->mlock);
|
|
mutex_lock(&swrm->mlock);
|
|
if (swrm->state == SWR_MSTR_DOWN)
|
|
if (swrm->state == SWR_MSTR_DOWN)
|
|
dev_dbg(swrm->dev, "%s:SWR master is already Down:%d\n",
|
|
dev_dbg(swrm->dev, "%s:SWR master is already Down:%d\n",
|
|
@@ -3761,7 +3714,6 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
break;
|
|
break;
|
|
case SWR_DEVICE_UP:
|
|
case SWR_DEVICE_UP:
|
|
dev_dbg(swrm->dev, "%s: swr master up called\n", __func__);
|
|
dev_dbg(swrm->dev, "%s: swr master up called\n", __func__);
|
|
- trace_printk("%s: swr master up called\n", __func__);
|
|
|
|
mutex_lock(&swrm->devlock);
|
|
mutex_lock(&swrm->devlock);
|
|
if (!swrm->dev_up) {
|
|
if (!swrm->dev_up) {
|
|
dev_dbg(swrm->dev, "SSR not complete yet\n");
|
|
dev_dbg(swrm->dev, "SSR not complete yet\n");
|