plat/st/common/stm32mp_dt.c
/*******************************************************************************
 * This function gets PWR VDD regulator voltage information from the DT.
 * Returns value in microvolts on success, and 0 on failure.
 ******************************************************************************/
This function gets PWR VDD regulator voltage information from the DT.
Returns value in microvolts on success, and 0 on failure.
This function gets PWR VDD regulator voltage information from the DT . Returns value in microvolts on success and 0 on failure .
uint32_t dt_get_pwr_vdd_voltage(void)
{
	int node, pwr_regulators_node;
	const fdt32_t *cuint;
	node = fdt_node_offset_by_compatible(fdt, -1, DT_PWR_COMPAT);
	if (node < 0) {
		INFO("%s: Cannot read PWR node in DT\n", __func__);
		return 0;
	}
	pwr_regulators_node = fdt_subnode_offset(fdt, node, "pwr-regulators");
	if (node < 0) {
		INFO("%s: Cannot read pwr-regulators node in DT\n", __func__);
		return 0;
	}
	cuint = fdt_getprop(fdt, pwr_regulators_node, "vdd-supply", NULL);
	if (cuint == NULL) {
		return 0;
	}
	node = fdt_node_offset_by_phandle(fdt, fdt32_to_cpu(*cuint));
	if (node < 0) {
		return 0;
	}
	cuint = fdt_getprop(fdt, node, "regulator-min-microvolt", NULL);
	if (cuint == NULL) {
		return 0;
	}
	return fdt32_to_cpu(*cuint);
}
uint32_t dt_get_pwr_vdd_voltage ( void ) { int node , pwr_regulators_node ; const fdt32_t * cuint ; node = fdt_node_offset_by_compatible ( fdt , -1 , DT_PWR_COMPAT ) ; if ( node < 0 ) { INFO ( " \n " , __func__ ) ; return 0 ; } pwr_regulators_node = fdt_subnode_offset ( fdt , node , " " ) ; if ( node < 0 ) { INFO ( " \n " , __func__ ) ; return 0 ; } cuint = fdt_getprop ( fdt , pwr_regulators_node , " " , NULL ) ; if ( cuint == NULL ) { return 0 ; } node = fdt_node_offset_by_phandle ( fdt , fdt32_to_cpu ( * cuint ) ) ; if ( node < 0 ) { return 0 ; } cuint = fdt_getprop ( fdt , node , " " , NULL ) ; if ( cuint == NULL ) { return 0 ; } return fdt32_to_cpu ( * cuint ) ; }
This function gets PWR VDD regulator voltage information from the DT.
This function gets PWR VDD regulator voltage information from the DT .