mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
ASoC: rockchip: i2s: add support 'rockchip,clk-trcm' property
If there is only one lrck (tx or rx) by hardware, we need to use 'rockchip,clk-trcm' specify which lrck can be used. Change-Id: I3bf8d87a6bc8c45e183040012d87d8be21a4c133 Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
This commit is contained in:
parent
bb7bcb0a02
commit
b73b288508
|
|
@ -53,6 +53,7 @@ struct rk_i2s_dev {
|
|||
bool is_master_mode;
|
||||
const struct rk_i2s_pins *pins;
|
||||
unsigned int bclk_fs;
|
||||
unsigned int clk_trcm;
|
||||
};
|
||||
|
||||
/* txctrl/rxctrl lock */
|
||||
|
|
@ -292,7 +293,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct rk_i2s_dev *i2s = to_info(dai);
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
unsigned int val = 0;
|
||||
unsigned int mclk_rate, bclk_rate, div_bclk, div_lrck;
|
||||
|
||||
|
|
@ -392,13 +392,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream,
|
|||
regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_RDL_MASK,
|
||||
I2S_DMACR_RDL(16));
|
||||
|
||||
val = I2S_CKR_TRCM_TXRX;
|
||||
if (dai->driver->symmetric_rates && rtd->dai_link->symmetric_rates)
|
||||
val = I2S_CKR_TRCM_TXONLY;
|
||||
|
||||
regmap_update_bits(i2s->regmap, I2S_CKR,
|
||||
I2S_CKR_TRCM_MASK,
|
||||
val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -488,7 +481,6 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = {
|
|||
SNDRV_PCM_FMTBIT_S32_LE),
|
||||
},
|
||||
.ops = &rockchip_i2s_dai_ops,
|
||||
.symmetric_rates = 1,
|
||||
};
|
||||
|
||||
static const struct snd_soc_component_driver rockchip_i2s_component = {
|
||||
|
|
@ -688,6 +680,18 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
|
|||
i2s->bclk_fs = val;
|
||||
}
|
||||
|
||||
i2s->clk_trcm = I2S_CKR_TRCM_TXRX;
|
||||
if (!of_property_read_u32(node, "rockchip,clk-trcm", &val)) {
|
||||
if (val >= 0 && val <= 2) {
|
||||
i2s->clk_trcm = val << I2S_CKR_TRCM_SHIFT;
|
||||
if (i2s->clk_trcm)
|
||||
soc_dai->symmetric_rates = 1;
|
||||
}
|
||||
}
|
||||
|
||||
regmap_update_bits(i2s->regmap, I2S_CKR,
|
||||
I2S_CKR_TRCM_MASK, i2s->clk_trcm);
|
||||
|
||||
ret = devm_snd_soc_register_component(&pdev->dev,
|
||||
&rockchip_i2s_component,
|
||||
soc_dai, 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user