Commit 308b3afb97dc342e9c4f958d8b4c459ae0e22bd7

Authored by Heiko Stuebner
Committed by Kukjin Kim
1 parent ddffeb8c4d

ARM: SAMSUNG: Add naming of s3c64xx-spi devices

Commit a5238e360b71 (spi: s3c64xx: move controller information into driver
data) introduced separate device names for the different subtypes of the
spi controller but forgot to set these in the relevant machines.

To fix this introduce a s3c64xx_spi_setname function and populate all
Samsung arches with the correct names. The function resides in a new
header, as the s3c64xx-spi.h contains driver platform data and should
therefore at some later point move out of the Samsung include dir.

Tested on a s3c2416-based machine.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Cc: Stable <stable@vger.kernel.org>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[s.nawrocki@samsung.com: tested on mach-exynos]
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

Showing 7 changed files with 50 additions and 0 deletions Side-by-side Diff

arch/arm/mach-exynos/common.c
... ... @@ -47,6 +47,7 @@
47 47 #include <plat/fimc-core.h>
48 48 #include <plat/iic-core.h>
49 49 #include <plat/tv-core.h>
  50 +#include <plat/spi-core.h>
50 51 #include <plat/regs-serial.h>
51 52  
52 53 #include "common.h"
... ... @@ -346,6 +347,8 @@
346 347  
347 348 s5p_fb_setname(0, "exynos4-fb");
348 349 s5p_hdmi_setname("exynos4-hdmi");
  350 +
  351 + s3c64xx_spi_setname("exynos4210-spi");
349 352 }
350 353  
351 354 static void __init exynos5_map_io(void)
... ... @@ -366,6 +369,8 @@
366 369 s3c_i2c0_setname("s3c2440-i2c");
367 370 s3c_i2c1_setname("s3c2440-i2c");
368 371 s3c_i2c2_setname("s3c2440-i2c");
  372 +
  373 + s3c64xx_spi_setname("exynos4210-spi");
369 374 }
370 375  
371 376 static void __init exynos4_init_clocks(int xtal)
arch/arm/mach-s3c24xx/s3c2416.c
... ... @@ -61,6 +61,7 @@
61 61 #include <plat/nand-core.h>
62 62 #include <plat/adc-core.h>
63 63 #include <plat/rtc-core.h>
  64 +#include <plat/spi-core.h>
64 65  
65 66 static struct map_desc s3c2416_iodesc[] __initdata = {
66 67 IODESC_ENT(WATCHDOG),
... ... @@ -132,6 +133,7 @@
132 133 /* initialize device information early */
133 134 s3c2416_default_sdhci0();
134 135 s3c2416_default_sdhci1();
  136 + s3c64xx_spi_setname("s3c2443-spi");
135 137  
136 138 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
137 139 }
arch/arm/mach-s3c24xx/s3c2443.c
... ... @@ -43,6 +43,7 @@
43 43 #include <plat/nand-core.h>
44 44 #include <plat/adc-core.h>
45 45 #include <plat/rtc-core.h>
  46 +#include <plat/spi-core.h>
46 47  
47 48 static struct map_desc s3c2443_iodesc[] __initdata = {
48 49 IODESC_ENT(WATCHDOG),
... ... @@ -99,6 +100,9 @@
99 100 {
100 101 s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull;
101 102 s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull;
  103 +
  104 + /* initialize device information early */
  105 + s3c64xx_spi_setname("s3c2443-spi");
102 106  
103 107 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
104 108 }
arch/arm/mach-s5p64x0/common.c
... ... @@ -44,6 +44,7 @@
44 44 #include <plat/sdhci.h>
45 45 #include <plat/adc-core.h>
46 46 #include <plat/fb-core.h>
  47 +#include <plat/spi-core.h>
47 48 #include <plat/gpio-cfg.h>
48 49 #include <plat/regs-irqtype.h>
49 50 #include <plat/regs-serial.h>
... ... @@ -179,6 +180,7 @@
179 180 /* initialize any device information early */
180 181 s3c_adc_setname("s3c64xx-adc");
181 182 s3c_fb_setname("s5p64x0-fb");
  183 + s3c64xx_spi_setname("s5p64x0-spi");
182 184  
183 185 s5p64x0_default_sdhci0();
184 186 s5p64x0_default_sdhci1();
... ... @@ -193,6 +195,7 @@
193 195 /* initialize any device information early */
194 196 s3c_adc_setname("s3c64xx-adc");
195 197 s3c_fb_setname("s5p64x0-fb");
  198 + s3c64xx_spi_setname("s5p64x0-spi");
196 199  
197 200 s5p64x0_default_sdhci0();
198 201 s5p64x0_default_sdhci1();
arch/arm/mach-s5pc100/common.c
... ... @@ -45,6 +45,7 @@
45 45 #include <plat/fb-core.h>
46 46 #include <plat/iic-core.h>
47 47 #include <plat/onenand-core.h>
  48 +#include <plat/spi-core.h>
48 49 #include <plat/regs-serial.h>
49 50 #include <plat/watchdog-reset.h>
50 51  
... ... @@ -165,6 +166,8 @@
165 166 s3c_onenand_setname("s5pc100-onenand");
166 167 s3c_fb_setname("s5pc100-fb");
167 168 s3c_cfcon_setname("s5pc100-pata");
  169 +
  170 + s3c64xx_spi_setname("s5pc100-spi");
168 171 }
169 172  
170 173 void __init s5pc100_init_clocks(int xtal)
arch/arm/mach-s5pv210/common.c
... ... @@ -43,6 +43,7 @@
43 43 #include <plat/iic-core.h>
44 44 #include <plat/keypad-core.h>
45 45 #include <plat/tv-core.h>
  46 +#include <plat/spi-core.h>
46 47 #include <plat/regs-serial.h>
47 48  
48 49 #include "common.h"
... ... @@ -196,6 +197,8 @@
196 197  
197 198 /* setup TV devices */
198 199 s5p_hdmi_setname("s5pv210-hdmi");
  200 +
  201 + s3c64xx_spi_setname("s5pv210-spi");
199 202 }
200 203  
201 204 void __init s5pv210_init_clocks(int xtal)
arch/arm/plat-samsung/include/plat/spi-core.h
  1 +/*
  2 + * Copyright (C) 2012 Heiko Stuebner <heiko@sntech.de>
  3 + *
  4 + * This program is free software; you can redistribute it and/or modify
  5 + * it under the terms of the GNU General Public License version 2 as
  6 + * published by the Free Software Foundation.
  7 + */
  8 +
  9 +#ifndef __PLAT_S3C_SPI_CORE_H
  10 +#define __PLAT_S3C_SPI_CORE_H
  11 +
  12 +/* These functions are only for use with the core support code, such as
  13 + * the cpu specific initialisation code
  14 + */
  15 +
  16 +/* re-define device name depending on support. */
  17 +static inline void s3c64xx_spi_setname(char *name)
  18 +{
  19 +#ifdef CONFIG_S3C64XX_DEV_SPI0
  20 + s3c64xx_device_spi0.name = name;
  21 +#endif
  22 +#ifdef CONFIG_S3C64XX_DEV_SPI1
  23 + s3c64xx_device_spi1.name = name;
  24 +#endif
  25 +#ifdef CONFIG_S3C64XX_DEV_SPI2
  26 + s3c64xx_device_spi2.name = name;
  27 +#endif
  28 +}
  29 +
  30 +#endif /* __PLAT_S3C_SPI_CORE_H */