static int __init sonywvga_init_panel(void) { int ret; printk(KERN_DEBUG "%s\n", __func__); if(is_sony_RGB666()) msm_device_mdp.dev.platform_data = &mdp_pdata; ret = platform_device_register(&msm_device_mdp); if (ret) return ret; /* set gpio to proper state in the beginning */ if (gpio_switch) (*gpio_switch)(1); ret = platform_device_register(&sonywvga_lcdc_device); if (ret) return ret; wake_lock_init(&panel_idle_lock, WAKE_LOCK_SUSPEND, "backlight_present"); ret = platform_device_register(&sonywvga_backlight); if (ret) return ret; return 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); 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; }
static int sonywvga_panel_init(struct msm_lcdc_panel_ops *ops) { LCMDBG("%s()\n", __func__); wake_lock(&panel_idle_lock); mutex_lock(&panel_lock); sonywvga_panel_power(1); hr_msleep(45); qspi_send_9bit(&init_cmd); hr_msleep(5); if (is_sony_RGB666()) { init_data = 0x06; qspi_send_9bit(&init_cmd2); } else { init_data = 0x05; qspi_send_9bit(&init_cmd2); } mutex_unlock(&panel_lock); wake_unlock(&panel_idle_lock); return 0; }