ccci_support.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <linux/device.h>
  2. #include <linux/syscalls.h>
  3. #include <linux/module.h>
  4. #include <linux/memblock.h>
  5. #include <asm/setup.h>
  6. #include <linux/of_fdt.h>
  7. #include <mt-plat/mt_ccci_common.h>
  8. #include "ccci_config.h"
  9. #include "port_kernel.h"
  10. #include "ccci_support.h"
  11. static struct ccci_setting ccci_cfg_setting;
  12. void ccci_reload_md_type(struct ccci_modem *md, int type)
  13. {
  14. if (type != md->config.load_type) {
  15. set_modem_support_cap(md->index, type);
  16. md->config.load_type = type;
  17. md->config.setting |= MD_SETTING_RELOAD;
  18. }
  19. }
  20. struct ccci_setting *ccci_get_common_setting(int md_id)
  21. {
  22. #ifdef CONFIG_EVDO_DT_SUPPORT
  23. ccci_cfg_setting.slot1_mode = CONFIG_MTK_TELEPHONY_BOOTUP_MODE_SLOT1;
  24. ccci_cfg_setting.slot2_mode = CONFIG_MTK_TELEPHONY_BOOTUP_MODE_SLOT2;
  25. #endif
  26. return &ccci_cfg_setting;
  27. }
  28. int ccci_store_sim_switch_mode(struct ccci_modem *md, int simmode)
  29. {
  30. if (ccci_cfg_setting.sim_mode != simmode) {
  31. ccci_cfg_setting.sim_mode = simmode;
  32. ccci_send_virtual_md_msg(md, CCCI_MONITOR_CH, CCCI_MD_MSG_CFG_UPDATE, 1);
  33. } else {
  34. CCCI_INF_MSG(md->index, CORE, "same sim mode as last time(0x%x)\n", simmode);
  35. }
  36. return 0;
  37. }
  38. int ccci_get_sim_switch_mode(void)
  39. {
  40. return ccci_cfg_setting.sim_mode;
  41. }