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

PMIC_STATUS pmic_bklit_config_boost_mode ( unsigned int  abms,
unsigned int  abr 
)

This function sets boost mode configuration Only on mc13783 2.0 or higher

Parameters:
abms Define adaptive boost mode selection
abr Define adaptive boost reference
Returns:
This function returns 0 if successful.

Definition at line 2220 of file pmic_light.c.

References pmic_get_version(), pmic_write_reg(), pmic_version_t::revision, and suspend_flag.

Referenced by pmic_light_ioctl().

{
      unsigned int conf_boost = 0;
      unsigned int mask;
      unsigned int value;
      pmic_version_t mc13783_ver;

      mc13783_ver = pmic_get_version();
      if (mc13783_ver.revision >= 20) {
            if (suspend_flag == 1) {
                  return -EBUSY;
            }

            if (abms > MAX_BOOST_ABMS) {
                  return PMIC_PARAMETER_ERROR;
            }

            if (abr > MAX_BOOST_ABR) {
                  return PMIC_PARAMETER_ERROR;
            }

            conf_boost = abms | (abr << 3);

            value = BITFVAL(BITS_BOOST, conf_boost);
            mask = BITFMASK(BITS_BOOST);
            CHECK_ERROR(pmic_write_reg(LREG_0, value, mask));

            return PMIC_SUCCESS;
      } else {
            return PMIC_NOT_SUPPORTED;
      }
}


Generated by  Doxygen 1.6.0   Back to index