diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/altera_spi.c | 6 | ||||
-rw-r--r-- | drivers/spi/cf_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/davinci_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/fsl_espi.c | 4 | ||||
-rw-r--r-- | drivers/spi/ich.c | 6 | ||||
-rw-r--r-- | drivers/spi/mxs_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/omap3_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/pl022_spi.c | 4 | ||||
-rw-r--r-- | drivers/spi/rk_spi.c | 38 | ||||
-rw-r--r-- | drivers/spi/spi-uclass.c | 14 |
10 files changed, 43 insertions, 45 deletions
diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c index fadc9f3965..989679e881 100644 --- a/drivers/spi/altera_spi.c +++ b/drivers/spi/altera_spi.c @@ -19,9 +19,7 @@ #define ALTERA_SPI_STATUS_RRDY_MSK BIT(7) #define ALTERA_SPI_CONTROL_SSO_MSK BIT(10) -#ifndef CONFIG_ALTERA_SPI_IDLE_VAL -#define CONFIG_ALTERA_SPI_IDLE_VAL 0xff -#endif +#define ALTERA_SPI_IDLE_VAL 0xff struct altera_spi_regs { u32 rxdata; @@ -119,7 +117,7 @@ static int altera_spi_xfer(struct udevice *dev, unsigned int bitlen, if (txp) data = *txp++; else - data = CONFIG_ALTERA_SPI_IDLE_VAL; + data = ALTERA_SPI_IDLE_VAL; debug("%s: tx:%x ", __func__, data); writel(data, ®s->txdata); diff --git a/drivers/spi/cf_spi.c b/drivers/spi/cf_spi.c index 6511c0e0e5..ea23357090 100644 --- a/drivers/spi/cf_spi.c +++ b/drivers/spi/cf_spi.c @@ -384,7 +384,7 @@ static int coldfire_spi_probe(struct udevice *bus) return 0; } -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) static int coldfire_dspi_of_to_plat(struct udevice *bus) { fdt_addr_t addr; @@ -450,7 +450,7 @@ static const struct dm_spi_ops coldfire_spi_ops = { U_BOOT_DRIVER(coldfire_spi) = { .name = "spi_coldfire", .id = UCLASS_SPI, -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) .of_match = coldfire_spi_ids, .of_to_plat = coldfire_dspi_of_to_plat, .plat_auto = sizeof(struct coldfire_spi_plat), diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c index 15557a6230..0ee6171108 100644 --- a/drivers/spi/davinci_spi.c +++ b/drivers/spi/davinci_spi.c @@ -391,7 +391,7 @@ static int davinci_spi_probe(struct udevice *bus) 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_plat *plat = dev_get_plat(bus); @@ -418,7 +418,7 @@ 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, .of_to_plat = davinci_ofdata_to_platadata, .plat_auto = sizeof(struct davinci_spi_plat), diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c index 387b547159..c7a692623f 100644 --- a/drivers/spi/fsl_espi.c +++ b/drivers/spi/fsl_espi.c @@ -541,7 +541,7 @@ static const struct dm_spi_ops fsl_espi_ops = { .set_mode = fsl_espi_set_mode, }; -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) static int fsl_espi_of_to_plat(struct udevice *bus) { fdt_addr_t addr; @@ -572,7 +572,7 @@ static const struct udevice_id fsl_espi_ids[] = { U_BOOT_DRIVER(fsl_espi) = { .name = "fsl_espi", .id = UCLASS_SPI, -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) .of_match = fsl_espi_ids, .of_to_plat = fsl_espi_of_to_plat, #endif diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c index 08d54e86f4..42071bb70c 100644 --- a/drivers/spi/ich.c +++ b/drivers/spi/ich.c @@ -604,7 +604,7 @@ static int ich_spi_exec_op(struct spi_slave *slave, const struct spi_mem_op *op) return ret; } -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) /** * ich_spi_get_basics() - Get basic information about the ICH device * @@ -672,7 +672,7 @@ static int ich_get_mmap_bus(struct udevice *bus, ulong *map_basep, uint *map_sizep, uint *offsetp) { pci_dev_t spi_bdf; -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) if (device_is_on_pci_bus(bus)) { struct pci_child_plat *pplat; @@ -940,7 +940,7 @@ static int ich_spi_of_to_plat(struct udevice *dev) { struct ich_spi_plat *plat = dev_get_plat(dev); -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) struct ich_spi_priv *priv = dev_get_priv(dev); int ret; diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index d41352a0bb..773e26bbed 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -440,7 +440,7 @@ static const struct dm_spi_ops mxs_spi_ops = { */ }; -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) static int mxs_of_to_plat(struct udevice *bus) { struct mxs_spi_plat *plat = dev_get_plat(bus); @@ -483,7 +483,7 @@ static const struct udevice_id mxs_spi_ids[] = { U_BOOT_DRIVER(fsl_imx23_spi) = { .name = "fsl_imx23_spi", .id = UCLASS_SPI, -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) .of_match = mxs_spi_ids, .of_to_plat = mxs_of_to_plat, #endif diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c index c69f8fee6e..ea38a0ffba 100644 --- a/drivers/spi/omap3_spi.c +++ b/drivers/spi/omap3_spi.c @@ -481,7 +481,7 @@ static const struct dm_spi_ops omap3_spi_ops = { */ }; -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) static struct omap2_mcspi_platform_config omap2_pdata = { .regs_offset = 0, }; @@ -516,7 +516,7 @@ U_BOOT_DRIVER(omap3_spi) = { .name = "omap3_spi", .id = UCLASS_SPI, .flags = DM_FLAG_PRE_RELOC, -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) .of_match = omap3_spi_ids, .of_to_plat = omap3_spi_of_to_plat, .plat_auto = sizeof(struct omap3_spi_plat), diff --git a/drivers/spi/pl022_spi.c b/drivers/spi/pl022_spi.c index 9856a5669c..ea1691438b 100644 --- a/drivers/spi/pl022_spi.c +++ b/drivers/spi/pl022_spi.c @@ -286,7 +286,7 @@ static const struct dm_spi_ops pl022_spi_ops = { .cs_info = pl022_cs_info, }; -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) static int pl022_spi_of_to_plat(struct udevice *bus) { struct pl022_spi_pdata *plat = dev_get_plat(bus); @@ -315,7 +315,7 @@ static const struct udevice_id pl022_spi_ids[] = { U_BOOT_DRIVER(pl022_spi) = { .name = "pl022_spi", .id = UCLASS_SPI, -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) .of_match = pl022_spi_ids, .of_to_plat = pl022_spi_of_to_plat, #endif diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c index 40bd8851b7..cb80be77ae 100644 --- a/drivers/spi/rk_spi.c +++ b/drivers/spi/rk_spi.c @@ -183,7 +183,7 @@ static int conv_of_plat(struct udevice *dev) plat->base = dtplat->reg[0]; plat->frequency = 20000000; - ret = clk_get_by_driver_info(dev, dtplat->clocks, &priv->clk); + ret = clk_get_by_phandle(dev, dtplat->clocks, &priv->clk); if (ret < 0) return ret; @@ -193,31 +193,31 @@ static int conv_of_plat(struct udevice *dev) static int rockchip_spi_of_to_plat(struct udevice *bus) { -#if !CONFIG_IS_ENABLED(OF_PLATDATA) struct rockchip_spi_plat *plat = dev_get_plat(bus); struct rockchip_spi_priv *priv = dev_get_priv(bus); int ret; - plat->base = dev_read_addr(bus); + if (CONFIG_IS_ENABLED(OF_REAL)) { + plat->base = dev_read_addr(bus); - ret = clk_get_by_index(bus, 0, &priv->clk); - if (ret < 0) { - debug("%s: Could not get clock for %s: %d\n", __func__, - bus->name, ret); - return ret; - } + ret = clk_get_by_index(bus, 0, &priv->clk); + if (ret < 0) { + debug("%s: Could not get clock for %s: %d\n", __func__, + bus->name, ret); + return ret; + } - plat->frequency = - dev_read_u32_default(bus, "spi-max-frequency", 50000000); - plat->deactivate_delay_us = - dev_read_u32_default(bus, "spi-deactivate-delay", 0); - plat->activate_delay_us = - dev_read_u32_default(bus, "spi-activate-delay", 0); + plat->frequency = dev_read_u32_default(bus, "spi-max-frequency", + 50000000); + plat->deactivate_delay_us = + dev_read_u32_default(bus, "spi-deactivate-delay", 0); + plat->activate_delay_us = + dev_read_u32_default(bus, "spi-activate-delay", 0); - debug("%s: base=%x, max-frequency=%d, deactivate_delay=%d\n", - __func__, (uint)plat->base, plat->frequency, - plat->deactivate_delay_us); -#endif + debug("%s: base=%x, max-frequency=%d, deactivate_delay=%d\n", + __func__, (uint)plat->base, plat->frequency, + plat->deactivate_delay_us); + } return 0; } diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c index d867b27806..f8ec312d71 100644 --- a/drivers/spi/spi-uclass.c +++ b/drivers/spi/spi-uclass.c @@ -162,7 +162,7 @@ int spi_write_then_read(struct spi_slave *slave, const u8 *opcode, return ret; } -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) static int spi_child_post_bind(struct udevice *dev) { struct dm_spi_slave_plat *plat = dev_get_parent_plat(dev); @@ -176,11 +176,11 @@ static int spi_child_post_bind(struct udevice *dev) static int spi_post_probe(struct udevice *bus) { -#if !CONFIG_IS_ENABLED(OF_PLATDATA) - struct dm_spi_bus *spi = dev_get_uclass_priv(bus); + if (CONFIG_IS_ENABLED(OF_REAL)) { + struct dm_spi_bus *spi = dev_get_uclass_priv(bus); - spi->max_hz = dev_read_u32_default(bus, "spi-max-frequency", 0); -#endif + spi->max_hz = dev_read_u32_default(bus, "spi-max-frequency", 0); + } #if defined(CONFIG_NEEDS_MANUAL_RELOC) struct dm_spi_ops *ops = spi_get_ops(bus); static int reloc_done; @@ -531,7 +531,7 @@ UCLASS_DRIVER(spi) = { .id = UCLASS_SPI, .name = "spi", .flags = DM_UC_FLAG_SEQ_ALIAS, -#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) .post_bind = dm_scan_fdt_dev, #endif .post_probe = spi_post_probe, @@ -539,7 +539,7 @@ UCLASS_DRIVER(spi) = { .per_device_auto = sizeof(struct dm_spi_bus), .per_child_auto = sizeof(struct spi_slave), .per_child_plat_auto = sizeof(struct dm_spi_slave_plat), -#if !CONFIG_IS_ENABLED(OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_REAL) .child_post_bind = spi_child_post_bind, #endif }; |