Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355737
b: refs/heads/master
c: 4fd243c
h: refs/heads/master
i:
  355735: 35c542f
v: v3
  • Loading branch information
Linus Walleij committed Jan 28, 2013
1 parent 745ceee commit 3e146b6
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ad6e39867cf026e668a4c566725c2c65dbde406
refs/heads/master: 4fd243c6c083ea159ae1a9f9a24198c350034439
3 changes: 3 additions & 0 deletions trunk/Documentation/devicetree/bindings/arm/ste-nomadik.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ usb-s8815 {
interrupts = <19 0x1>;
interrupt-parent = <&gpio3>;
};
mmcsd-gpio {
gpios = <&gpio3 16 0x1>;
};
};
4 changes: 4 additions & 0 deletions trunk/arch/arm/boot/dts/ste-nomadik-s8815.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
interrupts = <19 0x1>;
interrupt-parent = <&gpio3>;
};
/* This will bias the MMC/SD card detect line */
mmcsd-gpio {
gpios = <&gpio3 16 0x1>;
};
};
};
13 changes: 13 additions & 0 deletions trunk/arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,18 @@
interrupt-parent = <&vica>;
interrupts = <10>;
};

mmcsd: sdi@101f6000 {
compatible = "arm,pl18x", "arm,primecell";
reg = <0x101f6000 0x1000>;
interrupt-parent = <&vica>;
interrupts = <22>;
max-frequency = <48000000>;
bus-width = <4>;
mmc-cap-mmc-highspeed;
mmc-cap-sd-highspeed;
cd-gpios = <&gpio3 15 0x1>;
cd-inverted;
};
};
};
48 changes: 47 additions & 1 deletion trunk/arch/arm/mach-nomadik/cpu-8815.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/of_platform.h>
#include <linux/mtd/fsmc.h>
#include <linux/gpio.h>
#include <linux/amba/mmci.h>

#include <mach/hardware.h>
#include <mach/irqs.h>
Expand Down Expand Up @@ -297,6 +298,50 @@ static int __init cpu8815_eth_init(void)
}
device_initcall(cpu8815_eth_init);

/*
* TODO:
* cannot be set from device tree, convert to a proper DT
* binding.
*/
static struct mmci_platform_data mmcsd_plat_data = {
.ocr_mask = MMC_VDD_29_30,
};

/*
* This GPIO pin turns on a line that is used to detect card insertion
* on this board.
*/
static int __init cpu8815_mmcsd_init(void)
{
struct device_node *cdbias;
int gpio, err;

cdbias = of_find_node_by_path("/usb-s8815/mmcsd-gpio");
if (!cdbias) {
pr_info("could not find MMC/SD card detect bias node\n");
return 0;
}
gpio = of_get_gpio(cdbias, 0);
if (gpio < 0) {
pr_info("could not obtain MMC/SD card detect bias GPIO\n");
return 0;
}
err = gpio_request(gpio, "card detect bias");
if (err) {
pr_info("failed to request card detect bias GPIO %d\n", gpio);
return -ENODEV;
}
err = gpio_direction_output(gpio, 0);
if (err){
pr_info("failed to set GPIO %d as output, low\n", gpio);
return err;
}
pr_info("enabled USB-S8815 CD bias GPIO %d, low\n", gpio);
return 0;
}
device_initcall(cpu8815_mmcsd_init);


/* These are mostly to get the right device names for the clock lookups */
static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("st,nomadik-gpio", NOMADIK_GPIO0_BASE,
Expand All @@ -319,7 +364,8 @@ static struct of_dev_auxdata cpu8815_auxdata_lookup[] __initdata = {
"rtc-pl031", NULL),
OF_DEV_AUXDATA("stericsson,fsmc-nand", NOMADIK_FSMC_BASE,
"fsmc-nand", &cpu8815_nand_data),

OF_DEV_AUXDATA("arm,primecell", NOMADIK_SDI_BASE,
"mmci", &mmcsd_plat_data),
{ /* sentinel */ },
};

Expand Down

0 comments on commit 3e146b6

Please sign in to comment.