static void universal5410_audio_gpio_init(void)
{
        int err;

#ifdef CONFIG_SND_SOC_WM1811
	err = gpio_request(EXYNOS5410_GPJ3(7), "CODEC LDO enable");
	if (err < 0)
		pr_err("%s: Failed to get enable GPIO: %d\n", __func__, err);

	err = gpio_direction_output(EXYNOS5410_GPJ3(7), 1);
	if (err < 0)
		pr_err("%s: Failed to set GPIO direction: %d\n", __func__, err);

	gpio_set_value(EXYNOS5410_GPJ3(7), 1);
#endif

#ifdef CONFIG_SND_SOC_WM5102
	err = gpio_request(EXYNOS5410_GPJ2(1), "CODEC RESET enable");
	if (err < 0)
		pr_err("%s: Failed to get enable GPIO: %d\n", __func__, err);

	err = gpio_direction_output(EXYNOS5410_GPJ2(1), 1);
	if (err < 0)
		pr_err("%s: Failed to set GPIO direction: %d\n", __func__, err);

	gpio_set_value(EXYNOS5410_GPJ2(1), 0);
	gpio_free(EXYNOS5410_GPJ2(1));
#endif
}
static void mipi_lcd_power_control(struct s5p_platform_mipi_dsim *dsim,
				unsigned int power)
{
	struct regulator *regulator;

	regulator = regulator_get(NULL, "touch_1.8v_s");

	if (IS_ERR(regulator))
		printk(KERN_ERR "LCD: Fail to get regulator!\n");

	if (power) {
		/*mipi 1.8v enable*/
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_HIGH, "GPIO_MIPI_18V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));

		/*lcd 1.8V enable*/
		regulator_enable(regulator);
		usleep_range(2000, 3000);

		/*AVDD enable*/
		gpio_request_one(EXYNOS5410_GPJ2(0),
				GPIOF_OUT_INIT_HIGH, "GPIO_LCD_22V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ2(0));
		usleep_range(2000, 3000);

		/*LCD RESET high*/
		gpio_request_one(EXYNOS5410_GPJ1(0),
		GPIOF_OUT_INIT_HIGH, "GPIO_MLCD_RST");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));
		usleep_range(7000, 8000);
	} else {
		/*LCD RESET low*/
		gpio_request_one(EXYNOS5410_GPJ1(0),
				GPIOF_OUT_INIT_LOW, "GPIO_MLCD_RST");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));

		/*AVDD disable*/
		gpio_request_one(EXYNOS5410_GPJ2(0),
				GPIOF_OUT_INIT_LOW, "GPIO_LCD_22V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ2(0));

		/*lcd 1.8V disable*/
		if (regulator_is_enabled(regulator))
				regulator_disable(regulator);

		/*mipi 1.8v disable*/
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_LOW, "GPIO_MIPI_18V_EN");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));
	}
	regulator_put(regulator);
}
static void mipi_lcd_set_power(struct plat_lcd_data *pd,
				unsigned int power)
{
	/* reset */
	if (power) {
		gpio_request_one(GPIO_MLCD_RST,
				GPIOF_OUT_INIT_HIGH, "GPJ1");
		usleep_range(5000, 6000);
		gpio_set_value(EXYNOS5410_GPJ1(0), 0);
		usleep_range(5000, 6000);
		gpio_set_value(EXYNOS5410_GPJ1(0), 1);
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));
	} else {
		gpio_request_one(EXYNOS5410_GPJ1(0),
				GPIOF_OUT_INIT_LOW, "GPJ1");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ1(0));
	}

	/* enable VCC_2.2V_LCD */
	if (power) {
		gpio_request_one(EXYNOS5410_GPJ2(0),
				GPIOF_OUT_INIT_HIGH, "GPJ2");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ2(0));
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_HIGH, "GPF1");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));
	} else {
		gpio_request_one(EXYNOS5410_GPJ2(0),
				GPIOF_OUT_INIT_LOW, "GPJ2");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPJ2(0));
		gpio_request_one(EXYNOS5410_GPF1(6),
				GPIOF_OUT_INIT_LOW, "GPF1");
		usleep_range(5000, 6000);
		gpio_free(EXYNOS5410_GPF1(6));
	}
}
extern void adonisuniv_wm5102_hpdet_cb(unsigned int measurement);
#endif

static struct arizona_micd_config wm5102_micd[] = {
	{ 0,                  1 << ARIZONA_MICD_BIAS_SRC_SHIFT, 0 },
};

static const struct arizona_micd_range adonisuniv_micd_ranges[] = {
	{ .max =  139, .key = KEY_MEDIA },
	{ .max =  295, .key = KEY_VOLUMEUP },
	{ .max =  752, .key = KEY_VOLUMEDOWN },
	{ .max = 1257, .key = KEY_ESC },
};

static struct arizona_pdata arizona_platform_data = {
	.reset = EXYNOS5410_GPJ2(1),
	.ldoena = EXYNOS5410_GPJ1(5),
	.irq_base = IRQ_BOARD_AUDIO_START,
	.irq_flags = IRQF_TRIGGER_HIGH,
	.micd_configs = wm5102_micd,
	.num_micd_configs = ARRAY_SIZE(wm5102_micd),
	.micd_force_micbias = true,
/*
	.micd_level = {0x3f3f, 0x3f3f, 0x3b3f, 0x2832},
*/
	.micd_ranges = adonisuniv_micd_ranges,
	.num_micd_ranges = ARRAY_SIZE(adonisuniv_micd_ranges),
	.micd_bias_start_time = 0x7,
	.micd_rate = 0x7,
	.micd_dbtime = 0x1,
	.micd_timeout = 300,
Ejemplo n.º 5
0
#include "board-universal5410.h"


static struct es325_veq_parm veq_parm_table[] = {
	{ 0,  0},
	{ 2,  6},
	{ 2,  9},
	{ 2, 12},
	{ 2,  9},
	{ 2,  6},
	{19,  3},
};

static struct es325_platform_data es325_pdata = {
	.gpio_wakeup = EXYNOS5410_GPJ3(7),
	.gpio_reset = EXYNOS5410_GPJ2(3),
	.clk_enable = exynos5_audio_set_mclk,
	.pass[0] = {1, 3},
	.pass[1] = {2, 4},
	.passthrough_src = 1,
	.passthrough_dst = 3,
	.use_sleep = true,
	.veq_parm_table = veq_parm_table,
	.veq_parm_table_size = ARRAY_SIZE(veq_parm_table),
};

static struct platform_device *universal5410_2mic_devices[] __initdata = {
	&exynos5_device_hs_i2c0,
};

struct exynos5_platform_i2c hs_i2c4_data __initdata = {