atmel-isc-media.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2019 Microchip Technology Inc. and its subsidiaries
  4. *
  5. * Author: Eugen Hristev <eugen.hristev@microchip.com>
  6. */
  7. #ifndef __LINUX_ATMEL_ISC_MEDIA_H__
  8. #define __LINUX_ATMEL_ISC_MEDIA_H__
  9. /*
  10. * There are 8 controls available:
  11. * 4 gain controls, sliders, for each of the BAYER components: R, B, GR, GB.
  12. * These gains are multipliers for each component, in format unsigned 0:4:9 with
  13. * a default value of 512 (1.0 multiplier).
  14. * 4 offset controls, sliders, for each of the BAYER components: R, B, GR, GB.
  15. * These offsets are added/substracted from each component, in format signed
  16. * 1:12:0 with a default value of 0 (+/- 0)
  17. *
  18. * To expose this to userspace, added 8 custom controls, in an auto cluster.
  19. *
  20. * To summarize the functionality:
  21. * The auto cluster switch is the auto white balance control, and it works
  22. * like this:
  23. * AWB == 1: autowhitebalance is on, the do_white_balance button is inactive,
  24. * the gains/offsets are inactive, but volatile and readable.
  25. * Thus, the results of the whitebalance algorithm are available to userspace to
  26. * read at any time.
  27. * AWB == 0: autowhitebalance is off, cluster is in manual mode, user can
  28. * configure the gain/offsets directly.
  29. * More than that, if the do_white_balance button is
  30. * pressed, the driver will perform one-time-adjustment, (preferably with color
  31. * checker card) and the userspace can read again the new values.
  32. *
  33. * With this feature, the userspace can save the coefficients and reinstall them
  34. * for example after reboot or reprobing the driver.
  35. */
  36. enum atmel_isc_ctrl_id {
  37. /* Red component gain control */
  38. ISC_CID_R_GAIN = (V4L2_CID_USER_ATMEL_ISC_BASE + 0),
  39. /* Blue component gain control */
  40. ISC_CID_B_GAIN,
  41. /* Green Red component gain control */
  42. ISC_CID_GR_GAIN,
  43. /* Green Blue gain control */
  44. ISC_CID_GB_GAIN,
  45. /* Red component offset control */
  46. ISC_CID_R_OFFSET,
  47. /* Blue component offset control */
  48. ISC_CID_B_OFFSET,
  49. /* Green Red component offset control */
  50. ISC_CID_GR_OFFSET,
  51. /* Green Blue component offset control */
  52. ISC_CID_GB_OFFSET,
  53. };
  54. #endif