/* ------------------------------------------------------------------------*//** * @FUNCTION opp54xx_get * @BRIEF return the current voltage domain OPP name. * @RETURNS current voltage domain OPP name (as defined in opp.h) * NULL pointer in case of error or not found * @param[in] vdd_id: voltage domain ID * @DESCRIPTION return the current voltage domain OPP name. Search it by * voltage first, then if failed search it by rates. *//*------------------------------------------------------------------------ */ const char *opp54xx_get(voltdm54xx_id vdd_id) { CHECK_CPU(54xx, NULL); CHECK_ARG_LESS_THAN(vdd_id, VDD54XX_ID_MAX, NULL); opp54xx_init(); return opp_get(voltdm54xx_id2s(vdd_id), 1); }
/* ------------------------------------------------------------------------*//** * @FUNCTION opp54xx_list_get * @BRIEF return the list of OPP of a given voltage domain * @RETURNS list of OPP of a given voltage domain in case of success * NULL in case of error * @param[in] vdd_id: voltage domain ID * @DESCRIPTION return the list of OPP of a given voltage domain *//*------------------------------------------------------------------------ */ const genlist *opp54xx_list_get(voltdm54xx_id vdd_id) { CHECK_CPU(54xx, NULL); CHECK_ARG_LESS_THAN(vdd_id, VDD54XX_ID_MAX, NULL); opp54xx_init(); return opp54xx_list_table_es1[vdd_id]; }
/* ------------------------------------------------------------------------*//** * @FUNCTION opp_init * @BRIEF initialize internal data * @DESCRIPTION initialize internal data (architecture dependent) *//*------------------------------------------------------------------------ */ void opp_init(void) { if (cpu_is_omap44xx()) { opp44xx_init(); } else if (cpu_is_omap54xx()) { opp54xx_init(); } else { fprintf(stderr, "omapconf: %s(): cpu not supported!!!\n", __func__); } }
/* ------------------------------------------------------------------------*//** * @FUNCTION opp54xx_set * @BRIEF change OPP of a given voltage domain. * @RETURNS 0 in case of success * OMAPCONF_ERR_ARG * OMAPCONF_ERR_CPU * OMAPCONF_ERR_NOT_AVAILABLE * @param[in] vdd_id: voltage domain ID * @param[in] opp_id: ID of the OPP to be set * @DESCRIPTION change OPP of a given voltage domain. *//*------------------------------------------------------------------------ */ int opp54xx_set(voltdm54xx_id vdd_id, opp54xx_id opp_id) { CHECK_CPU(54xx, OMAPCONF_ERR_CPU); CHECK_ARG_LESS_THAN(vdd_id, VDD54XX_ID_MAX, OMAPCONF_ERR_ARG); CHECK_ARG_LESS_THAN(opp_id, OPP54XX_ID_MAX, OMAPCONF_ERR_ARG); opp54xx_init(); printf("Sorry, not yet implemented...\n"); return OMAPCONF_ERR_NOT_AVAILABLE; }
/* ------------------------------------------------------------------------*//** * @FUNCTION opp54xx_count_get * @BRIEF return the number of OPP(s) of a given voltage domain * @RETURNS number of OPP(s) (> 0) in case of success * OMAPCONF_ERR_CPU * OMAPCONF_ERR_ARG * @param[in] vdd_id: voltage domain ID * @DESCRIPTION return the number of OPP(s) of a given voltage domain *//*------------------------------------------------------------------------ */ int opp54xx_count_get(voltdm54xx_id vdd_id) { int count; CHECK_CPU(54xx, OMAPCONF_ERR_CPU); CHECK_ARG_LESS_THAN(vdd_id, VDD54XX_ID_MAX, OMAPCONF_ERR_ARG); opp54xx_init(); count = genlist_getcount(opp54xx_list_table_es1[vdd_id]); dprintf("%s(%d) = %d\n", __func__, vdd_id, count); return count; }