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

PMIC_STATUS pmic_tcled_get_fun_rampdown ( t_funlight_bank  bank,
t_funlight_channel  channel,
bool *  rampdown 
)

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

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

Definition at line 1918 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 = LEDR1RAMPDOWN;
            break;
      case TCLED_FUN_BANK2:
            mask = LEDR2RAMPDOWN;
            break;
      case TCLED_FUN_BANK3:
            mask = LEDR3RAMPDOWN;
            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) {
            *rampdown = true;
      } else {
            *rampdown = false;
      }
      return PMIC_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index