update rk610 codec

This commit is contained in:
邱建斌
2012-03-30 16:11:53 +08:00
parent fa14e144f5
commit d4ffe57610
7 changed files with 268 additions and 655 deletions

View File

@@ -974,7 +974,7 @@ static struct i2c_board_info __initdata i2c0_info[] = {
.platform_data = &akm8975_info,
},
#endif
#if defined (CONFIG_GYRO_L3G4200D)
#if defined (CONFIG_GYRO_L3G4200D1)
{
.type = "l3g4200d_gryo",
.addr = 0x69,
@@ -1003,6 +1003,36 @@ static struct i2c_board_info __initdata i2c0_info[] = {
},
#endif
#ifdef CONFIG_MFD_RK610
{
.type = "rk610_ctl",
.addr = 0x40,
.flags = 0,
},
#ifdef CONFIG_RK610_TVOUT
{
.type = "rk610_tvout",
.addr = 0x42,
.flags = 0,
},
#endif
#ifdef CONFIG_RK610_HDMI
{
.type = "rk610_hdmi",
.addr = 0x46,
.flags = 0,
.irq = RK29_PIN5_PA2,
},
#endif
#ifdef CONFIG_SND_SOC_RK610
{//RK610_CODEC addr from 0x60 to 0x80 (0x60~0x80)
.type = "rk610_i2c_codec",
.addr = 0x60,
.flags = 0,
},
#endif
#endif
};
#endif
@@ -1036,7 +1066,7 @@ static struct i2c_board_info __initdata i2c2_info[] = {
#if defined (CONFIG_LS_CM3217)
{
.type = "lightsensor",
.addr = 0x10,
.addr = 0x20,
.flags = 0,
.irq = CM3217_IRQ_PIN,
.platform_data = &cm3217_info,

88
drivers/mfd/rk610-core.c Normal file → Executable file
View File

@@ -9,7 +9,20 @@
#include <mach/iomux.h>
#include <linux/err.h>
#ifdef CONFIG_ARCH_RK30
#define RK610_RESET_PIN RK30_PIN0_PC6
#else
#define RK610_RESET_PIN RK29_PIN6_PC1
#endif
/*
* Debug
*/
#if 0
#define DBG(x...) printk(KERN_INFO x)
#else
#define DBG(x...)
#endif
static struct i2c_client *rk610_control_client = NULL;
#ifdef CONFIG_RK610_LCD
@@ -20,16 +33,16 @@ int rk610_lcd_init(struct i2c_client *client){}
int rk610_control_send_byte(const char reg, const char data)
{
int ret;
printk("reg = 0x%02x, val=0x%02x\n", reg ,data);
DBG("reg = 0x%02x, val=0x%02x\n", reg ,data);
if(rk610_control_client == NULL)
return -1;
//i2c_master_reg8_send
ret = i2c_master_reg8_send(rk610_control_client, reg, &data, 1, 100*1000);
if (ret > 0)
ret = 0;
return ret;
}
@@ -40,13 +53,13 @@ int rk610_codec_pll_set(unsigned int rate)
char N, M, NO, DIV;
unsigned int F;
char data;
if(current_pll_value == rate)
return 0;
// Input clock is 12MHz.
if(rate == 11289600) {
// For 11.2896MHz, N = 2 M= 75 F = 0.264(0x43958) NO = 8
// For 11.2896MHz, N = 2 M= 75 F = 0.264(0x43958) NO = 8
N = 2;
NO = 3;
M = 75;
@@ -54,7 +67,7 @@ int rk610_codec_pll_set(unsigned int rate)
DIV = 5;
}
else if(rate == 12288000) {
// For 12.2888MHz, N = 2 M= 75 F = 0.92(0xEB851) NO = 8
// For 12.2888MHz, N = 2 M= 75 F = 0.92(0xEB851) NO = 8
N = 2;
NO = 3;
M = 75;
@@ -65,12 +78,12 @@ int rk610_codec_pll_set(unsigned int rate)
printk(KERN_ERR "[%s] not support such frequency\n", __FUNCTION__);
return -1;
}
//Enable codec pll fractional number and power down.
data = 0x00;
rk610_control_send_byte(RK610_CONTROL_REG_C_PLL_CON5, data);
msleep(10);
data = (N << 4) | NO;
rk610_control_send_byte(RK610_CONTROL_REG_C_PLL_CON0, data);
// M
@@ -83,20 +96,20 @@ int rk610_codec_pll_set(unsigned int rate)
rk610_control_send_byte(RK610_CONTROL_REG_C_PLL_CON3, data);
data = (F >> 16) & 0xFF;
rk610_control_send_byte(RK610_CONTROL_REG_C_PLL_CON4, data);
// i2s mclk = codec_pll/5;
i2c_master_reg8_recv(rk610_control_client, RK610_CONTROL_REG_CLOCK_CON1, &data, 1, 100*1000);
data &= ~CLOCK_CON1_I2S_DVIDER_MASK;
data |= (DIV - 1);
rk610_control_send_byte(RK610_CONTROL_REG_CLOCK_CON1, data);
// Power up codec pll.
data |= C_PLL_POWER_ON;
rk610_control_send_byte(RK610_CONTROL_REG_C_PLL_CON5, data);
current_pll_value = rate;
printk(KERN_ERR "[%s] rate %u\n", __FUNCTION__, rate);
DBG("[%s] rate %u\n", __FUNCTION__, rate);
return 0;
}
@@ -105,20 +118,20 @@ void rk610_control_init_codec(void)
struct i2c_client *client = rk610_control_client;
char data = 0;
int ret;
if(rk610_control_client == NULL)
return;
printk(KERN_ERR "[%s] start\n", __FUNCTION__);
DBG("[%s] start\n", __FUNCTION__);
//gpio_set_value(RK610_RESET_PIN, GPIO_LOW); //reset rk601
// mdelay(100);
//gpio_set_value(RK610_RESET_PIN, GPIO_HIGH);
//mdelay(100);
// Set i2c glitch timeout.
data = 0x22;
ret = i2c_master_reg8_send(client, RK610_CONTROL_REG_I2C_CON, &data, 1, 20*1000);
// rk610_codec_pll_set(11289600);
//use internal codec, enable DAC ADC LRCK output.
@@ -127,18 +140,18 @@ void rk610_control_init_codec(void)
// data = CODEC_CON_BIT_ADC_LRCK_OUTPUT_DISABLE;
data = 0;
rk610_control_send_byte(RK610_CONTROL_REG_CODEC_CON, data);
// Select internal i2s clock from codec_pll.
i2c_master_reg8_recv(rk610_control_client, RK610_CONTROL_REG_CLOCK_CON1, &data, 1, 100*1000);
i2c_master_reg8_recv(rk610_control_client, RK610_CONTROL_REG_CLOCK_CON1, &data, 1, 100*1000);
// data |= CLOCK_CON1_I2S_CLK_CODEC_PLL;
data = 0;
rk610_control_send_byte(RK610_CONTROL_REG_CLOCK_CON1, data);
i2c_master_reg8_recv(client, RK610_CONTROL_REG_CODEC_CON, &data, 1, 100*1000);
printk(KERN_ERR "[%s] RK610_CONTROL_REG_CODEC_CON is %x\n", __FUNCTION__, data);
DBG("[%s] RK610_CONTROL_REG_CODEC_CON is %x\n", __FUNCTION__, data);
i2c_master_reg8_recv(client, RK610_CONTROL_REG_CLOCK_CON1, &data, 1, 100*1000);
printk(KERN_ERR "[%s] RK610_CONTROL_REG_CLOCK_CON1 is %x\n", __FUNCTION__, data);
DBG("[%s] RK610_CONTROL_REG_CLOCK_CON1 is %x\n", __FUNCTION__, data);
}
#endif
#ifdef CONFIG_RK610_DEBUG
@@ -177,12 +190,12 @@ static ssize_t rk610_store_reg_attrs(struct device *dev,
struct i2c_client *client=NULL;
static char val=0,reg=0;
client = rk610_control_client;
printk("/**********rk610 reg config******/");
DBG("/**********rk610 reg config******/");
sscanf(buf, "%x%x", &val,&reg);
printk("reg=%x val=%x\n",reg,val);
DBG("reg=%x val=%x\n",reg,val);
rk610_write_p0_reg(client, reg, &val);
printk("val=%x\n",val);
DBG("val=%x\n",val);
return size;
}
@@ -195,28 +208,34 @@ static int rk610_control_probe(struct i2c_client *client,
{
int ret;
struct clk *iis_clk;
DBG("[%s] start\n", __FUNCTION__);
iis_clk = clk_get_sys("rk29_i2s.0", "i2s");
if (IS_ERR(iis_clk)) {
printk("failed to get i2s clk\n");
ret = PTR_ERR(iis_clk);
}else{
printk("got i2s clk ok!\n");
DBG("got i2s clk ok!\n");
clk_enable(iis_clk);
clk_set_rate(iis_clk, 11289600);
#ifdef CONFIG_ARCH_RK29
rk29_mux_api_set(GPIO2D0_I2S0CLK_MIIRXCLKIN_NAME, GPIO2H_I2S0_CLK);
#else
rk30_mux_api_set(GPIO0B0_I2S8CHCLK_NAME, GPIO0B_I2S_8CH_CLK);
#endif
clk_put(iis_clk);
}
rk610_control_client = client;
msleep(100);
if(RK610_RESET_PIN != INVALID_GPIO) {
ret = gpio_request(RK610_RESET_PIN, "rk610 reset");
if (ret){
if (ret){
printk(KERN_ERR "rk610_control_probe request gpio fail\n");
}
else {
printk(KERN_ERR "rk610_control_probe request gpio ok\n");
DBG("rk610_control_probe request gpio ok\n");
gpio_direction_output(RK610_RESET_PIN, GPIO_HIGH);
msleep(100);
gpio_direction_output(RK610_RESET_PIN, GPIO_LOW);
@@ -253,6 +272,7 @@ static struct i2c_driver rk610_control_driver = {
static int __init rk610_control_init(void)
{
DBG("[%s] start\n", __FUNCTION__);
return i2c_add_driver(&rk610_control_driver);
}

View File

@@ -4,7 +4,9 @@
#include <linux/fb.h>
#include <mach/board.h>
#include <mach/gpio.h>
#ifdef CONFIG_ARCH_RK29
#include <mach/rk29_iomap.h>
#endif
#include "../screen/screen.h"
#include "../../rk29_fb.h"
#include <linux/mfd/rk610_core.h>
@@ -20,7 +22,7 @@
#define TVE_VFCR_PAL_M 1
#define TVE_VFCR_PAL_B_N 2
#define TVE_VFCR_PAL_NC 3
#define TVE_VINCR 0x01
#define TVE_VINCR_PIX_DATA_DELAY(n) (n << 5)
#define TVE_VINCR_H_SYNC_POLARITY_NEGTIVE 0 << 4
@@ -36,7 +38,7 @@ enum {
#define TVE_VINCR_INPUT_FORMAT(n) (n << 1)
#define TVE_VINCR_VSYNC_FUNCTION_VSYNC 0
#define TVE_VINCR_VSYNC_FUNCTION_FIELD 1
#define TVE_VOUTCR 0x02
#define TVE_VOUTCR_OUTPUT_CVBS 0 << 6
#define TVE_VOUTCR_OUTPUT_YPBPR 1 << 6
@@ -44,14 +46,14 @@ enum {
#define TVE_VOUTCR_OUTPUT_ENABLE_BLACK 1 << 4
#define TVE_VOUTCR_DISABLE_CVBS_COLOR 1 << 3
#define TVE_VOUTCR_CVBS_Y2C_DELAY(n) (n << 0)
#define TVE_POWERCR 0x03
#define TVE_PIX_CLK_INVERSE_ENABLE 1 << 4
#define TVE_DAC_CLK_INVERSE_DISABLE 1 << 3
#define TVE_DAC_Y_ENABLE 1 << 2
#define TVE_DAC_U_ENABLE 1 << 1
#define TVE_DAC_V_ENABLE 1 << 0
#define TVE_HDTVCR 0x05
#define TVE_RESET 1 << 7
#define TVE_FILTER(n) (n << 5)
@@ -65,7 +67,7 @@ enum {
#define TVE_OUTPUT_MODE_576P 1
#define TVE_OUTPUT_MODE_480P 2
#define TVE_OUTPUT_MODE_720P 3
#define TVE_YADJCR 0x06
#define TVE_OUTPUT_MODE_1080P 1 << 6
#define TVE_OUTPUT_MODE_1080I 1 << 5

629
sound/soc/codecs/rk610_codec.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -263,5 +263,6 @@
extern struct snd_soc_dai rk610_codec_dai;
extern struct snd_soc_codec_device soc_codec_dev_rk610_codec;
#endif
extern int rk610_control_init_codec(void);
extern int rk610_codec_pll_set(unsigned int rate);
#endif

View File

@@ -7,7 +7,7 @@ config SND_RK29_SOC
to select the audio interfaces to support below.
config SND_RK29_SOC_I2S
tristate
tristate
config SND_RK29_SOC_I2S_8CH
bool "Soc RK29 I2S 8 Channel support(I2S0)"
@@ -15,7 +15,7 @@ config SND_RK29_SOC_I2S_8CH
depends on SND_RK29_SOC_I2S
help
This supports the use of the 8 Channel I2S interface on rk29 processors.
config SND_RK29_SOC_I2S_2CH
bool "Soc RK29 I2S 2 Channel support(I2S1)"
default n
@@ -29,7 +29,7 @@ config SND_RK_SOC_I2S2_2CH
depends on SND_RK29_SOC_I2S && ARCH_RK30
help
This supports the use of the 2 Channel I2S2 interface on rk30 processors.
if SND_RK29_SOC_I2S_2CH || SND_RK29_SOC_I2S_8CH || SND_RK_SOC_I2S2_2CH
choice
bool "Set i2s on DMA event mode"
@@ -114,7 +114,7 @@ config SND_RK29_SOC_WM8994
select SND_SOC_WM8994
help
Say Y if you want to add support for SoC audio on rockchip
with the WM8994.
with the WM8994.
config SND_RK29_SOC_CS42L52
tristate "SoC I2S Audio support for rockchip - CS42L52"
@@ -133,7 +133,7 @@ config SND_RK29_SOC_AIC3111
help
Say Y if you want to add support for SoC audio on rockchip
with the AIC3111.
config SND_RK29_SOC_RK1000
tristate "SoC I2S Audio support for rockchip - RK1000"
depends on SND_RK29_SOC
@@ -141,23 +141,25 @@ config SND_RK29_SOC_RK1000
select SND_SOC_RK1000
help
Say Y if you want to add support for SoC audio on rockchip
with the RK1000.
with the RK1000.
config SND_RK29_SOC_HDMI
tristate "SoC I2S Audio support for rockchip - HDMI"
depends on SND_RK29_SOC && HDMI_ITV
select SND_RK29_SOC_I2S
help
Say Y if you want to add support for SoC audio on rockchip
with the HDMI.
with the HDMI.
config SND_RK29_SOC_RK610
tristate "SoC I2S Audio support for rockchip - RK610"
depends on SND_RK29_SOC && MFD_RK610 && I2C_RK29
depends on SND_RK29_SOC && MFD_RK610
select SND_RK29_SOC_I2S
select SND_SOC_RK610
help
Say Y if you want to add support for SoC audio on rockchip
with the RK610(JETTA).
with the RK610(JETTA).
if SND_RK29_SOC_WM8988 || SND_RK29_SOC_RK1000 || SND_RK29_SOC_WM8994 || SND_RK29_SOC_WM8900 || SND_RK29_SOC_RT5621 || SND_RK29_SOC_RT5631 || SND_RK29_SOC_RT5625 || SND_RK29_SOC_CS42L52 || SND_RK29_SOC_AIC3111 || SND_RK29_SOC_HDMI || SND_RK29_SOC_RK610
choice
bool "Set i2s type"
@@ -180,5 +182,6 @@ config PHONE_INCALL_IS_SUSPEND
default n
help
set "y" phone incall status cannot into suspend codec
endif

132
sound/soc/rk29/rk29_jetta_codec.c Normal file → Executable file
View File

@@ -19,7 +19,6 @@
#include <sound/soc-dapm.h>
#include <asm/io.h>
#include <mach/hardware.h>
#include <mach/rk29_iomap.h>
#include "../codecs/rk610_codec.h"
#include "rk29_pcm.h"
#include "rk29_i2s.h"
@@ -34,13 +33,8 @@ static int rk29_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
#else
struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
#endif
int ret;
unsigned int pll_out = 0;
int div_bclk,div_mclk;
@@ -52,59 +46,32 @@ static int rk29_hw_params(struct snd_pcm_substream *substream,
#define HW_PARAMS_FLAG_EQVOL_OFF 0x22
if ((params->flags == HW_PARAMS_FLAG_EQVOL_ON)||(params->flags == HW_PARAMS_FLAG_EQVOL_OFF))
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
ret = codec_dai->driver->ops->hw_params(substream, params, codec_dai); //by Vincent
#else
ret = codec_dai->ops->hw_params(substream, params, codec_dai); //by Vincent
#endif
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
}
else
{
/* set codec DAI configuration */
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
#if defined (CONFIG_SND_RK29_CODEC_SOC_SLAVE)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
ret = codec_dai->driver->ops->set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
#else
ret = codec_dai->ops->set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
#endif
#endif
#if defined (CONFIG_SND_RK29_CODEC_SOC_MASTER)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
ret = codec_dai->driver->ops->set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
#elif defined (CONFIG_SND_RK29_CODEC_SOC_MASTER)
ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM );
#else
ret = codec_dai->ops->set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM );
#endif
#endif
if (ret < 0)
return ret;
return ret;
/* set cpu DAI configuration */
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
#if defined (CONFIG_SND_RK29_CODEC_SOC_SLAVE)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
ret = cpu_dai->driver->ops->set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
#else
ret = cpu_dai->ops->set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM);
#endif
#endif
#if defined (CONFIG_SND_RK29_CODEC_SOC_MASTER)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
ret = cpu_dai->driver->ops->set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
#elif defined (CONFIG_SND_RK29_CODEC_SOC_MASTER)
ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
#else
ret = cpu_dai->ops->set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
#endif
#endif
if (ret < 0)
return ret;
return ret;
}
switch(params_rate(params)) {
@@ -143,7 +110,7 @@ static int rk29_hw_params(struct snd_pcm_substream *substream,
div_bclk = 63;
div_mclk = pll_out/(params_rate(params)*64) - 1;
DBG("func is%s,pll_out=%ld,div_mclk=%ld div_bclk=%ld\n",
DBG("func is%s,pll_out=%d,div_mclk=%d div_bclk\n",
__FUNCTION__,pll_out,div_mclk, div_bclk);
snd_soc_dai_set_sysclk(cpu_dai, 0, pll_out, 0);
snd_soc_dai_set_clkdiv(cpu_dai, ROCKCHIP_DIV_BCLK,div_bclk);
@@ -153,85 +120,23 @@ static int rk29_hw_params(struct snd_pcm_substream *substream,
return 0;
}
static const struct snd_soc_dapm_widget rk29_dapm_widgets[] = {
SND_SOC_DAPM_LINE("Audio Out", NULL),
SND_SOC_DAPM_LINE("Line in", NULL),
SND_SOC_DAPM_MIC("Micn", NULL),
SND_SOC_DAPM_MIC("Micp", NULL),
};
static const struct snd_soc_dapm_route audio_map[]= {
{"Audio Out", NULL, "LOUT1"},
{"Audio Out", NULL, "ROUT1"},
{"Line in", NULL, "RINPUT1"},
{"Line in", NULL, "LINPUT1"},
// {"Micn", NULL, "RINPUT2"},
// {"Micp", NULL, "LINPUT2"},
};
/*
* Logic for a RK610 codec as connected on a rockchip board.
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
static int rk29_RK610_codec_init(struct snd_soc_pcm_runtime *rtd) {
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
/* Add specific widgets */
snd_soc_dapm_new_controls(dapm, rk29_dapm_widgets,
ARRAY_SIZE(rk29_dapm_widgets));
/* Set up specific audio path audio_mapnects */
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_sync(dapm);
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
return 0;
}
#else
static int rk29_RK610_codec_init(struct snd_soc_codec *codec) {
// struct snd_soc_dai *codec_dai = &codec->dai[0];
int ret;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
// ret = snd_soc_dai_set_sysclk(codec_dai, 0,
// 11289600, SND_SOC_CLOCK_IN);
// if (ret < 0) {
// printk(KERN_ERR "Failed to set WM8988 SYSCLK: %d\n", ret);
// return ret;
// }
/* Add specific widgets */
snd_soc_dapm_new_controls(codec, rk29_dapm_widgets,
ARRAY_SIZE(rk29_dapm_widgets));
/* Set up specific audio path audio_mapnects */
snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
snd_soc_dapm_sync(codec);
return 0;
}
#endif
static struct snd_soc_ops rk29_ops = {
.hw_params = rk29_hw_params,
};
static struct snd_soc_dai_link rk29_dai = {
.name = "RK610",
.name = "RK610_CODEC",
.stream_name = "RK610 CODEC PCM",
.codec_name = "RK610_CODEC.1-0060",
.codec_name = "RK610_CODEC.0-0060",
.platform_name = "rockchip-audio",
#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",
#else
.cpu_dai_name = "rk29_i2s.2",
#endif
.codec_dai_name = "rk610_codec_xx",
.init = rk29_RK610_codec_init,
.codec_dai_name = "rk610_codec",
.ops = &rk29_ops,
};
static struct snd_soc_card snd_soc_card_rk29 = {
@@ -240,27 +145,22 @@ static struct snd_soc_card snd_soc_card_rk29 = {
.num_links = 1,
};
static struct platform_device *rk29_snd_device;
static int __init audio_card_init(void)
{
int ret =0;
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
printk(KERN_ERR "[%s] start\n", __FUNCTION__);
rk29_snd_device = platform_device_alloc("soc-audio", -1);
if (!rk29_snd_device) {
printk("[%s] platform device allocation failed\n", __FUNCTION__);
ret = -ENOMEM;
return ret;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
platform_set_drvdata(rk29_snd_device, &snd_soc_card_rk29);
#else
platform_set_drvdata(rk29_snd_device, &rk29_snd_devdata);
rk29_snd_devdata.dev = &rk29_snd_device->dev;
#endif
ret = platform_device_add(rk29_snd_device);
DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__);
if (ret) {
DBG("platform device add failed\n");
platform_device_put(rk29_snd_device);