~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to src/patches/kernel/omap/panda/0011-panda-spidev-setup-pinmux.patch

  • Committer: Dirk Wagner
  • Date: 2014-12-23 08:02:23 UTC
  • mfrom: (4405.56.108)
  • Revision ID: git-v1:601f8347ccb1e9c5e3f250ff26d4097ecd698875
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into asterisk-update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 9f5066a898b77f2fe2b1f0946bb6afebe3d08f6d Mon Sep 17 00:00:00 2001
2
 
From: Yann <yann.wanwanscappel@free.fr>
3
 
Date: Sat, 8 Jun 2013 13:06:37 -0500
4
 
Subject: [PATCH 7/7] panda: spidev: setup pinmux
5
 
 
6
 
It works fine on my board, I've been able to perform data transfers using the spidev_test program provided in kernel documentation
7
 
(shortcut between SIMO and SOMI to perform an hardware loopback). I also checked that CS0 and CS1 and CLK are properly driven using my scope.
8
 
 
9
 
The clock is strangely configured as input, but it is also the case for omap3 beagle board, so I guess this is fine.
10
 
 
11
 
Signed-off-by: Yann <yann.wanwanscappel@free.fr>
12
 
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
13
 
---
14
 
 arch/arm/mach-omap2/board-omap4panda.c |   13 ++++++++++++-
15
 
 1 file changed, 12 insertions(+), 1 deletion(-)
16
 
 
17
 
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
18
 
index 3563f86..10bb576 100644
19
 
--- a/arch/arm/mach-omap2/board-omap4panda.c
20
 
+++ b/arch/arm/mach-omap2/board-omap4panda.c
21
 
@@ -103,6 +103,16 @@ static struct platform_device leds_gpio = {
22
 
        },
23
 
 };
24
 
 
25
 
+static void __init omap4_panda_config_mcspi1_mux(void)
26
 
+{
27
 
+       /* NOTE: Clock pins need to be in input mode */
28
 
+       omap_mux_init_signal("mcspi1_clk", OMAP_PIN_INPUT);
29
 
+       omap_mux_init_signal("mcspi1_simo", OMAP_PIN_OUTPUT);
30
 
+       omap_mux_init_signal("mcspi1_somi", OMAP_PIN_INPUT_PULLUP);
31
 
+       omap_mux_init_signal("mcspi1_cs0", OMAP_PIN_OUTPUT);
32
 
+       omap_mux_init_signal("mcspi1_cs1", OMAP_PIN_OUTPUT);
33
 
+}
34
 
+
35
 
 static struct spi_board_info panda_mcspi_board_info[] = {
36
 
        /* spi 1.0 */
37
 
        {
38
 
@@ -472,7 +482,8 @@ static void __init omap4_panda_init(void)
39
 
        omap4_ehci_init();
40
 
        if (!strcmp(expboard_name, "spidev")) {
41
 
        #if IS_ENABLED(CONFIG_SPI_SPIDEV)
42
 
-               pr_info("Panda expansionboard: spidev: enabling spi3/spi4\n");
43
 
+               pr_info("Panda expansionboard: spidev: enabling spi1.0 and spi1.1\n");
44
 
+               omap4_panda_config_mcspi1_mux();
45
 
                spi_register_board_info(panda_mcspi_board_info, ARRAY_SIZE(panda_mcspi_board_info));
46
 
        #endif
47
 
        }
48
 
1.7.10.4
49