From 24c8d4550204f67a8ae9ae8f112d864bac46c620 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=AE=8B=E7=A7=80=E6=9D=B0?= Date: Mon, 21 Jan 2013 15:12:10 +0800 Subject: [PATCH] rt3261: fix two little issue. --- sound/soc/codecs/rt3261.c | 4 ++++ sound/soc/rk29/rk29_rt3261.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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, }, -- 2.34.1