Message ID | cover.1548654899.git.amit.kucheria@linaro.org |
---|---|
Headers | show |
Series | cpufreq: Add flag to auto-register as cooling device | expand |
On 28/01/2019 07:41, Amit Kucheria wrote: > All cpufreq drivers do similar things to register as a cooling device. > Provide a cpufreq driver flag so drivers can just ask the cpufreq core > to register the cooling device on their behalf. This allows us to get > rid of duplicated code in the drivers. > > In order to allow this, we add a struct thermal_cooling_device pointer > to struct cpufreq_policy so that drivers don't need to store it in a > private data structure. > > Suggested-by: Stephen Boyd <swboyd@chromium.org> > Suggested-by: Viresh Kumar <viresh.kumar@linaro.org> > Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org> > Reviewed-by: Matthias Kaehlcke <mka@chromium.org> > Tested-by: Matthias Kaehlcke <mka@chromium.org> > --- [ ... ] > +/* > + * Set by drivers that want the core to automatically register the cpufreq > + * driver as a thermal cooling device. > + */ > +#define CPUFREQ_AUTO_REGISTER_COOLING_DEV BIT(7) > + Isn't the CPUFREQ_IS_COOLING_DEV more appropriate? We define a property of the cpufreq driver and the resulting action is to auto-register, no? -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On Mon, Jan 28, 2019 at 5:34 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > > On Monday, January 28, 2019 9:32:44 AM CET Daniel Lezcano wrote: > > On 28/01/2019 07:41, Amit Kucheria wrote: > > > All cpufreq drivers do similar things to register as a cooling device. > > > Provide a cpufreq driver flag so drivers can just ask the cpufreq core > > > to register the cooling device on their behalf. This allows us to get > > > rid of duplicated code in the drivers. > > > > > > In order to allow this, we add a struct thermal_cooling_device pointer > > > to struct cpufreq_policy so that drivers don't need to store it in a > > > private data structure. > > > > > > Suggested-by: Stephen Boyd <swboyd@chromium.org> > > > Suggested-by: Viresh Kumar <viresh.kumar@linaro.org> > > > Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org> > > > Reviewed-by: Matthias Kaehlcke <mka@chromium.org> > > > Tested-by: Matthias Kaehlcke <mka@chromium.org> > > > --- > > > > [ ... ] > > > > > +/* > > > + * Set by drivers that want the core to automatically register the cpufreq > > > + * driver as a thermal cooling device. > > > + */ > > > +#define CPUFREQ_AUTO_REGISTER_COOLING_DEV BIT(7) > > > + > > > > Isn't the CPUFREQ_IS_COOLING_DEV more appropriate? We define a property > > of the cpufreq driver and the resulting action is to auto-register, no? > > Yes. OK, will send out another series with this change and the IS_ENABLED guards. Thank you everyone for the review.