CHROMIUM: ARM: Exynos5: Manually register spidev on spi1.
authorBryan Freed <bfreed@chromium.org>
Wed, 30 May 2012 20:44:23 +0000 (13:44 -0700)
committerOlof Johansson <olofj@chromium.org>
Wed, 20 Jun 2012 18:49:58 +0000 (11:49 -0700)
This gives user space apps access to spi1 through /dev/spidev1.0.

BUG=chrome-os-partner:9777
TEST=Confirm flashrom -p linux_spi:dev=/dev/spidev1.0 --get-size works.

Change-Id: Ieb957f9b191895e656e11323fd82fd7d68f18007
Signed-off-by: Bryan Freed <bfreed@chromium.org>
Reviewed-on: https://gerrit-int.chromium.org/18705
Commit-Ready: Bryan Freed <bfreed@google.com>
Reviewed-by: Bryan Freed <bfreed@google.com>
Tested-by: Bryan Freed <bfreed@google.com>
Reviewed-by: Olof Johansson <olofj@google.com>
arch/arm/mach-exynos/mach-exynos5-dt.c

index d6d7de1..f8210be 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/pwm_backlight.h>
 #include <linux/mfd/wm8994/pdata.h>
 #include <linux/regulator/machine.h>
+#include <linux/spi/spi.h>
 
 #include <asm/mach/arch.h>
 #include <asm/hardware/gic.h>
@@ -45,6 +46,7 @@
 #include <plat/usb-phy.h>
 #include <plat/ehci.h>
 #include <plat/dp.h>
+#include <plat/s3c64xx-spi.h>
 
 #include <video/platform_lcd.h>
 
@@ -399,6 +401,25 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
        },
 };
 
+static struct s3c64xx_spi_csinfo spi1_csi[] = {
+       [0] = {
+               .line           = EXYNOS5_GPA2(5),
+               .fb_delay       = 0x2,
+       },
+};
+
+static struct spi_board_info spi1_board_info[] __initdata = {
+       {
+               .modalias               = "spidev",
+               .platform_data          = NULL,
+               .max_speed_hz           = 10*1000*1000,
+               .bus_num                = 1,
+               .chip_select            = 0,
+               .mode                   = SPI_MODE_0,
+               .controller_data        = spi1_csi,
+       }
+};
+
 struct sysmmu_platform_data platdata_sysmmu_mfc_l = {
        .dbgname = "mfc_l",
        .clockname = "sysmmu",
@@ -711,6 +732,8 @@ static void __init exynos5250_dt_machine_init(void)
 
        i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
 
+       spi_register_board_info(spi1_board_info, ARRAY_SIZE(spi1_board_info));
+
        of_platform_populate(NULL, of_default_bus_match_table,
                                exynos5250_auxdata_lookup, NULL);