isph3a.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * isph3a.h
  3. *
  4. * TI OMAP3 ISP - H3A AF module
  5. *
  6. * Copyright (C) 2010 Nokia Corporation
  7. * Copyright (C) 2009 Texas Instruments, Inc.
  8. *
  9. * Contacts: David Cohen <dacohen@gmail.com>
  10. * Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  11. * Sakari Ailus <sakari.ailus@iki.fi>
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License version 2 as
  15. * published by the Free Software Foundation.
  16. */
  17. #ifndef OMAP3_ISP_H3A_H
  18. #define OMAP3_ISP_H3A_H
  19. #include <linux/omap3isp.h>
  20. /*
  21. * ----------
  22. * -H3A AEWB-
  23. * ----------
  24. */
  25. #define AEWB_PACKET_SIZE 16
  26. #define AEWB_SATURATION_LIMIT 0x3ff
  27. /* Flags for changed registers */
  28. #define PCR_CHNG (1 << 0)
  29. #define AEWWIN1_CHNG (1 << 1)
  30. #define AEWINSTART_CHNG (1 << 2)
  31. #define AEWINBLK_CHNG (1 << 3)
  32. #define AEWSUBWIN_CHNG (1 << 4)
  33. #define PRV_WBDGAIN_CHNG (1 << 5)
  34. #define PRV_WBGAIN_CHNG (1 << 6)
  35. /* ISPH3A REGISTERS bits */
  36. #define ISPH3A_PCR_AF_EN (1 << 0)
  37. #define ISPH3A_PCR_AF_ALAW_EN (1 << 1)
  38. #define ISPH3A_PCR_AF_MED_EN (1 << 2)
  39. #define ISPH3A_PCR_AF_BUSY (1 << 15)
  40. #define ISPH3A_PCR_AEW_EN (1 << 16)
  41. #define ISPH3A_PCR_AEW_ALAW_EN (1 << 17)
  42. #define ISPH3A_PCR_AEW_BUSY (1 << 18)
  43. #define ISPH3A_PCR_AEW_MASK (ISPH3A_PCR_AEW_ALAW_EN | \
  44. ISPH3A_PCR_AEW_AVE2LMT_MASK)
  45. /*
  46. * --------
  47. * -H3A AF-
  48. * --------
  49. */
  50. /* Peripheral Revision */
  51. #define AFPID 0x0
  52. #define AFCOEF_OFFSET 0x00000004 /* COEF base address */
  53. /* PCR fields */
  54. #define AF_BUSYAF (1 << 15)
  55. #define AF_FVMODE (1 << 14)
  56. #define AF_RGBPOS (0x7 << 11)
  57. #define AF_MED_TH (0xFF << 3)
  58. #define AF_MED_EN (1 << 2)
  59. #define AF_ALAW_EN (1 << 1)
  60. #define AF_EN (1 << 0)
  61. #define AF_PCR_MASK (AF_FVMODE | AF_RGBPOS | AF_MED_TH | \
  62. AF_MED_EN | AF_ALAW_EN)
  63. /* AFPAX1 fields */
  64. #define AF_PAXW (0x7F << 16)
  65. #define AF_PAXH 0x7F
  66. /* AFPAX2 fields */
  67. #define AF_AFINCV (0xF << 13)
  68. #define AF_PAXVC (0x7F << 6)
  69. #define AF_PAXHC 0x3F
  70. /* AFPAXSTART fields */
  71. #define AF_PAXSH (0xFFF<<16)
  72. #define AF_PAXSV 0xFFF
  73. /* COEFFICIENT MASK */
  74. #define AF_COEF_MASK0 0xFFF
  75. #define AF_COEF_MASK1 (0xFFF<<16)
  76. /* BIT SHIFTS */
  77. #define AF_RGBPOS_SHIFT 11
  78. #define AF_MED_TH_SHIFT 3
  79. #define AF_PAXW_SHIFT 16
  80. #define AF_LINE_INCR_SHIFT 13
  81. #define AF_VT_COUNT_SHIFT 6
  82. #define AF_HZ_START_SHIFT 16
  83. #define AF_COEF_SHIFT 16
  84. /* Init and cleanup functions */
  85. int omap3isp_h3a_aewb_init(struct isp_device *isp);
  86. int omap3isp_h3a_af_init(struct isp_device *isp);
  87. void omap3isp_h3a_aewb_cleanup(struct isp_device *isp);
  88. void omap3isp_h3a_af_cleanup(struct isp_device *isp);
  89. #endif /* OMAP3_ISP_H3A_H */