drivers: modem_if: Get board revision using bootargs
authorJiyoung Jeong <ji_0.jeong@samsung.com>
Mon, 8 Oct 2018 10:16:53 +0000 (19:16 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:44 +0000 (20:23 +0300)
In bootargs "revision="

Change-Id: Iba4f8d28e5d130e33d8aa1d7ea193ed5c59e3498
Signed-off-by: Jiyoung Jeong <ji_0.jeong@samsung.com>
drivers/misc/modem_if/Kconfig
drivers/misc/modem_if/modem_modemctl_device_sh333ap.c

index 73e946bf7b30fe6132b83b811a2d2b10a9b0fbd8..d222382aba721f24c0aa14e9403f7ad6f2ddf70f 100644 (file)
@@ -67,5 +67,9 @@ config UART_SWITCH
        bool "UART SWITCH Support"
        default n
 
+config HW_REV_DETECT
+        bool "Support HW REV Detect"
+        default n
+
 endmenu
 endif
index 3107176ee292ffccb60a045578cde51d8f6f6aa1..6cd89508a7e7355145c5bf2c8c48e56a6349dde6 100644 (file)
@@ -236,6 +236,17 @@ static void pcie_l1ss_disable_handler(void *arg)
 }
 #endif
 
+static int sys_rev;
+#ifdef CONFIG_HW_REV_DETECT
+static int __init hw_rev_setup(char *str)
+{
+       get_option(&str, &sys_rev);
+       mif_info("sys_rev:0x%x\n", sys_rev);
+
+       return 0;
+}
+__setup("revision=", hw_rev_setup);
+#else
 static int get_hw_rev(struct device_node *np)
 {
        int value, cnt, gpio_cnt;
@@ -260,6 +271,7 @@ static int get_hw_rev(struct device_node *np)
 
        return hw_rev;
 }
+#endif
 
 #ifdef CONFIG_SIM_DETECT
 static unsigned int get_sim_socket_detection(struct device_node *np)
@@ -297,7 +309,7 @@ static int sh333ap_on(struct modem_ctl *mc)
        int ret;
        int i;
        unsigned long int flags;
-       int sys_rev, ds_det;
+       int ds_det;
        unsigned int mbx_ap_status;
        unsigned int sbi_ds_det_mask, sbi_ds_det_pos;
        unsigned int sbi_sys_rev_mask, sbi_sys_rev_pos;
@@ -322,14 +334,16 @@ static int sh333ap_on(struct modem_ctl *mc)
 
        spin_lock_irqsave(&mc->ap_status_lock, flags);
 
+#ifndef CONFIG_HW_REV_DETECT
        sys_rev = get_hw_rev(np);
+#endif
        if (sys_rev >= 0) {
                mbox_update_value(MCU_CP, mbx_ap_status, sys_rev,
                        sbi_sys_rev_mask, sbi_sys_rev_pos);
        } else {
                mif_err("get_hw_rev() ERROR\n");
        }
-       mif_err("System Revision %d\n", sys_rev);
+       mif_err("System Revision 0x%x\n", sys_rev);
 
        if (mc->sim_slot_cnt > 0) {
                mif_err("System sim config: %d\n", mc->sim_slot_cnt);