aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/ste-nomadik-s8815.dts4
-rw-r--r--arch/arm/boot/dts/ste-nomadik-stn8815.dtsi13
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c48
3 files changed, 64 insertions, 1 deletions
diff --git a/arch/arm/boot/dts/ste-nomadik-s8815.dts b/arch/arm/boot/dts/ste-nomadik-s8815.dts
index cc777109f98f..b28fbf3408e3 100644
--- a/arch/arm/boot/dts/ste-nomadik-s8815.dts
+++ b/arch/arm/boot/dts/ste-nomadik-s8815.dts
@@ -22,5 +22,9 @@
22 interrupts = <19 0x1>; 22 interrupts = <19 0x1>;
23 interrupt-parent = <&gpio3>; 23 interrupt-parent = <&gpio3>;
24 }; 24 };
25 /* This will bias the MMC/SD card detect line */
26 mmcsd-gpio {
27 gpios = <&gpio3 16 0x1>;
28 };
25 }; 29 };
26}; 30};
diff --git a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
index f129425883a4..0164edc78eed 100644
--- a/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
+++ b/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
@@ -190,5 +190,18 @@
190 interrupt-parent = <&vica>; 190 interrupt-parent = <&vica>;
191 interrupts = <10>; 191 interrupts = <10>;
192 }; 192 };
193
194 mmcsd: sdi@101f6000 {
195 compatible = "arm,pl18x", "arm,primecell";
196 reg = <0x101f6000 0x1000>;
197 interrupt-parent = <&vica>;
198 interrupts = <22>;
199 max-frequency = <48000000>;
200 bus-width = <4>;
201 mmc-cap-mmc-highspeed;
202 mmc-cap-sd-highspeed;
203 cd-gpios = <&gpio3 15 0x1>;
204 cd-inverted;
205 };
193 }; 206 };
194}; 207};
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 339496f15138..5ad301e4eb2f 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -36,6 +36,7 @@
36#include <linux/of_platform.h> 36#include <linux/of_platform.h>
37#include <linux/mtd/fsmc.h> 37#include <linux/mtd/fsmc.h>
38#include <linux/gpio.h> 38#include <linux/gpio.h>
39#include <linux/amba/mmci.h>
39 40
40#include <mach/hardware.h> 41#include <mach/hardware.h>
41#include <mach/irqs.h> 42#include <mach/irqs.h>
@@ -297,6 +298,50 @@ static int __init cpu8815_eth_init(void)
297} 298}
298device_initcall(cpu8815_eth_init); 299device_initcall(cpu8815_eth_init);
299 300
301/*
302 * TODO:
303 * cannot be set from device tree, convert to a proper DT
304 * binding.
305 */
306static struct mmci_platform_data mmcsd_plat_data = {
307 .ocr_mask = MMC_VDD_29_30,
308};
309
310/*
311 * This GPIO pin turns on a line that is used to detect card insertion
312 * on this board.
313 */
314static int __init cpu8815_mmcsd_init(void)
315{
316 struct device_node *cdbias;
317 int gpio, err;
318
319 cdbias = of_find_node_by_path("/usb-s8815/mmcsd-gpio");
320 if (!cdbias) {
321 pr_info("could not find MMC/SD card detect bias node\n");
322 return 0;
323 }
324 gpio = of_get_gpio(cdbias, 0);
325 if (gpio < 0) {
326 pr_info("could not obtain MMC/SD card detect bias GPIO\n");
327 return 0;
328 }
329 err = gpio_request(gpio, "card detect bias");
330 if (err) {
331 pr_info("failed to request card detect bias GPIO %d\n", gpio);
332 return -ENODEV;
333 }
334 err = gpio_direction_output(gpio, 0);
335 if (err){
336 pr_info("failed to set GPIO %d as output, low\n", gpio);
337 return err;
338 }
339 pr_info("enabled USB-S8815 CD bias GPIO %d, low\n", gpio);
340 return 0;
341}
342device_initcall(cpu8815_mmcsd_init);
343
344
300/* These are mostly to get the right device names for the clock lookups */ 345/* These are mostly to get the right device names for the clock lookups */
301static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = { 346static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
302 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE, 347 OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE,
@@ -319,7 +364,8 @@ static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
319 "rtc-pl031", NULL), 364 "rtc-pl031", NULL),
320 OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE, 365 OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
321 "fsmc-nand", &cpu8815_nand_data), 366 "fsmc-nand", &cpu8815_nand_data),
322 367 OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE,
368 "mmci", &mmcsd_plat_data),
323 { /* sentinel */ }, 369 { /* sentinel */ },
324}; 370};
325 371