diff options
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r-- | arch/arm/mach-exynos/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mach-exynos/Kconfig.local | 25 | ||||
-rw-r--r-- | arch/arm/mach-exynos/Makefile | 10 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/gpio-rev00-p4notepq.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/mdm2.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mach-p4notepq.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mdm2.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mdm_common.c | 224 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mdm_device.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-exynos/mdm_private.h | 18 | ||||
-rw-r--r-- | arch/arm/mach-exynos/midas-lcd.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-exynos/p4-input.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-exynos/p4note-gpio.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-exynos/px-switch.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-exynos/setup-usb-phy.c | 11 |
15 files changed, 368 insertions, 34 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index e53a6f0c8b8..2c177ecd2e7 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -1774,6 +1774,9 @@ config MDM_HSIC_PM config EMI_ERROR_RECOVERY bool "unsuspected emi error recovery on HUB" default n +config SIM_DETECT + bool "support sim detect" + default n if QC_MODEM choice diff --git a/arch/arm/mach-exynos/Kconfig.local b/arch/arm/mach-exynos/Kconfig.local index 9630ab1da28..54baf94c00e 100644 --- a/arch/arm/mach-exynos/Kconfig.local +++ b/arch/arm/mach-exynos/Kconfig.local @@ -183,6 +183,31 @@ config MACH_M0_KOR_LGT endchoice choice + prompt "P4 LTE USA Target Carrier" + depends on MACH_P4NOTE && TARGET_LOCALE_USA + default MACH_P4NOTE_USA_ANY + +config MACH_P4NOTELTE_USA_VZW + bool "P4NOTE LTE USA VZW" + +config MACH_P4NOTELTE_USA_ATT + bool "P4NOTE LTE USA ATT" + +config MACH_P4NOTELTE_USA_TMO + bool "P4NOTE LTE USA TMO" + +config MACH_P4NOTELTE_USA_SPR + bool "P4NOTE LTE USA SPR" + +config MACH_P4NOTELTE_USA_USCC + bool "P4NOTE LTE USA USCC" + +config MACH_P4NOTELTE_USA_ANY + bool "P4NOTE LTE USA ANY" + +endchoice + +choice prompt "P4 KOR Target Carrier" depends on MACH_P4NOTE && TARGET_LOCALE_KOR default MACH_P4NOTE_KOR_ANY diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index 70025c6f410..22b8cfd3362 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile @@ -160,11 +160,19 @@ obj-$(CONFIG_MIDAS_COMMON) += sec-common.o \ obj-$(CONFIG_SEC_MODEM) += board-gps-bcm475x.o else ifeq ($(CONFIG_MACH_P4NOTE),y) +ifeq ($(CONFIG_MACH_P4NOTELTE_USA_VZW),y) +obj-$(CONFIG_MIDAS_COMMON) += sec-common.o\ + midas-tsp.o board-midas-wlan.o \ + midas-camera.o midas-thermistor.o \ + midas-mhl.o midas-lcd.o midas-sound.o +else obj-$(CONFIG_MIDAS_COMMON) += sec-common.o\ midas-tsp.o board-midas-wlan.o \ midas-camera.o midas-thermistor.o \ midas-mhl.o midas-lcd.o midas-sound.o \ - board-gps-bcm475x.o + board-gps-bcm475x.o +endif #CONFIG_MACH_P4NOTELTE_USA_VZW +obj-$(CONFIG_GPS_BRCM_475X) += board-gps-bcm475x.o else ifeq ($(CONFIG_MACH_SLP_T0_LTE),y) obj-$(CONFIG_MIDAS_COMMON) += sec-common.o \ diff --git a/arch/arm/mach-exynos/include/mach/gpio-rev00-p4notepq.h b/arch/arm/mach-exynos/include/mach/gpio-rev00-p4notepq.h index c44ac94856d..506accea2a1 100644 --- a/arch/arm/mach-exynos/include/mach/gpio-rev00-p4notepq.h +++ b/arch/arm/mach-exynos/include/mach/gpio-rev00-p4notepq.h @@ -43,7 +43,7 @@ extern void midas_config_sleep_gpio_table(void); #define GPIO_CAM_EN1 EXYNOS4212_GPJ0(6) #define GPIO_5M_nSTBY EXYNOS4212_GPJ0(7) #else -#define GPIO_3M_nSTBY EXYNOS4212_GPM0(6) +//#define GPIO_3M_nSTBY EXYNOS4212_GPM0(6) #endif #ifdef CONFIG_VIDEO_S5K5CCGX_COMMON #define GPIO_2M_nRST EXYNOS4212_GPM1(6) @@ -199,7 +199,7 @@ extern void midas_config_sleep_gpio_table(void); #define GPIO_IRDA_CONTROL EXYNOS4_GPL0(3) #elif defined(CONFIG_IR_REMOCON_MC96) #define GPIO_IRDA_WAKE EXYNOS4_GPL0(3) -#define GPIO_IRDA_IRQ EXYNOS4_GPM0(6) +#define GPIO_IRDA_IRQ EXYNOS4212_GPM0(6) #define GPIO_IRDA_SDA EXYNOS4_GPY0(0) #define GPIO_IRDA_SCL EXYNOS4_GPY0(1) #endif @@ -377,6 +377,9 @@ extern void midas_config_sleep_gpio_table(void); #define GPIO_MDM2AP_ERR_FATAL EXYNOS4_GPX1(2) #define GPIO_MDM_LTE_ACTIVE EXYNOS4_GPX1(6) #define GPIO_AP2MDM_HSIC_PORT_ACTIVE EXYNOS4_GPX3(2) /* AP2MDM_IPC1 */ +#ifdef CONFIG_SIM_DETECT +#define GPIO_SIM_DETECT EXYNOS4_GPX1(7) /* sim detect */ +#endif #endif #endif /* __MACH_GPIO_MIDAS_H */ diff --git a/arch/arm/mach-exynos/include/mach/mdm2.h b/arch/arm/mach-exynos/include/mach/mdm2.h index 61d875ced2d..534780e37e3 100644 --- a/arch/arm/mach-exynos/include/mach/mdm2.h +++ b/arch/arm/mach-exynos/include/mach/mdm2.h @@ -32,6 +32,11 @@ struct mdm_platform_data { struct platform_device *peripheral_platform_device_ehci; struct platform_device *peripheral_platform_device_ohci; const unsigned int ramdump_timeout_ms; +#ifdef CONFIG_SIM_DETECT + bool sim_polarity; +#endif + + void (*modem_complete)(struct device *dev); }; struct mdm_hsic_pm_platform_data { diff --git a/arch/arm/mach-exynos/mach-p4notepq.c b/arch/arm/mach-exynos/mach-p4notepq.c index 7015259f958..eafb3b9d5a1 100644 --- a/arch/arm/mach-exynos/mach-p4notepq.c +++ b/arch/arm/mach-exynos/mach-p4notepq.c @@ -1028,6 +1028,10 @@ static void irda_device_init(void) } gpio_direction_output(GPIO_IRDA_WAKE, 0); + s3c_gpio_cfgpin(GPIO_IRDA_IRQ, S3C_GPIO_INPUT); + s3c_gpio_setpull(GPIO_IRDA_IRQ, S3C_GPIO_PULL_UP); + gpio_direction_input(GPIO_IRDA_IRQ); + return; } @@ -1448,6 +1452,17 @@ static int check_sec_keyboard_dock(bool attached) return 0; } +/* call 30pin func. from sec_keyboard */ +static struct sec_30pin_callbacks *s30pin_callbacks; +static int noti_sec_univ_kbd_dock(unsigned int code) +{ + if (s30pin_callbacks && s30pin_callbacks->noti_univ_kdb_dock) + return s30pin_callbacks-> + noti_univ_kdb_dock(s30pin_callbacks, code); + return 0; +} + + static void check_uart_path(bool en) { int gpio_uart_sel; @@ -1493,6 +1508,11 @@ static void check_uart_path(bool en) #endif } +static void sec_30pin_register_cb(struct sec_30pin_callbacks *cb) +{ + s30pin_callbacks = cb; +} + static void sec_keyboard_register_cb(struct sec_keyboard_callbacks *cb) { keyboard_callbacks = cb; @@ -1503,6 +1523,7 @@ static struct sec_keyboard_platform_data kbd_pdata = { .acc_power = smdk_accessory_power, .check_uart_path = check_uart_path, .register_cb = sec_keyboard_register_cb, + .noti_univ_kbd_dock = noti_sec_univ_kbd_dock, .wakeup_key = NULL, }; @@ -1572,6 +1593,7 @@ struct acc_con_platform_data acc_con_pdata = { #ifdef CONFIG_SEC_KEYBOARD_DOCK .check_keyboard = check_sec_keyboard_dock, #endif + .register_cb = sec_30pin_register_cb, .accessory_irq_gpio = GPIO_ACCESSORY_INT, .dock_irq_gpio = GPIO_DOCK_INT, #if defined(CONFIG_SAMSUNG_MHL_9290) diff --git a/arch/arm/mach-exynos/mdm2.c b/arch/arm/mach-exynos/mdm2.c index bb66e2eed81..f6981ec1393 100644 --- a/arch/arm/mach-exynos/mdm2.c +++ b/arch/arm/mach-exynos/mdm2.c @@ -289,8 +289,13 @@ static void mdm_status_changed(struct mdm_modem_drv *mdm_drv, int value) if (value) { mdm_peripheral_disconnect(mdm_drv); mdm_peripheral_connect(mdm_drv); - if (mdm_drv->ap2mdm_wakeup_gpio > 0) + if (mdm_drv->ap2mdm_wakeup_gpio > 0) { + if (gpio_get_value(mdm_drv->ap2mdm_wakeup_gpio)) { + gpio_set_value(mdm_drv->ap2mdm_wakeup_gpio, 0); + mdelay(5); + } gpio_direction_output(mdm_drv->ap2mdm_wakeup_gpio, 1); + } } } diff --git a/arch/arm/mach-exynos/mdm_common.c b/arch/arm/mach-exynos/mdm_common.c index edd3418d79c..f0c819f3941 100644 --- a/arch/arm/mach-exynos/mdm_common.c +++ b/arch/arm/mach-exynos/mdm_common.c @@ -54,6 +54,10 @@ static const char rmnet_pm_dev[] = "mdm_hsic_pm0"; #include <mach/gpio.h> #endif +#ifdef CONFIG_SIM_DETECT +#include <linux/poll.h> +#endif + #define MDM_MODEM_TIMEOUT 6000 #define MDM_MODEM_DELTA 100 #define MDM_BOOT_TIMEOUT 60000L @@ -181,6 +185,23 @@ void mdm_set_chip_configuration(bool dload) } } +void print_mdm_gpio_state(void) +{ + pr_info("ap2mdm_status is %s\n", + gpio_get_value(mdm_drv->ap2mdm_status_gpio) ? + "high" : "low"); + pr_info("ap2mdm_errfatal is %s\n", + gpio_get_value(mdm_drv->ap2mdm_errfatal_gpio) ? + "high" : "low"); + pr_info("mdm2ap_status is %s\n", + gpio_get_value(mdm_drv->mdm2ap_status_gpio) ? + "high" : "low"); + pr_info("mdm2ap_errfatal is %s\n", + gpio_get_value(mdm_drv->mdm2ap_errfatal_gpio) ? + "high" : "low"); +} +EXPORT_SYMBOL(print_mdm_gpio_state); + static void mdm2ap_status_check(struct work_struct *work) { /* @@ -198,6 +219,27 @@ static void mdm2ap_status_check(struct work_struct *work) static DECLARE_DELAYED_WORK(mdm2ap_status_check_work, mdm2ap_status_check); +static void mdm_silent_reset(void) +{ + pr_info("mdm: silent reset!!\n"); + + mdm_drv->boot_type = CHARM_NORMAL_BOOT; + complete(&mdm_needs_reload); + if (!wait_for_completion_timeout(&mdm_boot, + msecs_to_jiffies(MDM_BOOT_TIMEOUT))) { + mdm_drv->mdm_boot_status = -ETIMEDOUT; + pr_info("%s: mdm modem restart timed out.\n", __func__); + panic("%s[%p]: Failed to powerup!", __func__, current); + } else { + pr_info("%s: mdm modem has been restarted\n", __func__); + + /* Log the reason for the restart */ + if (mdm_drv->pdata->sfr_query) + queue_work(mdm_sfr_queue, &sfr_reason_work); + } + INIT_COMPLETION(mdm_boot); +} + long mdm_modem_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { @@ -300,9 +342,20 @@ long mdm_modem_ioctl(struct file *filp, unsigned int cmd, return mdm_drv->proto_is_dload; case GET_FORCE_RAMDUMP: + get_user(status, (unsigned long __user *) arg); pr_info("%s: mdm get dump mode = %d\n", __func__, force_dump); - return force_dump; + if (status) + mdm_force_fatal(); + else + mdm_silent_reset(); + break; +#ifdef CONFIG_SIM_DETECT + case GET_SIM_DETECT: + pr_info("%s: mdm get sim detect = %d\n", __func__, + mdm_drv->sim_state); + return mdm_drv->sim_state; +#endif default: pr_err("%s: invalid ioctl cmd = %d\n", __func__, _IOC_NR(cmd)); ret = -EINVAL; @@ -312,19 +365,6 @@ long mdm_modem_ioctl(struct file *filp, unsigned int cmd, return ret; } -/* temporary implemented, it should be removed at mass production */ -/* simply declare this function as extern at test point, and call it */ -void mdm_force_fatal(void) -{ - pr_info("%s: Reseting the mdm due to AP request\n", __func__); - - force_dump = 1; - - notify_modem_fatal(); - subsystem_restart(EXTERNAL_MODEM); -} -EXPORT_SYMBOL(mdm_force_fatal); - static void mdm_fatal_fn(struct work_struct *work) { pr_info("%s: Reseting the mdm due to an errfatal\n", __func__); @@ -351,6 +391,23 @@ static void mdm_status_fn(struct work_struct *work) static DECLARE_WORK(mdm_status_work, mdm_status_fn); +/* temporary implemented, it should be removed at mass production */ +/* simply declare this function as extern at test point, and call it */ +void mdm_force_fatal(void) +{ + pr_info("%s: Reseting the mdm due to AP request\n", __func__); + + force_dump = 1; + + if (in_irq()) + queue_work(mdm_queue, &mdm_fatal_work); + else { + notify_modem_fatal(); + subsystem_restart(EXTERNAL_MODEM); + } +} +EXPORT_SYMBOL(mdm_force_fatal); + static void mdm_disable_irqs(void) { disable_irq_nosync(mdm_drv->mdm_errfatal_irq); @@ -370,6 +427,69 @@ static irqreturn_t mdm_errfatal(int irq, void *dev_id) return IRQ_HANDLED; } +#ifdef CONFIG_SIM_DETECT + +/* + * SIM state gpio shows level when SIM inserted + * + * sim_polarity == 1 + HIGH: attach + sim_polarity == 0 + * LOW : attach + */ +void get_sim_state_at_boot(void) +{ + if (mdm_drv) { + mdm_drv->sim_state = + mdm_drv->pdata->sim_polarity == + gpio_get_value(mdm_drv->sim_detect_gpio); + mdm_drv->sim_changed = 0; + pr_info("%s: sim state = %s\n", __func__, + mdm_drv->sim_state == 1 ? "Attach" : "Detach"); + } +} + +static void sim_status_check(struct work_struct *work) +{ + int cur_sim_state; + + if (!mdm_drv->mdm_ready) + return; + + cur_sim_state = + mdm_drv->pdata->sim_polarity == + gpio_get_value(mdm_drv->sim_detect_gpio); + + if (cur_sim_state != mdm_drv->sim_state) { + mdm_drv->sim_state = cur_sim_state; + mdm_drv->sim_changed = 1; + pr_info("sim state = %s\n", + mdm_drv->sim_state == 1 ? "Attach" : "Detach"); + wake_up_interruptible(&mdm_drv->wq); + } else + mdm_drv->sim_changed = 0; + + mdm_drv->sim_irq = false; +} + +static DECLARE_DELAYED_WORK(sim_status_check_work, sim_status_check); + +#define SIM_DEBOUNCE_TIME_MS 1000 +static irqreturn_t sim_detect_irq_handler(int irq, void *dev_id) +{ + if (mdm_drv->mdm_ready) { + pr_info("%s: sim gpio level = %d\n", __func__, + gpio_get_value(mdm_drv->sim_detect_gpio)); + + mdm_drv->sim_irq = true; + schedule_delayed_work(&sim_status_check_work, + msecs_to_jiffies(SIM_DEBOUNCE_TIME_MS)); + } + + return IRQ_HANDLED; +} +#endif + static unsigned char *mdm_read_err_report(void) { /* Read CP error report from mdm_err.log in tombstones */ @@ -391,6 +511,20 @@ static unsigned char *mdm_read_err_report(void) return (unsigned char *) buf; } +#ifdef CONFIG_SIM_DETECT +static unsigned int mdm_modem_poll(struct file *file, poll_table *wait) +{ + int mask = 0; + poll_wait(file, &mdm_drv->wq, wait); + if (mdm_drv->sim_changed == 1) { + mdm_drv->sim_changed = 0; + mask = POLLHUP; + } + + return mask; +} +#endif + static int mdm_modem_open(struct inode *inode, struct file *file) { return 0; @@ -400,6 +534,9 @@ static const struct file_operations mdm_modem_fops = { .owner = THIS_MODULE, .open = mdm_modem_open, .unlocked_ioctl = mdm_modem_ioctl, +#ifdef CONFIG_SIM_DETECT + .poll = mdm_modem_poll, +#endif }; @@ -444,6 +581,7 @@ static int mdm_reboot_notifier(struct notifier_block *this, { int soft_reset_direction = mdm_drv->pdata->soft_reset_inverted ? 1 : 0; + mdm_drv->mdm_ready = 0; mdm_disable_irqs(); notify_modem_fatal(); gpio_direction_output(mdm_drv->ap2mdm_soft_reset_gpio, @@ -500,6 +638,7 @@ static int mdm_subsys_shutdown(const struct subsys_data *crashed_subsys) */ msleep(mdm_drv->pdata->ramdump_delay_ms); } + #if 0 if (!mdm_drv->mdm_unexpected_reset_occurred) mdm_drv->ops->reset_mdm_cb(mdm_drv); @@ -599,7 +738,6 @@ static int mdm_debugfs_init(void) } #endif - static void mdm_modem_initialize_data(struct platform_device *pdev, struct mdm_ops *mdm_ops) { @@ -664,6 +802,17 @@ static void mdm_modem_initialize_data(struct platform_device *pdev, "MDM2AP_PBLRDY"); if (pres) mdm_drv->mdm2ap_pblrdy = pres->start; +#ifdef CONFIG_SIM_DETECT + /* SIM_DETECT */ + pres = platform_get_resource_byname(pdev, IORESOURCE_IO, + "SIM_DETECT"); + if (pres) + mdm_drv->sim_detect_gpio = pres->start; + else + pr_err("%s: fail to get resource\n", __func__); + +#endif + mdm_drv->sim_irq = false; mdm_drv->boot_type = CHARM_NORMAL_BOOT; @@ -695,6 +844,9 @@ int mdm_common_create(struct platform_device *pdev, gpio_request(mdm_drv->ap2mdm_kpdpwr_n_gpio, "AP2MDM_KPDPWR_N"); gpio_request(mdm_drv->mdm2ap_status_gpio, "MDM2AP_STATUS"); gpio_request(mdm_drv->mdm2ap_errfatal_gpio, "MDM2AP_ERRFATAL"); +#ifdef CONFIG_SIM_DETECT + gpio_request(mdm_drv->sim_detect_gpio, "SIM_DETECT"); +#endif if (mdm_drv->mdm2ap_pblrdy > 0) gpio_request(mdm_drv->mdm2ap_pblrdy, "MDM2AP_PBLRDY"); @@ -743,6 +895,10 @@ int mdm_common_create(struct platform_device *pdev, gpio_direction_input(mdm_drv->mdm2ap_status_gpio); gpio_direction_input(mdm_drv->mdm2ap_errfatal_gpio); +#ifdef CONFIG_SIM_DETECT + gpio_direction_input(mdm_drv->sim_detect_gpio); + init_waitqueue_head(&mdm_drv->wq); +#endif mdm_queue = create_singlethread_workqueue("mdm_queue"); if (!mdm_queue) { @@ -831,6 +987,38 @@ errfatal_err: enable_irq_wake(irq); status_err: +#ifdef CONFIG_SIM_DETECT + /* sim detect irq */ +#ifdef CONFIG_ARCH_EXYNOS + s3c_gpio_cfgpin(mdm_drv->sim_detect_gpio, S3C_GPIO_SFN(0xf)); + s3c_gpio_setpull(mdm_drv->sim_detect_gpio, S3C_GPIO_PULL_NONE); + irq = gpio_to_irq(mdm_drv->sim_detect_gpio); +#else + irq = MSM_GPIO_TO_INT(mdm_drv->sim_detect_gpio); +#endif + if (irq < 0) { + pr_err("%s: could not get SIM DETECT IRQ resource. " + "error=%d No IRQ will be generated on status change.", + __func__, irq); + goto simdetect_err; + } + + ret = request_threaded_irq(irq, NULL, sim_detect_irq_handler, + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_SHARED, + "sim detect", mdm_drv); + + if (ret < 0) { + pr_err("%s: SIM_DETECT IRQ#%d request failed with error=%d" + ". No IRQ will be generated on status change.", + __func__, irq, ret); + goto simdetect_err; + } + + mdm_drv->mdm_status_irq = irq; + enable_irq_wake(irq); +simdetect_err: +#endif + if (mdm_drv->mdm2ap_pblrdy > 0) { #ifdef CONFIG_ARCH_EXYNOS s3c_gpio_cfgpin(mdm_drv->mdm2ap_pblrdy, S3C_GPIO_SFN(0xf)); @@ -885,6 +1073,9 @@ fatal_err: gpio_free(mdm_drv->ap2mdm_pmic_pwr_en_gpio); gpio_free(mdm_drv->mdm2ap_status_gpio); gpio_free(mdm_drv->mdm2ap_errfatal_gpio); +#ifdef CONFIG_MACH_SIM_DETECT + gpio_free(mdm_drv->sim_detect_gpio); +#endif if (mdm_drv->ap2mdm_soft_reset_gpio > 0) gpio_free(mdm_drv->ap2mdm_soft_reset_gpio); @@ -910,6 +1101,9 @@ int mdm_common_modem_remove(struct platform_device *pdev) gpio_free(mdm_drv->ap2mdm_pmic_pwr_en_gpio); gpio_free(mdm_drv->mdm2ap_status_gpio); gpio_free(mdm_drv->mdm2ap_errfatal_gpio); +#ifdef CONFIG_SIM_DETECT + gpio_free(mdm_drv->sim_detect_gpio); +#endif if (mdm_drv->ap2mdm_soft_reset_gpio > 0) gpio_free(mdm_drv->ap2mdm_soft_reset_gpio); diff --git a/arch/arm/mach-exynos/mdm_device.c b/arch/arm/mach-exynos/mdm_device.c index f5af03c5c48..6c41e46d6b8 100644 --- a/arch/arm/mach-exynos/mdm_device.c +++ b/arch/arm/mach-exynos/mdm_device.c @@ -56,6 +56,15 @@ static struct resource mdm_resources[] = { .name = "AP2MDM_WAKEUP", .flags = IORESOURCE_IO, }, +#ifdef CONFIG_SIM_DETECT + { + .start = GPIO_SIM_DETECT, + .end = GPIO_SIM_DETECT, + .name = "SIM_DETECT", + .flags = IORESOURCE_IO, + }, +#endif + }; #ifdef CONFIG_MDM_HSIC_PM @@ -99,7 +108,7 @@ struct platform_device mdm_pm_device = { static struct mdm_platform_data mdm_platform_data = { .mdm_version = "3.0", - .ramdump_delay_ms = 2000, + .ramdump_delay_ms = 3000, .early_power_on = 1, .sfr_query = 0, .vddmin_resource = NULL, @@ -110,6 +119,10 @@ static struct mdm_platform_data mdm_platform_data = { .peripheral_platform_device_ohci = &s5p_device_ohci, #endif .ramdump_timeout_ms = 120000, +#if defined(CONFIG_MACH_P4NOTE) && defined(CONFIG_QC_MODEM) \ + && defined(CONFIG_SIM_DETECT) + .sim_polarity = 0, +#endif }; static int exynos_frequency_lock(struct device *dev) diff --git a/arch/arm/mach-exynos/mdm_private.h b/arch/arm/mach-exynos/mdm_private.h index 6dbcfa47622..d632c8fc52c 100644 --- a/arch/arm/mach-exynos/mdm_private.h +++ b/arch/arm/mach-exynos/mdm_private.h @@ -36,7 +36,9 @@ struct mdm_modem_drv { unsigned ap2mdm_soft_reset_gpio; unsigned ap2mdm_pmic_pwr_en_gpio; unsigned mdm2ap_pblrdy; - +#ifdef CONFIG_SIM_DETECT + unsigned sim_detect_gpio; +#endif int proto_is_dload; int mdm_errfatal_irq; @@ -47,9 +49,16 @@ struct mdm_modem_drv { enum charm_boot_type boot_type; int mdm_debug_on; int mdm_unexpected_reset_occurred; - +#ifdef CONFIG_SIM_DETECT + int sim_state; + bool sim_changed; + wait_queue_head_t wq; +#endif struct mdm_ops *ops; struct mdm_platform_data *pdata; + + bool sim_shutdown_req; + bool sim_irq; }; int mdm_common_create(struct platform_device *pdev, @@ -61,7 +70,10 @@ void mdm_peripheral_disconnect(struct mdm_modem_drv *mdm_drv); void notify_modem_fatal(void); void request_autopm_lock(int status); - +bool mdm_check_main_connect(const char *); +#ifdef CONFIG_SIM_DETECT +void get_sim_state_at_boot(void); +#endif extern unsigned int lpcharge; extern void ctrl_bridge_stop_all(void); extern void rmnet_usb_ctrl_stop_all(void); diff --git a/arch/arm/mach-exynos/midas-lcd.c b/arch/arm/mach-exynos/midas-lcd.c index 8612f62048c..f28c1961c22 100644 --- a/arch/arm/mach-exynos/midas-lcd.c +++ b/arch/arm/mach-exynos/midas-lcd.c @@ -360,8 +360,14 @@ static struct s3cfb_lcd s6c1372 = { .p_width = 217, .p_height = 135, .bpp = 24, - +#if defined(CONFIG_MACH_P4NOTELTE_USA_SPR) || \ + defined(CONFIG_MACH_P4NOTELTE_USA_VZW) || \ + defined(CONFIG_MACH_P4NOTELTE_USA_USCC) + .freq = 55, +#else .freq = 60, +#endif + .timing = { .h_fp = 18, .h_bp = 36, @@ -794,6 +800,7 @@ static struct s3cfb_lcd lms501xx = { #endif static int reset_lcd(void) { +#if defined(GPIO_MLCD_RST) int err; err = gpio_request(GPIO_MLCD_RST, "MLCD_RST"); @@ -810,15 +817,18 @@ static int reset_lcd(void) gpio_set_value(GPIO_MLCD_RST, 1); usleep_range(5000, 5000); gpio_free(GPIO_MLCD_RST); +#endif return 0; } static void lcd_cfg_gpio(void) { +#if defined(GPIO_MLCD_RST) + /* MLCD_RST */ s3c_gpio_cfgpin(GPIO_MLCD_RST, S3C_GPIO_OUTPUT); s3c_gpio_setpull(GPIO_MLCD_RST, S3C_GPIO_PULL_NONE); - +#endif #if defined(GPIO_LCD_22V_EN_00) /* LCD_EN */ s3c_gpio_cfgpin(GPIO_LCD_22V_EN_00, S3C_GPIO_OUTPUT); diff --git a/arch/arm/mach-exynos/p4-input.c b/arch/arm/mach-exynos/p4-input.c index e4d43c0fdef..71aa13548bc 100644 --- a/arch/arm/mach-exynos/p4-input.c +++ b/arch/arm/mach-exynos/p4-input.c @@ -344,6 +344,10 @@ static int ts_power_reset(void) Configuration for MXT1664-S */ #define MXT1664S_CONFIG_DATE "N80XX_ATM_0703" +#if defined(CONFIG_MACH_P4NOTELTE_USA_VZW) +#define MXT1664S_CONFIG_DATE_FOR_OVER_HW9 "I925_ATM_1121" +#endif + #define MXT1664S_MAX_MT_FINGERS 10 #define MXT1664S_BLEN_BATT 112 #define MXT1664S_CHRGTIME_BATT 180 @@ -585,9 +589,17 @@ static void switch_config(u32 rev) t62_config_s[14] = 1; t62_config_s[20] = 136; t62_config_s[22] = 35; +#if defined(CONFIG_MACH_P4NOTELTE_USA_VZW) + t62_config_s[23] = 48; + t62_config_s[26] = 24; + t62_config_s[27] = 24; +#endif t62_config_s[35] = 80; t62_config_s[36] = 50; t62_config_s[38] = 5; +#if defined(CONFIG_MACH_P4NOTELTE_USA_VZW) + t62_config_s[40] = 50; +#endif t62_config_s[42] = 30; t62_config_s[43] = 40; t62_config_s[44] = 10; @@ -595,6 +607,11 @@ static void switch_config(u32 rev) t62_config_s[48] = 30; t62_config_s[49] = 30; t62_config_s[53] = 20; +#if defined(CONFIG_MACH_P4NOTELTE_USA_VZW) + /* Change Config Name for LTE */ + mxt1664s_pdata.config_version = + MXT1664S_CONFIG_DATE_FOR_OVER_HW9; +#endif } } diff --git a/arch/arm/mach-exynos/p4note-gpio.c b/arch/arm/mach-exynos/p4note-gpio.c index 5596b7a2e92..510ed61c102 100644 --- a/arch/arm/mach-exynos/p4note-gpio.c +++ b/arch/arm/mach-exynos/p4note-gpio.c @@ -36,6 +36,14 @@ extern int s3c_gpio_slp_setpull_updown(unsigned int pin, unsigned int config); * P4NOTE GPIO Init Table */ static struct gpio_init_data p4note_init_gpios[] = { + #if defined(CONFIG_QC_MODEM) + {EXYNOS4_GPA0(4), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, + S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1}, /* NC */ + {EXYNOS4_GPA0(6), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, + S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1}, /* NC */ + {EXYNOS4_GPA0(7), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, + S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1}, /* NC */ +#endif #if defined(CONFIG_SEC_MODEM) {EXYNOS4_GPA1(4), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1}, /* NC */ @@ -136,7 +144,7 @@ static struct gpio_init_data p4note_init_gpios[] = { {EXYNOS4_GPK3(6), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_NONE, S5P_GPIO_DRVSTR_LV1}, /* WLAN_SDIO_D(3) */ -#if !defined(CONFIG_SEC_MODEM) +#if !defined(CONFIG_SEC_MODEM) && !defined(CONFIG_QC_MODEM) {EXYNOS4212_GPM0(7), S3C_GPIO_INPUT, S3C_GPIO_SETPIN_NONE, S3C_GPIO_PULL_DOWN, S5P_GPIO_DRVSTR_LV1}, /* NC */ #endif @@ -192,7 +200,7 @@ static unsigned int p4note_sleep_gpio_table[][3] = { {EXYNOS4_GPA1(1), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, {EXYNOS4_GPA1(2), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, {EXYNOS4_GPA1(3), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, -#if defined(CONFIG_SEC_MODEM) +#if defined(CONFIG_SEC_MODEM) || defined(CONFIG_QC_MODEM) {EXYNOS4_GPA1(4), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC(IPC_RXD) */ {EXYNOS4_GPA1(5), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC(IPC_TXD) */ #else @@ -450,7 +458,7 @@ static unsigned int p4note_sleep_gpio_table[][3] = { {EXYNOS4212_GPM0(4), S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* TSP_RST */ {EXYNOS4212_GPM0(5), S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* LVDS_nSHDN */ {EXYNOS4212_GPM0(6), S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* 3M_nSTBY */ -#if defined(CONFIG_SEC_MODEM) +#if defined(CONFIG_SEC_MODEM) || defined(CONFIG_QC_MODEM) {EXYNOS4212_GPM0(7), S3C_GPIO_SLP_OUT0, S3C_GPIO_PULL_NONE}, /* USB_SEL_CP */ #else {EXYNOS4212_GPM0(7), S3C_GPIO_SLP_INPUT, S3C_GPIO_PULL_DOWN}, /* NC */ diff --git a/arch/arm/mach-exynos/px-switch.c b/arch/arm/mach-exynos/px-switch.c index 99f0e15b22a..37173bb0b86 100644 --- a/arch/arm/mach-exynos/px-switch.c +++ b/arch/arm/mach-exynos/px-switch.c @@ -430,10 +430,10 @@ static void init_gpio(void) s3c_gpio_cfgpin(GPIO_USB_SEL1, S3C_GPIO_OUTPUT); s3c_gpio_setpull(GPIO_USB_SEL1, S3C_GPIO_PULL_NONE); - +#if defined(GPIO_USB_SEL_CP) s3c_gpio_cfgpin(GPIO_USB_SEL_CP, S3C_GPIO_OUTPUT); s3c_gpio_setpull(GPIO_USB_SEL_CP, S3C_GPIO_PULL_NONE); - +#endif /* GPIO_USB_SEL_CP */ s3c_gpio_cfgpin(GPIO_UART_SEL, S3C_GPIO_OUTPUT); s3c_gpio_setpull(GPIO_UART_SEL, S3C_GPIO_PULL_NONE); @@ -518,7 +518,9 @@ static int __init usb_switch_init(void) #if defined(CONFIG_MACH_P4NOTE) gpio_request(GPIO_USB_SEL0, "GPIO_USB_SEL0"); gpio_request(GPIO_USB_SEL1, "GPIO_USB_SEL1"); +#if defined(GPIO_USB_SEL_CP) gpio_request(GPIO_USB_SEL_CP, "GPIO_USB_SEL_CP"); +#endif /* GPIO_USB_SEL_CP */ #else gpio_request(GPIO_USB_SEL1, "GPIO_USB_SEL1"); gpio_request(GPIO_USB_SEL2, "GPIO_USB_SEL2"); @@ -540,7 +542,9 @@ static int __init usb_switch_init(void) #if defined(CONFIG_MACH_P4NOTE) gpio_export(GPIO_USB_SEL0, 1); gpio_export(GPIO_USB_SEL1, 1); +#if defined(GPIO_USB_SEL_CP) gpio_export(GPIO_USB_SEL_CP, 1); +#endif /* GPIO_USB_SEL_CP */ #else gpio_export(GPIO_USB_SEL1, 1); gpio_export(GPIO_USB_SEL2, 1); @@ -567,7 +571,9 @@ static int __init usb_switch_init(void) #if defined(CONFIG_MACH_P4NOTE) gpio_export_link(sec_switch_dev, "GPIO_USB_SEL0", GPIO_USB_SEL0); gpio_export_link(sec_switch_dev, "GPIO_USB_SEL1", GPIO_USB_SEL1); +#if defined(GPIO_USB_SEL_CP) gpio_export_link(sec_switch_dev, "GPIO_USB_SEL_CP", GPIO_USB_SEL_CP); +#endif /* GPIO_USB_SEL_CP */ #else gpio_export_link(sec_switch_dev, "GPIO_USB_SEL1", GPIO_USB_SEL1); gpio_export_link(sec_switch_dev, "GPIO_USB_SEL2", GPIO_USB_SEL2); diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c index c844752335d..22621c5a0f4 100644 --- a/arch/arm/mach-exynos/setup-usb-phy.c +++ b/arch/arm/mach-exynos/setup-usb-phy.c @@ -1044,11 +1044,14 @@ int exynos4_check_usb_op(void) if (phypwr & (PHY1_STD_FORCE_SUSPEND | EXYNOS4212_HSIC0_FORCE_SUSPEND | EXYNOS4212_HSIC1_FORCE_SUSPEND)) { -#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB) \ - || defined(CONFIG_MDM_HSIC_PM) - /* HSIC LPA: LPA USB phy retention reume call the usb - * reset resume, so we should let CP to HSIC L3 mode. */ +#if defined(CONFIG_LINK_DEVICE_HSIC) || defined(CONFIG_LINK_DEVICE_USB) set_hsic_lpa_states(STATE_HSIC_LPA_ENTER); +#elif defined(CONFIG_MDM_HSIC_PM) + ret = set_hsic_lpa_states(STATE_HSIC_LPA_ENTER); + if (ret < 0) { + op = 1; + goto done; + } #endif /* unset to normal of Host */ writel(readl(EXYNOS4_PHYPWR) |