lkml.org 
[lkml]   [2020]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] thermal: ti-soc-thermal: Enable addition power management
* Adam Ford <aford173@gmail.com> [200818 15:46]:
> @@ -1153,6 +1166,38 @@ static int ti_bandgap_suspend(struct device *dev)
> return err;
> }
>
> +static int bandgap_omap_cpu_notifier(struct notifier_block *nb,
> + unsigned long cmd, void *v)
> +{
> + struct ti_bandgap *bgp;
> +
> + bgp = container_of(nb, struct ti_bandgap, nb);
> +
> + spin_lock(&bgp->lock);
> + switch (cmd) {
> + case CPU_CLUSTER_PM_ENTER:
> + if (bgp->is_suspended)
> + break;
> + ti_bandgap_save_ctxt(bgp);
> + ti_bandgap_power(bgp, false);
> + if (TI_BANDGAP_HAS(bgp, CLK_CTRL))
> + clk_disable(bgp->fclock);
> + break;
> + case CPU_CLUSTER_PM_ENTER_FAILED:
> + case CPU_CLUSTER_PM_EXIT:
> + if (bgp->is_suspended)
> + break;
> + if (TI_BANDGAP_HAS(bgp, CLK_CTRL))
> + clk_enable(bgp->fclock);
> + ti_bandgap_power(bgp, true);
> + ti_bandgap_restore_ctxt(bgp);
> + break;
> + }
> + spin_unlock(&bgp->lock);
> +
> + return NOTIFY_OK;
> +}

Hmm to me it looks like is_suspended is not used right now?
I guess you want to set it in ti_bandgap_suspend() and clear
it in ti_bandgap_resume()?

Otherwise looks good to me, I can't test the power consumption
right now though so you may want to check it to make sure
device still hits off mode during idle.

Regards,

Tony

\
 
 \ /
  Last update: 2020-08-19 06:59    [W:0.076 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site