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

PMIC_STATUS pmic_tcled_get_mode ( t_tcled_mode *  mode,
t_funlight_bank  bank 
)

This function retrives tri-color LED operation mode.

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

Definition at line 894 of file pmic_light.c.

References pmic_read_reg(), and suspend_flag.

{
      unsigned int val;
      unsigned int mask;

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

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

      CHECK_ERROR(pmic_read_reg(LREG_0, &val, mask));

      if (val) {
            *mode = TCLED_FUN_MODE;
      } else {
            *mode = TCLED_IND_MODE;
      }

      return PMIC_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index