mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
spi: designware: convert to livetree
Convert 'dw_spi_ofdata_to_platdata' to use 'dev_read_u32_default' instead of 'fdtdec_get_int' and get rid of DECLARE_GLOBAL_DATA_PTR. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
This commit is contained in:
parent
46b633d7b4
commit
27c3e07bcb
1 changed files with 2 additions and 6 deletions
|
@ -22,8 +22,6 @@
|
||||||
#include <linux/iopoll.h>
|
#include <linux/iopoll.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
|
||||||
|
|
||||||
/* Register offsets */
|
/* Register offsets */
|
||||||
#define DW_SPI_CTRL0 0x00
|
#define DW_SPI_CTRL0 0x00
|
||||||
#define DW_SPI_CTRL1 0x04
|
#define DW_SPI_CTRL1 0x04
|
||||||
|
@ -155,14 +153,12 @@ static int request_gpio_cs(struct udevice *bus)
|
||||||
static int dw_spi_ofdata_to_platdata(struct udevice *bus)
|
static int dw_spi_ofdata_to_platdata(struct udevice *bus)
|
||||||
{
|
{
|
||||||
struct dw_spi_platdata *plat = bus->platdata;
|
struct dw_spi_platdata *plat = bus->platdata;
|
||||||
const void *blob = gd->fdt_blob;
|
|
||||||
int node = dev_of_offset(bus);
|
|
||||||
|
|
||||||
plat->regs = (struct dw_spi *)devfdt_get_addr(bus);
|
plat->regs = (struct dw_spi *)devfdt_get_addr(bus);
|
||||||
|
|
||||||
/* Use 500KHz as a suitable default */
|
/* Use 500KHz as a suitable default */
|
||||||
plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency",
|
plat->frequency = dev_read_u32_default(bus, "spi-max-frequency",
|
||||||
500000);
|
500000);
|
||||||
debug("%s: regs=%p max-frequency=%d\n", __func__, plat->regs,
|
debug("%s: regs=%p max-frequency=%d\n", __func__, plat->regs,
|
||||||
plat->frequency);
|
plat->frequency);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue