mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
soc: rockchip: opp_select: Add support to parse 'rockchip,pvtm-voltage-sel-hw'
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com> Change-Id: I9d8ad8057f5fff32d5cd859b9d6ee71486c61160
This commit is contained in:
@@ -1165,12 +1165,13 @@ static int rockchip_get_pvtm(struct device *dev, struct device_node *np,
|
||||
}
|
||||
|
||||
void rockchip_of_get_pvtm_sel(struct device *dev, struct device_node *np,
|
||||
char *reg_name, int process,
|
||||
char *reg_name, int bin, int process,
|
||||
int *volt_sel, int *scale_sel)
|
||||
{
|
||||
struct property *prop = NULL;
|
||||
char name[NAME_MAX];
|
||||
int pvtm, ret;
|
||||
u32 hw = 0;
|
||||
|
||||
if (of_property_read_bool(np, "rockchip,pvtm-pvtpll"))
|
||||
pvtm = rockchip_get_pvtm_pvtpll(dev, np, reg_name);
|
||||
@@ -1185,6 +1186,12 @@ void rockchip_of_get_pvtm_sel(struct device *dev, struct device_node *np,
|
||||
snprintf(name, sizeof(name),
|
||||
"rockchip,p%d-pvtm-voltage-sel", process);
|
||||
prop = of_find_property(np, name, NULL);
|
||||
} else if (bin >= 0) {
|
||||
of_property_read_u32(np, "rockchip,pvtm-hw", &hw);
|
||||
if (hw && (hw & BIT(bin))) {
|
||||
sprintf(name, "rockchip,pvtm-voltage-sel-hw");
|
||||
prop = of_find_property(np, name, NULL);
|
||||
}
|
||||
}
|
||||
if (!prop)
|
||||
sprintf(name, "rockchip,pvtm-voltage-sel");
|
||||
@@ -1195,6 +1202,7 @@ void rockchip_of_get_pvtm_sel(struct device *dev, struct device_node *np,
|
||||
next:
|
||||
if (!scale_sel)
|
||||
return;
|
||||
prop = NULL;
|
||||
if (process >= 0) {
|
||||
snprintf(name, sizeof(name),
|
||||
"rockchip,p%d-pvtm-scaling-sel", process);
|
||||
@@ -1346,7 +1354,7 @@ void rockchip_get_scale_volt_sel(struct device *dev, char *lkg_name,
|
||||
|
||||
rockchip_of_get_lkg_sel(dev, np, lkg_name, process,
|
||||
&lkg_volt_sel, &lkg_scale);
|
||||
rockchip_of_get_pvtm_sel(dev, np, reg_name, process,
|
||||
rockchip_of_get_pvtm_sel(dev, np, reg_name, bin, process,
|
||||
&pvtm_volt_sel, &pvtm_scale);
|
||||
rockchip_of_get_bin_sel(dev, np, bin, &bin_scale);
|
||||
rockchip_of_get_bin_volt_sel(dev, np, bin, &bin_volt_sel);
|
||||
|
||||
@@ -88,7 +88,7 @@ void rockchip_of_get_lkg_sel(struct device *dev, struct device_node *np,
|
||||
void rockchip_pvtpll_calibrate_opp(struct rockchip_opp_info *info);
|
||||
void rockchip_pvtpll_add_length(struct rockchip_opp_info *info);
|
||||
void rockchip_of_get_pvtm_sel(struct device *dev, struct device_node *np,
|
||||
char *reg_name, int process,
|
||||
char *reg_name, int bin, int process,
|
||||
int *volt_sel, int *scale_sel);
|
||||
void rockchip_of_get_bin_sel(struct device *dev, struct device_node *np,
|
||||
int bin, int *scale_sel);
|
||||
@@ -154,7 +154,7 @@ static inline void rockchip_pvtpll_add_length(struct rockchip_opp_info *info)
|
||||
|
||||
static inline void rockchip_of_get_pvtm_sel(struct device *dev,
|
||||
struct device_node *np,
|
||||
char *reg_name, int process,
|
||||
char *reg_name, int bin, int process,
|
||||
int *volt_sel, int *scale_sel)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user