Skip to content

Commit a873eae

Browse files
bastien-curutchetmiquelraynal
authored andcommitted
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 <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent ea11788 commit a873eae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/mtd/nand/raw/davinci_nand.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Dirk Behme <[email protected]>
1111
*/
1212

13+
#include <linux/clk.h>
1314
#include <linux/err.h>
1415
#include <linux/iopoll.h>
1516
#include <linux/kernel.h>
@@ -118,6 +119,8 @@ struct davinci_nand_info {
118119
uint32_t mask_cle;
119120

120121
uint32_t core_chipsel;
122+
123+
struct clk *clk;
121124
};
122125

123126
static DEFINE_SPINLOCK(davinci_nand_lock);
@@ -826,6 +829,10 @@ static int nand_davinci_probe(struct platform_device *pdev)
826829
return -EADDRNOTAVAIL;
827830
}
828831

832+
info->clk = devm_clk_get_enabled(&pdev->dev, "aemif");
833+
if (IS_ERR(info->clk))
834+
return dev_err_probe(&pdev->dev, PTR_ERR(info->clk), "failed to get clock");
835+
829836
info->pdev = pdev;
830837
info->base = base;
831838
info->vaddr = vaddr;

0 commit comments

Comments
 (0)