Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7ea803e authored by Kevin Hilman's avatar Kevin Hilman
Browse files

OMAP3+: VP: cleanup: move VP instance into voltdm, misc. renames



- move VP instance struct from vdd_info into struct voltage domain
- remove _data suffix from structure name
- rename vp_ prefix from vp_common field: accesses are now vp->common
- move vp_enabled bool from vdd_info into VP instance
- remove remaining references to omap_vdd_info

No functional changes.

Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent d7b0de2b
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -107,11 +107,8 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
	struct omap_vc_channel *vc = voltdm->vc;
	struct omap_vdd_info *vdd = voltdm->vdd;
	struct omap_volt_data *volt_data;
	const struct omap_vp_common_data *vp_common;
	u32 vc_cmdval, vp_errgain_val;

	vp_common = vdd->vp_data->vp_common;

	/* Check if sufficient pmic info is available for this vdd */
	if (!voltdm->pmic) {
		pr_err("%s: Insufficient pmic info to scale the vdd_%s\n",
@@ -148,12 +145,12 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,

	/* Setting vp errorgain based on the voltage */
	if (volt_data) {
		vp_errgain_val = voltdm->read(vdd->vp_data->vpconfig);
		vp_errgain_val = voltdm->read(voltdm->vp->vpconfig);
		vdd->vp_rt_data.vpconfig_errorgain = volt_data->vp_errgain;
		vp_errgain_val &= ~vp_common->vpconfig_errorgain_mask;
		vp_errgain_val &= voltdm->vp->common->vpconfig_errorgain_mask;
		vp_errgain_val |= vdd->vp_rt_data.vpconfig_errorgain <<
			vp_common->vpconfig_errorgain_shift;
		voltdm->write(vp_errgain_val, vdd->vp_data->vpconfig);
			voltdm->vp->common->vpconfig_errorgain_shift;
		voltdm->write(vp_errgain_val, voltdm->vp->vpconfig);
	}

	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -81,11 +81,11 @@ static int __init _config_common_vdd_data(struct voltagedomain *voltdm)

	/* Generic voltage parameters */
	vdd->volt_scale = omap_vp_forceupdate_scale;
	vdd->vp_enabled = false;
	voltdm->vp->enabled = false;

	vdd->vp_rt_data.vpconfig_erroroffset =
		(voltdm->pmic->vp_erroroffset <<
		 vdd->vp_data->vp_common->vpconfig_erroroffset_shift);
		 voltdm->vp->common->vpconfig_erroroffset_shift);

	timeout_val = (sys_clk_speed * voltdm->pmic->vp_timeout_us) / 1000;
	vdd->vp_rt_data.vlimitto_timeout = timeout_val;
+2 −5
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ struct omap_vfsm_instance {
 * @node: list_head linking all voltage domains
 * @pwrdm_list: list_head linking all powerdomains in this voltagedomain
 * @vc: pointer to VC channel associated with this voltagedomain
 * @vp: pointer to VP associated with this voltagedomain
 * @read: read a VC/VP register
 * @write: write a VC/VP register
 * @read: read-modify-write a VC/VP register
@@ -67,6 +68,7 @@ struct voltagedomain {
	struct list_head pwrdm_list;
	struct omap_vc_channel *vc;
	const struct omap_vfsm_instance *vfsm;
	struct omap_vp_instance *vp;
	struct omap_voltdm_pmic *pmic;

	/* VC/VP register access functions: SoC specific */
@@ -136,21 +138,16 @@ struct omap_voltdm_pmic {
 *
 * @volt_data		: voltage table having the distinct voltages supported
 *			  by the domain and other associated per voltage data.
 * @vp_data		: the register values, shifts, masks for various
 *			  vp registers
 * @vp_rt_data          : VP data derived at runtime, not predefined
 * @debug_dir		: debug directory for this voltage domain.
 * @curr_volt		: current voltage for this vdd.
 * @vp_enabled		: flag to keep track of whether vp is enabled or not
 * @volt_scale		: API to scale the voltage of the vdd.
 */
struct omap_vdd_info {
	struct omap_volt_data *volt_data;
	struct omap_vp_instance_data *vp_data;
	struct omap_vp_runtime_data vp_rt_data;
	struct dentry *debug_dir;
	u32 curr_volt;
	bool vp_enabled;

	int (*volt_scale) (struct voltagedomain *voltdm,
		unsigned long target_volt);
+4 −6
Original line number Diff line number Diff line
@@ -36,18 +36,14 @@ static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
	.voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
};

static struct omap_vdd_info omap3_vdd1_info = {
	.vp_data = &omap3_vp1_data,
};
static struct omap_vdd_info omap3_vdd1_info;

static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
	.voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
	.voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
};

static struct omap_vdd_info omap3_vdd2_info = {
	.vp_data = &omap3_vp2_data,
};
static struct omap_vdd_info omap3_vdd2_info;

static struct voltagedomain omap3_voltdm_mpu = {
	.name = "mpu_iva",
@@ -57,6 +53,7 @@ static struct voltagedomain omap3_voltdm_mpu = {
	.rmw = omap3_prm_vcvp_rmw,
	.vc = &omap3_vc_mpu,
	.vfsm = &omap3_vdd1_vfsm,
	.vp = &omap3_vp_mpu,
	.vdd = &omap3_vdd1_info,
};

@@ -68,6 +65,7 @@ static struct voltagedomain omap3_voltdm_core = {
	.rmw = omap3_prm_vcvp_rmw,
	.vc = &omap3_vc_core,
	.vfsm = &omap3_vdd2_vfsm,
	.vp = &omap3_vp_core,
	.vdd = &omap3_vdd2_info,
};

+6 −9
Original line number Diff line number Diff line
@@ -36,25 +36,19 @@ static const struct omap_vfsm_instance omap4_vdd_mpu_vfsm = {
	.voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
};

static struct omap_vdd_info omap4_vdd_mpu_info = {
	.vp_data = &omap4_vp_mpu_data,
};
static struct omap_vdd_info omap4_vdd_mpu_info;

static const struct omap_vfsm_instance omap4_vdd_iva_vfsm = {
	.voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
};

static struct omap_vdd_info omap4_vdd_iva_info = {
	.vp_data = &omap4_vp_iva_data,
};
static struct omap_vdd_info omap4_vdd_iva_info;

static const struct omap_vfsm_instance omap4_vdd_core_vfsm = {
	.voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
};

static struct omap_vdd_info omap4_vdd_core_info = {
	.vp_data = &omap4_vp_core_data,
};
static struct omap_vdd_info omap4_vdd_core_info;

static struct voltagedomain omap4_voltdm_mpu = {
	.name = "mpu",
@@ -64,6 +58,7 @@ static struct voltagedomain omap4_voltdm_mpu = {
	.rmw = omap4_prm_vcvp_rmw,
	.vc = &omap4_vc_mpu,
	.vfsm = &omap4_vdd_mpu_vfsm,
	.vp = &omap4_vp_mpu,
	.vdd = &omap4_vdd_mpu_info,
};

@@ -75,6 +70,7 @@ static struct voltagedomain omap4_voltdm_iva = {
	.rmw = omap4_prm_vcvp_rmw,
	.vc = &omap4_vc_iva,
	.vfsm = &omap4_vdd_iva_vfsm,
	.vp = &omap4_vp_iva,
	.vdd = &omap4_vdd_iva_info,
};

@@ -86,6 +82,7 @@ static struct voltagedomain omap4_voltdm_core = {
	.rmw = omap4_prm_vcvp_rmw,
	.vc = &omap4_vc_core,
	.vfsm = &omap4_vdd_core_vfsm,
	.vp = &omap4_vp_core,
	.vdd = &omap4_vdd_core_info,
};

Loading