Пример #1
0
static void cmc623_pwm_send_intensity(struct backlight_device *bd)
{
	/*unsigned long flags;*/
	int intensity = bd->props.brightness;
	struct platform_device *pdev = NULL;

	pdev = dev_get_drvdata(&bd->dev);
	if (pdev == NULL) {
		printk(KERN_ERR "%s:failed to get platform device.\n", __func__);
		return;
	}
#if 0
	if (bd->props.power != FB_BLANK_UNBLANK ||
		bd->props.fb_blank != FB_BLANK_UNBLANK ||
		cmc623_pwm_suspended) {
		printk("[cmc]i:%d(c:%d)\n", intensity, current_intensity);
		if (!current_intensity)
			return;
		msleep(1);
		intensity = 0;
	}
#endif

	mutex_lock(&cmc623_pwm_mutex);

	cmc623_pwm_backlight_ctl(pdev, intensity);

	mutex_unlock(&cmc623_pwm_mutex);

	current_intensity = intensity;
}
Пример #2
0
static void cmc623_pwm_send_intensity(struct backlight_device *bd)
{
	//unsigned long flags;
	int intensity = bd->props.brightness;
	struct platform_device *pdev = NULL;

	pdev = dev_get_drvdata(&bd->dev);
	if (pdev == NULL) 
		{
		printk(KERN_ERR "%s:failed to get platform device.\n", __func__);
		return;
		}

	if (bd->props.power != FB_BLANK_UNBLANK ||
		bd->props.fb_blank != FB_BLANK_UNBLANK ||
		cmc623_pwm_suspended)
		{
			printk("[cmc]i:%d(c:%d)\n", intensity, current_intensity);
			if(!current_intensity)
				{
				msleep(50);
				return;
				}
			intensity = 0;
		}

	//spin_lock_irqsave(&cmc623_pwm_lock, flags);
	//spin_lock(&cmc623_pwm_lock);
	mutex_lock(&cmc623_pwm_mutex);

	cmc623_pwm_backlight_ctl(pdev, intensity);

	//spin_unlock_irqrestore(&cmc623_pwm_lock, flags);
	//spin_unlock(&cmc623_pwm_lock);
	mutex_unlock(&cmc623_pwm_mutex);
#if 1
		if ( !intensity && lcd_type == LCD_TYPE_TN 
			&& current_intensity > intensity)
			{ 
			mdelay(10);
//			gpio_set_value(OMAP_GPIO_LCD_EN_SET, 0);
			gpio_set_value(OMAP_GPIO_LCD_LDO_EN, 0);
//			printk("LCD LDO Disable !!!!!!!!!!!!!!!\n");
			}
#endif

	current_intensity = intensity;
}