X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Fspi%2Ffsl_dspi.c;h=764c94215e7cebc8766f44974807e5081fe5ea79;hb=9450ab2ba8d720bd9f73bccc0af2e2b5a2c2aaf1;hp=3881b2e8a54630938667d08ca911a5f06854542d;hpb=fdb9f349be255b9b69a5e1a300296779b48a36b0;p=platform%2Fkernel%2Fu-boot.git diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c index 3881b2e..764c942 100644 --- a/drivers/spi/fsl_dspi.c +++ b/drivers/spi/fsl_dspi.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000-2003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. @@ -6,9 +7,9 @@ * TsiChung Liew (Tsi-Chung.Liew@freescale.com) * Chao Fu (B44548@freescale.com) * Haikun Wang (B53464@freescale.com) - * - * SPDX-License-Identifier: GPL-2.0+ */ + +#include #include #include #include @@ -24,7 +25,7 @@ DECLARE_GLOBAL_DATA_PTR; /* fsl_dspi_platdata flags */ -#define DSPI_FLAG_REGMAP_ENDIAN_BIG (1 << 0) +#define DSPI_FLAG_REGMAP_ENDIAN_BIG BIT(0) /* idle data value */ #define DSPI_IDLE_VAL 0x0 @@ -389,21 +390,6 @@ static int fsl_dspi_cfg_speed(struct fsl_dspi_priv *priv, uint speed) return 0; } #ifndef CONFIG_DM_SPI -void spi_init(void) -{ - /* Nothing to do */ -} - -void spi_init_f(void) -{ - /* Nothing to do */ -} - -void spi_init_r(void) -{ - /* Nothing to do */ -} - int spi_cs_is_valid(unsigned int bus, unsigned int cs) { if (((cs >= 0) && (cs < 8)) && ((bus >= 0) && (bus < 8))) @@ -594,7 +580,7 @@ static int fsl_dspi_claim_bus(struct udevice *dev) priv = dev_get_priv(bus); - /* processor special prepartion work */ + /* processor special preparation work */ cpu_dspi_claim_bus(bus->seq, slave_plat->cs); /* configure transfer mode */ @@ -646,7 +632,7 @@ static int fsl_dspi_ofdata_to_platdata(struct udevice *bus) fdt_addr_t addr; struct fsl_dspi_platdata *plat = bus->platdata; const void *blob = gd->fdt_blob; - int node = bus->of_offset; + int node = dev_of_offset(bus); if (fdtdec_get_bool(blob, node, "big-endian")) plat->flags |= DSPI_FLAG_REGMAP_ENDIAN_BIG; @@ -654,7 +640,7 @@ static int fsl_dspi_ofdata_to_platdata(struct udevice *bus) plat->num_chipselect = fdtdec_get_int(blob, node, "num-cs", FSL_DSPI_MAX_CHIPSELECT); - addr = fdtdec_get_addr(blob, node, "reg"); + addr = devfdt_get_addr(bus); if (addr == FDT_ADDR_T_NONE) { debug("DSPI: Can't get base address or size\n"); return -ENOMEM;