mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
ASoC: rockchip: i2s-tdm: Make reset property as optional
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com> Change-Id: I9707e8c763450f3a78f0fb419d90d9992cecfe59
This commit is contained in:
parent
d9f47a7b9c
commit
d11a687bd0
|
|
@ -241,10 +241,8 @@ static void rockchip_snd_xfer_sync_reset(struct rk_i2s_tdm_dev *i2s_tdm)
|
|||
|
||||
tx_id = i2s_tdm->soc_data->tx_reset_id;
|
||||
rx_id = i2s_tdm->soc_data->rx_reset_id;
|
||||
if (tx_id < 0 || rx_id < 0) {
|
||||
dev_err(i2s_tdm->dev, "invalid reset id\n");
|
||||
if (tx_id < 0 || rx_id < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
tx_bank = tx_id / 16;
|
||||
tx_offset = tx_id % 16;
|
||||
|
|
@ -329,6 +327,16 @@ static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream,
|
|||
spin_unlock(&i2s_tdm->lock);
|
||||
}
|
||||
|
||||
static void rockchip_snd_reset(struct reset_control *rc)
|
||||
{
|
||||
if (IS_ERR(rc))
|
||||
return;
|
||||
|
||||
reset_control_assert(rc);
|
||||
udelay(1);
|
||||
reset_control_deassert(rc);
|
||||
}
|
||||
|
||||
static void rockchip_snd_txctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
|
||||
{
|
||||
unsigned int val = 0;
|
||||
|
|
@ -362,9 +370,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
|
|||
retry--;
|
||||
if (!retry) {
|
||||
dev_warn(i2s_tdm->dev, "reset tx\n");
|
||||
reset_control_assert(i2s_tdm->tx_reset);
|
||||
udelay(1);
|
||||
reset_control_deassert(i2s_tdm->tx_reset);
|
||||
rockchip_snd_reset(i2s_tdm->tx_reset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -404,9 +410,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
|
|||
retry--;
|
||||
if (!retry) {
|
||||
dev_warn(i2s_tdm->dev, "reset rx\n");
|
||||
reset_control_assert(i2s_tdm->rx_reset);
|
||||
udelay(1);
|
||||
reset_control_deassert(i2s_tdm->rx_reset);
|
||||
rockchip_snd_reset(i2s_tdm->rx_reset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1402,11 +1406,7 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev)
|
|||
|
||||
i2s_tdm->soc_data = (struct rk_i2s_soc_data *)of_id->data;
|
||||
i2s_tdm->soc_data->tx_reset_id = of_i2s_resetid_get(node, "tx-m");
|
||||
if (i2s_tdm->soc_data->tx_reset_id < 0)
|
||||
return -EINVAL;
|
||||
i2s_tdm->soc_data->rx_reset_id = of_i2s_resetid_get(node, "rx-m");
|
||||
if (i2s_tdm->soc_data->rx_reset_id < 0)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
i2s_tdm->tx_reset = devm_reset_control_get(&pdev->dev, "tx-m");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user