]> Git Repo - u-boot.git/blobdiff - drivers/spi/davinci_spi.c
Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"
[u-boot.git] / drivers / spi / davinci_spi.c
index a11433db1e9ac96808a662c1fc082cd1cdf1a08b..04c134be9edf5bc9294e7b36b8b9cea038537329 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2009 Texas Instruments Incorporated - https://www.ti.com/
  *
  * Driver for SPI controller on DaVinci. Based on atmel_spi.c
  * by Atmel Corporation
@@ -8,10 +8,11 @@
  * Copyright (C) 2007 Atmel Corporation
  */
 
-#include <common.h>
+#include <config.h>
 #include <log.h>
 #include <spi.h>
 #include <malloc.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <dm.h>
@@ -224,7 +225,7 @@ static int __davinci_spi_claim_bus(struct davinci_spi_slave *ds, int cs)
                SPIPC0_DOFUN_MASK | SPIPC0_DIFUN_MASK), &ds->regs->pc0);
 
        /* setup format */
-       scalar = ((CONFIG_SYS_SPI_CLK / ds->freq) - 1) & 0xFF;
+       scalar = ((CFG_SYS_SPI_CLK / ds->freq) - 1) & 0xFF;
 
        /*
         * Use following format:
@@ -313,7 +314,7 @@ static int davinci_spi_set_speed(struct udevice *bus, uint max_hz)
        struct davinci_spi_slave *ds = dev_get_priv(bus);
 
        debug("%s speed %u\n", __func__, max_hz);
-       if (max_hz > CONFIG_SYS_SPI_CLK / 2)
+       if (max_hz > CFG_SYS_SPI_CLK / 2)
                return -EINVAL;
 
        ds->freq = max_hz;
@@ -333,8 +334,8 @@ static int davinci_spi_set_mode(struct udevice *bus, uint mode)
 
 static int davinci_spi_claim_bus(struct udevice *dev)
 {
-       struct dm_spi_slave_platdata *slave_plat =
-               dev_get_parent_platdata(dev);
+       struct dm_spi_slave_plat *slave_plat =
+               dev_get_parent_plat(dev);
        struct udevice *bus = dev->parent;
        struct davinci_spi_slave *ds = dev_get_priv(bus);
 
@@ -358,8 +359,8 @@ static int davinci_spi_xfer(struct udevice *dev, unsigned int bitlen,
                            const void *dout, void *din,
                            unsigned long flags)
 {
-       struct dm_spi_slave_platdata *slave =
-               dev_get_parent_platdata(dev);
+       struct dm_spi_slave_plat *slave =
+               dev_get_parent_plat(dev);
        struct udevice *bus = dev->parent;
        struct davinci_spi_slave *ds = dev_get_priv(bus);
 
@@ -383,17 +384,17 @@ static const struct dm_spi_ops davinci_spi_ops = {
 static int davinci_spi_probe(struct udevice *bus)
 {
        struct davinci_spi_slave *ds = dev_get_priv(bus);
-       struct davinci_spi_platdata *plat = bus->platdata;
+       struct davinci_spi_plat *plat = dev_get_plat(bus);
        ds->regs = plat->regs;
        ds->num_cs = plat->num_cs;
 
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int davinci_ofdata_to_platadata(struct udevice *bus)
 {
-       struct davinci_spi_platdata *plat = bus->platdata;
+       struct davinci_spi_plat *plat = dev_get_plat(bus);
        fdt_addr_t addr;
 
        addr = dev_read_addr(bus);
@@ -417,12 +418,12 @@ static const struct udevice_id davinci_spi_ids[] = {
 U_BOOT_DRIVER(davinci_spi) = {
        .name = "davinci_spi",
        .id = UCLASS_SPI,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = davinci_spi_ids,
-       .ofdata_to_platdata = davinci_ofdata_to_platadata,
-        .platdata_auto_alloc_size = sizeof(struct davinci_spi_platdata),
+       .of_to_plat = davinci_ofdata_to_platadata,
+       .plat_auto      = sizeof(struct davinci_spi_plat),
 #endif
        .probe = davinci_spi_probe,
        .ops = &davinci_spi_ops,
-       .priv_auto_alloc_size = sizeof(struct davinci_spi_slave),
+       .priv_auto      = sizeof(struct davinci_spi_slave),
 };
This page took 0.027565 seconds and 4 git commands to generate.