1 --- a/arch/mips/lantiq/xway/Makefile
2 +++ b/arch/mips/lantiq/xway/Makefile
4 obj-y := prom.o sysctrl.o clk.o reset.o dma.o timer.o dcdc.o
7 +obj-y += eth_mac.o vmmc.o
8 obj-$(CONFIG_PCI) += ath_eep.o rt_eep.o pci-ath-fixup.o
10 obj-$(CONFIG_XRX200_PHY_FW) += xrx200_phy_fw.o
12 +++ b/arch/mips/lantiq/xway/vmmc.c
15 + * This program is free software; you can redistribute it and/or modify it
16 + * under the terms of the GNU General Public License version 2 as published
17 + * by the Free Software Foundation.
19 + * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
22 +#include <linux/module.h>
23 +#include <linux/of_platform.h>
24 +#include <linux/of_gpio.h>
25 +#include <linux/dma-mapping.h>
27 +#include <lantiq_soc.h>
29 +static unsigned int *cp1_base = 0;
30 +unsigned int* ltq_get_cp1_base(void)
33 + panic("no cp1 base was set\n");
36 +EXPORT_SYMBOL(ltq_get_cp1_base);
38 +static int __devinit vmmc_probe(struct platform_device *pdev)
40 +#define CP1_SIZE (1 << 20)
44 + (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC));
46 + gpio_count = of_gpio_count(pdev->dev.of_node);
47 + while (gpio_count) {
48 + enum of_gpio_flags flags;
49 + int gpio = of_get_gpio_flags(pdev->dev.of_node, --gpio_count, &flags);
50 + if (gpio_request(gpio, "vmmc-relay"))
52 + dev_info(&pdev->dev, "requested GPIO %d\n", gpio);
53 + gpio_direction_output(gpio, (flags & OF_GPIO_ACTIVE_LOW) ? (0) : (1));
56 + dev_info(&pdev->dev, "reserved %dMB at 0x%p", CP1_SIZE >> 20, cp1_base);
61 +static const struct of_device_id vmmc_match[] = {
62 + { .compatible = "lantiq,vmmc" },
65 +MODULE_DEVICE_TABLE(of, vmmc_match);
67 +static struct platform_driver vmmc_driver = {
68 + .probe = vmmc_probe,
70 + .name = "lantiq,vmmc",
71 + .owner = THIS_MODULE,
72 + .of_match_table = vmmc_match,
76 +module_platform_driver(vmmc_driver);