as3645a.h 2.1 KB

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