static void tuna_oled_set_power(bool enable)
{
	if (IS_ERR_OR_NULL(tuna_oled_reg)) {
		tuna_oled_reg = regulator_get(NULL, "vlcd");
		if (IS_ERR_OR_NULL(tuna_oled_reg)) {
			pr_err("Can't get vlcd for display!\n");
			return;
		}
	}

	if (omap4_tuna_get_revision() >= 5) {
		if (IS_ERR_OR_NULL(tuna_oled_reg_iovcc)) {
			tuna_oled_reg_iovcc = regulator_get(NULL, "vlcd-iovcc");
			if (IS_ERR_OR_NULL(tuna_oled_reg_iovcc)) {
				pr_err("Can't get vlcd for display!\n");
				return;
			}
		}

		if (enable) {
			regulator_enable(tuna_oled_reg_iovcc);
			regulator_enable(tuna_oled_reg);
		} else {
			regulator_disable(tuna_oled_reg);
			regulator_disable(tuna_oled_reg_iovcc);
		}
	} else {
		if (enable)
			regulator_enable(tuna_oled_reg);
		else
			regulator_disable(tuna_oled_reg);
	}
}
void __init omap4_tuna_display_init(void)
{
	struct panel_s6e8aa0_data *panel;

	if (omap4_tuna_get_revision() ==
	    (omap4_tuna_get_type() == TUNA_TYPE_MAGURO ? 2 : 1)) {
		/*
		 * Older devices were not calibrated the same way as newer
		 * devices. These values are probably not correct, but the older
		 * devices tested look closer to the newer devices with these
		 * values than they do using the same register values as the
		 * newer devices.
		 */
		tuna_oled_data_m3.factory_info = &tuna_oled_factory_info_m2t1;
	} else if (omap4_tuna_get_revision() <= 1) {
		tuna_oled_data_m3.factory_info = &tuna_oled_factory_info_old;
	}

	if (panel_id == SM2)
		panel = &tuna_oled_data_sm2;
	else
		panel = &tuna_oled_data_m3;

	tuna_oled_device.data = panel;

	omap4_ctrl_pad_writel(0x1FF80000,
			OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
	omap_mux_init_gpio(panel->reset_gpio, OMAP_PIN_OUTPUT);

	pr_info("Using %ps\n", panel->factory_info);

	omap_vram_set_sdram_vram(TUNA_FB_RAM_SIZE, 0);
	omapfb_set_platform_data(&tuna_fb_pdata);
	tuna_hdmi_mux_init();
	omap_display_init(&tuna_dss_data);
}
static inline void __init board_serial_init(void)
{
	struct omap_device_pad *uart1_pads;
	int uart1_pads_sz;

	if (omap4_tuna_get_revision() >= TUNA_REV_SAMPLE_4) {
		uart1_pads = tuna_uart1_pads_sample4;
		uart1_pads_sz = ARRAY_SIZE(tuna_uart1_pads_sample4);
	} else {
		uart1_pads = tuna_uart1_pads;
		uart1_pads_sz = ARRAY_SIZE(tuna_uart1_pads);
	}

	omap_serial_init_port_pads(0, uart1_pads, uart1_pads_sz, NULL);
	omap_serial_init_port_pads(1, tuna_uart2_pads,
		ARRAY_SIZE(tuna_uart2_pads), &tuna_uart2_info);
	omap_serial_init_port_pads(3, tuna_uart4_pads,
				   ARRAY_SIZE(tuna_uart4_pads), NULL);
}
static void tuna_audio_init(void)
{
	unsigned int aud_pwron;

	/* twl6040 naudint */
	omap_mux_init_signal("sys_nirq2.sys_nirq2", \
		OMAP_PIN_INPUT_PULLUP);

	/* aud_pwron */
	if (omap4_tuna_get_type() == TUNA_TYPE_TORO &&
	    omap4_tuna_get_revision() >= 1)
		aud_pwron = GPIO_AUD_PWRON_TORO_V1;
	else
		aud_pwron = GPIO_AUD_PWRON;
	omap_mux_init_gpio(aud_pwron, OMAP_PIN_OUTPUT);
	twl6040_codec.audpwron_gpio = aud_pwron;

	omap_mux_init_signal("gpmc_a24.gpio_48", OMAP_PIN_OUTPUT | OMAP_MUX_MODE3);
	omap_mux_init_signal("kpd_col3.gpio_171", OMAP_PIN_OUTPUT | OMAP_MUX_MODE3);
}
/*
 * The UART1 is for GPS, and CSR GPS chip should control uart1 rts level
 * for gps firmware download.
 */
static int uart1_rts_ctrl_write(struct file *file, const char __user *buffer,
						size_t count, loff_t *offs)
{
	char buf[10] = {0,};

	if (omap4_tuna_get_revision() < TUNA_REV_SAMPLE_4)
		return -ENXIO;
	if (count > sizeof(buf) - 1)
		return -EINVAL;
	if (copy_from_user(buf, buffer, count))
		return -EFAULT;

	if (!strncmp(buf, "1", 1)) {
		omap_rts_mux_write(OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE7,
							UART_NUM_FOR_GPS);
	} else if (!strncmp(buf, "0", 1)) {
		omap_rts_mux_write(OMAP_PIN_OUTPUT | OMAP_MUX_MODE1,
							UART_NUM_FOR_GPS);
	}

	return count;
}
static const char *omap4_tuna_hw_rev_name(void) {
	const char *ret;
	const char **names;
	int num;
	int rev;

	if (omap4_tuna_get_type() == TUNA_TYPE_MAGURO) {
		names = omap4_tuna_hw_name_maguro;
		num = ARRAY_SIZE(omap4_tuna_hw_name_maguro);
		ret = "Maguro unknown";
	} else {
		names = omap4_tuna_hw_name_toro;
		num = ARRAY_SIZE(omap4_tuna_hw_name_toro);
		ret = "Toro unknown";
	}

	rev = omap4_tuna_get_revision();
	if (rev >= num || !names[rev])
		return ret;

	return names[rev];
}