[PATCH 09/10] mtd: rawnand: gpmi: use runtime PM to manage clocks

Lucas Stach l.stach at pengutronix.de
Fri Apr 5 03:23:15 PDT 2019


Am Freitag, den 05.04.2019, 12:07 +0200 schrieb Sascha Hauer:
> The gpmi driver aggressively en/disables the clocks between operations
> which has significant performance cost. Use runtime PM to get rid of
> this bottleneck.
> 
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
> ---
[...]
> +static int __maybe_unused gpmi_runtime_suspend(struct device *dev)
> +{
> +	struct gpmi_nand_data *this = dev_get_drvdata(dev);
> +
> +	printk("%s\n", __func__);
> +
> +	return __gpmi_enable_clk(this, false);
> +}
> +
> +static int __maybe_unused gpmi_runtime_resume(struct device *dev)
> +{
> +	struct gpmi_nand_data *this = dev_get_drvdata(dev);
> +
> +	printk("%s\n", __func__);

Leftover debugging in both functions.

Regards,
Lucas

> +
> +	return __gpmi_enable_clk(this, true);
> +}
> +
>  static const struct dev_pm_ops gpmi_pm_ops = {
>  	SET_SYSTEM_SLEEP_PM_OPS(gpmi_pm_suspend, gpmi_pm_resume)
> +	SET_RUNTIME_PM_OPS(gpmi_runtime_suspend, gpmi_runtime_resume, NULL)
>  };
>  
>  static struct platform_driver gpmi_nand_driver = {



More information about the linux-mtd mailing list