cabc_tuning.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. * 02110-1301, USA.
  16. *
  17. */
  18. #include <linux/mutex.h>
  19. #include "mdss_dsi.h"
  20. #ifndef _CABC_TUNING_H_
  21. #define _CABC_TUNING_H_
  22. #define MAX_FILE_NAME 128
  23. #define TUNING_FILE_PATH "/sdcard/"
  24. #define DPRINT(x...) printk(KERN_ERR "[CABC Tuning] " x)
  25. #define CABC_TUNE_FIRST_SIZE 7
  26. #define CABC_TUNE_SECOND_SIZE 7
  27. #define CABC_TUNE_THIRD_SIZE 18
  28. #define CABC_TUNE_FOURTH_SIZE 36
  29. #define CABC_TUNE_SELECT_SIZE 2
  30. #define PAYLOAD1 cabc_tune_cmd[0]
  31. #define PAYLOAD2 cabc_tune_cmd[1]
  32. #define PAYLOAD3 cabc_tune_cmd[2]
  33. #define PAYLOAD4 cabc_tune_cmd[3]
  34. #define SELECT cabc_tune_cmd[4]
  35. #define CABC_OFF 0
  36. #define CABC_ON 1
  37. #define INPUT_PAYLOAD1(x) PAYLOAD1.payload = x
  38. #define INPUT_PAYLOAD2(x) PAYLOAD2.payload = x
  39. #define INPUT_PAYLOAD3(x) PAYLOAD3.payload = x
  40. #define INPUT_PAYLOAD4(x) PAYLOAD4.payload = x
  41. #define INPUT_SELECT(x) SELECT.payload = x
  42. enum LuxValue {
  43. CABC_LUX_0, /* 0 ~ 500 Lux */
  44. CABC_LUX_1, /* 500 ~ 5000 Lux */
  45. CABC_LUX_2, /* 5000 ~ Lux */
  46. CABC_LUX_MAX,
  47. };
  48. enum CABC_UI {
  49. CABC_MODE_UI,
  50. CABC_MODE_VIDEO,
  51. CABC_MODE_MAX,
  52. };
  53. enum CABC_Negative {
  54. CABC_NEGATIVE_OFF = 0,
  55. CABC_NEGATIVE_ON,
  56. };
  57. enum CABC_Auto_Br {
  58. CABC_AUTO_BR_OFF = 0,
  59. CABC_AUTO_BR_ON,
  60. CABC_AUTO_BR_MAX
  61. };
  62. enum ACCESSIBILITY {
  63. ACCESSIBILITY_OFF = 0,
  64. NEGATIVE,
  65. COLOR_BLIND,
  66. ACCESSIBILITY_MAX,
  67. };
  68. struct cabc_tun_type {
  69. struct mutex cabc_mutex;
  70. bool cabc_enable;
  71. enum CABC_Auto_Br auto_br;
  72. enum LuxValue luxvalue;
  73. enum CABC_UI mode;
  74. enum CABC_Negative negative;
  75. };
  76. void cabc_tuning_init(struct mdss_dsi_ctrl_pdata *dsi_pdata);
  77. void CABC_Set_Mode(void);
  78. void update_lux(unsigned int input_lux);
  79. int get_panel_power_state(void);
  80. #endif