Beispiel #1
0
static int dsim_panel_probe(struct dsim_device *dsim)
{
	int ret = 0;
	struct panel_private *panel = &dsim->priv;
#if defined(CONFIG_EXYNOS_DECON_MDNIE_LITE)
	u16 coordinate[2] = {0, };
#endif
	dsim->lcd = lcd_device_register("panel", dsim->dev, &dsim->priv, NULL);
	if (IS_ERR(dsim->lcd)) {
		dsim_err("%s : faield to register lcd device\n", __func__);
		ret = PTR_ERR(dsim->lcd);
		goto probe_err;
	}
	ret = dsim_backlight_probe(dsim);
	if (ret) {
		dsim_err("%s : failed to prbe backlight driver\n", __func__);
		goto probe_err;
	}

	panel->lcdConnected = PANEL_CONNECTED;
	panel->state = PANEL_STATE_RESUMED;
	panel->temperature = NORMAL_TEMPERATURE;
	panel->acl_enable = 0;
	panel->current_acl = 0;
	panel->auto_brightness = 0;
	panel->siop_enable = 0;
	panel->current_hbm = 0;
	panel->current_vint = 0;
	mutex_init(&panel->lock);
#ifdef CONFIG_EXYNOS_DECON_LCD_MCD
	panel->mcd_on = 0;
#endif
	if (panel->ops->probe) {
		ret = panel->ops->probe(dsim);
		if (ret) {
			dsim_err("%s : failed to probe panel\n", __func__);
			goto probe_err;
		}
	}

#if defined(CONFIG_EXYNOS_DECON_LCD_SYSFS)
	lcd_init_sysfs(dsim);
#endif

#if defined(CONFIG_EXYNOS_DECON_MDNIE_LITE)
	coordinate[0] = (u16)panel->coordinate[0];
	coordinate[1] = (u16)panel->coordinate[1];
	mdnie_register(&dsim->lcd->dev, dsim, (mdnie_w)mdnie_lite_send_seq, (mdnie_r)mdnie_lite_read, coordinate, &tune_info);
#endif
probe_err:
	return ret;
}
static int s6e3hf2_wqhd_probe(struct dsim_device *dsim)
{
	int ret = 0;
	struct panel_private *priv = &dsim->priv;

	dsim_info("%s was called\n", __func__);

	dsim->lcd = lcd_device_register("panel", dsim->dev, &dsim->priv, NULL);
	if (IS_ERR(dsim->lcd)) {
		pr_err("failed to register lcd device\n");
		ret = PTR_ERR(dsim->lcd);
		goto probe_err;
	}

	priv->bd = backlight_device_register("panel", dsim->dev, &dsim->priv, &s6e3hf2_wqhd_backlight_ops, NULL);

	if (IS_ERR(priv->bd)) {
		pr_err("failed to register backlight device\n");
		ret = PTR_ERR(priv->bd);
		goto probe_err;
	}
	priv->bd->props.max_brightness = MAX_PLATFORM_BRIGHTNESS;
	priv->bd->props.brightness = DEFAULT_PLATFORM_BRIGHTNESS;

	/*Todo need to rearrange below value */
	priv->lcdConnected = PANEL_CONNECTED;
	priv->state = PANEL_STATE_ACTIVE;
	priv->power = FB_BLANK_UNBLANK;
	priv->temperature = NORMAL_TEMPERATURE;
	priv->acl_enable= 0;
	priv->current_acl = 0;
	priv->auto_brightness = 0;
	priv->siop_enable = 0;
	priv->current_hbm = 0;

	mutex_init(&priv->lock);
#if defined(CONFIG_EXYNOS_DECON_LCD_SYSFS)
	lcd_init_sysfs(dsim);
#endif
	dsim_panel_probe(dsim);

#if defined(CONFIG_EXYNOS_DECON_MDNIE_LITE)
	mdnie_register(&dsim->lcd->dev, dsim, (mdnie_w)s6e3hf2_send_seq, (mdnie_r)s6e3hf2_read);
#endif
probe_err:
	return ret;
}