1 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-pci.c
2 ===================================================================
4 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-pci.c
7 + * arch/arch/mach-ixp4xx/fsg-pci.c
9 + * FSG board-level PCI initialization
11 + * Author: Rod Whitby <rod@whitby.id.au>
12 + * Maintainer: http://www.nslu2-linux.org/
14 + * based on ixdp425-pci.c:
15 + * Copyright (C) 2002 Intel Corporation.
16 + * Copyright (C) 2003-2004 MontaVista Software, Inc.
18 + * This program is free software; you can redistribute it and/or modify
19 + * it under the terms of the GNU General Public License version 2 as
20 + * published by the Free Software Foundation.
24 +#include <linux/pci.h>
25 +#include <linux/init.h>
26 +#include <linux/irq.h>
28 +#include <asm/mach/pci.h>
29 +#include <asm/mach-types.h>
31 +void __init fsg_pci_preinit(void)
33 + set_irq_type(IRQ_FSG_PCI_INTA, IRQT_LOW);
34 + set_irq_type(IRQ_FSG_PCI_INTB, IRQT_LOW);
35 + set_irq_type(IRQ_FSG_PCI_INTC, IRQT_LOW);
37 + ixp4xx_pci_preinit();
40 +static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
42 + static int pci_irq_table[FSG_PCI_IRQ_LINES] = {
51 + if (slot >= 1 && slot <= FSG_PCI_MAX_DEV &&
52 + pin >= 1 && pin <= FSG_PCI_IRQ_LINES) {
53 + irq = pci_irq_table[(slot - 1)];
55 + printk("%s: Mapped slot %d pin %d to IRQ %d\n", __FUNCTION__,slot, pin, irq);
60 +struct hw_pci fsg_pci __initdata = {
61 + .nr_controllers = 1,
62 + .preinit = fsg_pci_preinit,
63 + .swizzle = pci_std_swizzle,
64 + .setup = ixp4xx_setup,
65 + .scan = ixp4xx_scan_bus,
66 + .map_irq = fsg_map_irq,
69 +int __init fsg_pci_init(void)
71 + if (machine_is_fsg())
72 + pci_common_init(&fsg_pci);
76 +subsys_initcall(fsg_pci_init);
77 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-setup.c
78 ===================================================================
80 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-setup.c
83 + * arch/arm/mach-ixp4xx/fsg-setup.c
87 + * based ixdp425-setup.c:
88 + * Copyright (C) 2003-2004 MontaVista Software, Inc.
90 + * Author: Rod Whitby <rod@whitby.id.au>
91 + * Maintainers: http://www.nslu2-linux.org/
95 +#include <linux/kernel.h>
96 +#include <linux/serial.h>
97 +#include <linux/serial_8250.h>
98 +#include <linux/leds.h>
99 +#include <linux/reboot.h>
100 +#include <linux/i2c-gpio.h>
102 +#include <asm/mach-types.h>
103 +#include <asm/mach/arch.h>
104 +#include <asm/mach/flash.h>
107 +static struct flash_platform_data fsg_flash_data = {
108 + .map_name = "cfi_probe",
112 +static struct resource fsg_flash_resource = {
113 + .flags = IORESOURCE_MEM,
116 +static struct platform_device fsg_flash = {
117 + .name = "IXP4XX-Flash",
119 + .dev.platform_data = &fsg_flash_data,
120 + .num_resources = 1,
121 + .resource = &fsg_flash_resource,
124 +static struct i2c_gpio_platform_data fsg_i2c_gpio_data = {
125 + .sda_pin = FSG_SDA_PIN,
126 + .scl_pin = FSG_SCL_PIN,
129 +static struct platform_device fsg_i2c_gpio = {
130 + .name = "i2c-gpio",
133 + .platform_data = &fsg_i2c_gpio_data,
137 +static struct resource fsg_uart_resources[] = {
139 + .start = IXP4XX_UART1_BASE_PHYS,
140 + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
141 + .flags = IORESOURCE_MEM,
144 + .start = IXP4XX_UART2_BASE_PHYS,
145 + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
146 + .flags = IORESOURCE_MEM,
150 +static struct plat_serial8250_port fsg_uart_data[] = {
152 + .mapbase = IXP4XX_UART1_BASE_PHYS,
153 + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
154 + .irq = IRQ_IXP4XX_UART1,
155 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
156 + .iotype = UPIO_MEM,
158 + .uartclk = IXP4XX_UART_XTAL,
161 + .mapbase = IXP4XX_UART2_BASE_PHYS,
162 + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
163 + .irq = IRQ_IXP4XX_UART2,
164 + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
165 + .iotype = UPIO_MEM,
167 + .uartclk = IXP4XX_UART_XTAL,
172 +static struct platform_device fsg_uart = {
173 + .name = "serial8250",
174 + .id = PLAT8250_DEV_PLATFORM,
175 + .dev.platform_data = fsg_uart_data,
176 + .num_resources = ARRAY_SIZE(fsg_uart_resources),
177 + .resource = fsg_uart_resources,
180 +static struct platform_device fsg_leds = {
185 +/* Built-in 10/100 Ethernet MAC interfaces */
186 +static struct eth_plat_info fsg_plat_eth[] = {
198 +static struct platform_device fsg_eth[] = {
200 + .name = "ixp4xx_eth",
201 + .id = IXP4XX_ETH_NPEB,
202 + .dev.platform_data = fsg_plat_eth,
204 + .name = "ixp4xx_eth",
205 + .id = IXP4XX_ETH_NPEC,
206 + .dev.platform_data = fsg_plat_eth + 1,
210 +static struct platform_device *fsg_devices[] __initdata = {
218 +static void fsg_power_off(void)
220 + printk("Restarting system.\n");
221 + machine_restart(NULL);
224 +static void __init fsg_init(void)
226 + uint8_t __iomem *f;
231 + pm_power_off = fsg_power_off;
233 + fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
234 + fsg_flash_resource.end =
235 + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
237 + *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
238 + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
240 + /* Configure CS2 for operation, 8bit and writable */
241 + *IXP4XX_EXP_CS2 = 0xbfff0002;
243 + /* This is only useful on a modified machine, but it is valuable
244 + * to have it first in order to see debug messages, and so that
245 + * it does *not* get removed if platform_add_devices fails!
247 + (void)platform_device_register(&fsg_uart);
249 + platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
253 + * Map in a portion of the flash and read the MAC addresses.
254 + * Since it is stored in BE in the flash itself, we need to
255 + * byteswap it if we're in LE mode.
257 + if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000))) {
259 + for (i = 0; i < 6; i++) {
260 + fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i);
261 + fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i);
264 + fsg_plat_eth[0].hwaddr[0] = readb(f + 0x3C0422 + 3);
265 + fsg_plat_eth[0].hwaddr[1] = readb(f + 0x3C0422 + 2);
266 + fsg_plat_eth[0].hwaddr[2] = readb(f + 0x3C0422 + 1);
267 + fsg_plat_eth[0].hwaddr[3] = readb(f + 0x3C0422 + 0);
268 + fsg_plat_eth[0].hwaddr[4] = readb(f + 0x3C0422 + 7);
269 + fsg_plat_eth[0].hwaddr[5] = readb(f + 0x3C0422 + 6);
271 + fsg_plat_eth[1].hwaddr[0] = readb(f + 0x3C0422 + 3);
272 + fsg_plat_eth[1].hwaddr[1] = readb(f + 0x3C0422 + 2);
273 + fsg_plat_eth[1].hwaddr[2] = readb(f + 0x3C0422 + 1);
274 + fsg_plat_eth[1].hwaddr[3] = readb(f + 0x3C0422 + 0);
275 + fsg_plat_eth[1].hwaddr[4] = readb(f + 0x3C0422 + 7);
276 + fsg_plat_eth[1].hwaddr[5] = readb(f + 0x3C0422 + 6);
280 + printk(KERN_INFO "FSG: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
281 + fsg_plat_eth[0].hwaddr[0], fsg_plat_eth[0].hwaddr[1],
282 + fsg_plat_eth[0].hwaddr[2], fsg_plat_eth[0].hwaddr[3],
283 + fsg_plat_eth[0].hwaddr[4], fsg_plat_eth[0].hwaddr[5]);
284 + printk(KERN_INFO "FSG: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 1\n",
285 + fsg_plat_eth[1].hwaddr[0], fsg_plat_eth[1].hwaddr[1],
286 + fsg_plat_eth[1].hwaddr[2], fsg_plat_eth[1].hwaddr[3],
287 + fsg_plat_eth[1].hwaddr[4], fsg_plat_eth[1].hwaddr[5]);
291 +MACHINE_START(FSG, "Freecom FSG-3")
292 + /* Maintainer: www.nslu2-linux.org */
293 + .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
294 + .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
295 + .map_io = ixp4xx_map_io,
296 + .init_irq = ixp4xx_init_irq,
297 + .timer = &ixp4xx_timer,
298 + .boot_params = 0x0100,
299 + .init_machine = fsg_init,
302 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
303 ===================================================================
304 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Kconfig
305 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Kconfig
306 @@ -125,6 +125,15 @@ config ARCH_IXDP4XX
307 depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
312 + prompt "Freecom FSG-3"
315 + Say 'Y' here if you want your kernel to support Freecom's
316 + FSG-3 device. For more information on this platform,
317 + see http://www.nslu2-linux.org/wiki/FSG3/HomePage
320 # Certain registers and IRQs are only enabled if supporting IXP465 CPUs
322 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
323 ===================================================================
324 --- linux-2.6.23.17.orig/arch/arm/mach-ixp4xx/Makefile
325 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/Makefile
326 @@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NAS100D) += nas10
327 obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
328 obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o
329 obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o
330 +obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o
334 @@ -28,5 +29,6 @@ obj-$(CONFIG_MACH_NAS100D) += nas100d-se
335 obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
336 obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o
337 obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o
338 +obj-$(CONFIG_MACH_FSG) += fsg-setup.o fsg-power.o
340 obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
341 Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/fsg.h
342 ===================================================================
344 +++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/fsg.h
347 + * include/asm-arm/arch-ixp4xx/fsg.h
349 + * Freecom FSG-3 platform specific definitions
351 + * Author: Rod Whitby <rod@whitby.id.au>
352 + * Author: Tomasz Chmielewski <mangoo@wpkg.org>
353 + * Maintainers: http://www.nslu2-linux.org
355 + * Based on coyote.h by
356 + * Copyright 2004 (c) MontaVista, Software, Inc.
358 + * This file is licensed under the terms of the GNU General Public
359 + * License version 2. This program is licensed "as is" without any
360 + * warranty of any kind, whether express or implied.
363 +#ifndef __ASM_ARCH_HARDWARE_H__
364 +#error "Do not include this directly, instead #include <asm/hardware.h>"
367 +#define FSG_SDA_PIN 12
368 +#define FSG_SCL_PIN 13
373 +#define FSG_PCI_MAX_DEV 3
374 +#define FSG_PCI_IRQ_LINES 3
377 +/* PCI controller GPIO to IRQ pin mappings */
378 +#define FSG_PCI_INTA_PIN 6
379 +#define FSG_PCI_INTB_PIN 7
380 +#define FSG_PCI_INTC_PIN 5
384 +#define FSG_SB_GPIO 4 /* sync button */
385 +#define FSG_RB_GPIO 9 /* reset button */
386 +#define FSG_UB_GPIO 10 /* usb button */
390 +#define FSG_LED_WLAN_BIT 0
391 +#define FSG_LED_WAN_BIT 1
392 +#define FSG_LED_SATA_BIT 2
393 +#define FSG_LED_USB_BIT 4
394 +#define FSG_LED_RING_BIT 5
395 +#define FSG_LED_SYNC_BIT 7
396 Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/hardware.h
397 ===================================================================
398 --- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/hardware.h
399 +++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/hardware.h
406 #endif /* _ASM_ARCH_HARDWARE_H */
407 Index: linux-2.6.23.17/include/asm-arm/arch-ixp4xx/irqs.h
408 ===================================================================
409 --- linux-2.6.23.17.orig/include/asm-arm/arch-ixp4xx/irqs.h
410 +++ linux-2.6.23.17/include/asm-arm/arch-ixp4xx/irqs.h
412 #define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7
413 #define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6
416 + * Freecom FSG-3 Board IRQs
418 +#define IRQ_FSG_PCI_INTA IRQ_IXP4XX_GPIO6
419 +#define IRQ_FSG_PCI_INTB IRQ_IXP4XX_GPIO7
420 +#define IRQ_FSG_PCI_INTC IRQ_IXP4XX_GPIO5
423 Index: linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-power.c
424 ===================================================================
426 +++ linux-2.6.23.17/arch/arm/mach-ixp4xx/fsg-power.c
429 + * arch/arm/mach-ixp4xx/fsg-power.c
431 + * FSG Power/Reset driver
433 + * Copyright (C) 2008 Rod Whitby <rod@whitby.id.au>
435 + * based on nslu2-power.c
436 + * Copyright (C) 2005 Tower Technologies
438 + * This program is free software; you can redistribute it and/or modify
439 + * it under the terms of the GNU General Public License version 2 as
440 + * published by the Free Software Foundation.
444 +#include <linux/module.h>
445 +#include <linux/reboot.h>
446 +#include <linux/interrupt.h>
447 +#include <linux/irq.h>
448 +#include <linux/jiffies.h>
449 +#include <linux/timer.h>
451 +#include <asm/gpio.h>
452 +#include <asm/mach-types.h>
454 +static irqreturn_t fsg_power_handler(int irq, void *dev_id)
456 + /* Signal init to do the ctrlaltdel action, this will bypass init if
457 + * it hasn't started and do a kernel_restart.
461 + return IRQ_HANDLED;
464 +static irqreturn_t fsg_reset_handler(int irq, void *dev_id)
466 + /* This is the paper-clip reset, it shuts the machine down directly.
468 + machine_power_off();
470 + return IRQ_HANDLED;
473 +static int __init fsg_power_init(void)
475 + if (!(machine_is_fsg()))
478 + set_irq_type(gpio_to_irq(FSG_RB_GPIO), IRQT_LOW);
479 + set_irq_type(gpio_to_irq(FSG_SB_GPIO), IRQT_LOW);
481 + if (request_irq(gpio_to_irq(FSG_RB_GPIO), &fsg_reset_handler,
482 + IRQF_DISABLED, "FSG reset button", NULL) < 0) {
484 + printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
485 + gpio_to_irq(FSG_RB_GPIO));
490 + if (request_irq(gpio_to_irq(FSG_SB_GPIO), &fsg_power_handler,
491 + IRQF_DISABLED, "FSG power button", NULL) < 0) {
493 + printk(KERN_DEBUG "Power Button IRQ %d not available\n",
494 + gpio_to_irq(FSG_SB_GPIO));
502 +static void __exit fsg_power_exit(void)
504 + if (!(machine_is_fsg()))
507 + free_irq(gpio_to_irq(FSG_SB_GPIO), NULL);
508 + free_irq(gpio_to_irq(FSG_RB_GPIO), NULL);
511 +module_init(fsg_power_init);
512 +module_exit(fsg_power_exit);
514 +MODULE_AUTHOR("Rod Whitby <rod@whitby.id.au>");
515 +MODULE_DESCRIPTION("FSG Power/Reset driver");
516 +MODULE_LICENSE("GPL");
517 Index: linux-2.6.23.17/drivers/leds/Kconfig
518 ===================================================================
519 --- linux-2.6.23.17.orig/drivers/leds/Kconfig
520 +++ linux-2.6.23.17/drivers/leds/Kconfig
521 @@ -48,6 +48,12 @@ config LEDS_IXP4XX
522 particular board must have LEDs and they must be connected
523 to the GPIO lines. If unsure, say Y.
526 + tristate "LED Support for the Freecom FSG-3"
527 + depends on LEDS_CLASS && MACH_FSG
529 + This option enables support for the LEDs on the Freecom FSG-3.
532 tristate "LED Support for the Sharp SL-6000 series"
533 depends on LEDS_CLASS && PXA_SHARPSL
534 Index: linux-2.6.23.17/drivers/leds/Makefile
535 ===================================================================
536 --- linux-2.6.23.17.orig/drivers/leds/Makefile
537 +++ linux-2.6.23.17/drivers/leds/Makefile
538 @@ -9,6 +9,7 @@ obj-$(CONFIG_LEDS_CORGI) += leds-corgi.
539 obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o
540 obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o
541 obj-$(CONFIG_LEDS_IXP4XX) += leds-ixp4xx-gpio.o
542 +obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
543 obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o
544 obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o
545 obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o
546 Index: linux-2.6.23.17/drivers/leds/leds-fsg.c
547 ===================================================================
549 +++ linux-2.6.23.17/drivers/leds/leds-fsg.c
552 + * LED Driver for the Freecom FSG-3
554 + * Copyright (c) 2008 Rod Whitby <rod@whitby.id.au>
556 + * Author: Rod Whitby <rod@whitby.id.au>
558 + * Based on leds-spitz.c
559 + * Copyright 2005-2006 Openedhand Ltd.
560 + * Author: Richard Purdie <rpurdie@openedhand.com>
562 + * This program is free software; you can redistribute it and/or modify
563 + * it under the terms of the GNU General Public License version 2 as
564 + * published by the Free Software Foundation.
568 +#include <linux/kernel.h>
569 +#include <linux/init.h>
570 +#include <linux/platform_device.h>
571 +#include <linux/leds.h>
572 +#include <asm/arch/hardware.h>
575 +static short __iomem *latch_address;
576 +static unsigned short latch_value;
579 +static void fsg_led_wlan_set(struct led_classdev *led_cdev, enum led_brightness value)
582 + latch_value &= ~(1 << FSG_LED_WLAN_BIT);
583 + *latch_address = latch_value;
586 + latch_value |= (1 << FSG_LED_WLAN_BIT);
587 + *latch_address = latch_value;
591 +static void fsg_led_wan_set(struct led_classdev *led_cdev, enum led_brightness value)
594 + latch_value &= ~(1 << FSG_LED_WAN_BIT);
595 + *latch_address = latch_value;
598 + latch_value |= (1 << FSG_LED_WAN_BIT);
599 + *latch_address = latch_value;
603 +static void fsg_led_sata_set(struct led_classdev *led_cdev, enum led_brightness value)
606 + latch_value &= ~(1 << FSG_LED_SATA_BIT);
607 + *latch_address = latch_value;
610 + latch_value |= (1 << FSG_LED_SATA_BIT);
611 + *latch_address = latch_value;
615 +static void fsg_led_usb_set(struct led_classdev *led_cdev, enum led_brightness value)
618 + latch_value &= ~(1 << FSG_LED_USB_BIT);
619 + *latch_address = latch_value;
622 + latch_value |= (1 << FSG_LED_USB_BIT);
623 + *latch_address = latch_value;
627 +static void fsg_led_sync_set(struct led_classdev *led_cdev, enum led_brightness value)
630 + latch_value &= ~(1 << FSG_LED_SYNC_BIT);
631 + *latch_address = latch_value;
634 + latch_value |= (1 << FSG_LED_SYNC_BIT);
635 + *latch_address = latch_value;
639 +static void fsg_led_ring_set(struct led_classdev *led_cdev, enum led_brightness value)
642 + latch_value &= ~(1 << FSG_LED_RING_BIT);
643 + *latch_address = latch_value;
646 + latch_value |= (1 << FSG_LED_RING_BIT);
647 + *latch_address = latch_value;
653 +static struct led_classdev fsg_wlan_led = {
654 + .name = "fsg:wlan",
655 + .brightness_set = fsg_led_wlan_set,
658 +static struct led_classdev fsg_wan_led = {
660 + .brightness_set = fsg_led_wan_set,
663 +static struct led_classdev fsg_sata_led = {
664 + .name = "fsg:sata",
665 + .brightness_set = fsg_led_sata_set,
668 +static struct led_classdev fsg_usb_led = {
670 + .brightness_set = fsg_led_usb_set,
673 +static struct led_classdev fsg_sync_led = {
674 + .name = "fsg:sync",
675 + .brightness_set = fsg_led_sync_set,
678 +static struct led_classdev fsg_ring_led = {
679 + .name = "fsg:ring",
680 + .brightness_set = fsg_led_ring_set,
686 +static int fsg_led_suspend(struct platform_device *dev, pm_message_t state)
688 + led_classdev_suspend(&fsg_wlan_led);
689 + led_classdev_suspend(&fsg_wan_led);
690 + led_classdev_suspend(&fsg_sata_led);
691 + led_classdev_suspend(&fsg_usb_led);
692 + led_classdev_suspend(&fsg_sync_led);
693 + led_classdev_suspend(&fsg_ring_led);
697 +static int fsg_led_resume(struct platform_device *dev)
699 + led_classdev_resume(&fsg_wlan_led);
700 + led_classdev_resume(&fsg_wan_led);
701 + led_classdev_resume(&fsg_sata_led);
702 + led_classdev_resume(&fsg_usb_led);
703 + led_classdev_resume(&fsg_sync_led);
704 + led_classdev_resume(&fsg_ring_led);
710 +static int fsg_led_probe(struct platform_device *pdev)
714 + /* FIXME: Need to work out how to handle failure below */
716 + ret = led_classdev_register(&pdev->dev, &fsg_wlan_led);
720 + ret = led_classdev_register(&pdev->dev, &fsg_wan_led);
724 + ret = led_classdev_register(&pdev->dev, &fsg_sata_led);
728 + ret = led_classdev_register(&pdev->dev, &fsg_usb_led);
732 + ret = led_classdev_register(&pdev->dev, &fsg_sync_led);
736 + ret = led_classdev_register(&pdev->dev, &fsg_ring_led);
743 +static int fsg_led_remove(struct platform_device *pdev)
745 + led_classdev_unregister(&fsg_wlan_led);
746 + led_classdev_unregister(&fsg_wan_led);
747 + led_classdev_unregister(&fsg_sata_led);
748 + led_classdev_unregister(&fsg_usb_led);
749 + led_classdev_unregister(&fsg_sync_led);
750 + led_classdev_unregister(&fsg_ring_led);
756 +static struct platform_driver fsg_led_driver = {
757 + .probe = fsg_led_probe,
758 + .remove = fsg_led_remove,
760 + .suspend = fsg_led_suspend,
761 + .resume = fsg_led_resume,
769 +static int __init fsg_led_init(void)
771 + /* Map the LED chip select address space */
772 + latch_address = (unsigned short *) ioremap(IXP4XX_EXP_BUS_BASE(2), 512);
773 + if (!latch_address)
775 + latch_value = 0xffff;
776 + *latch_address = latch_value;
777 + /* FIXME: We leak memory if the next line fails */
778 + return platform_driver_register(&fsg_led_driver);
781 +static void __exit fsg_led_exit(void)
783 + platform_driver_unregister(&fsg_led_driver);
784 + iounmap(latch_address);
788 +module_init(fsg_led_init);
789 +module_exit(fsg_led_exit);
791 +MODULE_AUTHOR("Rod Whitby <rod@whitby.id.au>");
792 +MODULE_DESCRIPTION("Freecom FSG-3 LED driver");
793 +MODULE_LICENSE("GPL");