From e48aecc3e61143a3684ff614c69d7f7eb928aabe Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=AE=8B=E7=A7=80=E6=9D=B0?= Date: Wed, 19 Sep 2012 19:44:22 +0800 Subject: [PATCH] phonepad: modify rt3261 I2C rate as 400K, change dsp reg. --- sound/soc/codecs/rt3261-dsp.c | 2 +- sound/soc/codecs/rt3261.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt3261-dsp.c b/sound/soc/codecs/rt3261-dsp.c index a732acb8af63..84ec5fa9015c 100644 --- a/sound/soc/codecs/rt3261-dsp.c +++ b/sound/soc/codecs/rt3261-dsp.c @@ -69,7 +69,7 @@ static const u16 rt3261_dsp_aec_ns_fens[][2] = { {0x23bd, 0x0100}, {0x23be, 0x2400}, {0x23cf, 0x0800}, {0x23d0, 0x0400}, {0x23d1, 0xff80}, {0x23d2, 0xff80}, {0x23d3, 0x0800}, {0x23d4, 0x3e00}, {0x23d5, 0x5000}, {0x23e7, 0x0800}, {0x23e8, 0x0e00}, {0x23e9, 0x7000}, - {0x23ea, 0x7ff0}, {0x23ed, 0x0300}, {0x22fb, 0x0000}, + {0x23ea, 0x7ff0}, {0x23ed, 0x0300}, {0x22fb, 0x0000}, {0x2328, 0x7fff}, }; #define RT3261_DSP_AEC_NUM \ (sizeof(rt3261_dsp_aec_ns_fens) / sizeof(rt3261_dsp_aec_ns_fens[0])) diff --git a/sound/soc/codecs/rt3261.c b/sound/soc/codecs/rt3261.c index daf28f70dc29..b7bc22c2095f 100644 --- a/sound/soc/codecs/rt3261.c +++ b/sound/soc/codecs/rt3261.c @@ -216,7 +216,7 @@ static int do_hw_write(struct snd_soc_codec *codec, unsigned int reg, return 0; } - ret = codec->hw_write(codec->control_data, data, len); + ret = i2c_master_normal_send(codec->control_data, data, len,400*1000); if (ret == len) return 0; if (ret < 0) @@ -234,6 +234,7 @@ static int rt3261_write(struct snd_soc_codec *codec, unsigned int reg, data[1] = (value >> 8) & 0xff; data[2] = value & 0xff; + DBG("rt3261_write 0x%x = 0x%x\n",reg,value); return do_hw_write(codec, reg, value, data, 3); } @@ -2955,6 +2956,7 @@ static int rt3261_probe(struct snd_soc_codec *codec) dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); return ret; } + codec->write = rt3261_write; #ifdef RT3261_PROC rt3261_proc_init(); @@ -3144,6 +3146,7 @@ static struct snd_soc_codec_driver soc_codec_dev_rt3261 = { .remove = rt3261_remove, .suspend = rt3261_suspend, .resume = rt3261_resume, + .write = rt3261_write, .set_bias_level = rt3261_set_bias_level, .reg_cache_size = RT3261_VENDOR_ID2 + 1, .reg_word_size = sizeof(u16), -- 2.34.1