as3645a.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #ifndef __AS3645A_H__
  24. #define __AS3645A_H__
  25. #include <media/v4l2-subdev.h>
  26. #define AS3645A_NAME "as3645a"
  27. #define AS3645A_I2C_ADDR (0x60 >> 1) /* W:0x60, R:0x61 */
  28. #define AS3645A_FLASH_TIMEOUT_MIN 100000 /* us */
  29. #define AS3645A_FLASH_TIMEOUT_MAX 850000
  30. #define AS3645A_FLASH_TIMEOUT_STEP 50000
  31. #define AS3645A_FLASH_INTENSITY_MIN 200 /* mA */
  32. #define AS3645A_FLASH_INTENSITY_MAX_1LED 500
  33. #define AS3645A_FLASH_INTENSITY_MAX_2LEDS 400
  34. #define AS3645A_FLASH_INTENSITY_STEP 20
  35. #define AS3645A_TORCH_INTENSITY_MIN 20 /* mA */
  36. #define AS3645A_TORCH_INTENSITY_MAX 160
  37. #define AS3645A_TORCH_INTENSITY_STEP 20
  38. #define AS3645A_INDICATOR_INTENSITY_MIN 0 /* uA */
  39. #define AS3645A_INDICATOR_INTENSITY_MAX 10000
  40. #define AS3645A_INDICATOR_INTENSITY_STEP 2500
  41. /*
  42. * as3645a_platform_data - Flash controller platform data
  43. * @set_power: Set power callback
  44. * @vref: VREF offset (0=0V, 1=+0.3V, 2=-0.3V, 3=+0.6V)
  45. * @peak: Inductor peak current limit (0=1.25A, 1=1.5A, 2=1.75A, 3=2.0A)
  46. * @ext_strobe: True if external flash strobe can be used
  47. * @flash_max_current: Max flash current (mA, <= AS3645A_FLASH_INTENSITY_MAX)
  48. * @torch_max_current: Max torch current (mA, >= AS3645A_TORCH_INTENSITY_MAX)
  49. * @timeout_max: Max flash timeout (us, <= AS3645A_FLASH_TIMEOUT_MAX)
  50. */
  51. struct as3645a_platform_data {
  52. int (*set_power)(struct v4l2_subdev *subdev, int on);
  53. unsigned int vref;
  54. unsigned int peak;
  55. bool ext_strobe;
  56. /* Flash and torch currents and timeout limits */
  57. unsigned int flash_max_current;
  58. unsigned int torch_max_current;
  59. unsigned int timeout_max;
  60. };
  61. #endif /* __AS3645A_H__ */