From: Bastien Curutchet Date: Wed, 4 Dec 2024 09:43:18 +0000 (+0100) Subject: mtd: rawnand: davinci: Add clock resource X-Git-Tag: v6.14-rc1~89^2^2~14 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a873eaed31a76979404ab7078d39f9e9324e7a17;p=linux-block.git mtd: rawnand: davinci: Add clock resource NAND controller has a reference clock inherited from the AEMIF (cf. Documentation/devicetree/bindings/memory-controllers/ti-aemif.txt) This clock isn't used yet by the driver. Add a struct clock in the struct davinci_nand_info so it can be used to compute timings. Signed-off-by: Bastien Curutchet Signed-off-by: Miquel Raynal --- diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c index d1dfc0788e74..2a3957c15423 100644 --- a/drivers/mtd/nand/raw/davinci_nand.c +++ b/drivers/mtd/nand/raw/davinci_nand.c @@ -10,6 +10,7 @@ * Dirk Behme */ +#include #include #include #include @@ -118,6 +119,8 @@ struct davinci_nand_info { uint32_t mask_cle; uint32_t core_chipsel; + + struct clk *clk; }; static DEFINE_SPINLOCK(davinci_nand_lock); @@ -826,6 +829,10 @@ static int nand_davinci_probe(struct platform_device *pdev) return -EADDRNOTAVAIL; } + info->clk = devm_clk_get_enabled(&pdev->dev, "aemif"); + if (IS_ERR(info->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(info->clk), "failed to get clock"); + info->pdev = pdev; info->base = base; info->vaddr = vaddr;