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

PMIC_STATUS pmic_tcled_get_fun_rampup ( t_funlight_bank  bank,
t_funlight_channel  channel,
bool *  rampup 
)

This function gets Tri-color LED brightness Ramp Up function; Ramp time is fixed at 1 second.

Parameters:
bank Tri-color LED bank
channel Tri-color LED channel.
rampup Ramp-up configuration.
Returns:
This function returns PMIC_SUCCESS if successful.

Definition at line 1798 of file pmic_light.c.

References pmic_read_reg(), and suspend_flag.

Referenced by pmic_light_ioctl().

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

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

      switch (bank) {
      case TCLED_FUN_BANK1:
            mask = LEDR1RAMPUP;
            break;
      case TCLED_FUN_BANK2:
            mask = LEDR2RAMPUP;
            break;
      case TCLED_FUN_BANK3:
            mask = LEDR3RAMPUP;
            break;
      default:
            return PMIC_PARAMETER_ERROR;
      }

      switch (channel) {
      case TCLED_FUN_CHANNEL1:
            mask = mask;
            break;
      case TCLED_FUN_CHANNEL2:
            mask = mask * 2;
            break;
      case TCLED_FUN_CHANNEL3:
            mask = mask * 4;
            break;
      default:
            return PMIC_PARAMETER_ERROR;
      }

      CHECK_ERROR(pmic_read_reg(LREG_1, &value, mask));
      if (value) {
            *rampup = true;
      } else {
            *rampup = false;
      }

      return PMIC_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index