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

PMIC_STATUS pmic_bklit_get_dutycycle ( t_bklit_channel  channel,
unsigned char *  dc 
)

This function retrives a backlight channel duty cycle.

Parameters:
channel Backlight channel.
dc Pointer to backlight duty cycle.
Returns:
This function returns PMIC_SUCCESS if successful.

Definition at line 388 of file pmic_light.c.

References pmic_read_reg(), and suspend_flag.

Referenced by pmic_light_ioctl().

{
      unsigned int reg_value = 0;

      if (suspend_flag == 1) {
            return -EBUSY;
      }
      CHECK_ERROR(pmic_read_reg(LREG_2, &reg_value, PMIC_ALL_BITS));

      switch (channel) {
      case BACKLIGHT_LED1:
            *dc = (int)((reg_value & (MASK_DUTY_CYCLE))
                      >> BIT_DUTY_CYCLE);

            break;
      case BACKLIGHT_LED2:
            *dc = (int)((reg_value & (MASK_DUTY_CYCLE << INDEX_AUX))
                      >> (BIT_DUTY_CYCLE + INDEX_AUX));
            break;
      case BACKLIGHT_LED3:
            *dc = (int)((reg_value & (MASK_DUTY_CYCLE <<
                                INDEX_KYD)) >> (BIT_DUTY_CYCLE +
                                            INDEX_KYD));
            break;
      default:
            return PMIC_PARAMETER_ERROR;
      }

      return PMIC_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index