[RFC 6/6] bus: Add support for Tegra NOR controller
From: jonathanh@nvidia.com (Jon Hunter)
Date: 2016-07-21 15:12:05
Also in:
linux-clk, linux-devicetree, linux-tegra
From: jonathanh@nvidia.com (Jon Hunter)
Date: 2016-07-21 15:12:05
Also in:
linux-clk, linux-devicetree, linux-tegra
On 19/07/16 14:36, Mirza Krak wrote:
From: Mirza Krak <redacted> The NOR bus can be used to connect high-speed devices such as NOR flash, FPGAs, DSPs, CAN chips, Wi-Fi chips etc. Signed-off-by: Mirza Krak <redacted> --- drivers/bus/Kconfig | 7 +++ drivers/bus/Makefile | 1 + drivers/bus/tegra-nor.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 drivers/bus/tegra-nor.c
...
+static int __init nor_probe(struct platform_device *pdev)
+{
+ struct resource *res;
+ struct clk *clk;
+ void __iomem *base;
+ int ret;
+
+ /* get the resource */
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ /* get the clock */
+ clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
+
+ ret = clk_prepare_enable(clk);
+ if (ret)
+ return ret;
+
+ /* parse the device node */
+ ret = nor_parse_dt(pdev, base);
+ if (ret) {
+ dev_err(&pdev->dev, "%s fail to create devices.\n",
+ pdev->dev.of_node->full_name);
+ clk_disable_unprepare(clk);
+ return ret;
+ }
+
+ dev_info(&pdev->dev, "Driver registered.\n");
+ return 0;
+}The reset is defined in the binding, but never used. Should we make sure the reset is de-asserted in the probe? Jon -- nvpublic