1 Index: linux-2.6.25.10/drivers/mmc/host/gpiommc.c
2 ===================================================================
3 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
4 +++ linux-2.6.25.10/drivers/mmc/host/gpiommc.c 2008-07-20 20:49:16.000000000 +0200
7 + * Driver an MMC/SD card on a bitbanging GPIO SPI bus.
8 + * This module hooks up the mmc_spi and spi_gpio modules and also
9 + * provides a configfs interface.
11 + * Copyright 2008 Michael Buesch <mb@bu3sch.de>
13 + * Licensed under the GNU/GPL. See COPYING for details.
16 +#include <linux/mmc/gpiommc.h>
17 +#include <linux/platform_device.h>
18 +#include <linux/list.h>
19 +#include <linux/mutex.h>
20 +#include <linux/spi/spi_gpio.h>
21 +#include <linux/configfs.h>
22 +#include <linux/gpio.h>
23 +#include <asm/atomic.h>
26 +#define PFX "gpio-mmc: "
29 +struct gpiommc_device {
30 + struct platform_device *pdev;
31 + struct platform_device *spi_pdev;
32 + struct spi_board_info boardinfo;
36 +MODULE_DESCRIPTION("GPIO based MMC driver");
37 +MODULE_AUTHOR("Michael Buesch");
38 +MODULE_LICENSE("GPL");
41 +static int gpiommc_boardinfo_setup(struct spi_board_info *bi,
42 + struct spi_master *master,
45 + struct gpiommc_device *d = data;
46 + struct gpiommc_platform_data *pdata = d->pdev->dev.platform_data;
48 + /* Bind the SPI master to the MMC-SPI host driver. */
49 + strlcpy(bi->modalias, "mmc_spi", sizeof(bi->modalias));
51 + bi->max_speed_hz = pdata->max_bus_speed;
52 + bi->bus_num = master->bus_num;
53 + bi->mode = pdata->mode;
58 +static int gpiommc_probe(struct platform_device *pdev)
60 + struct gpiommc_platform_data *mmc_pdata = pdev->dev.platform_data;
61 + struct spi_gpio_platform_data spi_pdata;
62 + struct gpiommc_device *d;
69 +#ifdef CONFIG_MMC_SPI_MODULE
70 + err = request_module("mmc_spi");
72 + printk(KERN_WARNING PFX
73 + "Failed to request mmc_spi module.\n");
75 +#endif /* CONFIG_MMC_SPI_MODULE */
77 + /* Allocate the GPIO-MMC device */
79 + d = kzalloc(sizeof(*d), GFP_KERNEL);
84 + /* Create the SPI-GPIO device */
85 + d->spi_pdev = platform_device_alloc(SPI_GPIO_PLATDEV_NAME,
86 + spi_gpio_next_id());
90 + memset(&spi_pdata, 0, sizeof(spi_pdata));
91 + spi_pdata.pin_clk = mmc_pdata->pins.gpio_clk;
92 + spi_pdata.pin_miso = mmc_pdata->pins.gpio_do;
93 + spi_pdata.pin_mosi = mmc_pdata->pins.gpio_di;
94 + spi_pdata.pin_cs = mmc_pdata->pins.gpio_cs;
95 + spi_pdata.cs_activelow = mmc_pdata->pins.cs_activelow;
96 + spi_pdata.no_spi_delay = mmc_pdata->no_spi_delay;
97 + spi_pdata.boardinfo_setup = gpiommc_boardinfo_setup;
98 + spi_pdata.boardinfo_setup_data = d;
100 + err = platform_device_add_data(d->spi_pdev, &spi_pdata,
101 + sizeof(spi_pdata));
103 + goto err_free_pdev;
104 + err = platform_device_add(d->spi_pdev);
106 + goto err_free_pdata;
107 + platform_set_drvdata(pdev, d);
109 + printk(KERN_INFO PFX "MMC-Card \"%s\" "
110 + "attached to GPIO pins di=%u, do=%u, clk=%u, cs=%u\n",
111 + mmc_pdata->name, mmc_pdata->pins.gpio_di,
112 + mmc_pdata->pins.gpio_do,
113 + mmc_pdata->pins.gpio_clk,
114 + mmc_pdata->pins.gpio_cs);
119 + kfree(d->spi_pdev->dev.platform_data);
120 + d->spi_pdev->dev.platform_data = NULL;
122 + platform_device_put(d->spi_pdev);
129 +static int gpiommc_remove(struct platform_device *pdev)
131 + struct gpiommc_device *d = platform_get_drvdata(pdev);
132 + struct gpiommc_platform_data *pdata = d->pdev->dev.platform_data;
134 + platform_device_unregister(d->spi_pdev);
135 + printk(KERN_INFO PFX "GPIO based MMC-Card \"%s\" removed\n",
137 + platform_device_put(d->spi_pdev);
142 +#ifdef CONFIG_GPIOMMC_CONFIGFS
144 +/* A device that was created through configfs */
145 +struct gpiommc_configfs_device {
146 + struct config_item item;
147 + /* The platform device, after registration. */
148 + struct platform_device *pdev;
149 + /* The configuration */
150 + struct gpiommc_platform_data pdata;
153 +#define GPIO_INVALID -1
155 +static inline bool gpiommc_is_registered(struct gpiommc_configfs_device *dev)
157 + return (dev->pdev != NULL);
160 +static inline struct gpiommc_configfs_device *ci_to_gpiommc(struct config_item *item)
162 + return item ? container_of(item, struct gpiommc_configfs_device, item) : NULL;
165 +static struct configfs_attribute gpiommc_attr_DI = {
166 + .ca_owner = THIS_MODULE,
167 + .ca_name = "gpio_data_in",
168 + .ca_mode = S_IRUGO | S_IWUSR,
171 +static struct configfs_attribute gpiommc_attr_DO = {
172 + .ca_owner = THIS_MODULE,
173 + .ca_name = "gpio_data_out",
174 + .ca_mode = S_IRUGO | S_IWUSR,
177 +static struct configfs_attribute gpiommc_attr_CLK = {
178 + .ca_owner = THIS_MODULE,
179 + .ca_name = "gpio_clock",
180 + .ca_mode = S_IRUGO | S_IWUSR,
183 +static struct configfs_attribute gpiommc_attr_CS = {
184 + .ca_owner = THIS_MODULE,
185 + .ca_name = "gpio_chipselect",
186 + .ca_mode = S_IRUGO | S_IWUSR,
189 +static struct configfs_attribute gpiommc_attr_CS_activelow = {
190 + .ca_owner = THIS_MODULE,
191 + .ca_name = "gpio_chipselect_activelow",
192 + .ca_mode = S_IRUGO | S_IWUSR,
195 +static struct configfs_attribute gpiommc_attr_spimode = {
196 + .ca_owner = THIS_MODULE,
197 + .ca_name = "spi_mode",
198 + .ca_mode = S_IRUGO | S_IWUSR,
201 +static struct configfs_attribute gpiommc_attr_spidelay = {
202 + .ca_owner = THIS_MODULE,
203 + .ca_name = "spi_delay",
204 + .ca_mode = S_IRUGO | S_IWUSR,
207 +static struct configfs_attribute gpiommc_attr_max_bus_speed = {
208 + .ca_owner = THIS_MODULE,
209 + .ca_name = "max_bus_speed",
210 + .ca_mode = S_IRUGO | S_IWUSR,
213 +static struct configfs_attribute gpiommc_attr_register = {
214 + .ca_owner = THIS_MODULE,
215 + .ca_name = "register",
216 + .ca_mode = S_IRUGO | S_IWUSR,
219 +static struct configfs_attribute *gpiommc_config_attrs[] = {
224 + &gpiommc_attr_CS_activelow,
225 + &gpiommc_attr_spimode,
226 + &gpiommc_attr_spidelay,
227 + &gpiommc_attr_max_bus_speed,
228 + &gpiommc_attr_register,
232 +static ssize_t gpiommc_config_attr_show(struct config_item *item,
233 + struct configfs_attribute *attr,
236 + struct gpiommc_configfs_device *dev = ci_to_gpiommc(item);
241 + if (attr == &gpiommc_attr_DI) {
242 + gpio = dev->pdata.pins.gpio_di;
243 + if (gpio == GPIO_INVALID)
244 + count = snprintf(page, PAGE_SIZE, "not configured\n");
246 + count = snprintf(page, PAGE_SIZE, "%u\n", gpio);
249 + if (attr == &gpiommc_attr_DO) {
250 + gpio = dev->pdata.pins.gpio_do;
251 + if (gpio == GPIO_INVALID)
252 + count = snprintf(page, PAGE_SIZE, "not configured\n");
254 + count = snprintf(page, PAGE_SIZE, "%u\n", gpio);
257 + if (attr == &gpiommc_attr_CLK) {
258 + gpio = dev->pdata.pins.gpio_clk;
259 + if (gpio == GPIO_INVALID)
260 + count = snprintf(page, PAGE_SIZE, "not configured\n");
262 + count = snprintf(page, PAGE_SIZE, "%u\n", gpio);
265 + if (attr == &gpiommc_attr_CS) {
266 + gpio = dev->pdata.pins.gpio_cs;
267 + if (gpio == GPIO_INVALID)
268 + count = snprintf(page, PAGE_SIZE, "not configured\n");
270 + count = snprintf(page, PAGE_SIZE, "%u\n", gpio);
273 + if (attr == &gpiommc_attr_CS_activelow) {
274 + count = snprintf(page, PAGE_SIZE, "%u\n",
275 + dev->pdata.pins.cs_activelow);
278 + if (attr == &gpiommc_attr_spimode) {
279 + count = snprintf(page, PAGE_SIZE, "%u\n",
283 + if (attr == &gpiommc_attr_spidelay) {
284 + count = snprintf(page, PAGE_SIZE, "%u\n",
285 + !dev->pdata.no_spi_delay);
288 + if (attr == &gpiommc_attr_max_bus_speed) {
289 + count = snprintf(page, PAGE_SIZE, "%u\n",
290 + dev->pdata.max_bus_speed);
293 + if (attr == &gpiommc_attr_register) {
294 + count = snprintf(page, PAGE_SIZE, "%u\n",
295 + gpiommc_is_registered(dev));
301 + return err ? err : count;
304 +static int gpiommc_do_register(struct gpiommc_configfs_device *dev,
309 + if (gpiommc_is_registered(dev))
312 + if (!gpio_is_valid(dev->pdata.pins.gpio_di) ||
313 + !gpio_is_valid(dev->pdata.pins.gpio_do) ||
314 + !gpio_is_valid(dev->pdata.pins.gpio_clk) ||
315 + !gpio_is_valid(dev->pdata.pins.gpio_cs)) {
316 + printk(KERN_ERR PFX
317 + "configfs: Invalid GPIO pin number(s)\n");
321 + strlcpy(dev->pdata.name, name,
322 + sizeof(dev->pdata.name));
324 + dev->pdev = platform_device_alloc(GPIOMMC_PLATDEV_NAME,
325 + gpiommc_next_id());
328 + err = platform_device_add_data(dev->pdev, &dev->pdata,
329 + sizeof(dev->pdata));
331 + platform_device_put(dev->pdev);
334 + err = platform_device_add(dev->pdev);
336 + platform_device_put(dev->pdev);
343 +static void gpiommc_do_unregister(struct gpiommc_configfs_device *dev)
345 + if (!gpiommc_is_registered(dev))
348 + platform_device_unregister(dev->pdev);
352 +static ssize_t gpiommc_config_attr_store(struct config_item *item,
353 + struct configfs_attribute *attr,
354 + const char *page, size_t count)
356 + struct gpiommc_configfs_device *dev = ci_to_gpiommc(item);
358 + unsigned long data;
360 + if (attr == &gpiommc_attr_register) {
361 + err = strict_strtoul(page, 10, &data);
366 + err = gpiommc_do_register(dev, item->ci_name);
368 + gpiommc_do_unregister(dev);
374 + if (gpiommc_is_registered(dev)) {
375 + /* The rest of the config parameters can only be set
376 + * as long as the device is not registered, yet. */
381 + if (attr == &gpiommc_attr_DI) {
382 + err = strict_strtoul(page, 10, &data);
386 + if (!gpio_is_valid(data))
388 + dev->pdata.pins.gpio_di = data;
392 + if (attr == &gpiommc_attr_DO) {
393 + err = strict_strtoul(page, 10, &data);
397 + if (!gpio_is_valid(data))
399 + dev->pdata.pins.gpio_do = data;
403 + if (attr == &gpiommc_attr_CLK) {
404 + err = strict_strtoul(page, 10, &data);
408 + if (!gpio_is_valid(data))
410 + dev->pdata.pins.gpio_clk = data;
414 + if (attr == &gpiommc_attr_CS) {
415 + err = strict_strtoul(page, 10, &data);
419 + if (!gpio_is_valid(data))
421 + dev->pdata.pins.gpio_cs = data;
425 + if (attr == &gpiommc_attr_CS_activelow) {
426 + err = strict_strtoul(page, 10, &data);
430 + if (data != 0 && data != 1)
432 + dev->pdata.pins.cs_activelow = data;
436 + if (attr == &gpiommc_attr_spimode) {
437 + err = strict_strtoul(page, 10, &data);
443 + dev->pdata.mode = SPI_MODE_0;
446 + dev->pdata.mode = SPI_MODE_1;
449 + dev->pdata.mode = SPI_MODE_2;
452 + dev->pdata.mode = SPI_MODE_3;
460 + if (attr == &gpiommc_attr_spidelay) {
461 + err = strict_strtoul(page, 10, &data);
465 + if (data != 0 && data != 1)
467 + dev->pdata.no_spi_delay = !data;
471 + if (attr == &gpiommc_attr_max_bus_speed) {
472 + err = strict_strtoul(page, 10, &data);
476 + if (data > UINT_MAX)
478 + dev->pdata.max_bus_speed = data;
485 + return err ? err : count;
488 +static void gpiommc_config_item_release(struct config_item *item)
490 + struct gpiommc_configfs_device *dev = ci_to_gpiommc(item);
495 +static struct configfs_item_operations gpiommc_config_item_ops = {
496 + .release = gpiommc_config_item_release,
497 + .show_attribute = gpiommc_config_attr_show,
498 + .store_attribute = gpiommc_config_attr_store,
501 +static struct config_item_type gpiommc_dev_ci_type = {
502 + .ct_item_ops = &gpiommc_config_item_ops,
503 + .ct_attrs = gpiommc_config_attrs,
504 + .ct_owner = THIS_MODULE,
507 +static struct config_item *gpiommc_make_item(struct config_group *group,
510 + struct gpiommc_configfs_device *dev;
512 + if (strlen(name) > GPIOMMC_MAX_NAMELEN) {
513 + printk(KERN_ERR PFX "configfs: device name too long\n");
517 + dev = kzalloc(sizeof(*dev), GFP_KERNEL);
521 + config_item_init_type_name(&dev->item, name,
522 + &gpiommc_dev_ci_type);
524 + /* Assign default configuration */
525 + dev->pdata.pins.gpio_di = GPIO_INVALID;
526 + dev->pdata.pins.gpio_do = GPIO_INVALID;
527 + dev->pdata.pins.gpio_clk = GPIO_INVALID;
528 + dev->pdata.pins.gpio_cs = GPIO_INVALID;
529 + dev->pdata.pins.cs_activelow = 1;
530 + dev->pdata.mode = SPI_MODE_0;
531 + dev->pdata.no_spi_delay = 0;
532 + dev->pdata.max_bus_speed = 5000000; /* 5 MHz */
534 + return &(dev->item);
537 +static void gpiommc_drop_item(struct config_group *group,
538 + struct config_item *item)
540 + struct gpiommc_configfs_device *dev = ci_to_gpiommc(item);
542 + gpiommc_do_unregister(dev);
546 +static struct configfs_group_operations gpiommc_ct_group_ops = {
547 + .make_item = gpiommc_make_item,
548 + .drop_item = gpiommc_drop_item,
551 +static struct config_item_type gpiommc_ci_type = {
552 + .ct_group_ops = &gpiommc_ct_group_ops,
553 + .ct_owner = THIS_MODULE,
556 +static struct configfs_subsystem gpiommc_subsys = {
559 + .ci_namebuf = GPIOMMC_PLATDEV_NAME,
560 + .ci_type = &gpiommc_ci_type,
563 + .su_mutex = __MUTEX_INITIALIZER(gpiommc_subsys.su_mutex),
566 +#endif /* CONFIG_GPIOMMC_CONFIGFS */
568 +static struct platform_driver gpiommc_plat_driver = {
569 + .probe = gpiommc_probe,
570 + .remove = gpiommc_remove,
572 + .name = GPIOMMC_PLATDEV_NAME,
573 + .owner = THIS_MODULE,
577 +int gpiommc_next_id(void)
579 + static atomic_t counter = ATOMIC_INIT(-1);
581 + return atomic_inc_return(&counter);
583 +EXPORT_SYMBOL(gpiommc_next_id);
585 +static int __init gpiommc_modinit(void)
589 + err = platform_driver_register(&gpiommc_plat_driver);
593 +#ifdef CONFIG_GPIOMMC_CONFIGFS
594 + config_group_init(&gpiommc_subsys.su_group);
595 + err = configfs_register_subsystem(&gpiommc_subsys);
597 + platform_driver_unregister(&gpiommc_plat_driver);
600 +#endif /* CONFIG_GPIOMMC_CONFIGFS */
604 +module_init(gpiommc_modinit);
606 +static void __exit gpiommc_modexit(void)
608 +#ifdef CONFIG_GPIOMMC_CONFIGFS
609 + configfs_unregister_subsystem(&gpiommc_subsys);
611 + platform_driver_unregister(&gpiommc_plat_driver);
613 +module_exit(gpiommc_modexit);
614 Index: linux-2.6.25.10/drivers/mmc/host/Kconfig
615 ===================================================================
616 --- linux-2.6.25.10.orig/drivers/mmc/host/Kconfig 2008-07-20 20:32:22.000000000 +0200
617 +++ linux-2.6.25.10/drivers/mmc/host/Kconfig 2008-07-20 20:33:20.000000000 +0200
618 @@ -130,3 +130,27 @@ config MMC_SPI
620 If unsure, or if your system has no SPI master driver, say N.
623 + tristate "MMC/SD over GPIO-based SPI"
624 + depends on MMC && MMC_SPI && SPI_GPIO
626 + This driver hooks up the mmc_spi and spi_gpio modules so that
627 + MMC/SD cards can be used on a GPIO based bus by bitbanging
628 + the SPI protocol in software.
630 + This driver provides a configfs interface to dynamically create
631 + and destroy GPIO-based MMC/SD card devices. It also provides
632 + a platform device interface API.
633 + See Documentation/gpiommc.txt for details.
635 + The module will be called gpiommc.
639 +config GPIOMMC_CONFIGFS
641 + depends on GPIOMMC && CONFIGFS_FS
644 + This option automatically enables configfs support for gpiommc
645 + if configfs is available.
646 Index: linux-2.6.25.10/drivers/mmc/host/Makefile
647 ===================================================================
648 --- linux-2.6.25.10.orig/drivers/mmc/host/Makefile 2008-07-20 20:32:22.000000000 +0200
649 +++ linux-2.6.25.10/drivers/mmc/host/Makefile 2008-07-20 20:33:20.000000000 +0200
650 @@ -17,4 +17,4 @@ obj-$(CONFIG_MMC_OMAP) += omap.o
651 obj-$(CONFIG_MMC_AT91) += at91_mci.o
652 obj-$(CONFIG_MMC_TIFM_SD) += tifm_sd.o
653 obj-$(CONFIG_MMC_SPI) += mmc_spi.o
655 +obj-$(CONFIG_GPIOMMC) += gpiommc.o
656 Index: linux-2.6.25.10/include/linux/mmc/gpiommc.h
657 ===================================================================
658 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
659 +++ linux-2.6.25.10/include/linux/mmc/gpiommc.h 2008-07-20 20:33:20.000000000 +0200
662 + * Device driver for MMC/SD cards driven over a GPIO bus.
664 + * Copyright (c) 2008 Michael Buesch
666 + * Licensed under the GNU/GPL version 2.
668 +#ifndef LINUX_GPIOMMC_H_
669 +#define LINUX_GPIOMMC_H_
671 +#include <linux/types.h>
674 +#define GPIOMMC_MAX_NAMELEN 15
675 +#define GPIOMMC_MAX_NAMELEN_STR __stringify(GPIOMMC_MAX_NAMELEN)
678 + * struct gpiommc_pins - Hardware pin assignments
680 + * @gpio_di: The GPIO number of the DATA IN pin
681 + * @gpio_do: The GPIO number of the DATA OUT pin
682 + * @gpio_clk: The GPIO number of the CLOCK pin
683 + * @gpio_cs: The GPIO number of the CHIPSELECT pin
684 + * @cs_activelow: If true, the chip is considered selected if @gpio_cs is low.
686 +struct gpiommc_pins {
687 + unsigned int gpio_di;
688 + unsigned int gpio_do;
689 + unsigned int gpio_clk;
690 + unsigned int gpio_cs;
695 + * struct gpiommc_platform_data - Platform data for a MMC-over-SPI-GPIO device.
697 + * @name: The unique name string of the device.
698 + * @pins: The hardware pin assignments.
699 + * @mode: The hardware mode. This is either SPI_MODE_0,
700 + * SPI_MODE_1, SPI_MODE_2 or SPI_MODE_3. See the SPI documentation.
701 + * @no_spi_delay: Do not use delays in the lowlevel SPI bitbanging code.
702 + * This is not standards compliant, but may be required for some
703 + * embedded machines to gain reasonable speed.
704 + * @max_bus_speed: The maximum speed of the SPI bus, in Hertz.
706 +struct gpiommc_platform_data {
707 + char name[GPIOMMC_MAX_NAMELEN + 1];
708 + struct gpiommc_pins pins;
711 + unsigned int max_bus_speed;
715 + * GPIOMMC_PLATDEV_NAME - The platform device name string.
717 + * The name string that has to be used for platform_device_alloc
718 + * when allocating a gpiommc device.
720 +#define GPIOMMC_PLATDEV_NAME "gpiommc"
723 + * gpiommc_next_id - Get another platform device ID number.
725 + * This returns the next platform device ID number that has to be used
726 + * for platform_device_alloc. The ID is opaque and should not be used for
729 +int gpiommc_next_id(void);
731 +#endif /* LINUX_GPIOMMC_H_ */
732 Index: linux-2.6.25.10/Documentation/gpiommc.txt
733 ===================================================================
734 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
735 +++ linux-2.6.25.10/Documentation/gpiommc.txt 2008-07-20 20:33:20.000000000 +0200
737 +GPIOMMC - Driver for an MMC/SD card on a bitbanging GPIO SPI bus
738 +================================================================
740 +The gpiommc module hooks up the mmc_spi and spi_gpio modules for running an
741 +MMC or SD card on GPIO pins.
743 +Two interfaces for registering a new MMC/SD card device are provided:
744 +A static platform-device based mechanism and a dynamic configfs based interface.
747 +Registering devices via platform-device
748 +=======================================
750 +The platform-device interface is used for registering MMC/SD devices that are
751 +part of the hardware platform. This is most useful only for embedded machines
752 +with MMC/SD devices statically connected to the platform GPIO bus.
754 +The data structures are declared in <linux/mmc/gpiommc.h>.
756 +To register a new device, define an instance of struct gpiommc_platform_data.
757 +This structure holds any information about how the device is hooked up to the
758 +GPIO pins and what hardware modes the device supports. See the docbook-style
759 +documentation in the header file for more information on the struct fields.
761 +Then allocate a new instance of a platform device by doing:
763 + pdev = platform_device_alloc(GPIOMMC_PLATDEV_NAME, gpiommc_next_id());
765 +This will allocate the platform device data structures and hook it up to the
767 +Then add the gpiommc_platform_data to the platform device.
769 + err = platform_device_add_data(pdev, pdata, sizeof(struct gpiommc_platform_data));
771 +You may free the local instance of struct gpiommc_platform_data now. (So the
772 +struct may be allocated on the stack, too).
773 +Now simply register the platform device.
775 + err = platform_device_add(pdev);
777 +Done. The gpiommc probe routine will be invoked now and you should see a kernel
778 +log message for the added device.
781 +Registering devices via configfs
782 +================================
784 +MMC/SD cards connected via GPIO often are a pretty dynamic thing, as for example
785 +selfmade hacks for soldering an MMC/SD card to standard GPIO pins on embedded
786 +hardware are a common situation.
787 +So we provide a dynamic interface to conveniently handle adding and removing
788 +devices from userspace, without the need to recompile the kernel.
790 +The "gpiommc" subdirectory at the configfs mountpoint is used for handling
791 +the dynamic configuration.
793 +To create a new device, it must first be allocated with mkdir.
794 +The following command will allocate a device named "my_mmc":
795 + mkdir /config/gpiommc/my_mmc
797 +There are several configuration files available in the new
798 +/config/gpiommc/my_mmc/ directory:
800 +gpio_data_in = The SPI data-IN GPIO pin number.
801 +gpio_data_out = The SPI data-OUT GPIO pin number.
802 +gpio_clock = The SPI Clock GPIO pin number.
803 +gpio_chipselect = The SPI Chipselect GPIO pin number.
804 +gpio_chipselect_activelow = Boolean. If 0, Chipselect is active-HIGH.
805 + If 1, Chipselect is active-LOW.
806 +spi_mode = The SPI data mode. Can be 0-3.
807 +spi_delay = Enable all delays in the lowlevel bitbanging.
808 +max_bus_speed = The maximum SPI bus speed. In Hertz.
810 +register = Not a configuration parameter.
811 + Used to register the configured card
814 +The device must first get configured and then registered by writing "1" to
815 +the "register" file.
816 +The configuration parameters "gpio_data_in", "gpio_data_out", "gpio_clock"
817 +and "gpio_chipselect" are essential and _must_ be configured before writing
818 +"1" to the "register" file. The registration will fail, otherwise.
820 +The default values for the other parameters are:
821 +gpio_chipselect_activelow = 1 (CS active-LOW)
822 +spi_mode = 0 (SPI_MODE_0)
823 +spi_delay = 1 (enabled)
824 +max_bus_speed = 5000000 (5 Mhz)
826 +Configuration values can not be changed after registration. To unregister
827 +the device, write a "0" to the "register" file. The configuration can be
828 +changed again after unregistering.
830 +To completely remove the device, simply rmdir the directory
831 +(/config/gpiommc/my_mmc in this example).
832 +There's no need to first unregister the device before removing it. That will
833 +be done automatically.
834 Index: linux-2.6.25.10/MAINTAINERS
835 ===================================================================
836 --- linux-2.6.25.10.orig/MAINTAINERS 2008-07-20 20:33:20.000000000 +0200
837 +++ linux-2.6.25.10/MAINTAINERS 2008-07-20 20:33:20.000000000 +0200
838 @@ -1736,6 +1736,11 @@ L: gigaset307x-common@lists.sourceforge.
839 W: http://gigaset307x.sourceforge.net/
849 M: mhoffman@lightlink.com