From: 宋秀杰 Date: Mon, 21 Jan 2013 07:12:10 +0000 (+0800) Subject: rt3261: fix two little issue. X-Git-Tag: firefly_0821_release~7882 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=24c8d4550204f67a8ae9ae8f112d864bac46c620;p=firefly-linux-kernel-4.4.55.git rt3261: fix two little issue. --- diff --git a/sound/soc/codecs/rt3261.c b/sound/soc/codecs/rt3261.c index 5ab69f2d7e50..56718b900220 100644 --- a/sound/soc/codecs/rt3261.c +++ b/sound/soc/codecs/rt3261.c @@ -565,6 +565,10 @@ int rt3261_headset_mic_detect(int jack_insert) int sclk_src; #endif + if(rt3261_codec == NULL){ + return -1; + } + if(jack_insert) { if (SND_SOC_BIAS_OFF == rt3261_codec->dapm.bias_level) { snd_soc_write(rt3261_codec, RT3261_PWR_ANLG1, 0x2004); diff --git a/sound/soc/rk29/rk29_rt3261.c b/sound/soc/rk29/rk29_rt3261.c index 09117cf5a227..ba6db7f393c3 100644 --- a/sound/soc/rk29/rk29_rt3261.c +++ b/sound/soc/rk29/rk29_rt3261.c @@ -258,7 +258,11 @@ static struct snd_soc_dai_link rk29_dai[] = { .stream_name = "RT3261 PCM", .codec_name = "rt3261.0-001c", .platform_name = "rockchip-audio", - .cpu_dai_name = "rk29_i2s.0", + #if defined(CONFIG_SND_RK29_SOC_I2S_8CH) + .cpu_dai_name = "rk29_i2s.0", + #elif defined(CONFIG_SND_RK29_SOC_I2S_2CH) + .cpu_dai_name = "rk29_i2s.1", + #endif .codec_dai_name = "rt3261-aif1", .init = rk29_rt3261_init, .ops = &rk29_ops, @@ -268,7 +272,11 @@ static struct snd_soc_dai_link rk29_dai[] = { .stream_name = "RT3261 PCM", .codec_name = "rt3261.0-001c", .platform_name = "rockchip-audio", - .cpu_dai_name = "rk29_i2s.0", + #if defined(CONFIG_SND_RK29_SOC_I2S_8CH) + .cpu_dai_name = "rk29_i2s.0", + #elif defined(CONFIG_SND_RK29_SOC_I2S_2CH) + .cpu_dai_name = "rk29_i2s.1", + #endif .codec_dai_name = "rt3261-aif2", .ops = &rt3261_voice_ops, },