|
@@ -235,14 +235,14 @@ static ssize_t swrm_reg_show(struct swr_mstr_ctrl *swrm, char __user *ubuf,
|
|
|
reg_val = swr_master_read(swrm, i);
|
|
|
len = snprintf(tmp_buf, 25, "0x%.3x: 0x%.2x\n", i, reg_val);
|
|
|
if (len < 0) {
|
|
|
- pr_err("%s: fail to fill the buffer\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: fail to fill the buffer\n", __func__);
|
|
|
total = -EFAULT;
|
|
|
goto copy_err;
|
|
|
}
|
|
|
if ((total + len) >= count - 1)
|
|
|
break;
|
|
|
if (copy_to_user((ubuf + total), tmp_buf, len)) {
|
|
|
- pr_err("%s: fail to copy reg dump\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: fail to copy reg dump\n", __func__);
|
|
|
total = -EFAULT;
|
|
|
goto copy_err;
|
|
|
}
|
|
@@ -329,7 +329,7 @@ static ssize_t swrm_debug_peek_write(struct file *file, const char __user *ubuf,
|
|
|
if (rc == 0)
|
|
|
rc = count;
|
|
|
else
|
|
|
- dev_err(swrm->dev, "%s: rc = %d\n", __func__, rc);
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: rc = %d\n", __func__, rc);
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
@@ -368,7 +368,7 @@ static ssize_t swrm_debug_write(struct file *file,
|
|
|
if (rc == 0)
|
|
|
rc = count;
|
|
|
else
|
|
|
- pr_err("%s: rc = %d\n", __func__, rc);
|
|
|
+ pr_err_ratelimited("%s: rc = %d\n", __func__, rc);
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
@@ -427,7 +427,7 @@ static int swrm_request_hw_vote(struct swr_mstr_ctrl *swrm,
|
|
|
digital_cdc_rsc_mgr_hw_vote_enable(
|
|
|
swrm->lpass_core_hw_vote);
|
|
|
if (ret < 0) {
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s:lpass core hw enable failed\n",
|
|
|
__func__);
|
|
|
--swrm->hw_core_clk_en;
|
|
@@ -459,7 +459,7 @@ static int swrm_request_hw_vote(struct swr_mstr_ctrl *swrm,
|
|
|
digital_cdc_rsc_mgr_hw_vote_enable(
|
|
|
swrm->lpass_core_audio);
|
|
|
if (ret < 0) {
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s:lpass audio hw enable failed\n",
|
|
|
__func__);
|
|
|
--swrm->aud_core_clk_en;
|
|
@@ -563,7 +563,7 @@ static int swrm_clk_request(struct swr_mstr_ctrl *swrm, bool enable)
|
|
|
complete(&swrm->clk_off_complete);
|
|
|
}
|
|
|
if (swrm->clk_ref_count < 0) {
|
|
|
- dev_err(swrm->dev, "%s: swrm clk count mismatch\n", __func__);
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: swrm clk count mismatch\n", __func__);
|
|
|
swrm->clk_ref_count = 0;
|
|
|
}
|
|
|
|
|
@@ -716,7 +716,7 @@ static bool swrm_check_link_status(struct swr_mstr_ctrl *swrm, bool active)
|
|
|
} while (retry);
|
|
|
|
|
|
if (retry == 0)
|
|
|
- dev_err(swrm->dev, "%s: link status not %s\n", __func__,
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: link status not %s\n", __func__,
|
|
|
active ? "connected" : "disconnected");
|
|
|
|
|
|
return ret;
|
|
@@ -785,7 +785,7 @@ static int swrm_pcm_port_config(struct swr_mstr_ctrl *swrm, u8 port_num,
|
|
|
u32 reg_val = 0;
|
|
|
|
|
|
if (!port_num || port_num > SWR_MSTR_PORT_LEN) {
|
|
|
- dev_err(swrm->dev, "%s: invalid port: %d\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: invalid port: %d\n",
|
|
|
__func__, port_num);
|
|
|
return -EINVAL;
|
|
|
}
|
|
@@ -816,7 +816,7 @@ static int swrm_get_master_port(struct swr_mstr_ctrl *swrm, u8 *mstr_port_id,
|
|
|
}
|
|
|
found:
|
|
|
if (i > swrm->num_ports || j == SWR_MAX_CH_PER_PORT) {
|
|
|
- dev_err(swrm->dev, "%s: port type not supported by master\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: port type not supported by master\n",
|
|
|
__func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
@@ -1002,11 +1002,11 @@ static int swrm_read(struct swr_master *master, u8 dev_num, u16 reg_addr,
|
|
|
u8 *reg_val = (u8 *)buf;
|
|
|
|
|
|
if (!swrm) {
|
|
|
- dev_err(&master->dev, "%s: swrm is NULL\n", __func__);
|
|
|
+ dev_err_ratelimited(&master->dev, "%s: swrm is NULL\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (!dev_num) {
|
|
|
- dev_err(&master->dev, "%s: invalid slave dev num\n", __func__);
|
|
|
+ dev_err_ratelimited(&master->dev, "%s: invalid slave dev num\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
mutex_lock(&swrm->devlock);
|
|
@@ -1038,11 +1038,11 @@ static int swrm_write(struct swr_master *master, u8 dev_num, u16 reg_addr,
|
|
|
u8 reg_val = *(u8 *)buf;
|
|
|
|
|
|
if (!swrm) {
|
|
|
- dev_err(&master->dev, "%s: swrm is NULL\n", __func__);
|
|
|
+ dev_err_ratelimited(&master->dev, "%s: swrm is NULL\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (!dev_num) {
|
|
|
- dev_err(&master->dev, "%s: invalid slave dev num\n", __func__);
|
|
|
+ dev_err_ratelimited(&master->dev, "%s: invalid slave dev num\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
mutex_lock(&swrm->devlock);
|
|
@@ -1073,7 +1073,7 @@ static int swrm_bulk_write(struct swr_master *master, u8 dev_num, void *reg,
|
|
|
u32 *swr_fifo_reg;
|
|
|
|
|
|
if (!swrm || !swrm->handle) {
|
|
|
- dev_err(&master->dev, "%s: swrm is NULL\n", __func__);
|
|
|
+ dev_err_ratelimited(&master->dev, "%s: swrm is NULL\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
if (len <= 0)
|
|
@@ -1107,12 +1107,12 @@ static int swrm_bulk_write(struct swr_master *master, u8 dev_num, void *reg,
|
|
|
}
|
|
|
ret = swr_master_bulk_write(swrm, swr_fifo_reg, val, len);
|
|
|
if (ret) {
|
|
|
- dev_err(&master->dev, "%s: bulk write failed\n",
|
|
|
+ dev_err_ratelimited(&master->dev, "%s: bulk write failed\n",
|
|
|
__func__);
|
|
|
ret = -EINVAL;
|
|
|
}
|
|
|
} else {
|
|
|
- dev_err(&master->dev,
|
|
|
+ dev_err_ratelimited(&master->dev,
|
|
|
"%s: No support of Bulk write for master regs\n",
|
|
|
__func__);
|
|
|
ret = -EINVAL;
|
|
@@ -1265,7 +1265,7 @@ static void swrm_disable_ports(struct swr_master *master,
|
|
|
struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master);
|
|
|
|
|
|
if (!swrm) {
|
|
|
- pr_err("%s: swrm is null\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: swrm is null\n", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -1320,7 +1320,7 @@ static void swrm_cleanup_disabled_port_reqs(struct swr_master *master)
|
|
|
struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master);
|
|
|
|
|
|
if (!swrm) {
|
|
|
- pr_err("%s: swrm is null\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: swrm is null\n", __func__);
|
|
|
return;
|
|
|
}
|
|
|
dev_dbg(swrm->dev, "%s: master num_port: %d\n", __func__,
|
|
@@ -1456,7 +1456,7 @@ static void swrm_copy_data_port_config(struct swr_master *master, u8 bank)
|
|
|
u8 dev_offset[SWRM_NUM_AUTO_ENUM_SLAVES];
|
|
|
|
|
|
if (!swrm) {
|
|
|
- pr_err("%s: swrm is null\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: swrm is null\n", __func__);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -1490,7 +1490,7 @@ static void swrm_copy_data_port_config(struct swr_master *master, u8 bank)
|
|
|
lane_ctrl = port_req->lane_ctrl;
|
|
|
} else if (sinterval != port_req->sinterval ||
|
|
|
lane_ctrl != port_req->lane_ctrl) {
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s:slaves/slave ports attaching to mport%d"\
|
|
|
" are not using same SI or data lane, update slave tables,"\
|
|
|
"bailing out without setting port config\n",
|
|
@@ -1644,7 +1644,7 @@ static void swrm_apply_port_config(struct swr_master *master)
|
|
|
struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(master);
|
|
|
|
|
|
if (!swrm) {
|
|
|
- pr_err("%s: Invalid handle to swr controller\n",
|
|
|
+ pr_err_ratelimited("%s: Invalid handle to swr controller\n",
|
|
|
__func__);
|
|
|
return;
|
|
|
}
|
|
@@ -1675,7 +1675,7 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable)
|
|
|
int frame_sync = SWRM_FRAME_SYNC_SEL;
|
|
|
|
|
|
if (!swrm) {
|
|
|
- pr_err("%s: swrm is null\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: swrm is null\n", __func__);
|
|
|
return -EFAULT;
|
|
|
}
|
|
|
|
|
@@ -1818,7 +1818,7 @@ static int swrm_connect_port(struct swr_master *master,
|
|
|
return -EINVAL;
|
|
|
|
|
|
if (!swrm) {
|
|
|
- dev_err(&master->dev,
|
|
|
+ dev_err_ratelimited(&master->dev,
|
|
|
"%s: Invalid handle to swr controller\n",
|
|
|
__func__);
|
|
|
return -EINVAL;
|
|
@@ -1841,7 +1841,7 @@ static int swrm_connect_port(struct swr_master *master,
|
|
|
portinfo->port_type[i],
|
|
|
portinfo->port_id[i]);
|
|
|
if (ret) {
|
|
|
- dev_err(&master->dev,
|
|
|
+ dev_err_ratelimited(&master->dev,
|
|
|
"%s: mstr portid for slv port %d not found\n",
|
|
|
__func__, portinfo->port_id[i]);
|
|
|
goto port_fail;
|
|
@@ -1922,14 +1922,14 @@ static int swrm_disconnect_port(struct swr_master *master,
|
|
|
u8 mstr_port_id, mstr_ch_mask;
|
|
|
|
|
|
if (!swrm) {
|
|
|
- dev_err(&master->dev,
|
|
|
+ dev_err_ratelimited(&master->dev,
|
|
|
"%s: Invalid handle to swr controller\n",
|
|
|
__func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
if (!portinfo) {
|
|
|
- dev_err(&master->dev, "%s: portinfo is NULL\n", __func__);
|
|
|
+ dev_err_ratelimited(&master->dev, "%s: portinfo is NULL\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
mutex_lock(&swrm->mlock);
|
|
@@ -1939,7 +1939,7 @@ static int swrm_disconnect_port(struct swr_master *master,
|
|
|
ret = swrm_get_master_port(swrm, &mstr_port_id, &mstr_ch_mask,
|
|
|
portinfo->port_type[i], portinfo->port_id[i]);
|
|
|
if (ret) {
|
|
|
- dev_err(&master->dev,
|
|
|
+ dev_err_ratelimited(&master->dev,
|
|
|
"%s: mstr portid for slv port %d not found\n",
|
|
|
__func__, portinfo->port_id[i]);
|
|
|
goto err;
|
|
@@ -1950,7 +1950,7 @@ static int swrm_disconnect_port(struct swr_master *master,
|
|
|
portinfo->dev_num);
|
|
|
|
|
|
if (!port_req) {
|
|
|
- dev_err(&master->dev, "%s:port not enabled : port %d\n",
|
|
|
+ dev_err_ratelimited(&master->dev, "%s:port not enabled : port %d\n",
|
|
|
__func__, portinfo->port_id[i]);
|
|
|
goto err;
|
|
|
}
|
|
@@ -2061,7 +2061,7 @@ static irqreturn_t swr_mstr_interrupt(int irq, void *dev)
|
|
|
|
|
|
trace_printk("%s enter\n", __func__);
|
|
|
if (unlikely(swrm_lock_sleep(swrm) == false)) {
|
|
|
- dev_err(swrm->dev, "%s Failed to hold suspend\n", __func__);
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s Failed to hold suspend\n", __func__);
|
|
|
return IRQ_NONE;
|
|
|
}
|
|
|
|
|
@@ -2076,7 +2076,7 @@ static irqreturn_t swr_mstr_interrupt(int irq, void *dev)
|
|
|
}
|
|
|
ret = swrm_clk_request(swrm, true);
|
|
|
if (ret) {
|
|
|
- dev_err(dev, "%s: swrm clk failed\n", __func__);
|
|
|
+ dev_err_ratelimited(dev, "%s: swrm clk failed\n", __func__);
|
|
|
ret = IRQ_NONE;
|
|
|
goto err_audio_core_vote;
|
|
|
}
|
|
@@ -2188,19 +2188,19 @@ handle_irq:
|
|
|
break;
|
|
|
case SWRM_INTERRUPT_STATUS_RD_FIFO_OVERFLOW:
|
|
|
value = swr_master_read(swrm, SWRM_CMD_FIFO_STATUS(swrm->ee_val));
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s: SWR read FIFO overflow fifo status %x\n",
|
|
|
__func__, value);
|
|
|
break;
|
|
|
case SWRM_INTERRUPT_STATUS_RD_FIFO_UNDERFLOW:
|
|
|
value = swr_master_read(swrm, SWRM_CMD_FIFO_STATUS(swrm->ee_val));
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s: SWR read FIFO underflow fifo status %x\n",
|
|
|
__func__, value);
|
|
|
break;
|
|
|
case SWRM_INTERRUPT_STATUS_WR_CMD_FIFO_OVERFLOW:
|
|
|
value = swr_master_read(swrm, SWRM_CMD_FIFO_STATUS(swrm->ee_val));
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s: SWR write FIFO overflow fifo status %x\n",
|
|
|
__func__, value);
|
|
|
break;
|
|
@@ -2330,7 +2330,7 @@ static irqreturn_t swrm_wakeup_interrupt(int irq, void *dev)
|
|
|
int ret = IRQ_HANDLED;
|
|
|
|
|
|
if (!swrm || !(swrm->dev)) {
|
|
|
- pr_err("%s: swrm or dev is null\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: swrm or dev is null\n", __func__);
|
|
|
return IRQ_NONE;
|
|
|
}
|
|
|
|
|
@@ -2339,7 +2339,7 @@ static irqreturn_t swrm_wakeup_interrupt(int irq, void *dev)
|
|
|
if (swrm->state == SWR_MSTR_SSR || !swrm->dev_up) {
|
|
|
if (swrm->wake_irq > 0) {
|
|
|
if (unlikely(!irq_get_irq_data(swrm->wake_irq))) {
|
|
|
- pr_err("%s: irq data is NULL\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: irq data is NULL\n", __func__);
|
|
|
mutex_unlock(&swrm->devlock);
|
|
|
return IRQ_NONE;
|
|
|
}
|
|
@@ -2354,12 +2354,12 @@ static irqreturn_t swrm_wakeup_interrupt(int irq, void *dev)
|
|
|
}
|
|
|
mutex_unlock(&swrm->devlock);
|
|
|
if (unlikely(swrm_lock_sleep(swrm) == false)) {
|
|
|
- dev_err(swrm->dev, "%s Failed to hold suspend\n", __func__);
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s Failed to hold suspend\n", __func__);
|
|
|
goto exit;
|
|
|
}
|
|
|
if (swrm->wake_irq > 0) {
|
|
|
if (unlikely(!irq_get_irq_data(swrm->wake_irq))) {
|
|
|
- pr_err("%s: irq data is NULL\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: irq data is NULL\n", __func__);
|
|
|
return IRQ_NONE;
|
|
|
}
|
|
|
mutex_lock(&swrm->irq_lock);
|
|
@@ -2472,7 +2472,7 @@ static int swrm_get_logical_dev_num(struct swr_master *mstr, u64 dev_id,
|
|
|
}
|
|
|
}
|
|
|
if (ret)
|
|
|
- dev_err_ratelimited(swrm->dev,
|
|
|
+ dev_err(swrm->dev,
|
|
|
"%s: device 0x%llx is not ready\n",
|
|
|
__func__, dev_id);
|
|
|
|
|
@@ -2507,19 +2507,19 @@ static void swrm_device_wakeup_vote(struct swr_master *mstr)
|
|
|
struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(mstr);
|
|
|
|
|
|
if (!swrm) {
|
|
|
- pr_err("%s: Invalid handle to swr controller\n",
|
|
|
+ pr_err_ratelimited("%s: Invalid handle to swr controller\n",
|
|
|
__func__);
|
|
|
return;
|
|
|
}
|
|
|
if (unlikely(swrm_lock_sleep(swrm) == false)) {
|
|
|
- dev_err(swrm->dev, "%s Failed to hold suspend\n", __func__);
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s Failed to hold suspend\n", __func__);
|
|
|
return;
|
|
|
}
|
|
|
if (swrm_request_hw_vote(swrm, LPASS_HW_CORE, true))
|
|
|
- dev_err(swrm->dev, "%s:lpass core hw enable failed\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s:lpass core hw enable failed\n",
|
|
|
__func__);
|
|
|
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true))
|
|
|
- dev_err(swrm->dev, "%s:lpass audio hw enable failed\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s:lpass audio hw enable failed\n",
|
|
|
__func__);
|
|
|
|
|
|
pm_runtime_get_sync(swrm->dev);
|
|
@@ -2530,7 +2530,7 @@ static void swrm_device_wakeup_unvote(struct swr_master *mstr)
|
|
|
struct swr_mstr_ctrl *swrm = swr_get_ctrl_data(mstr);
|
|
|
|
|
|
if (!swrm) {
|
|
|
- pr_err("%s: Invalid handle to swr controller\n",
|
|
|
+ pr_err_ratelimited("%s: Invalid handle to swr controller\n",
|
|
|
__func__);
|
|
|
return;
|
|
|
}
|
|
@@ -2655,7 +2655,7 @@ static int swrm_event_notify(struct notifier_block *self,
|
|
|
event_notifier);
|
|
|
|
|
|
if (!swrm || !(swrm->dev)) {
|
|
|
- pr_err("%s: swrm or dev is NULL\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: swrm or dev is NULL\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
switch (action) {
|
|
@@ -2670,7 +2670,7 @@ static int swrm_event_notify(struct notifier_block *self,
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
- dev_err(swrm->dev, "%s: invalid event type: %lu\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: invalid event type: %lu\n",
|
|
|
__func__, action);
|
|
|
return -EINVAL;
|
|
|
}
|
|
@@ -2684,7 +2684,7 @@ static void swrm_notify_work_fn(struct work_struct *work)
|
|
|
dc_presence_work);
|
|
|
|
|
|
if (!swrm || !swrm->pdev) {
|
|
|
- pr_err("%s: swrm or pdev is NULL\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: swrm or pdev is NULL\n", __func__);
|
|
|
return;
|
|
|
}
|
|
|
swrm_wcd_notify(swrm->pdev, SWR_DEVICE_DOWN, NULL);
|
|
@@ -3203,7 +3203,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
mutex_lock(&swrm->reslock);
|
|
|
|
|
|
if (swrm_request_hw_vote(swrm, LPASS_HW_CORE, true)) {
|
|
|
- dev_err(dev, "%s:lpass core hw enable failed\n",
|
|
|
+ dev_err_ratelimited(dev, "%s:lpass core hw enable failed\n",
|
|
|
__func__);
|
|
|
hw_core_err = true;
|
|
|
pm_runtime_set_autosuspend_delay(&pdev->dev,
|
|
@@ -3216,7 +3216,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
}
|
|
|
|
|
|
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) {
|
|
|
- dev_err(dev, "%s:lpass audio hw enable failed\n",
|
|
|
+ dev_err_ratelimited(dev, "%s:lpass audio hw enable failed\n",
|
|
|
__func__);
|
|
|
aud_core_err = true;
|
|
|
}
|
|
@@ -3227,7 +3227,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
if (swrm->wake_irq > 0) {
|
|
|
if (unlikely(!irq_get_irq_data
|
|
|
(swrm->wake_irq))) {
|
|
|
- pr_err("%s: irq data is NULL\n",
|
|
|
+ pr_err_ratelimited("%s: irq data is NULL\n",
|
|
|
__func__);
|
|
|
mutex_unlock(&swrm->reslock);
|
|
|
mutex_unlock(&swrm->runtime_lock);
|
|
@@ -3240,7 +3240,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
mutex_unlock(&swrm->irq_lock);
|
|
|
}
|
|
|
if (swrm->ipc_wakeup)
|
|
|
- dev_err(dev, "%s:notifications disabled\n", __func__);
|
|
|
+ dev_err_ratelimited(dev, "%s:notifications disabled\n", __func__);
|
|
|
// msm_aud_evt_blocking_notifier_call_chain(
|
|
|
// SWR_WAKE_IRQ_DEREGISTER, (void *)swrm);
|
|
|
}
|
|
@@ -3265,7 +3265,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|
|
__func__);
|
|
|
ret = 0;
|
|
|
} else if (ret) {
|
|
|
- dev_err(dev,
|
|
|
+ dev_err_ratelimited(dev,
|
|
|
"%s: failed to wakeup swr dev %d\n",
|
|
|
__func__, swr_dev->dev_num);
|
|
|
swrm_clk_request(swrm, false);
|
|
@@ -3358,7 +3358,7 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
mutex_unlock(&swrm->force_down_lock);
|
|
|
|
|
|
if (swrm_request_hw_vote(swrm, LPASS_HW_CORE, true)) {
|
|
|
- dev_err(dev, "%s:lpass core hw enable failed\n",
|
|
|
+ dev_err_ratelimited(dev, "%s:lpass core hw enable failed\n",
|
|
|
__func__);
|
|
|
hw_core_err = true;
|
|
|
}
|
|
@@ -3376,7 +3376,7 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
goto exit;
|
|
|
}
|
|
|
if (!swrm->clk_stop_mode0_supp || swrm->state == SWR_MSTR_SSR) {
|
|
|
- dev_err(dev, "%s: clk stop mode not supported or SSR entry\n",
|
|
|
+ dev_err_ratelimited(dev, "%s: clk stop mode not supported or SSR entry\n",
|
|
|
__func__);
|
|
|
mutex_unlock(&swrm->reslock);
|
|
|
enable_bank_switch(swrm, 0, SWR_ROW_50, SWR_MIN_COL);
|
|
@@ -3394,7 +3394,7 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
__func__);
|
|
|
ret = 0;
|
|
|
} else if (ret) {
|
|
|
- dev_err(dev,
|
|
|
+ dev_err_ratelimited(dev,
|
|
|
"%s: failed to shutdown swr dev %d\n",
|
|
|
__func__, swr_dev->dev_num);
|
|
|
trace_printk(
|
|
@@ -3422,7 +3422,7 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
__func__);
|
|
|
ret = swrm_clk_request(swrm, false);
|
|
|
if (ret) {
|
|
|
- dev_err(dev, "%s: swrmn clk failed\n", __func__);
|
|
|
+ dev_err_ratelimited(dev, "%s: swrmn clk failed\n", __func__);
|
|
|
ret = 0;
|
|
|
goto exit;
|
|
|
}
|
|
@@ -3435,7 +3435,7 @@ static int swrm_runtime_suspend(struct device *dev)
|
|
|
} else if (swrm->ipc_wakeup) {
|
|
|
//msm_aud_evt_blocking_notifier_call_chain(
|
|
|
// SWR_WAKE_IRQ_REGISTER, (void *)swrm);
|
|
|
- dev_err(dev, "%s:notifications disabled\n", __func__);
|
|
|
+ dev_err_ratelimited(dev, "%s:notifications disabled\n", __func__);
|
|
|
swrm->ipc_wakeup_triggered = false;
|
|
|
}
|
|
|
}
|
|
@@ -3513,7 +3513,7 @@ int swrm_register_wake_irq(struct swr_mstr_ctrl *swrm)
|
|
|
if (gpio_is_valid(irq)) {
|
|
|
swrm->wake_irq = gpio_to_irq(irq);
|
|
|
if (swrm->wake_irq < 0) {
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"Unable to configure irq\n");
|
|
|
return swrm->wake_irq;
|
|
|
}
|
|
@@ -3521,7 +3521,7 @@ int swrm_register_wake_irq(struct swr_mstr_ctrl *swrm)
|
|
|
dir_apps_irq = platform_get_irq_byname(swrm->pdev,
|
|
|
"swr_wake_irq");
|
|
|
if (dir_apps_irq < 0) {
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"TLMM connect gpio not found\n");
|
|
|
return -EINVAL;
|
|
|
}
|
|
@@ -3532,7 +3532,7 @@ int swrm_register_wake_irq(struct swr_mstr_ctrl *swrm)
|
|
|
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
|
|
|
"swr_wake_irq", swrm);
|
|
|
if (ret) {
|
|
|
- dev_err(swrm->dev, "%s: Failed to request irq %d\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: Failed to request irq %d\n",
|
|
|
__func__, ret);
|
|
|
return -EINVAL;
|
|
|
}
|
|
@@ -3577,7 +3577,7 @@ static int swrm_copy_port_config(struct swr_mstr_ctrl *swrm,
|
|
|
for (idx = 0; idx < size; idx++) {
|
|
|
params = &((struct port_params *)port_cfg->params)[idx];
|
|
|
if (!params) {
|
|
|
- dev_err(swrm->dev, "%s: Invalid params\n", __func__);
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: Invalid params\n", __func__);
|
|
|
ret = -EINVAL;
|
|
|
break;
|
|
|
}
|
|
@@ -3604,12 +3604,12 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
struct swrm_port_config *port_cfg;
|
|
|
|
|
|
if (!pdev) {
|
|
|
- pr_err("%s: pdev is NULL\n", __func__);
|
|
|
+ pr_err_ratelimited("%s: pdev is NULL\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
swrm = platform_get_drvdata(pdev);
|
|
|
if (!swrm) {
|
|
|
- dev_err(&pdev->dev, "%s: swrm is NULL\n", __func__);
|
|
|
+ dev_err_ratelimited(&pdev->dev, "%s: swrm is NULL\n", __func__);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
mstr = &swrm->master;
|
|
@@ -3622,7 +3622,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
* source.
|
|
|
*/
|
|
|
if (!data) {
|
|
|
- dev_err(swrm->dev, "%s: data is NULL for id:%d\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: data is NULL for id:%d\n",
|
|
|
__func__, id);
|
|
|
ret = -EINVAL;
|
|
|
break;
|
|
@@ -3641,7 +3641,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
break;
|
|
|
case SWR_CLK_FREQ:
|
|
|
if (!data) {
|
|
|
- dev_err(swrm->dev, "%s: data is NULL\n", __func__);
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: data is NULL\n", __func__);
|
|
|
ret = -EINVAL;
|
|
|
} else {
|
|
|
mutex_lock(&swrm->mlock);
|
|
@@ -3694,7 +3694,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
if (swrm->clk_ref_count &&
|
|
|
!wait_for_completion_timeout(&swrm->clk_off_complete,
|
|
|
msecs_to_jiffies(500)))
|
|
|
- dev_err(swrm->dev, "%s: clock voting not zero\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: clock voting not zero\n",
|
|
|
__func__);
|
|
|
|
|
|
if (swrm->state == SWR_MSTR_UP ||
|
|
@@ -3746,7 +3746,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
__func__);
|
|
|
ret = 0;
|
|
|
} else if (ret) {
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s: failed to reset swr device %d\n",
|
|
|
__func__, swr_dev->dev_num);
|
|
|
swrm_clk_request(swrm, false);
|
|
@@ -3759,7 +3759,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
break;
|
|
|
case SWR_SET_NUM_RX_CH:
|
|
|
if (!data) {
|
|
|
- dev_err(swrm->dev, "%s: data is NULL\n", __func__);
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: data is NULL\n", __func__);
|
|
|
ret = -EINVAL;
|
|
|
} else {
|
|
|
mutex_lock(&swrm->mlock);
|
|
@@ -3770,7 +3770,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
ret = swr_set_device_group(swr_dev,
|
|
|
SWR_BROADCAST);
|
|
|
if (ret)
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s: set num ch failed\n",
|
|
|
__func__);
|
|
|
}
|
|
@@ -3780,7 +3780,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
ret = swr_set_device_group(swr_dev,
|
|
|
SWR_GROUP_NONE);
|
|
|
if (ret)
|
|
|
- dev_err(swrm->dev,
|
|
|
+ dev_err_ratelimited(swrm->dev,
|
|
|
"%s: set num ch failed\n",
|
|
|
__func__);
|
|
|
}
|
|
@@ -3790,7 +3790,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
break;
|
|
|
case SWR_REGISTER_WAKE_IRQ:
|
|
|
if (!data) {
|
|
|
- dev_err(swrm->dev, "%s: reg wake irq data is NULL\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: reg wake irq data is NULL\n",
|
|
|
__func__);
|
|
|
ret = -EINVAL;
|
|
|
} else {
|
|
@@ -3798,7 +3798,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
swrm->ipc_wakeup = *(u32 *)data;
|
|
|
ret = swrm_register_wake_irq(swrm);
|
|
|
if (ret)
|
|
|
- dev_err(swrm->dev, "%s: register wake_irq failed\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: register wake_irq failed\n",
|
|
|
__func__);
|
|
|
mutex_unlock(&swrm->mlock);
|
|
|
}
|
|
@@ -3813,7 +3813,7 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|
|
break;
|
|
|
case SWR_SET_PORT_MAP:
|
|
|
if (!data) {
|
|
|
- dev_err(swrm->dev, "%s: data is NULL for id=%d\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: data is NULL for id=%d\n",
|
|
|
__func__, id);
|
|
|
ret = -EINVAL;
|
|
|
} else {
|
|
@@ -3833,7 +3833,7 @@ done:
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
- dev_err(swrm->dev, "%s: swr master unknown id %d\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: swr master unknown id %d\n",
|
|
|
__func__, id);
|
|
|
break;
|
|
|
}
|
|
@@ -3899,7 +3899,7 @@ static bool swrm_lock_sleep(struct swr_mstr_ctrl *swrm)
|
|
|
(os == SWRM_PM_AWAKE)),
|
|
|
msecs_to_jiffies(
|
|
|
SWRM_SYSTEM_RESUME_TIMEOUT_MS))) {
|
|
|
- dev_err(swrm->dev, "%s: system didn't resume within %dms, s %d, w %d\n",
|
|
|
+ dev_err_ratelimited(swrm->dev, "%s: system didn't resume within %dms, s %d, w %d\n",
|
|
|
__func__, SWRM_SYSTEM_RESUME_TIMEOUT_MS, swrm->pm_state,
|
|
|
swrm->wlock_holders);
|
|
|
swrm_unlock_sleep(swrm);
|