spi: Zap sh_spi driver
[oweals/u-boot.git] / drivers / spi / renesas_rpc_spi.c
index e54f24c5d89a3d44eadf4e7a3728a18bfaf5b4fa..3ea59b8fb82a4d961032dec9cb4d928d1a9fa7bf 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Renesas RCar Gen3 RPC QSPI driver
  *
  * Copyright (C) 2018 Marek Vasut <marek.vasut@gmail.com>
- *
- * SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
@@ -13,6 +12,8 @@
 #include <dm/of_access.h>
 #include <dt-structs.h>
 #include <errno.h>
+#include <linux/bitops.h>
+#include <linux/bug.h>
 #include <linux/errno.h>
 #include <spi.h>
 #include <wait_bit.h>
@@ -410,27 +411,30 @@ static int rpc_spi_probe(struct udevice *dev)
 
        priv->regs = plat->regs;
        priv->extr = plat->extr;
-
+#if CONFIG_IS_ENABLED(CLK)
        clk_enable(&priv->clk);
-
+#endif
        return 0;
 }
 
 static int rpc_spi_ofdata_to_platdata(struct udevice *bus)
 {
        struct rpc_spi_platdata *plat = dev_get_platdata(bus);
-       struct rpc_spi_priv *priv = dev_get_priv(bus);
-       int ret;
 
        plat->regs = dev_read_addr_index(bus, 0);
        plat->extr = dev_read_addr_index(bus, 1);
 
+#if CONFIG_IS_ENABLED(CLK)
+       struct rpc_spi_priv *priv = dev_get_priv(bus);
+       int ret;
+
        ret = clk_get_by_index(bus, 0, &priv->clk);
        if (ret < 0) {
                printf("%s: Could not get clock for %s: %d\n",
                       __func__, bus->name, ret);
                return ret;
        }
+#endif
 
        plat->freq = dev_read_u32_default(bus, "spi-max-freq", 50000000);
 
@@ -449,6 +453,7 @@ static const struct udevice_id rpc_spi_ids[] = {
        { .compatible = "renesas,rpc-r8a77965" },
        { .compatible = "renesas,rpc-r8a77970" },
        { .compatible = "renesas,rpc-r8a77995" },
+       { .compatible = "renesas,rpc-r7s72100" },
        { }
 };