示例#1
0
static int msm_pmic_led_resume(struct platform_device *dev)
{
/* if phone is set in system sleep indicator mode and awoke,GPIO_24 is relseased so it should be requested*/
#ifdef CONFIG_HUAWEI_LEDS_PMIC
    if( machine_is_msm8255_u8860lp()
    || machine_is_msm8255_u8860_r()
	 ||machine_is_msm8255_u8860_51())
    {
        led_pwm_gpio_config();
        bl_pwm = pwm_request(LED_PM_GPIO25_PWM_ID, "keypad backlight");
    }
#endif
	led_classdev_resume(&msm_kp_bl_led);

	return 0;
}
static int msm_pmic_led_probe(struct platform_device *pdev)
{
	int rc;

	rc = led_classdev_register(&pdev->dev, &msm_kp_bl_led);
	if (rc) {
		dev_err(&pdev->dev, "unable to register led class driver\n");
		return rc;
	}
#ifdef CONFIG_HUAWEI_LEDS_PMIC
    if( machine_is_msm8255_u8860lp()	
    || machine_is_msm8255_u8860_r()
	  ||machine_is_msm8255_u8860_51())
    {
        led_pwm_gpio_config();   
        bl_pwm = pwm_request(LED_PM_GPIO25_PWM_ID, "keypad backlight");
    }
#endif

	msm_keypad_bl_led_set(&msm_kp_bl_led, LED_OFF);
	return rc;
}