static void pmic_green_led_on(struct work_struct *work) { #if defined CONFIG_GPIO_34_49_CTRL_LED || defined CONFIG_GPIO_10_11_CTRL_LED ||defined(CONFIG_USE_PM_GPIO_CTRL_LED) //not use b_led #else struct BLINK_LED_data *b_led = container_of(work, struct BLINK_LED_data, work_led_on); #endif #if defined (CONFIG_GPIO_10_11_CTRL_LED) gpio_direction_output(GPIO_GREEN_LIGHT_CTRL, 1); #elif defined (CONFIG_GPIO_34_49_CTRL_LED) pmic_secure_mpp_config_i_sink(GPIO_GREEN_LIGHT_CTRL, PM_MPP__I_SINK__LEVEL_5mA, PM_MPP__I_SINK__SWITCH_ENA); #elif defined(CONFIG_USE_PM_GPIO_CTRL_LED) pmic_gpio_direction_output(GPIO_GREEN_LIGHT_CTRL); pmic_gpio_set_value(GPIO_GREEN_LIGHT_CTRL,1); #else //pmic_set_led_intensity(LED_LCD, b_led->led.brightness / MAX_PMIC_BL_LEVEL); pmic_secure_mpp_config_i_sink(PM_MPP_8, b_led->led.brightness / MAX_PMIC_BL_LEVEL, PM_MPP__I_SINK__SWITCH_ENA); #endif //printk(KERN_NOTICE "PM_DEBUG_MXP:Green led on.\r\n"); }
static int pm8xxx_gpio_rpc_set(struct pm8xxx_gpio_rpc_chip *pm8xxx_gpio_chip, unsigned gpio, int value) { int rc; if (gpio >= pm8xxx_gpio_chip->gpio_chip.ngpio || pm8xxx_gpio_chip == NULL) return -EINVAL; rc = pmic_gpio_set_value(gpio, value); return rc; }
static void pmic_green_led_off(struct work_struct *work) { #if defined (CONFIG_GPIO_10_11_CTRL_LED) gpio_direction_output(GPIO_GREEN_LIGHT_CTRL, 0); #elif defined (CONFIG_GPIO_34_49_CTRL_LED) pmic_secure_mpp_config_i_sink(GPIO_GREEN_LIGHT_CTRL, PM_MPP__I_SINK__LEVEL_5mA, PM_MPP__I_SINK__SWITCH_DIS); #elif defined(CONFIG_USE_PM_GPIO_CTRL_LED) pmic_gpio_direction_output(GPIO_GREEN_LIGHT_CTRL); pmic_gpio_set_value(GPIO_GREEN_LIGHT_CTRL,0); #else //pmic_set_led_intensity(LED_LCD, LED_OFF); pmic_secure_mpp_config_i_sink(PM_MPP_8, 0, PM_MPP__I_SINK__SWITCH_DIS); #endif //printk(KERN_NOTICE "PM_DEBUG_MXP:Green led off.\r\n"); }
static void msm_pmic_bl_led_set(struct led_classdev *led_cdev, enum led_brightness value) { int ret; if(led_not_suspend_flag ==0) { printk(KERN_NOTICE "PM_DEBUG_MXP:Led colour updated.\r\n"); #ifdef CONFIG_ZTE_NLED_BLINK_WHILE_APP_SUSPEND msm_pmic_led_config_while_app2sleep( STATUS_LED->blink_led[0].led.brightness, STATUS_LED->blink_led[1].led.brightness, STATUS_LED->blink_led[0].blink_flag, STATUS_LED->blink_led[1].blink_flag, ZTE_PROC_COMM_CMD3_NLED_BLINK_ENABLE); #endif } else { if (!strcmp(led_cdev->name, "red")) { #if defined (CONFIG_GPIO_10_11_CTRL_LED) if(value == LED_OFF) { ret = gpio_direction_output(GPIO_RED_LIGHT_CTRL, 0); } else { ret = gpio_direction_output(GPIO_RED_LIGHT_CTRL, 1); } #elif defined (CONFIG_GPIO_34_49_CTRL_LED) if(value == LED_OFF) { ret = pmic_secure_mpp_config_i_sink(GPIO_RED_LIGHT_CTRL, PM_MPP__I_SINK__LEVEL_5mA, PM_MPP__I_SINK__SWITCH_DIS); } else { ret = pmic_secure_mpp_config_i_sink(GPIO_RED_LIGHT_CTRL, PM_MPP__I_SINK__LEVEL_5mA, PM_MPP__I_SINK__SWITCH_ENA); } #elif defined(CONFIG_USE_PM_GPIO_CTRL_LED) if(value == LED_OFF) { ret = pmic_gpio_direction_output(GPIO_RED_LIGHT_CTRL); ret = pmic_gpio_set_value(GPIO_RED_LIGHT_CTRL,0); } else { ret = pmic_gpio_direction_output(GPIO_RED_LIGHT_CTRL); ret = pmic_gpio_set_value(GPIO_RED_LIGHT_CTRL,1); } #else //ret = pmic_set_led_intensity(LED_KEYPAD, value / MAX_PMIC_BL_LEVEL); if(value == LED_OFF) { ret = pmic_secure_mpp_config_i_sink(PM_MPP_3, value / MAX_PMIC_BL_LEVEL, PM_MPP__I_SINK__SWITCH_DIS); } else { ret = pmic_secure_mpp_config_i_sink(PM_MPP_3, value / MAX_PMIC_BL_LEVEL, PM_MPP__I_SINK__SWITCH_ENA); } #endif } else //green { #if defined (CONFIG_GPIO_10_11_CTRL_LED) if(value == LED_OFF) { ret = gpio_direction_output(GPIO_GREEN_LIGHT_CTRL, 0); } else { ret = gpio_direction_output(GPIO_GREEN_LIGHT_CTRL, 1); } #elif defined (CONFIG_GPIO_34_49_CTRL_LED) if(value == LED_OFF) { ret = pmic_secure_mpp_config_i_sink(GPIO_GREEN_LIGHT_CTRL, PM_MPP__I_SINK__LEVEL_5mA, PM_MPP__I_SINK__SWITCH_DIS); } else { ret = pmic_secure_mpp_config_i_sink(GPIO_GREEN_LIGHT_CTRL, PM_MPP__I_SINK__LEVEL_5mA, PM_MPP__I_SINK__SWITCH_ENA); } #elif defined(CONFIG_USE_PM_GPIO_CTRL_LED) if(value == LED_OFF) { ret = pmic_gpio_direction_output(GPIO_GREEN_LIGHT_CTRL); ret = pmic_gpio_set_value(GPIO_GREEN_LIGHT_CTRL,0); } else { ret = pmic_gpio_direction_output(GPIO_GREEN_LIGHT_CTRL); ret = pmic_gpio_set_value(GPIO_GREEN_LIGHT_CTRL,1); } #else if(value == LED_OFF) { ret = pmic_secure_mpp_config_i_sink(PM_MPP_8, value / MAX_PMIC_BL_LEVEL, PM_MPP__I_SINK__SWITCH_DIS); } else { ret = pmic_secure_mpp_config_i_sink(PM_MPP_8, value / MAX_PMIC_BL_LEVEL, PM_MPP__I_SINK__SWITCH_ENA); } #endif } if (ret) dev_err(led_cdev->dev, "PM_DEBUG_MXP:LEDS:can't set pmic backlight\n"); } }