aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>2010-10-01 19:37:01 -0400
committerTony Lindgren <tony@atomide.com>2010-10-01 19:37:01 -0400
commit243e76b426e6e040961b84249b4eaab4ad9fa6dc (patch)
treedc774617469dc1ed0789294886260ae32cee4dde /arch/arm
parent8452e9ef2b08c7bd492194554cdffc67d0b2a51b (diff)
OMAP1: Amstrad Delta: add camera controlled LEDS trigger
This patch extends the Amstrad Delta camera support with LEDS trigger that can be used for automatic control of the on-board camera LED. The led turns on automatically on camera device open and turns off on camera device close. Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 12f7f607ab1f..248e8bb64b6a 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -16,6 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/input.h> 17#include <linux/input.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/leds.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/serial_8250.h> 21#include <linux/serial_8250.h>
21 22
@@ -222,11 +223,30 @@ static struct i2c_board_info ams_delta_camera_board_info[] = {
222 }, 223 },
223}; 224};
224 225
226#ifdef CONFIG_LEDS_TRIGGERS
227DEFINE_LED_TRIGGER(ams_delta_camera_led_trigger);
228
229static int ams_delta_camera_power(struct device *dev, int power)
230{
231 /*
232 * turn on camera LED
233 */
234 if (power)
235 led_trigger_event(ams_delta_camera_led_trigger, LED_FULL);
236 else
237 led_trigger_event(ams_delta_camera_led_trigger, LED_OFF);
238 return 0;
239}
240#else
241#define ams_delta_camera_power NULL
242#endif
243
225static struct soc_camera_link __initdata ams_delta_iclink = { 244static struct soc_camera_link __initdata ams_delta_iclink = {
226 .bus_id = 0, /* OMAP1 SoC camera bus */ 245 .bus_id = 0, /* OMAP1 SoC camera bus */
227 .i2c_adapter_id = 1, 246 .i2c_adapter_id = 1,
228 .board_info = &ams_delta_camera_board_info[0], 247 .board_info = &ams_delta_camera_board_info[0],
229 .module_name = "ov6650", 248 .module_name = "ov6650",
249 .power = ams_delta_camera_power,
230}; 250};
231 251
232static struct platform_device ams_delta_camera_device = { 252static struct platform_device ams_delta_camera_device = {
@@ -281,6 +301,10 @@ static void __init ams_delta_init(void)
281 301
282 omap1_usb_init(&ams_delta_usb_config); 302 omap1_usb_init(&ams_delta_usb_config);
283 omap1_set_camera_info(&ams_delta_camera_platform_data); 303 omap1_set_camera_info(&ams_delta_camera_platform_data);
304#ifdef CONFIG_LEDS_TRIGGERS
305 led_trigger_register_simple("ams_delta_camera",
306 &ams_delta_camera_led_trigger);
307#endif
284 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); 308 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
285 309
286#ifdef CONFIG_AMS_DELTA_FIQ 310#ifdef CONFIG_AMS_DELTA_FIQ