コード例 #1
0
ファイル: board-bravo-panel.c プロジェクト: Redux/rx-kernel
static int sony_tft_panel_unblank(struct msm_lcdc_panel_ops *ops)
{
	pr_info("%s: +()\n", __func__);

	mutex_lock(&panel_lock);

	if (tft_panel_on) {
		pr_info("%s: -() already unblanked\n", __func__);
		goto done;
	}

	sony_tft_panel_power(1);
	msleep(45);

	clk_enable(spi_clk);
	qspi_send_9bit(0x0, 0x11);
	msleep(5);
	qspi_send_9bit(0x0, 0x3a);
	if (is_sony_RGB666())
		qspi_send_9bit(0x1, 0x06);
	else
		qspi_send_9bit(0x1, 0x05);
	msleep(100);
	qspi_send_9bit(0x0, 0x29);
	msleep(20);

	//init gamma setting
	if(!is_sony_with_gamma())
		sony_tft_panel_without_gamma_init();

	/* unlock register page for pwm setting */
	if (is_sony_spi()) {
		qspi_send_9bit(0x0, 0xf0);
		qspi_send_9bit(0x1, 0x5a);
		qspi_send_9bit(0x1, 0x5a);
		qspi_send_9bit(0x0, 0xf1);
		qspi_send_9bit(0x1, 0x5a);
		qspi_send_9bit(0x1, 0x5a);
		qspi_send_9bit(0x0, 0xd0);
		qspi_send_9bit(0x1, 0x5a);
		qspi_send_9bit(0x1, 0x5a);

		qspi_send_9bit(0x0, 0xc2);
		qspi_send_9bit(0x1, 0x53);
		qspi_send_9bit(0x1, 0x12);
	}
	clk_disable(spi_clk);
	msleep(100);
	tft_panel_on = 1;
	sony_tft_set_pwm_val(last_val);

	pr_info("%s: -()\n", __func__);
done:
	mutex_unlock(&panel_lock);
	return 0;
}
コード例 #2
0
ファイル: board-bravo-panel.c プロジェクト: Redux/rx-kernel
static void bravo_brightness_tft_set_work(struct work_struct *work_ptr)
{
	unsigned long flags;
	uint8_t val;

	spin_lock_irqsave(&brightness_lock, flags);
	val = new_val;
	spin_unlock_irqrestore(&brightness_lock, flags);

	mutex_lock(&panel_lock);
	sony_tft_set_pwm_val(val);
	mutex_unlock(&panel_lock);
}
コード例 #3
0
static int sony_tft_panel_unblank(struct msm_lcdc_panel_ops *ops)
{
	pr_info("%s: +()\n", __func__);

	mutex_lock(&panel_lock);

	if (tft_panel_on) {
		pr_info("%s: -() already unblanked\n", __func__);
		goto done;
	}

	sony_tft_panel_power(1);
	msleep(45);

	clk_enable(spi_clk);
	qspi_send_9bit(0x0, 0x11);
	msleep(5);
	qspi_send_9bit(0x0, 0x3a);
	qspi_send_9bit(0x1, 0x05);
	msleep(100);
	qspi_send_9bit(0x0, 0x29);
	/* unlock register page for pwm setting */
	qspi_send_9bit(0x0, 0xf0);
	qspi_send_9bit(0x1, 0x5a);
	qspi_send_9bit(0x1, 0x5a);
	qspi_send_9bit(0x0, 0xf1);
	qspi_send_9bit(0x1, 0x5a);
	qspi_send_9bit(0x1, 0x5a);
	qspi_send_9bit(0x0, 0xd0);
	qspi_send_9bit(0x1, 0x5a);
	qspi_send_9bit(0x1, 0x5a);

	qspi_send_9bit(0x0, 0xc2);
	qspi_send_9bit(0x1, 0x53);
	qspi_send_9bit(0x1, 0x12);
	clk_disable(spi_clk);
	msleep(100);
	tft_panel_on = 1;
	sony_tft_set_pwm_val(last_val);

	pr_info("%s: -()\n", __func__);
done:
	mutex_unlock(&panel_lock);
	return 0;
}