diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index 13971c0f3d77..f0bc264a7868 100755 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -80,10 +80,6 @@ source "drivers/soc/oplus/midas/Kconfig" source "drivers/soc/oplus/boot/qcom_watchdog/Kconfig" #endif -#ifdef OPLUS_FEATURE_MODEM_MINIDUMP -source "drivers/soc/oplus/mdmrst/Kconfig" -#endif /*OPLUS_FEATURE_MODEM_MINIDUMP*/ - endmenu #ifdef OPLUS_FEATURE_TP_BASIC @@ -182,6 +178,14 @@ source "drivers/soc/oplus/network/oplus_vnet/Kconfig" source "drivers/soc/oplus/network/hans/Kconfig" #endif /* OPLUS_FEATURE_HANS */ +#ifdef OPLUS_FEATURE_MDMFEATURE +source "drivers/soc/oplus/radio/mdmfeature/Kconfig" +#endif /* OPLUS_FEATURE_MDMFEATURE */ + +#ifdef OPLUS_FEATURE_RECORD_MDMRST +source "drivers/soc/oplus/radio/mdmrst/Kconfig" +#endif /* OPLUS_FEATURE_RECORD_MDMRST */ + #ifdef OPLUS_SUBSYS_SLEEP_MONITOR source "drivers/soc/oplus/power/subsys_sleep_monitor/Kconfig" #endif /* OPLUS_SUBSYS_SLEEP_MONITOR */ diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index 395bd9a78595..de762efcbe21 100755 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile @@ -50,10 +50,6 @@ obj-$(CONFIG_OPLUS_TRIKEY_MAIN) += oplus/tri_state_key/ obj-y += oplus/boot/ #endif /* OPLUS_FEATURE_BOOT */ -#ifdef OPLUS_FEATURE_MODEM_MINIDUMP -obj-$(CONFIG_OPLUS_FEATURE_RECORD_MDMRST) += oplus/mdmrst/ -#endif /*OPLUS_FEATURE_MODEM_MINIDUMP*/ - #ifdef OPLUS_FEATURE_MIDAS_GKI obj-$(CONFIG_OPLUS_FEATURE_MIDAS_GKI) += oplus/midas/ #endif @@ -142,6 +138,14 @@ obj-$(CONFIG_OPLUS_FEATURE_VIRTUAL_NET) += oplus/network/oplus_vnet/ obj-$(CONFIG_OPLUS_FEATURE_HANS) += oplus/network/hans/ #endif +#ifdef OPLUS_FEATURE_MDMFEATURE +obj-$(CONFIG_OPLUS_FEATURE_MDMFEATURE) += oplus/radio/mdmfeature/ +#endif + +#ifdef OPLUS_FEATURE_RECORD_MDMRST +obj-$(CONFIG_OPLUS_FEATURE_RECORD_MDMRST) += oplus/radio/mdmrst/ +#endif + obj-$(CONFIG_OPLUS_FEATURE_QCOM_WATCHDOG) += oplus/boot/qcom_watchdog/ obj-y += oplus/dfr/ obj-y += oplus/dft/ diff --git a/drivers/soc/oplus/mdmrst/Kconfig b/drivers/soc/oplus/mdmrst/Kconfig deleted file mode 100755 index f5636e30d18c..000000000000 --- a/drivers/soc/oplus/mdmrst/Kconfig +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# Copyright (C) 2018-2020 Oplus. All rights reserved. -config OPLUS_FEATURE_RECORD_MDMRST -tristate "config record mdmrst" -help - define this config to count the modem restart times. \ No newline at end of file diff --git a/drivers/soc/oplus/mdmrst/Makefile b/drivers/soc/oplus/mdmrst/Makefile deleted file mode 100755 index c14b7a41fc35..000000000000 --- a/drivers/soc/oplus/mdmrst/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# Copyright (C) 2018-2020 Oplus. All rights reserved. -obj-$(CONFIG_OPLUS_FEATURE_RECORD_MDMRST) += oplus_mdmrst.o diff --git a/drivers/soc/oplus/mdmrst/oplus_mdmrst.c b/drivers/soc/oplus/mdmrst/oplus_mdmrst.c deleted file mode 100755 index 8af50fe11874..000000000000 --- a/drivers/soc/oplus/mdmrst/oplus_mdmrst.c +++ /dev/null @@ -1,185 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (C) 2018-2020 Oplus. All rights reserved. - */ -#include -#include -#include -#ifdef CONFIG_ARM -#include -#else -#include -#endif -#include -#include -#include - - -/*****yixue.ge ******/ -#define MDMREASON_BUF_LEN 256 -static wait_queue_head_t mdmreason_wq; -static int g_mdmreason_flag = 0; -static char mdmreason_buf[MDMREASON_BUF_LEN] = {0}; - - -void mdmreason_set(char * buf) -{ - if ((buf != NULL) && (buf[0] != '\0')) { - if (strlen(buf) >= MDMREASON_BUF_LEN) { - memcpy(mdmreason_buf, buf, MDMREASON_BUF_LEN - 1); - mdmreason_buf[MDMREASON_BUF_LEN - 1] = '\0'; - } else { - strcpy(mdmreason_buf, buf); - } - g_mdmreason_flag = 1; - wake_up_interruptible(&mdmreason_wq); - } -} -EXPORT_SYMBOL(mdmreason_set); - - -/*this write interface just use for test*/ -static ssize_t mdmreason_write(struct file *file, const char __user * buf, - size_t count, loff_t * ppos) -{ - /*just for test*/ - if (count > MDMREASON_BUF_LEN - 1) { - count = MDMREASON_BUF_LEN - 1; - } - if (count > *ppos) { - count -= *ppos; - } - else - count = 0; - - printk("mdmreason_write is called\n"); - - if (copy_from_user(mdmreason_buf, buf, count)) { - return -EFAULT; - } - mdmreason_buf[count] = '\0'; - *ppos += count; - - g_mdmreason_flag = 1; - wake_up_interruptible(&mdmreason_wq); - - return count; -} - - -static unsigned int mdmreason_poll (struct file *file, struct poll_table_struct *pt) -{ - unsigned int ptr = 0; - - poll_wait(file, &mdmreason_wq, pt); - - if (g_mdmreason_flag) { - ptr |= POLLIN | POLLRDNORM; - g_mdmreason_flag = 0; - } - return ptr; -} - - -static ssize_t mdmreason_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - size_t size = 0; - - if (count > MDMREASON_BUF_LEN - 1) { - count = MDMREASON_BUF_LEN - 1; - } - size = count < strlen(mdmreason_buf) ? count : strlen(mdmreason_buf); - - if (size > *ppos) { - size -= *ppos; - } - else - size = 0; - - if (copy_to_user(buf, mdmreason_buf, size)) { - return -EFAULT; - } - /*g_mdmreason_flag = 0;*/ - *ppos += size; - - return size; -} - - -static int mdmreason_release (struct inode *inode, struct file *file) -{ - /*g_mdmreason_flag = 0;*/ - /*memset(mdmreason_buf, 0, MDMREASON_BUF_LEN);*/ - return 0; -} - - -static const struct file_operations mdmreason_device_fops = { - .owner = THIS_MODULE, - .read = mdmreason_read, - .write = mdmreason_write, - .poll = mdmreason_poll, - .llseek = generic_file_llseek, - .release = mdmreason_release, -}; - - -static struct miscdevice mdmreason_device = { - MISC_DYNAMIC_MINOR, "mdmreason", &mdmreason_device_fops -}; - - -/*****yixue.ge add end******/ -wait_queue_head_t mdmrst_wq; -/*unsigned int mdmrest_flg;*/ -unsigned int g_mdmrest_count = 0; - - -ssize_t mdmrst_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - char *tmp = "1"; - - /*wait_event_interruptible(mdmrst_wq, mdmrest_flg);*/ - /*if (copy_to_user(buf, tmp, strlen(tmp)))*/ - if (copy_to_user(buf, &g_mdmrest_count, 1)) { - return -EFAULT; - } - /*mdmrest_flg = 0;*/ - return strlen(tmp); -} - - -static const struct file_operations mdmrst_device_fops = { - .owner = THIS_MODULE, - .read = mdmrst_read, -}; - - -static struct miscdevice mdmrst_device = { - MISC_DYNAMIC_MINOR, "mdmrst", &mdmrst_device_fops -}; - - -static int __init mdmrst_init(void) -{ - init_waitqueue_head(&mdmrst_wq); - init_waitqueue_head(&mdmreason_wq); - misc_register(&mdmreason_device); - return misc_register(&mdmrst_device); -} - - -static void __exit mdmrst_exit(void) -{ - misc_deregister(&mdmreason_device); - misc_deregister(&mdmrst_device); -} - - -module_init(mdmrst_init); -module_exit(mdmrst_exit); -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Oplus"); -