ic_drv_global.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* i2c_drv_global.c
  2. *
  3. * Raydium TouchScreen driver.
  4. *
  5. * Copyright (c) 2021 Raydium tech Ltd.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #include "../Config.h"
  19. #include "ic_drv_global.h"
  20. #include "ic_drv_interface.h"
  21. #ifdef __KERNEL__
  22. #include <linux/delay.h>
  23. #include <linux/mutex.h>
  24. #include <linux/unistd.h>
  25. #include <linux/kernel.h>
  26. #include <linux/string.h>
  27. #include <linux/timer.h>
  28. #include <linux/fs.h>
  29. #include <asm/uaccess.h>
  30. #endif
  31. #include "../drv_interface.h"
  32. #if !SELFTEST
  33. #include "usb.h"
  34. #include "Descriptors.h"
  35. #endif
  36. /*
  37. *****************************************************************************
  38. **
  39. ** Declared Global Variable
  40. **
  41. *****************************************************************************
  42. ********************* Global *********************
  43. */
  44. unsigned short g_u16_dev_id;
  45. unsigned char g_u8_drv_interface;
  46. volatile unsigned char g_u8_gpio_irq_trigger;
  47. unsigned char g_u8_raw_data_buffer[MAX_IMAGE_BUFFER_SIZE * 2];
  48. unsigned short g_u16_raw_data_tmp[MAX_IMAGE_BUFFER_SIZE];
  49. // IC Test
  50. short g_i16_raw_data_1_short_buf[MAX_SENSING_PIN_NUM];
  51. short g_i16_raw_data_2_open_buf[MAX_SENSING_PIN_NUM];
  52. unsigned short g_u16_raw_data3_cc_buf[MAX_SENSING_PIN_NUM];
  53. unsigned short g_u16_uc_buf[MAX_SENSING_PIN_NUM];//CC
  54. unsigned short g_u16_raw_data3_golden_cc_buf[MAX_SENSING_PIN_NUM];
  55. unsigned short g_u16_uc_golden_cc_buf[MAX_SENSING_PIN_NUM];
  56. unsigned int g_u32_test_result[MAX_SENSING_PIN_NUM]; // each node test result (bit[0]:open ng, bit[1]:short ng, bit[2]:uniformity ng..etc)
  57. unsigned char g_u8_test_result[MAX_SENSING_PIN_NUM];
  58. unsigned int g_u32_wearable_test_result;
  59. unsigned char g_u8_wearable_pin_map[MAX_IMAGE_BUFFER_SIZE];
  60. unsigned char g_u8_data_buf[DATA_BUFFER_SIZE];
  61. unsigned char g_u8_mipi_read_buf[56];
  62. unsigned char g_u8_channel_x;
  63. unsigned char g_u8_channel_y;
  64. unsigned char g_u8_is_normal_fw;
  65. volatile unsigned short g_u16_test_items_host_cmd;
  66. unsigned short g_u16_test_items_tool_cmd;
  67. unsigned char g_u8_ic_power_on_ng;
  68. char g_i8_test_baseline_msg[30];
  69. volatile unsigned short g_u16_panel_jig_set_test_items;
  70. bool b_is_auo_jig_testing;
  71. #if ENABLE_TEST_TIME_MEASURMENT || ENABLE_TEST_TIME_MEASURMENT_CC
  72. unsigned int g_u32_spend_time;
  73. #endif
  74. unsigned int g_u32_fw_cc_version;
  75. unsigned char g_u8_print_debug_msg;
  76. unsigned char g_u8_display_interface;
  77. unsigned char g_u8_PAGE_ADDR;
  78. int g_u32_dongle_flash_ini_addr;// 0xF000
  79. int g_u32_ini_threshold_addr;// DONGLE_FLASH_INI_ADDR + 16
  80. int g_u32_ini_para_addr;// INI_THRESHOLD_ADDR + 36
  81. //int u32_ini_raw_data_2_bl_addr;// INI_PARA_ADDR+48
  82. int g_u32_ini_raw_data_3_cc_addr;// INI_RAW_DATA2_BL_ADDR+72
  83. int g_u32_ini_uc_cc_addr;// INI_RAW_DATA_3_CC_ADDR + 72// INI_RAW_DATA2_ADDR
  84. int g_u32_initial_code_start_addr;
  85. void ic_drv_init(void)
  86. {
  87. g_u16_test_items_host_cmd = 0xFFFF;
  88. g_u16_test_items_tool_cmd = 0;
  89. g_u16_dev_id = DEVICE_ID_3X;
  90. g_u8_print_debug_msg = 0;
  91. g_u8_display_interface = DISPLAY_TOUCH_2_DRIVER_MODE;
  92. b_is_auo_jig_testing = false;
  93. #if !SELFTEST
  94. g_u8_ic_power_on_ng = FALSE;
  95. #endif
  96. }
  97. /*
  98. *****************************************************************************
  99. **
  100. * End Of File
  101. ******************************************************************************
  102. */