2 +++ b/arch/arm/plat-omap/bootreason.c
5 + * linux/arch/arm/plat-omap/bootreason.c
7 + * OMAP Bootreason passing
9 + * Copyright (c) 2004 Nokia
11 + * Written by David Weinehall <david.weinehall@nokia.com>
13 + * This program is free software; you can redistribute it and/or modify it
14 + * under the terms of the GNU General Public License as published by the
15 + * Free Software Foundation; either version 2 of the License, or (at your
16 + * option) any later version.
18 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
19 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
21 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
24 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 + * You should have received a copy of the GNU General Public License along
30 + * with this program; if not, write to the Free Software Foundation, Inc.,
31 + * 675 Mass Ave, Cambridge, MA 02139, USA.
33 +#include <linux/proc_fs.h>
34 +#include <linux/errno.h>
35 +#include <plat/board.h>
37 +static char boot_reason[16];
39 +static int omap_bootreason_read_proc(char *page, char **start, off_t off,
40 + int count, int *eof, void *data)
44 + len += sprintf(page + len, "%s\n", boot_reason);
46 + *start = page + off;
53 + return len < count ? len : count;
56 +static int __init bootreason_init(void)
58 + const struct omap_boot_reason_config *cfg;
59 + int reason_valid = 0;
61 + cfg = omap_get_config(OMAP_TAG_BOOT_REASON, struct omap_boot_reason_config);
63 + strncpy(boot_reason, cfg->reason_str, sizeof(cfg->reason_str));
64 + boot_reason[sizeof(cfg->reason_str)] = 0;
67 + /* Read the boot reason from the OMAP registers */
73 + printk(KERN_INFO "Bootup reason: %s\n", boot_reason);
75 + if (!create_proc_read_entry("bootreason", S_IRUGO, NULL,
76 + omap_bootreason_read_proc, NULL))
82 +late_initcall(bootreason_init);
83 --- a/arch/arm/plat-omap/common.c
84 +++ b/arch/arm/plat-omap/common.c
86 #include <plat/vram.h>
89 +#include <asm/setup.h>
92 #define NO_LENGTH_CHECK 0xffffffff
94 struct omap_board_config_kernel *omap_board_config;
95 int omap_board_config_size;
97 +unsigned char omap_bootloader_tag[1024];
98 +int omap_bootloader_tag_len;
100 +/* used by omap-smp.c and board-4430sdp.c */
101 +void __iomem *gic_cpu_base_addr;
103 +#ifdef CONFIG_OMAP_BOOT_TAG
105 +static int __init parse_tag_omap(const struct tag *tag)
107 + u32 size = tag->hdr.size - (sizeof(tag->hdr) >> 2);
110 + if (size > sizeof(omap_bootloader_tag))
113 + memcpy(omap_bootloader_tag, tag->u.omap.data, size);
114 + omap_bootloader_tag_len = size;
119 +__tagtable(ATAG_BOARD, parse_tag_omap);
123 static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
125 struct omap_board_config_kernel *kinfo = NULL;
128 +#ifdef CONFIG_OMAP_BOOT_TAG
129 + struct omap_board_config_entry *info = NULL;
131 + if (omap_bootloader_tag_len > 4)
132 + info = (struct omap_board_config_entry *) omap_bootloader_tag;
133 + while (info != NULL) {
136 + if (info->tag == tag) {
142 + if ((info->len & 0x03) != 0) {
143 + /* We bail out to avoid an alignment fault */
144 + printk(KERN_ERR "OMAP peripheral config: Length (%d) not word-aligned (tag %04x)\n",
145 + info->len, info->tag);
148 + next = (u8 *) info + sizeof(*info) + info->len;
149 + if (next >= omap_bootloader_tag + omap_bootloader_tag_len)
152 + info = (struct omap_board_config_entry *) next;
154 + if (info != NULL) {
155 + /* Check the length as a lame attempt to check for
156 + * binary inconsistency. */
157 + if (len != NO_LENGTH_CHECK) {
158 + /* Word-align len */
160 + len = (len + 3) & ~0x03;
161 + if (info->len != len) {
162 + printk(KERN_ERR "OMAP peripheral config: Length mismatch with tag %x (want %d, got %d)\n",
163 + tag, len, info->len);
167 + if (len_out != NULL)
168 + *len_out = info->len;
172 /* Try to find the config from the board-specific structures
174 for (i = 0; i < omap_board_config_size; i++) {
176 +++ b/arch/arm/plat-omap/component-version.c
179 + * linux/arch/arm/plat-omap/component-version.c
181 + * Copyright (C) 2005 Nokia Corporation
182 + * Written by Juha Yrjölä <juha.yrjola@nokia.com>
184 + * This program is free software; you can redistribute it and/or modify
185 + * it under the terms of the GNU General Public License version 2 as
186 + * published by the Free Software Foundation.
189 +#include <linux/init.h>
190 +#include <linux/module.h>
191 +#include <linux/err.h>
192 +#include <linux/proc_fs.h>
193 +#include <plat/board.h>
195 +static int component_version_read_proc(char *page, char **start, off_t off,
196 + int count, int *eof, void *data)
199 + const struct omap_version_config *ver;
204 + while ((ver = omap_get_nr_config(OMAP_TAG_VERSION_STR,
205 + struct omap_version_config, i)) != NULL) {
206 + p += sprintf(p, "%-12s%s\n", ver->component, ver->version);
210 + len = (p - page) - off;
214 + *eof = (len <= count) ? 1 : 0;
215 + *start = page + off;
220 +static int __init component_version_init(void)
222 + if (omap_get_config(OMAP_TAG_VERSION_STR, struct omap_version_config) == NULL)
224 + if (!create_proc_read_entry("component_version", S_IRUGO, NULL,
225 + component_version_read_proc, NULL))
231 +static void __exit component_version_exit(void)
233 + remove_proc_entry("component_version", NULL);
236 +late_initcall(component_version_init);
237 +module_exit(component_version_exit);
239 +MODULE_AUTHOR("Juha Yrjölä <juha.yrjola@nokia.com>");
240 +MODULE_DESCRIPTION("Component version driver");
241 +MODULE_LICENSE("GPL");
242 --- a/arch/arm/plat-omap/Kconfig
243 +++ b/arch/arm/plat-omap/Kconfig
244 @@ -79,6 +79,38 @@ config OMAP_RESET_CLOCKS
245 probably do not want this option enabled until your
246 device drivers work properly.
248 +config OMAP_BOOT_TAG
249 + bool "OMAP bootloader information passing"
250 + depends on ARCH_OMAP
253 + Say Y, if you have a bootloader which passes information
254 + about your board and its peripheral configuration.
256 +config OMAP_BOOT_REASON
257 + bool "Support for boot reason"
258 + depends on OMAP_BOOT_TAG
261 + Say Y, if you want to have a procfs entry for reading the boot
262 + reason in user-space.
264 +config OMAP_COMPONENT_VERSION
265 + bool "Support for component version display"
266 + depends on OMAP_BOOT_TAG && PROC_FS
269 + Say Y, if you want to have a procfs entry for reading component
270 + versions (supplied by the bootloader) in user-space.
272 +config OMAP_GPIO_SWITCH
273 + bool "GPIO switch support"
275 + Say Y, if you want to have support for reporting of GPIO
276 + switches (e.g. cover switches) via sysfs. Your bootloader has
277 + to provide information about the switches to the kernel via the
278 + ATAG_BOARD mechanism if they're not defined by the board config.
281 bool "OMAP multiplexing support"
283 --- a/arch/arm/plat-omap/Makefile
284 +++ b/arch/arm/plat-omap/Makefile
285 @@ -23,6 +23,9 @@ obj-$(CONFIG_OMAP_IOMMU_DEBUG) += iommu-
287 obj-$(CONFIG_CPU_FREQ) += cpu-omap.o
288 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
289 +obj-$(CONFIG_OMAP_BOOT_REASON) += bootreason.o
290 +obj-$(CONFIG_OMAP_COMPONENT_VERSION) += component-version.o
291 +obj-$(CONFIG_OMAP_GPIO_SWITCH) += gpio-switch.o
292 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
293 obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
294 i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
295 --- a/arch/arm/include/asm/setup.h
296 +++ b/arch/arm/include/asm/setup.h
297 @@ -136,6 +136,13 @@ struct tag_acorn {
301 +/* TI OMAP specific information */
302 +#define ATAG_BOARD 0x414f4d50
308 /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
309 #define ATAG_MEMCLK 0x41000402
311 @@ -162,6 +169,11 @@ struct tag {
312 struct tag_acorn acorn;
317 + struct tag_omap omap;
322 struct tag_memclk memclk;
324 +++ b/arch/arm/plat-omap/gpio-switch.c
327 + * linux/arch/arm/plat-omap/gpio-switch.c
329 + * Copyright (C) 2004-2006 Nokia Corporation
330 + * Written by Juha Yrjölä <juha.yrjola@nokia.com>
331 + * and Paul Mundt <paul.mundt@nokia.com>
333 + * This program is free software; you can redistribute it and/or modify
334 + * it under the terms of the GNU General Public License version 2 as
335 + * published by the Free Software Foundation.
338 +#include <linux/sched.h>
339 +#include <linux/init.h>
340 +#include <linux/list.h>
341 +#include <linux/irq.h>
342 +#include <linux/interrupt.h>
343 +#include <linux/module.h>
344 +#include <linux/platform_device.h>
345 +#include <linux/timer.h>
346 +#include <linux/err.h>
347 +#include <linux/slab.h>
348 +#include <linux/gpio.h>
349 +#include <plat/hardware.h>
350 +#include <plat/irqs.h>
351 +#include <plat/mux.h>
352 +#include <plat/board.h>
353 +#include <plat/gpio-switch.h>
355 +struct gpio_switch {
361 + unsigned both_edges:1;
363 + u16 debounce_rising;
364 + u16 debounce_falling;
366 + void (* notify)(void *data, int state);
369 + struct work_struct work;
370 + struct timer_list timer;
371 + struct platform_device pdev;
373 + struct list_head node;
376 +static LIST_HEAD(gpio_switches);
377 +static struct platform_device *gpio_sw_platform_dev;
378 +static struct platform_driver gpio_sw_driver;
380 +static const struct omap_gpio_switch *board_gpio_sw_table;
381 +static int board_gpio_sw_count;
383 +static const char *cover_str[2] = { "open", "closed" };
384 +static const char *connection_str[2] = { "disconnected", "connected" };
385 +static const char *activity_str[2] = { "inactive", "active" };
388 + * GPIO switch state default debounce delay in ms
390 +#define OMAP_GPIO_SW_DEFAULT_DEBOUNCE 10
392 +static const char **get_sw_str(struct gpio_switch *sw)
394 + switch (sw->type) {
395 + case OMAP_GPIO_SWITCH_TYPE_COVER:
397 + case OMAP_GPIO_SWITCH_TYPE_CONNECTION:
398 + return connection_str;
399 + case OMAP_GPIO_SWITCH_TYPE_ACTIVITY:
400 + return activity_str;
407 +static const char *get_sw_type(struct gpio_switch *sw)
409 + switch (sw->type) {
410 + case OMAP_GPIO_SWITCH_TYPE_COVER:
412 + case OMAP_GPIO_SWITCH_TYPE_CONNECTION:
413 + return "connection";
414 + case OMAP_GPIO_SWITCH_TYPE_ACTIVITY:
422 +static void print_sw_state(struct gpio_switch *sw, int state)
426 + str = get_sw_str(sw);
428 + printk(KERN_INFO "%s (GPIO %d) is now %s\n", sw->name, sw->gpio, str[state]);
431 +static int gpio_sw_get_state(struct gpio_switch *sw)
435 + state = gpio_get_value(sw->gpio);
436 + if (sw->flags & OMAP_GPIO_SWITCH_FLAG_INVERTED)
442 +static ssize_t gpio_sw_state_store(struct device *dev,
443 + struct device_attribute *attr,
447 + struct gpio_switch *sw = dev_get_drvdata(dev);
452 + if (!(sw->flags & OMAP_GPIO_SWITCH_FLAG_OUTPUT))
455 + if (sscanf(buf, "%15s", state) != 1)
458 + str = get_sw_str(sw);
459 + if (strcmp(state, str[0]) == 0)
460 + sw->state = enable = 0;
461 + else if (strcmp(state, str[1]) == 0)
462 + sw->state = enable = 1;
466 + if (sw->flags & OMAP_GPIO_SWITCH_FLAG_INVERTED)
468 + gpio_set_value(sw->gpio, enable);
473 +static ssize_t gpio_sw_state_show(struct device *dev,
474 + struct device_attribute *attr,
477 + struct gpio_switch *sw = dev_get_drvdata(dev);
480 + str = get_sw_str(sw);
481 + return sprintf(buf, "%s\n", str[sw->state]);
484 +static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, gpio_sw_state_show,
485 + gpio_sw_state_store);
487 +static ssize_t gpio_sw_type_show(struct device *dev,
488 + struct device_attribute *attr,
491 + struct gpio_switch *sw = dev_get_drvdata(dev);
493 + return sprintf(buf, "%s\n", get_sw_type(sw));
496 +static DEVICE_ATTR(type, S_IRUGO, gpio_sw_type_show, NULL);
498 +static ssize_t gpio_sw_direction_show(struct device *dev,
499 + struct device_attribute *attr,
502 + struct gpio_switch *sw = dev_get_drvdata(dev);
505 + is_output = sw->flags & OMAP_GPIO_SWITCH_FLAG_OUTPUT;
506 + return sprintf(buf, "%s\n", is_output ? "output" : "input");
509 +static DEVICE_ATTR(direction, S_IRUGO, gpio_sw_direction_show, NULL);
512 +static irqreturn_t gpio_sw_irq_handler(int irq, void *arg)
514 + struct gpio_switch *sw = arg;
515 + unsigned long timeout;
518 + if (!sw->both_edges) {
519 + if (gpio_get_value(sw->gpio))
520 + set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQ_TYPE_EDGE_FALLING);
522 + set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQ_TYPE_EDGE_RISING);
525 + state = gpio_sw_get_state(sw);
526 + if (sw->state == state)
527 + return IRQ_HANDLED;
530 + timeout = sw->debounce_rising;
532 + timeout = sw->debounce_falling;
534 + schedule_work(&sw->work);
536 + mod_timer(&sw->timer, jiffies + msecs_to_jiffies(timeout));
538 + return IRQ_HANDLED;
541 +static void gpio_sw_timer(unsigned long arg)
543 + struct gpio_switch *sw = (struct gpio_switch *) arg;
545 + schedule_work(&sw->work);
548 +static void gpio_sw_handler(struct work_struct *work)
550 + struct gpio_switch *sw = container_of(work, struct gpio_switch, work);
553 + state = gpio_sw_get_state(sw);
554 + if (sw->state == state)
558 + if (sw->notify != NULL)
559 + sw->notify(sw->notify_data, state);
560 + sysfs_notify(&sw->pdev.dev.kobj, NULL, "state");
561 + print_sw_state(sw, state);
564 +static int __init can_do_both_edges(struct gpio_switch *sw)
566 + if (!cpu_class_is_omap1())
568 + if (OMAP_GPIO_IS_MPUIO(sw->gpio))
574 +static void gpio_sw_release(struct device *dev)
578 +static int __init new_switch(struct gpio_switch *sw)
580 + int r, direction, trigger;
582 + switch (sw->type) {
583 + case OMAP_GPIO_SWITCH_TYPE_COVER:
584 + case OMAP_GPIO_SWITCH_TYPE_CONNECTION:
585 + case OMAP_GPIO_SWITCH_TYPE_ACTIVITY:
588 + printk(KERN_ERR "invalid GPIO switch type: %d\n", sw->type);
592 + sw->pdev.name = sw->name;
595 + sw->pdev.dev.parent = &gpio_sw_platform_dev->dev;
596 + sw->pdev.dev.driver = &gpio_sw_driver.driver;
597 + sw->pdev.dev.release = gpio_sw_release;
599 + r = platform_device_register(&sw->pdev);
601 + printk(KERN_ERR "gpio-switch: platform device registration "
602 + "failed for %s", sw->name);
605 + dev_set_drvdata(&sw->pdev.dev, sw);
607 + r = gpio_request(sw->gpio, "gpio-switch");
609 + platform_device_unregister(&sw->pdev);
613 + /* input: 1, output: 0 */
614 + direction = !(sw->flags & OMAP_GPIO_SWITCH_FLAG_OUTPUT);
616 + gpio_direction_input(sw->gpio);
618 + gpio_direction_output(sw->gpio, 0);
620 + sw->state = gpio_sw_get_state(sw);
623 + r |= device_create_file(&sw->pdev.dev, &dev_attr_state);
624 + r |= device_create_file(&sw->pdev.dev, &dev_attr_type);
625 + r |= device_create_file(&sw->pdev.dev, &dev_attr_direction);
627 + printk(KERN_ERR "gpio-switch: attribute file creation "
628 + "failed for %s\n", sw->name);
633 + if (can_do_both_edges(sw)) {
634 + trigger = IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING;
635 + sw->both_edges = 1;
637 + if (gpio_get_value(sw->gpio))
638 + trigger = IRQF_TRIGGER_FALLING;
640 + trigger = IRQF_TRIGGER_RISING;
642 + r = request_irq(OMAP_GPIO_IRQ(sw->gpio), gpio_sw_irq_handler,
643 + IRQF_SHARED | trigger, sw->name, sw);
645 + printk(KERN_ERR "gpio-switch: request_irq() failed "
646 + "for GPIO %d\n", sw->gpio);
647 + platform_device_unregister(&sw->pdev);
648 + gpio_free(sw->gpio);
652 + INIT_WORK(&sw->work, gpio_sw_handler);
653 + init_timer(&sw->timer);
655 + sw->timer.function = gpio_sw_timer;
656 + sw->timer.data = (unsigned long)sw;
658 + list_add(&sw->node, &gpio_switches);
663 +static int __init add_atag_switches(void)
665 + const struct omap_gpio_switch_config *cfg;
666 + struct gpio_switch *sw;
669 + for (i = 0; ; i++) {
670 + cfg = omap_get_nr_config(OMAP_TAG_GPIO_SWITCH,
671 + struct omap_gpio_switch_config, i);
674 + sw = kzalloc(sizeof(*sw), GFP_KERNEL);
676 + printk(KERN_ERR "gpio-switch: kmalloc failed\n");
679 + strncpy(sw->name, cfg->name, sizeof(cfg->name));
680 + sw->gpio = cfg->gpio;
681 + sw->flags = cfg->flags;
682 + sw->type = cfg->type;
683 + sw->debounce_rising = OMAP_GPIO_SW_DEFAULT_DEBOUNCE;
684 + sw->debounce_falling = OMAP_GPIO_SW_DEFAULT_DEBOUNCE;
685 + if ((r = new_switch(sw)) < 0) {
693 +static struct gpio_switch * __init find_switch(int gpio, const char *name)
695 + struct gpio_switch *sw;
697 + list_for_each_entry(sw, &gpio_switches, node) {
698 + if ((gpio < 0 || sw->gpio != gpio) &&
699 + (name == NULL || strcmp(sw->name, name) != 0))
702 + if (gpio < 0 || name == NULL)
705 + if (strcmp(sw->name, name) != 0)
706 + printk("gpio-switch: name mismatch for %d (%s, %s)\n",
707 + gpio, name, sw->name);
708 + else if (sw->gpio != gpio)
709 + printk("gpio-switch: GPIO mismatch for %s (%d, %d)\n",
710 + name, gpio, sw->gpio);
717 +static int __init add_board_switches(void)
721 + for (i = 0; i < board_gpio_sw_count; i++) {
722 + const struct omap_gpio_switch *cfg;
723 + struct gpio_switch *sw;
726 + cfg = board_gpio_sw_table + i;
727 + if (strlen(cfg->name) > sizeof(sw->name) - 1)
729 + /* Check whether we only update an existing switch
730 + * or add a new switch. */
731 + sw = find_switch(cfg->gpio, cfg->name);
733 + sw->debounce_rising = cfg->debounce_rising;
734 + sw->debounce_falling = cfg->debounce_falling;
735 + sw->notify = cfg->notify;
736 + sw->notify_data = cfg->notify_data;
739 + if (cfg->gpio < 0 || cfg->name == NULL) {
740 + printk("gpio-switch: required switch not "
741 + "found (%d, %s)\n", cfg->gpio,
746 + sw = kzalloc(sizeof(*sw), GFP_KERNEL);
748 + printk(KERN_ERR "gpio-switch: kmalloc failed\n");
751 + strlcpy(sw->name, cfg->name, sizeof(sw->name));
752 + sw->gpio = cfg->gpio;
753 + sw->flags = cfg->flags;
754 + sw->type = cfg->type;
755 + sw->debounce_rising = cfg->debounce_rising;
756 + sw->debounce_falling = cfg->debounce_falling;
757 + sw->notify = cfg->notify;
758 + sw->notify_data = cfg->notify_data;
759 + if ((r = new_switch(sw)) < 0) {
767 +static void gpio_sw_cleanup(void)
769 + struct gpio_switch *sw = NULL, *old = NULL;
771 + list_for_each_entry(sw, &gpio_switches, node) {
774 + flush_scheduled_work();
775 + del_timer_sync(&sw->timer);
777 + free_irq(OMAP_GPIO_IRQ(sw->gpio), sw);
779 + device_remove_file(&sw->pdev.dev, &dev_attr_state);
780 + device_remove_file(&sw->pdev.dev, &dev_attr_type);
781 + device_remove_file(&sw->pdev.dev, &dev_attr_direction);
783 + platform_device_unregister(&sw->pdev);
784 + gpio_free(sw->gpio);
790 +static void __init report_initial_state(void)
792 + struct gpio_switch *sw;
794 + list_for_each_entry(sw, &gpio_switches, node) {
797 + state = gpio_get_value(sw->gpio);
798 + if (sw->flags & OMAP_GPIO_SWITCH_FLAG_INVERTED)
800 + if (sw->notify != NULL)
801 + sw->notify(sw->notify_data, state);
802 + print_sw_state(sw, state);
806 +static int gpio_sw_remove(struct platform_device *dev)
811 +static struct platform_driver gpio_sw_driver = {
812 + .remove = gpio_sw_remove,
814 + .name = "gpio-switch",
818 +void __init omap_register_gpio_switches(const struct omap_gpio_switch *tbl,
821 + BUG_ON(board_gpio_sw_table != NULL);
823 + board_gpio_sw_table = tbl;
824 + board_gpio_sw_count = count;
827 +static int __init gpio_sw_init(void)
831 + printk(KERN_INFO "OMAP GPIO switch handler initializing\n");
833 + r = platform_driver_register(&gpio_sw_driver);
837 + gpio_sw_platform_dev = platform_device_register_simple("gpio-switch",
839 + if (IS_ERR(gpio_sw_platform_dev)) {
840 + r = PTR_ERR(gpio_sw_platform_dev);
844 + r = add_atag_switches();
848 + r = add_board_switches();
852 + report_initial_state();
857 + platform_device_unregister(gpio_sw_platform_dev);
859 + platform_driver_unregister(&gpio_sw_driver);
863 +static void __exit gpio_sw_exit(void)
866 + platform_device_unregister(gpio_sw_platform_dev);
867 + platform_driver_unregister(&gpio_sw_driver);
871 +late_initcall(gpio_sw_init);
873 +module_init(gpio_sw_init);
875 +module_exit(gpio_sw_exit);
877 +MODULE_AUTHOR("Juha Yrjölä <juha.yrjola@nokia.com>, Paul Mundt <paul.mundt@nokia.com");
878 +MODULE_DESCRIPTION("GPIO switch driver");
879 +MODULE_LICENSE("GPL");
880 --- a/arch/arm/plat-omap/include/plat/board.h
881 +++ b/arch/arm/plat-omap/include/plat/board.h
882 @@ -151,6 +151,14 @@ struct omap_board_config_kernel {
886 +struct omap_gpio_switch_config {
891 + int key_code:24; /* Linux key code */
894 extern const void *__omap_get_config(u16 tag, size_t len, int nr);
896 #define omap_get_config(tag, type) \