sound soc-core:codec_name not adapted i2c_name

change i2s id
This commit is contained in:
qjb
2014-03-05 16:42:52 +08:00
parent 05427aa0c9
commit 392a497fe0
3 changed files with 23 additions and 6 deletions

6
arch/arm/boot/dts/rk3188-tb.dts Normal file → Executable file
View File

@@ -69,7 +69,7 @@
dais {
dai0 {
codec-name = "rt5631.0-001a";
cpu-dai-name = "rockchip-i2s.1";
cpu-dai-name = "rockchip-i2s.0";
format = "i2s";
//continuous-clock;
//bitclock-inversion;
@@ -85,7 +85,7 @@
dais {
dai0 {
codec-name = "rk610_codec.0-0060";
cpu-dai-name = "rockchip-i2s.1";
cpu-dai-name = "rockchip-i2s.0";
format = "i2s";
//continuous-clock;
//bitclock-inversion;
@@ -101,7 +101,7 @@
dais {
dai0 {
codec-name = "hdmi-i2s";
cpu-dai-name = "rockchip-i2s.1";
cpu-dai-name = "rockchip-i2s.0";
format = "i2s";
//continuous-clock;
//bitclock-inversion;

View File

@@ -465,10 +465,10 @@
pinctrl-0 = <&spdif_tx>;
};
i2s1: rockchip-i2s@0x1011a000 {
i2s0: rockchip-i2s@0x1011a000 {
compatible = "rockchip-i2s";
reg = <0x1011a000 0x2000>;
i2s-id = <1>;
i2s-id = <0>;
clocks = <&clk_i2s>;
clock-names = "i2s_clk";
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;

19
sound/soc/soc-core.c Normal file → Executable file
View File

@@ -815,6 +815,7 @@ EXPORT_SYMBOL_GPL(snd_soc_resume);
static const struct snd_soc_dai_ops null_dai_ops = {
};
#define CODEC_NAME_CMP
static int soc_bind_dai_link(struct snd_soc_card *card, int num)
{
struct snd_soc_dai_link *dai_link = &card->dai_link[num];
@@ -824,6 +825,14 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
struct snd_soc_dai *codec_dai, *cpu_dai;
const char *platform_name;
#ifdef CODEC_NAME_CMP
char *p_codec_name;
char *p_dai_codec_name;
char tmp_codec_name[50];
char tmp_dai_codec_name[50];
p_codec_name = tmp_codec_name;
p_dai_codec_name = tmp_dai_codec_name;
#endif
dev_dbg(card->dev, "ASoC: binding %s at idx %d\n", dai_link->name, num);
/* Find CPU DAI from registered DAIs*/
@@ -853,7 +862,15 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
if (codec->dev->of_node != dai_link->codec_of_node)
continue;
} else {
if (strcmp(codec->name, dai_link->codec_name))
#ifdef CODEC_NAME_CMP
strcpy(p_codec_name,codec->name);
strcpy(p_dai_codec_name,dai_link->codec_name);
#endif
if (strcmp(codec->name, dai_link->codec_name)
#ifdef CODEC_NAME_CMP
&& strcmp(strsep(&p_codec_name,"."), strsep(&p_dai_codec_name,"."))
#endif
)
continue;
}