Re: [PATCHv3 07/11] omap3+: vp: use new vp_params for calculating vddmin and vddmax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tero Kristo <t-kristo@xxxxxx> writes:

> Now we select the vddmin and vddmax values based on both pmic and
> voltage processor data, this allows usage of different power ICs.
>
> Signed-off-by: Tero Kristo <t-kristo@xxxxxx>
> ---
>  arch/arm/mach-omap2/vp.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
> index 16cb6d4..fd3f43c 100644
> --- a/arch/arm/mach-omap2/vp.c
> +++ b/arch/arm/mach-omap2/vp.c
> @@ -53,8 +53,12 @@ void __init omap_vp_init(struct voltagedomain *voltdm)
>  	sys_clk_rate = voltdm->sys_clk.rate / 1000;
>  
>  	timeout = (sys_clk_rate * voltdm->pmic->vp_timeout_us) / 1000;
> -	vddmin = voltdm->pmic->uv_to_vsel(voltdm->pmic->vp_vddmin);
> -	vddmax = voltdm->pmic->uv_to_vsel(voltdm->pmic->vp_vddmax);
> +	vddmin = voltdm->vp_param->vddmin > voltdm->pmic->vp_vddmin ?
> +		voltdm->vp_param->vddmin : voltdm->pmic->vp_vddmin;
> +	vddmax = voltdm->vp_param->vddmax < voltdm->pmic->vp_vddmax ?
> +		voltdm->vp_param->vddmax : voltdm->pmic->vp_vddmax;

For better readability, please use the min() and max() macros here.

Kevin

> +	vddmin = voltdm->pmic->uv_to_vsel(vddmin);
> +	vddmax = voltdm->pmic->uv_to_vsel(vddmax);
>  
>  	waittime = ((voltdm->pmic->step_size / voltdm->pmic->slew_rate) *
>  		    sys_clk_rate) / 1000;
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux