diff options
| author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-05-05 14:39:25 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-20 06:36:18 -0500 |
| commit | 22db44cb9cd67d56b02b2b5dceb10d3d1361b28b (patch) | |
| tree | b6adffded0cd82bc8a6858185b4a9b7689c92961 /include | |
| parent | a597fa78d374c57dcf9a9bac02472a530cd7e60a (diff) | |
[media] as3645a: Add driver for LED flash controller
This patch adds the driver for the as3645a LED flash controller. This
controller supports a high power led in flash and torch modes and an
indicator light, sometimes also called privacy light.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Nayden Kanchev <nkanchev@mm-sol.com>
Signed-off-by: Tuukka Toivonen <tuukkat76@gmail.com>
Signed-off-by: Antti Koskipaa <antti.koskipaa@gmail.com>
Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Vimarsh Zutshi <vimarsh.zutshi@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
Signed-off-by: David Cohen <dacohen@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/media/as3645a.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/include/media/as3645a.h b/include/media/as3645a.h new file mode 100644 index 000000000000..5075496d2c9e --- /dev/null +++ b/include/media/as3645a.h | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | /* | ||
| 2 | * include/media/as3645a.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008-2011 Nokia Corporation | ||
| 5 | * | ||
| 6 | * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public License | ||
| 10 | * version 2 as published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 20 | * 02110-1301 USA | ||
| 21 | * | ||
| 22 | */ | ||
| 23 | |||
| 24 | #ifndef __AS3645A_H__ | ||
| 25 | #define __AS3645A_H__ | ||
| 26 | |||
| 27 | #include <media/v4l2-subdev.h> | ||
| 28 | |||
| 29 | #define AS3645A_NAME "as3645a" | ||
| 30 | #define AS3645A_I2C_ADDR (0x60 >> 1) /* W:0x60, R:0x61 */ | ||
| 31 | |||
| 32 | #define AS3645A_FLASH_TIMEOUT_MIN 100000 /* us */ | ||
| 33 | #define AS3645A_FLASH_TIMEOUT_MAX 850000 | ||
| 34 | #define AS3645A_FLASH_TIMEOUT_STEP 50000 | ||
| 35 | |||
| 36 | #define AS3645A_FLASH_INTENSITY_MIN 200 /* mA */ | ||
| 37 | #define AS3645A_FLASH_INTENSITY_MAX_1LED 500 | ||
| 38 | #define AS3645A_FLASH_INTENSITY_MAX_2LEDS 400 | ||
| 39 | #define AS3645A_FLASH_INTENSITY_STEP 20 | ||
| 40 | |||
| 41 | #define AS3645A_TORCH_INTENSITY_MIN 20 /* mA */ | ||
| 42 | #define AS3645A_TORCH_INTENSITY_MAX 160 | ||
| 43 | #define AS3645A_TORCH_INTENSITY_STEP 20 | ||
| 44 | |||
| 45 | #define AS3645A_INDICATOR_INTENSITY_MIN 0 /* uA */ | ||
| 46 | #define AS3645A_INDICATOR_INTENSITY_MAX 10000 | ||
| 47 | #define AS3645A_INDICATOR_INTENSITY_STEP 2500 | ||
| 48 | |||
| 49 | /* | ||
| 50 | * as3645a_platform_data - Flash controller platform data | ||
| 51 | * @set_power: Set power callback | ||
| 52 | * @vref: VREF offset (0=0V, 1=+0.3V, 2=-0.3V, 3=+0.6V) | ||
| 53 | * @peak: Inductor peak current limit (0=1.25A, 1=1.5A, 2=1.75A, 3=2.0A) | ||
| 54 | * @ext_strobe: True if external flash strobe can be used | ||
| 55 | * @flash_max_current: Max flash current (mA, <= AS3645A_FLASH_INTENSITY_MAX) | ||
| 56 | * @torch_max_current: Max torch current (mA, >= AS3645A_TORCH_INTENSITY_MAX) | ||
| 57 | * @timeout_max: Max flash timeout (us, <= AS3645A_FLASH_TIMEOUT_MAX) | ||
| 58 | */ | ||
| 59 | struct as3645a_platform_data { | ||
| 60 | int (*set_power)(struct v4l2_subdev *subdev, int on); | ||
| 61 | unsigned int vref; | ||
| 62 | unsigned int peak; | ||
| 63 | bool ext_strobe; | ||
| 64 | |||
| 65 | /* Flash and torch currents and timeout limits */ | ||
| 66 | unsigned int flash_max_current; | ||
| 67 | unsigned int torch_max_current; | ||
| 68 | unsigned int timeout_max; | ||
| 69 | }; | ||
| 70 | |||
| 71 | #endif /* __AS3645A_H__ */ | ||
