On Fri, 28 Jun 2013 09:10:53 +0530, Viresh Kumar wrote:
> On 27 June 2013 21:25, Lukasz Majewski <l.majew...@samsung.com> wrote:
> > On Wed, 26 Jun 2013 16:24:32 +0530, Viresh Kumar wrote:
> >> > +       if (boost_enabled != state) {
> >> > +               write_lock_irqsave(&cpufreq_driver_lock, flags);
> >> > +               boost_enabled = state;
> >> > +               if (cpufreq_driver->enable_boost)
> >> > +                       ret =
> >> > cpufreq_driver->enable_boost(state);
> >> > +               else
> >> > +                       ret = cpufreq_boost_trigger_state_sw();
> >
> > I will use only one call to cpufreq_driver->enable_boost(state) [*]
> > with either cpufreq_boost_enable_sw() (function with SW boost
> > handling) or the one provided by cpufreq driver.
> >
> > Only when cpufreq driver doesn't provide [*], it will be filled with
> > "default" cpufreq_boost_enable_sw().
> 
> I didn't get it completely. You are saying you will send a function
> pointer now?

No, I will use:

if (boost_enabled != state) {
        write_lock_irqsave(&cpufreq_driver_lock, flags);
        boost_enabled = state;

        ret = cpufreq_driver->enable_boost(state);
        ^^^^^^^^^^^^^^^^^^^^ only one callback call
        if (ret)
                boost_enabled = 0;

        write_unlock_irqrestore(&cpufreq_driver_lock, flags);

        if (ret)
                pr_err("%s: BOOST cannot enable (%d)\n",
                       __func__, ret);
}

and @ cpufreq_register_driver() I will add following line:

if (!cpufreq_driver->enable_boost)
        cpufreq_driver->enable_boost = &cpufreq_boost_enable_sw;

When cpufreq driver doesn't define callback for enable_boost it will be
filled with default SW cpufreq_boost_enable_sw callback.



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to