From e2d078b5a68e232955a4258353fed8b4915e4c24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=AE=8B=E7=A7=80=E6=9D=B0?= Date: Mon, 7 May 2012 12:43:50 +0800 Subject: [PATCH] rk30 phone: add codec reset function, modify rk30_i2s.c, do not use SDO1 to SDO3 as i2s mode --- arch/arm/mach-rk30/board-rk30-phone-loquat.c | 36 ++++++++++++++++++++ drivers/mfd/tlv320aic3262-core.c | 10 +++--- sound/soc/codecs/tlv320aic326x.c | 2 +- sound/soc/rk29/rk30_i2s.c | 6 ++-- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk30-phone-loquat.c b/arch/arm/mach-rk30/board-rk30-phone-loquat.c index 2dbb6f3742f1..4c497cb09913 100755 --- a/arch/arm/mach-rk30/board-rk30-phone-loquat.c +++ b/arch/arm/mach-rk30/board-rk30-phone-loquat.c @@ -44,6 +44,8 @@ #if defined(CONFIG_HDMI_RK30) #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h" #endif +#include +#include #if defined(CONFIG_SPIM_RK29) #include "../../../drivers/spi/rk29_spim.h" @@ -1442,6 +1444,39 @@ static struct platform_device *devices[] __initdata = { #endif }; +static struct aic3262_gpio_setup aic3262_gpio[] = { + { // GPIO1 + .used = 0, + .in = 0, + .value = AIC3262_GPIO1_FUNC_INT1_OUTPUT , + + }, + {// GPIO2 + .used = 0, + .in = 0, + .value = AIC3262_GPIO2_FUNC_CLOCK_OUTPUT, + }, + {// GPI1 + .used = 1, + .in = 1, + .value = 0, + }, + {// GPI2 + .used = 1, + .in = 1, + .value = AIC3262_GPO1_FUNC_DISABLED, + }, + {// GPO1 + .used = 0, + .in = 0, + .value = AIC3262_GPO1_FUNC_ADC_MOD_CLK_OUTPUT, + }, +}; +static struct aic3262_pdata aic3262_codec_pdata = { + .gpio = aic3262_gpio, + .gpio_reset = RK30_PIN0_PB7, +}; + // i2c #ifdef CONFIG_I2C0_RK30 static struct i2c_board_info __initdata i2c0_info[] = { @@ -1498,6 +1533,7 @@ static struct i2c_board_info __initdata i2c0_info[] = { .type = "tlv320aic3262", .addr = 0x18, .flags = 0, + .platform_data = &aic3262_codec_pdata, }, #endif diff --git a/drivers/mfd/tlv320aic3262-core.c b/drivers/mfd/tlv320aic3262-core.c index 4e058aca1fd0..ddf4bd6f32e1 100644 --- a/drivers/mfd/tlv320aic3262-core.c +++ b/drivers/mfd/tlv320aic3262-core.c @@ -12,6 +12,9 @@ #include #include +#include +#include + #define DEBUG 1 struct aic3262_gpio { @@ -317,7 +320,7 @@ static int aic3262_device_init(struct aic3262 *aic3262, int irq) u8 revID, pgID; unsigned int naudint = 0; u8 resetVal = 1; - printk("aic3262_device_init beginning\n"); + //printk("aic3262_device_init beginning\n"); mutex_init(&aic3262->io_lock); dev_set_drvdata(aic3262->dev, aic3262); @@ -328,15 +331,14 @@ static int aic3262_device_init(struct aic3262 *aic3262, int irq) dev_err(aic3262->dev,"not able to acquire gpio %d for reseting the AIC3262 \n", pdata->gpio_reset); goto err_return; } + rk30_mux_api_set(GPIO0B7_I2S8CHSDO3_NAME, GPIO0B_GPIO0B7); gpio_direction_output(pdata->gpio_reset, 1); msleep(5); gpio_direction_output(pdata->gpio_reset, 0); msleep(5); gpio_direction_output(pdata->gpio_reset, 1); // gpio_set_value(pdata->gpio_reset, 0); - msleep(5); - - + msleep(5); } } diff --git a/sound/soc/codecs/tlv320aic326x.c b/sound/soc/codecs/tlv320aic326x.c index 33d7cd8e45ee..bc2a16cd7e42 100644 --- a/sound/soc/codecs/tlv320aic326x.c +++ b/sound/soc/codecs/tlv320aic326x.c @@ -2741,7 +2741,7 @@ static void test_playback(void) int ret; printk("test palyback start\n"); - record_in1lr( ); + AP_to_headphone( ); } diff --git a/sound/soc/rk29/rk30_i2s.c b/sound/soc/rk29/rk30_i2s.c index 348c3ce54d65..19ce18820571 100755 --- a/sound/soc/rk29/rk30_i2s.c +++ b/sound/soc/rk29/rk30_i2s.c @@ -491,9 +491,9 @@ static int rockchip_i2s_dai_probe(struct snd_soc_dai *dai) rk30_mux_api_set(GPIO0B2_I2S8CHLRCKRX_NAME, GPIO0B_I2S_8CH_LRCK_RX); rk30_mux_api_set(GPIO0B3_I2S8CHLRCKTX_NAME, GPIO0B_I2S_8CH_LRCK_TX); rk30_mux_api_set(GPIO0B4_I2S8CHSDO0_NAME, GPIO0B_I2S_8CH_SDO0); - rk30_mux_api_set(GPIO0B5_I2S8CHSDO1_NAME, GPIO0B_I2S_8CH_SDO1); - rk30_mux_api_set(GPIO0B6_I2S8CHSDO2_NAME, GPIO0B_I2S_8CH_SDO2); - rk30_mux_api_set(GPIO0B7_I2S8CHSDO3_NAME, GPIO0B_I2S_8CH_SDO3); + //rk30_mux_api_set(GPIO0B5_I2S8CHSDO1_NAME, GPIO0B_I2S_8CH_SDO1); + //rk30_mux_api_set(GPIO0B6_I2S8CHSDO2_NAME, GPIO0B_I2S_8CH_SDO2); + //rk30_mux_api_set(GPIO0B7_I2S8CHSDO3_NAME, GPIO0B_I2S_8CH_SDO3); break; case 1: rk30_mux_api_set(GPIO0C0_I2S12CHCLK_NAME, GPIO0C_I2S1_2CH_CLK); -- 2.34.1