sde_ad4.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _SDE_AD4_H_
  6. #define _SDE_AD4_H_
  7. #include <drm/drm_mode.h>
  8. #include <drm/drm_property.h>
  9. #include "sde_hw_dspp.h"
  10. /**
  11. * enum ad4_modes - ad4 modes supported by driver
  12. */
  13. enum ad4_modes {
  14. AD4_OFF,
  15. AD4_AUTO_STRENGTH,
  16. AD4_CALIBRATION,
  17. AD4_MANUAL,
  18. };
  19. /**
  20. * struct drm_prop_enum_list - drm structure for creating enum property and
  21. * enumerating values
  22. */
  23. static const struct drm_prop_enum_list ad4_modes[] = {
  24. {AD4_OFF, "off"},
  25. {AD4_AUTO_STRENGTH, "auto_strength_mode"},
  26. {AD4_CALIBRATION, "calibration_mode"},
  27. {AD4_MANUAL, "manual_mode"},
  28. };
  29. /**
  30. * enum ad_property - properties that can be set for ad
  31. */
  32. enum ad_property {
  33. AD_MODE,
  34. AD_INIT,
  35. AD_CFG,
  36. AD_INPUT,
  37. AD_SUSPEND,
  38. AD_ASSERTIVE,
  39. AD_BACKLIGHT,
  40. AD_STRENGTH,
  41. AD_ROI,
  42. AD_IPC_SUSPEND,
  43. AD_IPC_RESUME,
  44. AD_IPC_RESET,
  45. AD_PROPMAX,
  46. };
  47. /**
  48. * enum ad_intr_resp_property - ad4 interrupt response enum
  49. */
  50. enum ad_intr_resp_property {
  51. AD4_IN_OUT_BACKLIGHT,
  52. AD4_RESPMAX,
  53. };
  54. /**
  55. * struct sde_ad_hw_cfg - structure for setting the ad properties
  56. * @prop: enum of ad property
  57. * @hw_cfg: payload for the prop being set.
  58. */
  59. struct sde_ad_hw_cfg {
  60. enum ad_property prop;
  61. struct sde_hw_cp_cfg *hw_cfg;
  62. };
  63. /**
  64. * sde_validate_dspp_ad4() - api to validate if ad property is allowed for
  65. * the display with allocated dspp/mixers.
  66. * @dspp: pointer to dspp info structure.
  67. * @prop: pointer to u32 pointing to ad property
  68. */
  69. int sde_validate_dspp_ad4(struct sde_hw_dspp *dspp, u32 *prop);
  70. /**
  71. * sde_setup_dspp_ad4 - api to apply the ad property, sde_validate_dspp_ad4
  72. * should be called before call this function
  73. * @dspp: pointer to dspp info structure.
  74. * @cfg: pointer to struct sde_ad_hw_cfg
  75. */
  76. void sde_setup_dspp_ad4(struct sde_hw_dspp *dspp, void *cfg);
  77. /**
  78. * sde_read_intr_resp_ad4 - api to get ad4 interrupt status for event
  79. * @dspp: pointer to dspp object
  80. * @event: event for which response is needed
  81. * @resp_in: read ad4 input value of event requested
  82. * @resp_out: read ad4 output value of event requested
  83. */
  84. void sde_read_intr_resp_ad4(struct sde_hw_dspp *dspp, u32 event,
  85. u32 *resp_in, u32 *resp_out);
  86. #endif /* _SDE_AD4_H_ */