Commit ce764072 authored by Gary Zhang's avatar Gary Zhang Committed by Jason Liu

ENGR00209739-3 MX6DQ/DL_SABRESD: operate WM8962 MCLK by callback

operate WM8962 MCLK by callback
Signed-off-by: default avatarGary Zhang <b13634@freescale.com>
parent 13fd3a7f
......@@ -198,6 +198,7 @@
#define SABRESD_ELAN_INT IMX_GPIO_NR(3, 28)
static struct clk *sata_clk;
static struct clk *clko;
static int mma8451_position = 1;
static int mag3110_position = 2;
static int max11801_mode = 1;
......@@ -389,26 +390,20 @@ static struct platform_device mx6_sabresd_audio_wm8962_device = {
.name = "imx-wm8962",
};
static struct wm8962_pdata wm8962_config_data = {
.gpio_init = {
[2] = WM8962_GPIO_FN_DMICCLK,
[4] = 0x8000 | WM8962_GPIO_FN_DMICDAT,
},
};
static struct mxc_audio_platform_data wm8962_data;
static struct mxc_audio_platform_data wm8962_data = {
.ssi_num = 1,
.src_port = 2,
.ext_port = 3,
.hp_gpio = SABRESD_HEADPHONE_DET,
.hp_active_low = 1,
.mic_gpio = SABRESD_MICROPHONE_DET,
.mic_active_low = 1,
};
static int wm8962_clk_enable(int enable)
{
if (enable)
clk_enable(clko);
else
clk_disable(clko);
return 0;
}
static int mxc_wm8962_init(void)
{
struct clk *clko;
int rate;
clko = clk_get(NULL, "clko_clk");
......@@ -418,13 +413,32 @@ static int mxc_wm8962_init(void)
}
/* both audio codec and comera use CLKO clk*/
rate = clk_round_rate(clko, 22000000);
clk_set_rate(clko, rate);
wm8962_data.sysclk = rate;
clk_set_rate(clko, rate);
return 0;
}
static struct wm8962_pdata wm8962_config_data = {
.gpio_init = {
[2] = WM8962_GPIO_FN_DMICCLK,
[4] = 0x8000 | WM8962_GPIO_FN_DMICDAT,
},
};
static struct mxc_audio_platform_data wm8962_data = {
.ssi_num = 1,
.src_port = 2,
.ext_port = 3,
.hp_gpio = SABRESD_HEADPHONE_DET,
.hp_active_low = 1,
.mic_gpio = SABRESD_MICROPHONE_DET,
.mic_active_low = 1,
.init = mxc_wm8962_init,
.clock_enable = wm8962_clk_enable,
};
static struct regulator_consumer_supply sabresd_vwm8962_consumers[] = {
REGULATOR_SUPPLY("SPKVDD1", "0-001a"),
REGULATOR_SUPPLY("SPKVDD2", "0-001a"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment