2 * LEDs support for the HP iPaq hx4700
4 * Copyright (c) 2006 Anton Vorontsov <cbou@mail.ru>
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive for
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
15 #include <linux/leds.h>
17 #include <asm/hardware/ipaq-asic3.h>
18 #include <linux/soc/asic3_base.h>
19 #include <asm/mach-types.h>
20 #include <asm/arch/ipaq.h>
21 #include <asm/hardware/asic3_leds.h>
23 DEFINE_LED_TRIGGER_SHARED_GLOBAL(hx4700_radio_trig
);
24 EXPORT_LED_TRIGGER_SHARED(hx4700_radio_trig
);
26 extern struct platform_device hx4700_asic3
;
28 struct asic3_led hx4700_leds
[] = {
31 .name
= "hx4700:amber",
32 .default_trigger
= "hx4700-charging",
39 .name
= "hx4700:green",
40 .default_trigger
= "hx4700-chargefull",
46 .name
= "hx4700:blue",
47 .default_trigger
= "hx4700-radio",
53 void hx4700_leds_release(struct device
*dev
)
59 struct asic3_leds_machinfo hx4700_leds_machinfo
= {
60 .num_leds
= ARRAY_SIZE(hx4700_leds
),
62 .asic3_pdev
= &hx4700_asic3
,
66 struct platform_device hx4700_leds_pdev
= {
69 .platform_data
= &hx4700_leds_machinfo
,
70 .release
= hx4700_leds_release
,
75 int __init
hx4700_leds_init(void)
78 printk("hx4700 LEDs Driver\n");
79 led_trigger_register_shared("hx4700-radio", &hx4700_radio_trig
);
81 ret
= asic3_leds_register();
82 if (ret
) goto asic3_leds_failed
;
84 ret
= platform_device_register(&hx4700_leds_pdev
);
85 if (ret
) goto platform_device_failed
;
89 platform_device_failed
:
90 asic3_leds_unregister();
92 led_trigger_unregister_shared(hx4700_radio_trig
);
93 printk("hx4700 LEDs Driver failed to init");
99 void __exit
hx4700_leds_exit(void)
101 led_trigger_unregister_shared(hx4700_radio_trig
);
102 platform_device_unregister(&hx4700_leds_pdev
);
103 asic3_leds_unregister();
107 module_init(hx4700_leds_init
);
108 module_exit(hx4700_leds_exit
);
110 MODULE_AUTHOR("Anton Vorontsov <cbou@mail.ru>");
111 MODULE_DESCRIPTION("HP iPAQ hx4700 LEDs driver");
112 MODULE_LICENSE("GPL");