Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 6437e4ef authored by Robert Nelson's avatar Robert Nelson
Browse files

missing file on 3.9-rc5-armv7-d5


Signed-off-by: default avatarRobert Nelson <robertcnelson@gmail.com>
parent 47e6c990
Branches
Tags
No related merge requests found
From 3304f2feba4999fc1013911f0cf0d9acc33a0117 Mon Sep 17 00:00:00 2001
From: Adrien Ferre <ferre.adrien@gmail.com>
Date: Mon, 25 Mar 2013 12:00:38 -0500
Subject: [PATCH 3/3] Panda: expansion: add spidev
I've made a patch to enable spidev on pandaboards using buddy=spidev just like for beagle.
https://github.com/RobertCNelson/stable-kernel/issues/22
Signed-off-by: Adrien Ferre <ferre.adrien@gmail.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
arch/arm/mach-omap2/board-omap4panda.c | 42 ++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index b02c2f0..6b11231 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -22,6 +22,7 @@
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/leds.h>
+#include <linux/irq.h>
#include <linux/gpio.h>
#include <linux/usb/otg.h>
#include <linux/i2c/twl.h>
@@ -34,6 +35,7 @@
#include <linux/wl12xx.h>
#include <linux/irqchip/arm-gic.h>
#include <linux/platform_data/omap-abe-twl6040.h>
+#include <linux/spi/spi.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -53,6 +55,8 @@
#define GPIO_WIFI_PMENA 43
#define GPIO_WIFI_IRQ 53
+char expboard_name[16];
+
/* wl127x BT, FM, GPS connectivity chip */
static struct ti_st_plat_data wilink_platform_data = {
.nshutdown_gpio = 46,
@@ -98,6 +102,25 @@ static struct platform_device leds_gpio = {
},
};
+static struct spi_board_info panda_mcspi_board_info[] = {
+ /* spi 1.0 */
+ {
+ .modalias = "spidev",
+ .max_speed_hz = 48000000, //48 Mbps
+ .bus_num = 1,
+ .chip_select = 0,
+ .mode = SPI_MODE_1,
+ },
+ /* spi 1.1 */
+ {
+ .modalias = "spidev",
+ .max_speed_hz = 48000000, //48 Mbps
+ .bus_num = 1,
+ .chip_select = 1,
+ .mode = SPI_MODE_1,
+ },
+};
+
static struct omap_abe_twl6040_data panda_abe_audio_data = {
/* Audio out */
.has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
@@ -155,6 +178,18 @@ static struct gpio panda_ehci_gpios[] __initdata = {
{ GPIO_HUB_NRESET, GPIOF_OUT_INIT_LOW, "hub_nreset" },
};
+static int __init expansionboard_setup(char *str)
+{
+ if (!machine_is_omap4_panda())
+ return 0;
+
+ if (!str)
+ return -EINVAL;
+ strncpy(expboard_name, str, 16);
+ pr_info("Panda expansionboard: %s\n", expboard_name);
+ return 0;
+}
+
static void __init omap4_ehci_init(void)
{
int ret;
@@ -448,11 +483,18 @@ static void __init omap4_panda_init(void)
omap_sdrc_init(NULL, NULL);
omap4_twl6030_hsmmc_init(mmc);
omap4_ehci_init();
+ if (!strcmp(expboard_name, "spidev"))
+ {
+ pr_info("Panda expansionboard: spidev: enabling spi3/spi4\n");
+ spi_register_board_info(panda_mcspi_board_info, ARRAY_SIZE(panda_mcspi_board_info));
+ }
usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto");
usb_musb_init(&musb_board_data);
omap4_panda_display_init();
}
+early_param("buddy", expansionboard_setup);
+
MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
/* Maintainer: David Anders - Texas Instruments Inc */
.atag_offset = 0x100,
--
1.7.10.4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment