Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

PMIC_STATUS pmic_tcled_enable ( t_tcled_mode  mode,
t_funlight_bank  bank 
)

This function enables tri-color LED.

Parameters:
mode Tri-color LED operation mode.
bank Selected tri-color bank
Returns:
This function returns PMIC_SUCCESS if successful.

Definition at line 813 of file pmic_light.c.

References pmic_write_reg(), and suspend_flag.

Referenced by pmic_light_ioctl().

{
      unsigned int mask = 0;
      unsigned int value = 0;

      if (suspend_flag == 1) {
            return -EBUSY;
      }

      switch (mode) {
      case TCLED_FUN_MODE:
            switch (bank) {
            case TCLED_FUN_BANK1:
                  mask = MASK_BK1_FL;
                  value = MASK_BK1_FL;
                  break;
            case TCLED_FUN_BANK2:
                  mask = MASK_BK2_FL;
                  value = MASK_BK2_FL;
                  break;
            case TCLED_FUN_BANK3:
                  mask = MASK_BK3_FL;
                  value = MASK_BK3_FL;
                  break;
            default:
                  return PMIC_PARAMETER_ERROR;
            }
            break;
      case TCLED_IND_MODE:
            mask = MASK_BK1_FL | MASK_BK2_FL | MASK_BK3_FL;
            break;
      }

      CHECK_ERROR(pmic_write_reg(LREG_0, value, mask));

      return PMIC_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index