2 * LEDs support for the HP iPaq h4000
4 * Copyright (c) 2006 Anton Vorontsov <cbou@mail.ru>
5 * Copyright (c) 2006 Paul Sokolovsky <pmiscml@gmail.com>
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <linux/leds.h>
18 #include <asm/hardware/ipaq-asic3.h>
19 #include <linux/soc/asic3_base.h>
20 #include <asm/mach-types.h>
21 #include <asm/arch/ipaq.h>
22 #include <asm/hardware/asic3_leds.h>
24 DEFINE_LED_TRIGGER_SHARED_GLOBAL(h4000_radio_trig
);
25 EXPORT_LED_TRIGGER_SHARED(h4000_radio_trig
);
27 extern struct platform_device h4000_asic3
;
29 struct asic3_led h4000_leds
[] = {
33 .default_trigger
= "h4000-charging",
40 .name
= "h4000:right-green",
41 .default_trigger
= "h4000-chargefull",
47 .name
= "h4000:left-green",
48 .default_trigger
= "h4000-wifi",
56 .default_trigger
= "h4000-bt",
63 void h4000_leds_release(struct device
*dev
)
69 struct asic3_leds_machinfo h4000_leds_machinfo
= {
70 .num_leds
= ARRAY_SIZE(h4000_leds
),
72 .asic3_pdev
= &h4000_asic3
,
76 struct platform_device h4000_leds_pdev
= {
79 .platform_data
= &h4000_leds_machinfo
,
80 .release
= h4000_leds_release
,
85 int __init
h4000_leds_init(void)
88 printk("h4000 LEDs Driver\n");
89 led_trigger_register_shared("h4000-radio", &h4000_radio_trig
);
91 ret
= asic3_leds_register();
92 if (ret
) goto asic3_leds_failed
;
94 ret
= platform_device_register(&h4000_leds_pdev
);
95 if (ret
) goto platform_device_failed
;
99 platform_device_failed
:
100 asic3_leds_unregister();
102 led_trigger_unregister_shared(h4000_radio_trig
);
103 printk("h4000 LEDs Driver failed to init");
109 void __exit
h4000_leds_exit(void)
111 led_trigger_unregister_shared(h4000_radio_trig
);
112 platform_device_unregister(&h4000_leds_pdev
);
113 asic3_leds_unregister();
117 module_init(h4000_leds_init
);
118 module_exit(h4000_leds_exit
);
120 MODULE_AUTHOR("Paul Sokolovsky <pmiscml@gmail.com>");
121 MODULE_DESCRIPTION("HP iPAQ h4000 LEDs driver");
122 MODULE_LICENSE("GPL");