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

PMIC_STATUS pmic_tcled_fun_set_cycletime ( t_funlight_bank  bank,
t_tcled_fun_cycle_time  ct 
)

This function sets tri-color LED cycle time.

Parameters:
bank Tri-color LED bank
ct Cycle time.
Returns:
This function returns PMIC_SUCCESS if successful.

Definition at line 1331 of file pmic_light.c.

References pmic_write_reg(), and suspend_flag.

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

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

      if (ct > TC_CYCLE_TIME_4) {
            return PMIC_PARAMETER_ERROR;
      }

      switch (bank) {
      case TCLED_FUN_BANK1:
            reg_conf = LREG_3;
            break;
      case TCLED_FUN_BANK2:
            reg_conf = LREG_4;
            break;
      case TCLED_FUN_BANK3:
            reg_conf = LREG_5;
            break;
      default:
            return PMIC_PARAMETER_ERROR;
      }

      value = BITFVAL(BIT_PERIOD, ct);
      mask = BITFMASK(BIT_PERIOD);

      CHECK_ERROR(pmic_write_reg(reg_conf, value, mask));
      return PMIC_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index