aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/mdm_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos/mdm_common.c')
-rw-r--r--arch/arm/mach-exynos/mdm_common.c60
1 files changed, 45 insertions, 15 deletions
diff --git a/arch/arm/mach-exynos/mdm_common.c b/arch/arm/mach-exynos/mdm_common.c
index f47a122..294772d 100644
--- a/arch/arm/mach-exynos/mdm_common.c
+++ b/arch/arm/mach-exynos/mdm_common.c
@@ -58,6 +58,10 @@ static const char rmnet_pm_dev[] = "mdm_hsic_pm0";
#include <linux/poll.h>
#endif
+#ifdef CONFIG_FAST_BOOT
+#include <linux/reboot.h>
+#endif
+
#define MDM_MODEM_TIMEOUT 6000
#define MDM_MODEM_DELTA 100
#define MDM_BOOT_TIMEOUT 60000L
@@ -223,6 +227,9 @@ static void mdm_silent_reset(void)
{
pr_info("mdm: silent reset!!\n");
+
+ set_shutdown();
+ mdm_drv->mdm_ready = 0;
mdm_drv->boot_type = CHARM_NORMAL_BOOT;
complete(&mdm_needs_reload);
if (!wait_for_completion_timeout(&mdm_boot,
@@ -374,6 +381,18 @@ static void mdm_fatal_fn(struct work_struct *work)
static DECLARE_WORK(mdm_fatal_work, mdm_fatal_fn);
+static void mdm_reconnect_fn(struct work_struct *work)
+{
+ pr_info("mdm: check 2nd enumeration\n");
+
+ if (mdm_check_main_connect(rmnet_pm_dev))
+ return;
+
+ mdm_silent_reset();
+}
+
+static DECLARE_DELAYED_WORK(mdm_reconnect_work, mdm_reconnect_fn);
+
static void mdm_status_fn(struct work_struct *work)
{
int value = gpio_get_value(mdm_drv->mdm2ap_status_gpio);
@@ -385,6 +404,8 @@ static void mdm_status_fn(struct work_struct *work)
if (value) {
request_boot_lock_release(rmnet_pm_dev);
request_active_lock_set(rmnet_pm_dev);
+ queue_delayed_work(mdm_queue, &mdm_reconnect_work,
+ msecs_to_jiffies(3000));
}
#endif
}
@@ -465,6 +486,10 @@ static void sim_status_check(struct work_struct *work)
mdm_drv->sim_changed = 1;
pr_info("sim state = %s\n",
mdm_drv->sim_state == 1 ? "Attach" : "Detach");
+#ifdef CONFIG_FAST_BOOT
+ if (fake_shut_down)
+ mdm_drv->sim_shutdown_req = true;
+#endif
wake_up_interruptible(&mdm_drv->wq);
} else
mdm_drv->sim_changed = 0;
@@ -639,6 +664,9 @@ static int mdm_subsys_shutdown(const struct subsys_data *crashed_subsys)
msleep(mdm_drv->pdata->ramdump_delay_ms);
}
+ /* close silent log */
+ silent_log_panic_handler();
+
#if 0
if (!mdm_drv->mdm_unexpected_reset_occurred)
mdm_drv->ops->reset_mdm_cb(mdm_drv);
@@ -738,6 +766,18 @@ static int mdm_debugfs_init(void)
}
#endif
+#ifdef CONFIG_FAST_BOOT
+static void sim_detect_complete(struct device *dev)
+{
+ if (!mdm_drv->sim_irq && mdm_drv->sim_shutdown_req) {
+ pr_info("fake shutdown sim changed shutdown\n");
+ kernel_power_off();
+ /*kernel_restart(NULL);*/
+ mdm_drv->sim_shutdown_req = false;
+ }
+}
+#endif
+
static void mdm_modem_initialize_data(struct platform_device *pdev,
struct mdm_ops *mdm_ops)
{
@@ -797,15 +837,9 @@ static void mdm_modem_initialize_data(struct platform_device *pdev,
if (pres)
mdm_drv->ap2mdm_pmic_pwr_en_gpio = pres->start;
-#ifdef CONFIG_HSIC_EURONLY_APPLY
- /* MDM2AP_HSIC_READY */
- pres = platform_get_resource_byname(pdev, IORESOURCE_IO,
- "MDM2AP_HSIC_READY");
-#else
/* MDM2AP_PBLRDY */
pres = platform_get_resource_byname(pdev, IORESOURCE_IO,
"MDM2AP_PBLRDY");
-#endif
if (pres)
mdm_drv->mdm2ap_pblrdy = pres->start;
#ifdef CONFIG_SIM_DETECT
@@ -826,6 +860,10 @@ static void mdm_modem_initialize_data(struct platform_device *pdev,
mdm_drv->pdata = pdev->dev.platform_data;
dump_timeout_ms = mdm_drv->pdata->ramdump_timeout_ms > 0 ?
mdm_drv->pdata->ramdump_timeout_ms : MDM_RDUMP_TIMEOUT;
+#ifdef CONFIG_FAST_BOOT
+ mdm_drv->pdata->modem_complete = sim_detect_complete;
+ mdm_drv->sim_shutdown_req = false;
+#endif
}
int mdm_common_create(struct platform_device *pdev,
@@ -853,12 +891,8 @@ int mdm_common_create(struct platform_device *pdev,
#ifdef CONFIG_SIM_DETECT
gpio_request(mdm_drv->sim_detect_gpio, "SIM_DETECT");
#endif
-#ifdef CONFIG_HSIC_EURONLY_APPLY
- gpio_request(mdm_drv->mdm2ap_pblrdy, "MDM2AP_HSIC_READY");
-#else
if (mdm_drv->mdm2ap_pblrdy > 0)
gpio_request(mdm_drv->mdm2ap_pblrdy, "MDM2AP_PBLRDY");
-#endif
if (mdm_drv->ap2mdm_pmic_pwr_en_gpio > 0) {
gpio_request(mdm_drv->ap2mdm_pmic_pwr_en_gpio,
@@ -1029,11 +1063,7 @@ status_err:
simdetect_err:
#endif
-#ifndef CONFIG_HSIC_EURONLY_APPLY
- if (mdm_drv->mdm2ap_pblrdy > 0)
-#endif
- {
-
+ if (mdm_drv->mdm2ap_pblrdy > 0) {
#ifdef CONFIG_ARCH_EXYNOS
s3c_gpio_cfgpin(mdm_drv->mdm2ap_pblrdy, S3C_GPIO_SFN(0xf));
s3c_gpio_setpull(mdm_drv->mdm2ap_pblrdy, S3C_GPIO_PULL_NONE);