summaryrefslogtreecommitdiffstats
path: root/arch/mips/ath79/mach-pb44.c
diff options
context:
space:
mode:
authorGabor Juhos2011-01-04 21:28:23 +0100
committerRalf Baechle2011-01-18 19:30:27 +0100
commit68a1d3163678a42ad2d0a9013672083c4fb613be (patch)
treeac653355ea8030195c4edd606fa1b31c7f4a8a75 /arch/mips/ath79/mach-pb44.c
parentSPI: Add SPI controller driver for the Atheros AR71XX/AR724X/AR913X SoCs (diff)
downloadkernel-qcow2-linux-68a1d3163678a42ad2d0a9013672083c4fb613be.tar.gz
kernel-qcow2-linux-68a1d3163678a42ad2d0a9013672083c4fb613be.tar.xz
kernel-qcow2-linux-68a1d3163678a42ad2d0a9013672083c4fb613be.zip
MIPS: ath79: add common SPI controller device
Several boards are using the built-in SPI controller of the AR71XX/AR724X/AR913X SoCs. This patch adds common platform_device and helper code to register it. Additionally, the patch registers the SPI bus on the PB44 board. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: linux-mips@linux-mips.org Cc: Imre Kaloz <kaloz@openwrt.org> Cc: Luis R. Rodriguez <lrodriguez@atheros.com> Cc: Cliff Holden <Cliff.Holden@Atheros.com> Cc: Kathy Giori <Kathy.Giori@Atheros.com> Patchwork: https://patchwork.linux-mips.org/patch/1956/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/ath79/mach-pb44.c')
-rw-r--r--arch/mips/ath79/mach-pb44.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/mips/ath79/mach-pb44.c b/arch/mips/ath79/mach-pb44.c
index 3dc5080185cb..ec7b7a135d53 100644
--- a/arch/mips/ath79/mach-pb44.c
+++ b/arch/mips/ath79/mach-pb44.c
@@ -17,6 +17,7 @@
#include "machtypes.h"
#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
+#include "dev-spi.h"
#define PB44_GPIO_I2C_SCL 0
#define PB44_GPIO_I2C_SDA 1
@@ -84,6 +85,20 @@ static struct gpio_keys_button pb44_gpio_keys[] __initdata = {
}
};
+static struct spi_board_info pb44_spi_info[] = {
+ {
+ .bus_num = 0,
+ .chip_select = 0,
+ .max_speed_hz = 25000000,
+ .modalias = "m25p64",
+ },
+};
+
+static struct ath79_spi_platform_data pb44_spi_data = {
+ .bus_num = 0,
+ .num_chipselect = 1,
+};
+
static void __init pb44_init(void)
{
i2c_register_board_info(0, pb44_i2c_board_info,
@@ -95,6 +110,8 @@ static void __init pb44_init(void)
ath79_register_gpio_keys_polled(-1, PB44_KEYS_POLL_INTERVAL,
ARRAY_SIZE(pb44_gpio_keys),
pb44_gpio_keys);
+ ath79_register_spi(&pb44_spi_data, pb44_spi_info,
+ ARRAY_SIZE(pb44_spi_info));
}
MIPS_MACHINE(ATH79_MACH_PB44, "PB44", "Atheros PB44 reference board",