adaptive_mipi_v2.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) Samsung Electronics Co., Ltd.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #ifndef __ADAPTIVE_MIPI_V2_H__
  10. #define __ADAPTIVE_MIPI_V2_H__
  11. /* Adaptive MIPI v2 interfaces for display drivers */
  12. #define MAX_MIPI_FREQ_CNT (4)
  13. #define INV_OSC_CLK (0)
  14. enum {
  15. DEFAULT_OSC_ID = 0,
  16. ALTERNATIVE_OSC_ID,
  17. MAX_OSC_FREQ_CNT,
  18. };
  19. enum {
  20. BANDWIDTH_10M_IDX = 0,
  21. BANDWIDTH_20M_IDX,
  22. MAX_BANDWIDTH_IDX,
  23. };
  24. struct adaptive_mipi_v2_table_element {
  25. int rat;
  26. int band;
  27. int from_ch;
  28. int end_ch;
  29. union {
  30. int mipi_clocks_rating[MAX_MIPI_FREQ_CNT];
  31. int osc_idx;
  32. };
  33. };
  34. struct adaptive_mipi_v2_adapter_funcs {
  35. int (*apply_freq)(int mipi_clk_kbps, int osc_clk_khz, void *ctx);
  36. };
  37. struct adaptive_mipi_v2_info {
  38. void *ctx;
  39. int mipi_clocks_kbps[MAX_MIPI_FREQ_CNT];
  40. int mipi_clocks_size;
  41. int osc_clocks_khz[MAX_OSC_FREQ_CNT];
  42. int osc_clocks_size;
  43. struct adaptive_mipi_v2_table_element *mipi_table[MAX_BANDWIDTH_IDX];
  44. int mipi_table_size[MAX_BANDWIDTH_IDX];
  45. struct adaptive_mipi_v2_table_element *osc_table;
  46. int osc_table_size;
  47. struct adaptive_mipi_v2_adapter_funcs *funcs;
  48. struct notifier_block ril_nb;
  49. };
  50. extern int sdp_init_adaptive_mipi_v2(struct adaptive_mipi_v2_info *info);
  51. extern int sdp_cleanup_adaptive_mipi_v2(struct adaptive_mipi_v2_info *info);
  52. #endif /* __ADAPTIVE_MIPI_V2_H__ */