mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
Audio: delete format for spdif, update format for dai1 of rt3224
This commit is contained in:
@@ -142,6 +142,12 @@
|
||||
|
||||
rockchip-hdmi-spdif {
|
||||
compatible = "rockchip-hdmi-spdif";
|
||||
dais {
|
||||
dai0 {
|
||||
audio-codec = <&codec_hdmi_spdif>;
|
||||
i2s-controller = <&spdif>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vmac-phy {
|
||||
|
||||
@@ -109,14 +109,8 @@
|
||||
dai0 {
|
||||
audio-codec = <&codec_hdmi_spdif>;
|
||||
i2s-controller = <&spdif>;
|
||||
format = "spdif";
|
||||
//continuous-clock;
|
||||
//bitclock-inversion;
|
||||
//frame-inversion;
|
||||
//bitclock-master;
|
||||
//frame-master;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rockchip-rt5631 {
|
||||
@@ -149,11 +143,11 @@
|
||||
//frame-master;
|
||||
};
|
||||
dai1 {
|
||||
audio-codec = <&rt3261>;
|
||||
i2s-controller = <&i2s>;
|
||||
format = "i2s";
|
||||
audio-codec = <&codec_of_node>;
|
||||
i2s-controller = <&cpu_of_node>;
|
||||
format = "dsp_a";
|
||||
//continuous-clock;
|
||||
//bitclock-inversion;
|
||||
bitclock-inversion;
|
||||
//frame-inversion;
|
||||
//bitclock-master;
|
||||
//frame-master;
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
};
|
||||
};
|
||||
*/
|
||||
int rockchip_of_get_sound_card_info(struct snd_soc_card *card)
|
||||
int rockchip_of_get_sound_card_info_(struct snd_soc_card *card, bool is_need_fmt)
|
||||
{
|
||||
struct device_node *dai_node, *child_dai_node;
|
||||
int dai_num;
|
||||
@@ -73,18 +73,20 @@ int rockchip_of_get_sound_card_info(struct snd_soc_card *card)
|
||||
|
||||
for_each_child_of_node(dai_node, child_dai_node) {
|
||||
|
||||
card->dai_link[dai_num].dai_fmt = snd_soc_of_parse_daifmt(child_dai_node, NULL);
|
||||
if ((card->dai_link[dai_num].dai_fmt & SND_SOC_DAIFMT_MASTER_MASK) == 0) {
|
||||
dev_err(card->dev,
|
||||
"Property 'format' missing or invalid\n");
|
||||
return -EINVAL;
|
||||
if (is_need_fmt) {
|
||||
card->dai_link[dai_num].dai_fmt = snd_soc_of_parse_daifmt(child_dai_node, NULL);
|
||||
if ((card->dai_link[dai_num].dai_fmt & SND_SOC_DAIFMT_MASTER_MASK) == 0) {
|
||||
dev_err(card->dev,
|
||||
"Property 'format' missing or invalid\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
card->dai_link[dai_num].codec_name = NULL;
|
||||
card->dai_link[dai_num].cpu_dai_name = NULL;
|
||||
card->dai_link[dai_num].platform_name= NULL;
|
||||
card->dai_link[dai_num].platform_name = NULL;
|
||||
|
||||
card->dai_link[dai_num].codec_of_node= of_parse_phandle(child_dai_node,
|
||||
card->dai_link[dai_num].codec_of_node = of_parse_phandle(child_dai_node,
|
||||
"audio-codec", 0);
|
||||
if (!card->dai_link[dai_num].codec_of_node) {
|
||||
dev_err(card->dev,
|
||||
@@ -92,7 +94,7 @@ int rockchip_of_get_sound_card_info(struct snd_soc_card *card)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
card->dai_link[dai_num].cpu_of_node= of_parse_phandle(child_dai_node,
|
||||
card->dai_link[dai_num].cpu_of_node = of_parse_phandle(child_dai_node,
|
||||
"i2s-controller", 0);
|
||||
if (!card->dai_link[dai_num].cpu_of_node) {
|
||||
dev_err(card->dev,
|
||||
@@ -114,6 +116,12 @@ int rockchip_of_get_sound_card_info(struct snd_soc_card *card)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rockchip_of_get_sound_card_info_);
|
||||
|
||||
int rockchip_of_get_sound_card_info(struct snd_soc_card *card)
|
||||
{
|
||||
return rockchip_of_get_sound_card_info_(card, true);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rockchip_of_get_sound_card_info);
|
||||
|
||||
/* Module information */
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#ifndef _SND_SOC_ROCKCHIP_CARD_INFO_H
|
||||
#define _SND_SOC_ROCKCHIP_CARD_INFO_H
|
||||
|
||||
int rockchip_of_get_sound_card_info_(struct snd_soc_card *card, bool is_need_fmt);
|
||||
int rockchip_of_get_sound_card_info(struct snd_soc_card *card);
|
||||
|
||||
#endif /* _SND_SOC_ROCKCHIP_CARD_INFO_H */
|
||||
|
||||
@@ -29,19 +29,11 @@ static int hdmi_i2s_hifi_hw_params(struct snd_pcm_substream *substream,
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
|
||||
struct snd_soc_dai *codec_dai = rtd->codec_dai;
|
||||
unsigned int pll_out = 0, dai_fmt = rtd->dai_link->dai_fmt;
|
||||
int ret;
|
||||
|
||||
DBG("Enter::%s----%d\n", __FUNCTION__, __LINE__);
|
||||
#if 0
|
||||
/* set codec DAI configuration */
|
||||
ret = snd_soc_dai_set_fmt(codec_dai, dai_fmt);
|
||||
if (ret < 0) {
|
||||
printk("%s():failed to set the format for codec side\n", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* set cpu DAI configuration */
|
||||
ret = snd_soc_dai_set_fmt(cpu_dai, dai_fmt);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -37,9 +37,12 @@
|
||||
static int set_audio_clock_rate(unsigned long pll_rate,
|
||||
unsigned long audio_rate)
|
||||
{
|
||||
struct clk *hclk_spdif, *sclk_spdif;
|
||||
struct clk *sclk_spdif;
|
||||
#if defined (CONFIG_ARCH_RK30) || defined (CONFIG_ARCH_RK3188)
|
||||
struct clk *hclk_spdif;
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_ARCH_RK30) || (CONFIG_ARCH_RK3188)
|
||||
#if defined (CONFIG_ARCH_RK30) || defined (CONFIG_ARCH_RK3188)
|
||||
hclk_spdif = clk_get(NULL, "hclk_spdif");
|
||||
if (IS_ERR(hclk_spdif)) {
|
||||
printk(KERN_ERR "spdif:failed to get hclk_spdif\n");
|
||||
@@ -131,9 +134,7 @@ static struct snd_soc_ops rk_spdif_ops = {
|
||||
static struct snd_soc_dai_link rk_dai = {
|
||||
.name = "SPDIF",
|
||||
.stream_name = "SPDIF PCM Playback",
|
||||
.cpu_dai_name = "rockchip-spdif",
|
||||
.codec_dai_name = "rk-hdmi-spdif-hifi",
|
||||
.codec_name = "hdmi-spdif",
|
||||
.ops = &rk_spdif_ops,
|
||||
};
|
||||
|
||||
@@ -150,7 +151,7 @@ static int rockchip_hdmi_spdif_audio_probe(struct platform_device *pdev)
|
||||
|
||||
card->dev = &pdev->dev;
|
||||
|
||||
ret = rockchip_of_get_sound_card_info(card);
|
||||
ret = rockchip_of_get_sound_card_info_(card, false);
|
||||
if (ret) {
|
||||
printk("%s() get sound card info failed:%d\n", __FUNCTION__, ret);
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user