static ssize_t store_cabc_mode(struct device *dev,
		struct device_attribute *attr,
		const char *buf, size_t count)
{
	struct acx565akm_device *md = dev_get_drvdata(dev);
	int i;

	for (i = 0; i < ARRAY_SIZE(cabc_modes); i++) {
		const char *mode_str = cabc_modes[i];
		int cmp_len = strlen(mode_str);

		if (count > 0 && buf[count - 1] == '\n')
			count--;
		if (count != cmp_len)
			continue;

		if (strncmp(buf, mode_str, cmp_len) == 0)
			break;
	}

	if (i == ARRAY_SIZE(cabc_modes))
		return -EINVAL;

	if (!md->has_cabc && i != 0)
		return -EINVAL;

	mutex_lock(&md->mutex);
	set_cabc_mode(md, i);
	mutex_unlock(&md->mutex);

	return count;
}
static int acx_panel_power_on(struct omap_dss_device *dssdev)
{
	struct acx565akm_device *md = &acx_dev;
	int r;

	dev_dbg(&dssdev->dev, "%s\n", __func__);

	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
		return 0;

	mutex_lock(&md->mutex);

	r = omapdss_sdi_display_enable(dssdev);
	if (r) {
		pr_err("%s sdi enable failed\n", __func__);
		goto fail_unlock;
	}

	/*               */
	msleep(50);

	if (dssdev->platform_enable) {
		r = dssdev->platform_enable(dssdev);
		if (r)
			goto fail;
	}

	if (md->enabled) {
		dev_dbg(&md->spi->dev, "panel already enabled\n");
		mutex_unlock(&md->mutex);
		return 0;
	}

	/*
                                                         
                                             
                                            
                                                                
                   
                                                    
  */
	msleep(120);

	set_sleep_mode(md, 0);
	md->enabled = 1;

	/*                                                        */
	msleep(5);
	set_display_state(md, 1);
	set_cabc_mode(md, md->cabc_mode);

	mutex_unlock(&md->mutex);

	return acx565akm_bl_update_status(md->bl_dev);
fail:
	omapdss_sdi_display_disable(dssdev);
fail_unlock:
	mutex_unlock(&md->mutex);
	return r;
}
static int acx_panel_power_on(struct omap_dss_device *dssdev)
{
	struct acx565akm_device *md = &acx_dev;
	int r;

	dev_dbg(&dssdev->dev, "%s\n", __func__);

	mutex_lock(&md->mutex);

	r = omapdss_sdi_display_enable(dssdev);
	if (r) {
		pr_err("%s sdi enable failed\n", __func__);
		return r;
	}

	/*FIXME tweak me */
	msleep(50);

	if (dssdev->platform_enable) {
		r = dssdev->platform_enable(dssdev);
		if (r)
			goto fail;
	}

	if (md->enabled) {
		dev_dbg(&md->spi->dev, "panel already enabled\n");
		mutex_unlock(&md->mutex);
		return 0;
	}

	/*
	 * We have to meet all the following delay requirements:
	 * 1. tRW: reset pulse width 10usec (7.12.1)
	 * 2. tRT: reset cancel time 5msec (7.12.1)
	 * 3. Providing PCLK,HS,VS signals for 2 frames = ~50msec worst
	 *    case (7.6.2)
	 * 4. 120msec before the sleep out command (7.12.1)
	 */
	msleep(120);

	set_sleep_mode(md, 0);
	md->enabled = 1;

	/* 5msec between sleep out and the next command. (8.2.16) */
	msleep(5);
	set_display_state(md, 1);
	set_cabc_mode(md, md->cabc_mode);

	mutex_unlock(&md->mutex);

	return acx565akm_bl_update_status(md->bl_dev);
fail:
	omapdss_sdi_display_disable(dssdev);
	return r;
}
static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *in = ddata->in;
	int r;

	dev_dbg(&ddata->spi->dev, "%s\n", __func__);

	in->ops.sdi->set_timings(in, &ddata->videomode);

	if (ddata->datapairs > 0)
		in->ops.sdi->set_datapairs(in, ddata->datapairs);

	r = in->ops.sdi->enable(in);
	if (r) {
		pr_err("%s sdi enable failed\n", __func__);
		return r;
	}

	/*FIXME tweak me */
	msleep(50);

	if (gpio_is_valid(ddata->reset_gpio))
		gpio_set_value(ddata->reset_gpio, 1);

	if (ddata->enabled) {
		dev_dbg(&ddata->spi->dev, "panel already enabled\n");
		return 0;
	}

	/*
	 * We have to meet all the following delay requirements:
	 * 1. tRW: reset pulse width 10usec (7.12.1)
	 * 2. tRT: reset cancel time 5msec (7.12.1)
	 * 3. Providing PCLK,HS,VS signals for 2 frames = ~50msec worst
	 *    case (7.6.2)
	 * 4. 120msec before the sleep out command (7.12.1)
	 */
	msleep(120);

	set_sleep_mode(ddata, 0);
	ddata->enabled = 1;

	/* 5msec between sleep out and the next command. (8.2.16) */
	usleep_range(5000, 10000);
	set_display_state(ddata, 1);
	set_cabc_mode(ddata, ddata->cabc_mode);

	return acx565akm_bl_update_status(ddata->bl_dev);
}
static int acx565akm_panel_enable(struct omap_display *display)
{
	struct acx565akm_device *md =
		(struct acx565akm_device*)display->panel->priv;

	dev_dbg(&md->spi->dev, "%s\n", __func__);

	mutex_lock(&md->mutex);

	if (display->hw_config.panel_enable != NULL)
		display->hw_config.panel_enable(display);

	if (md->enabled) {
		dev_dbg(&md->spi->dev, "panel already enabled\n");
		mutex_unlock(&md->mutex);
		return 0;
	}

	/*
	 * We have to meet all the following delay requirements:
	 * 1. tRW: reset pulse width 10usec (7.12.1)
	 * 2. tRT: reset cancel time 5msec (7.12.1)
	 * 3. Providing PCLK,HS,VS signals for 2 frames = ~50msec worst
	 *    case (7.6.2)
	 * 4. 120msec before the sleep out command (7.12.1)
	 */
	msleep(120);

	set_sleep_mode(md, 0);
	md->enabled = 1;

	/* 5msec between sleep out and the next command. (8.2.16) */
	msleep(5);
	set_display_state(md, 1);
	set_cabc_mode(md, md->cabc_mode);

	mutex_unlock(&md->mutex);

	return acx565akm_bl_update_status(md->bl_dev);
}