diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/Kconfig | 4 | ||||
-rw-r--r-- | drivers/spi/atmel_spi.c | 14 | ||||
-rw-r--r-- | drivers/spi/mpc8xx_spi.c | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index a3b4a0b2f0..d3e407ec11 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -41,7 +41,7 @@ config ATH79_SPI config ATMEL_SPI bool "Atmel SPI driver" - depends on ARCH_AT91 + default y if ARCH_AT91 help This enables driver for the Atmel SPI Controller, present on many AT91 (ARM) chips. This driver can be used to access @@ -276,7 +276,7 @@ config LPC32XX_SSP config MPC8XX_SPI bool "MPC8XX SPI Driver" - depends on 8xx + depends on MPC8xx help Enable support for SPI on MPC8XX diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 8010ab434c..3cdfd366ab 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c @@ -236,7 +236,9 @@ struct atmel_spi_priv { unsigned int freq; /* Default frequency */ unsigned int mode; ulong bus_clk_rate; +#ifdef CONFIG_DM_GPIO struct gpio_desc cs_gpios[MAX_CS_COUNT]; +#endif }; static int atmel_spi_claim_bus(struct udevice *dev) @@ -291,6 +293,7 @@ static int atmel_spi_release_bus(struct udevice *dev) static void atmel_spi_cs_activate(struct udevice *dev) { +#ifdef CONFIG_DM_GPIO struct udevice *bus = dev_get_parent(dev); struct atmel_spi_priv *priv = dev_get_priv(bus); struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev); @@ -300,10 +303,12 @@ static void atmel_spi_cs_activate(struct udevice *dev) return; dm_gpio_set_value(&priv->cs_gpios[cs], 0); +#endif } static void atmel_spi_cs_deactivate(struct udevice *dev) { +#ifdef CONFIG_DM_GPIO struct udevice *bus = dev_get_parent(dev); struct atmel_spi_priv *priv = dev_get_priv(bus); struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev); @@ -313,6 +318,7 @@ static void atmel_spi_cs_deactivate(struct udevice *dev) return; dm_gpio_set_value(&priv->cs_gpios[cs], 1); +#endif } static int atmel_spi_xfer(struct udevice *dev, unsigned int bitlen, @@ -462,8 +468,7 @@ static int atmel_spi_enable_clk(struct udevice *bus) static int atmel_spi_probe(struct udevice *bus) { struct atmel_spi_platdata *bus_plat = dev_get_platdata(bus); - struct atmel_spi_priv *priv = dev_get_priv(bus); - int i, ret; + int ret; ret = atmel_spi_enable_clk(bus); if (ret) @@ -471,6 +476,10 @@ static int atmel_spi_probe(struct udevice *bus) bus_plat->regs = (struct at91_spi *)devfdt_get_addr(bus); +#ifdef CONFIG_DM_GPIO + struct atmel_spi_priv *priv = dev_get_priv(bus); + int i; + ret = gpio_request_list_by_name(bus, "cs-gpios", priv->cs_gpios, ARRAY_SIZE(priv->cs_gpios), 0); if (ret < 0) { @@ -485,6 +494,7 @@ static int atmel_spi_probe(struct udevice *bus) dm_gpio_set_dir_flags(&priv->cs_gpios[i], GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); } +#endif writel(ATMEL_SPI_CR_SWRST, &bus_plat->regs->cr); diff --git a/drivers/spi/mpc8xx_spi.c b/drivers/spi/mpc8xx_spi.c index b5bd558526..eb035e9510 100644 --- a/drivers/spi/mpc8xx_spi.c +++ b/drivers/spi/mpc8xx_spi.c @@ -19,7 +19,7 @@ #include <common.h> #include <mpc8xx.h> -#include <commproc.h> +#include <asm/cpm_8xx.h> #include <linux/ctype.h> #include <malloc.h> #include <post.h> |