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

PMIC_STATUS pmic_bklit_get_mode ( t_bklit_channel  channel,
t_bklit_mode *  mode 
)

This function gets backlight operation mode. There are two modes of operations: current control and triode mode. The Duty Cycle/Cycle Time control is retained in Triode Mode. Audio coupling is not available in Triode Mode.

Parameters:
channel Backlight channel.
mode Backlight operation mode.
Returns:
This function returns PMIC_SUCCESS if successful.

Definition at line 537 of file pmic_light.c.

References pmic_read_reg(), and suspend_flag.

Referenced by pmic_light_ioctl().

{
      unsigned int reg_value = 0;
      unsigned int mask = 0;

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

      switch (channel) {
      case BACKLIGHT_LED1:
            mask = BITFMASK(BIT_TRIODE_MAIN_BL);
            break;
      case BACKLIGHT_LED2:
            mask = BITFMASK(BIT_TRIODE_AUX_BL);
            break;
      case BACKLIGHT_LED3:
            mask = BITFMASK(BIT_TRIODE_KEY_BL);
            break;
      default:
            return PMIC_PARAMETER_ERROR;
      }

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

      switch (channel) {
      case BACKLIGHT_LED1:
            *mode = BITFEXT(reg_value, BIT_TRIODE_MAIN_BL);
            break;
      case BACKLIGHT_LED2:
            *mode = BITFEXT(reg_value, BIT_TRIODE_AUX_BL);
            break;
      case BACKLIGHT_LED3:
            *mode = BITFEXT(reg_value, BIT_TRIODE_KEY_BL);
            break;
      default:
            return PMIC_PARAMETER_ERROR;
      }

      return PMIC_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index