static irqreturn_t earjack_debugger_irq_handler(int irq, void *_dev) { struct earjack_debugger_device *adev = _dev; unsigned int um = lge_get_uart_mode(); int detect; /* LGE_CHANGE_S * add debounce time because accure earjack popup noise * [email protected] 2012/12/20 */ msleep(400); /* LGE_CHANGE_E */ detect = earjack_debugger_detected(adev); if (detect) { pr_debug("%s() : in!!\n", __func__); if (um & UART_MODE_INIT_BMSK) { adev->set_uart_console(1); } else { lge_set_uart_mode(um | UART_MODE_EN_BMSK); } } else { pr_debug("%s() : out!!\n", __func__); if (um & UART_MODE_INIT_BMSK) { adev->set_uart_console(0); } else { lge_set_uart_mode(um & ~UART_MODE_EN_BMSK); } } return IRQ_HANDLED; }
static void __init msm7x2x_init(void) { msm_clock_init(msm_clocks_7x27, msm_num_clocks_7x27); #if defined(CONFIG_MSM_SERIAL_DEBUGGER) msm_serial_debug_init(MSM_UART1_PHYS, INT_UART1, &msm_device_uart1.dev, 1); #endif if (cpu_is_msm7x27()) msm7x2x_clock_data.max_axi_khz = 200000; msm_acpu_clock_init(&msm7x2x_clock_data); msm_add_pmem_devices(); msm_add_fb_device(); #if !defined(CONFIG_MSM_SERIAL_DEBUGGER) if (lge_get_uart_mode()) platform_device_register(&msm_device_uart3); #endif platform_add_devices(devices, ARRAY_SIZE(devices)); #ifdef CONFIG_ARCH_MSM7X27 msm_add_kgsl_device(); #endif msm_add_usb_devices(); #ifdef CONFIG_MSM_CAMERA config_camera_off_gpios(); /* might not be necessary */ #endif msm_device_i2c_init(); i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); if (cpu_is_msm7x27()) msm_pm_set_platform_data(msm7x27_pm_data, ARRAY_SIZE(msm7x27_pm_data)); else msm_pm_set_platform_data(msm7x25_pm_data, ARRAY_SIZE(msm7x25_pm_data)); msm7x27_wlan_init(); #ifdef CONFIG_ANDROID_RAM_CONSOLE lge_add_ramconsole_devices(); lge_add_ers_devices(); lge_add_panic_handler_devices(); #endif lge_add_camera_devices(); lge_add_lcd_devices(); lge_add_btpower_devices(); lge_add_mmc_devices(); lge_add_input_devices(); lge_add_misc_devices(); lge_add_pm_devices(); lge_add_gpio_i2c_devices(); create_testmode_status(); create_sw_version_status(); create_smpl_reset_status(); create_qpst_enable_status(); }
static irqreturn_t earjack_debugger_irq_handler(int irq, void *_dev) { struct earjack_debugger_device *adev = _dev; unsigned int um = lge_get_uart_mode(); int detect; /* */ msleep(400); /* */ detect = earjack_debugger_detected(adev); if (detect) { pr_debug("%s() : in!!\n", __func__); if (um & UART_MODE_INIT_BMSK) { adev->set_uart_console(1); } else { lge_set_uart_mode(um | UART_MODE_EN_BMSK); } } else { pr_debug("%s() : out!!\n", __func__); if (um & UART_MODE_INIT_BMSK) { adev->set_uart_console(0); } else { lge_set_uart_mode(um & ~UART_MODE_EN_BMSK); } } return IRQ_HANDLED; }
static int __init earjack_debugger_init(void) { if (lge_get_uart_mode() & (UART_MODE_ALWAYS_ON_BMSK | UART_MODE_ALWAYS_OFF_BMSK)) return -ENODEV; return platform_driver_register(&earjack_debugger_driver); }
static void __init msm7x2x_init(void) { if (socinfo_init() < 0) printk(KERN_ERR "%s: socinfo_init() failed!\n", __func__); msm_clock_init(msm_clocks_7x27a, msm_num_clocks_7x27a); msm_acpu_clock_init(&msm7x2x_clock_data); /* Common functions for SURF/FFA/RUMI3 */ msm_device_i2c_init(); msm7x27a_init_ebi2(); #ifdef CONFIG_SERIAL_MSM_HS msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO); msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata; #endif msm_add_pmem_devices(); msm_add_fb_device(); platform_add_devices(m3eu_devices, ARRAY_SIZE(m3eu_devices)); /*7x25a kgsl initializations*/ msm7x25a_kgsl_3d0_init(); if (lge_get_uart_mode()) { if (lge_bd_rev == LGE_REV_A) platform_device_register(&msm_device_uart3); else platform_device_register(&msm_device_uart1); } lge_add_input_devices(); lge_add_misc_devices(); lge_add_mmc_devices(); lge_add_sound_devices(); lge_add_lcd_devices(); lge_add_camera_devices(); lge_add_pm_devices(); lge_add_usb_devices(); lge_add_connectivity_devices(); /* [email protected], for Bluetooth/FM */ /* gpio i2c devices should be registered at latest point */ lge_add_gpio_i2c_devices(); lge_add_ramconsole_devices(); #if defined(CONFIG_ANDROID_RAM_CONSOLE) && defined(CONFIG_LGE_HANDLE_PANIC) lge_add_panic_handler_devices(); #endif /* [email protected] [2011-09-22] - Read power on status and update boot reason */ #ifdef CONFIG_LGE_POWER_ON_STATUS_PATCH lge_board_pwr_on_status(); #endif }
static int zw_earjack_debugger_notifier_call(struct notifier_block *nb, unsigned long state, void *ptr) { struct earjack_debugger_device *dev = (struct earjack_debugger_device *)nb->ptr; switch (state) { case ZW_STATE_OFF: if (!zw_keep_uart_console()) { /* if earjack-debugger is detected, then enable */ if (earjack_debugger_detected(dev)) { unsigned int um = lge_get_uart_mode(); if (um & UART_MODE_INIT_BMSK) { dev->set_uart_console(1); } else { lge_set_uart_mode( um | UART_MODE_EN_BMSK); } } } break; case ZW_STATE_ON_SYSTEM: case ZW_STATE_ON_USER: if (!zw_keep_uart_console()) { /* if earjack-debugger is detected, then disable */ if (earjack_debugger_detected(dev)) { unsigned int um = lge_get_uart_mode(); if (um & UART_MODE_INIT_BMSK) { dev->set_uart_console(0); } else { lge_set_uart_mode( um & ~UART_MODE_EN_BMSK); } } } break; } return NOTIFY_DONE; }
static void __init msm7x30_init(void) { uint32_t soc_version = 0; if (socinfo_init() < 0) printk(KERN_ERR "%s: socinfo_init() failed!\n", __func__); soc_version = socinfo_get_version(); msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30); #ifdef CONFIG_SERIAL_MSM_CONSOLE if (lge_get_uart_mode()) msm7x30_init_uart2(); #endif msm_spm_init(&msm_spm_data, 1); msm_acpu_clock_init(&msm7x30_clock_data); msm_add_pmem_devices(); msm_add_fb_device(); msm_add_kgsl_device(); msm_add_usb_devices(); #if defined(CONFIG_LGE_MODEL_E739) msm7x30_init_marimba(); #endif #ifdef CONFIG_MSM7KV2_AUDIO lge_victor_audio_init(); msm_snddev_init(); aux_pcm_gpio_init(); #endif if (lge_get_uart_mode()) platform_device_register(&msm_device_uart2); //LGE_FW_TDMB [START] #if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) msm_device_tsif.dev.platform_data = &tsif_platform_data; #endif //LGE_FW_TDMB [END] platform_add_devices(devices, ARRAY_SIZE(devices)); msm_device_i2c_init(); msm_device_i2c_2_init(); qup_device_i2c_init(); #if defined(CONFIG_LGE_MODEL_E739) register_board_info(); #else msm7x30_init_marimba(); #endif #ifdef CONFIG_I2C_SSBI msm_device_ssbi6.dev.platform_data = &msm_i2c_ssbi6_pdata; msm_device_ssbi7.dev.platform_data = &msm_i2c_ssbi7_pdata; #endif /* initialize pm */ pmic8058_buses_init(); lge_pm_set_platform_data(); /* add lcd devices */ lge_add_lcd_devices(); /* add mmc devices */ lge_add_mmc_devices(); /* add misc devices */ lge_add_misc_devices(); /* add input devices */ lge_add_input_devices(); //LGE_FW_TDMB [START] #ifdef CONFIG_LGE_BROADCAST lge_add_broadcast_dmb_devices(); #endif //LGE_FW_TDMB [END] /* gpio i2c devices should be registered at latest point */ lge_add_gpio_i2c_devices(); /* add buletooth devices */ lge_add_btpower_devices(); /* add camera devices */ lge_add_camera_devices(); /* add ram console device */ #ifdef CONFIG_ANDROID_RAM_CONSOLE lge_add_ramconsole_devices(); #endif #if defined(CONFIG_ANDROID_RAM_CONSOLE) && defined(CONFIG_LGE_HANDLE_PANIC) lge_add_panic_handler_devices(); #endif }
static void __init msm7x30_init(void) { uint32_t soc_version = 0; if (socinfo_init() < 0) printk(KERN_ERR "%s: socinfo_init() failed!\n", __func__); soc_version = socinfo_get_version(); msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30); #ifdef CONFIG_SERIAL_MSM_CONSOLE if (lge_get_uart_mode()) msm7x30_init_uart2(); #endif msm_spm_init(&msm_spm_data, 1); msm_acpu_clock_init(&msm7x30_clock_data); msm_add_pmem_devices(); msm_add_fb_device(); msm_add_kgsl_device(); msm_add_usb_devices(); msm7x30_init_marimba(); #ifdef CONFIG_MSM7KV2_AUDIO lge_victor_audio_init(); msm_snddev_init(); aux_pcm_gpio_init(); #endif if (lge_get_uart_mode()) platform_device_register(&msm_device_uart2); platform_add_devices(devices, ARRAY_SIZE(devices)); msm_device_i2c_init(); msm_device_i2c_2_init(); qup_device_i2c_init(); register_board_info(); #ifdef CONFIG_I2C_SSBI msm_device_ssbi6.dev.platform_data = &msm_i2c_ssbi6_pdata; msm_device_ssbi7.dev.platform_data = &msm_i2c_ssbi7_pdata; #endif /* initialize pm */ pmic8058_buses_init(); pmic8058_leds_init(); // LGE_UPDATE [email protected]. PMIC LED Control Drv. lge_pm_set_platform_data(); pm8058_special_clock0_setting(); /* add lcd devices */ lge_add_lcd_devices(); /* add mmc devices */ lge_add_mmc_devices(); /* add misc devices */ lge_add_misc_devices(); /* add input devices */ lge_add_input_devices(); /* gpio i2c devices should be registered at latest point */ lge_add_gpio_i2c_devices(); /* add buletooth devices */ lge_add_btpower_devices(); /* add camera devices */ lge_add_camera_devices(); /* add ram console device */ #ifdef CONFIG_ANDROID_RAM_CONSOLE lge_add_ramconsole_devices(); #endif #if defined(CONFIG_ANDROID_RAM_CONSOLE) && defined(CONFIG_LGE_HANDLE_PANIC) lge_add_panic_handler_devices(); #endif }
static int __devinit earjack_debugger_probe(struct platform_device *pdev) { int ret = 0; struct earjack_debugger_device *adev; struct earjack_debugger_platform_data *pdata; unsigned int um = 0; if (pdev->dev.of_node) { pdata = devm_kzalloc(&pdev->dev, sizeof(struct earjack_debugger_platform_data), GFP_KERNEL); if (pdata == NULL) { pr_err("%s: no pdata\n", __func__); return -ENOMEM; } pdev->dev.platform_data = pdata; earjack_debugger_parse_dt(&pdev->dev, pdata); } else { pdata = pdev->dev.platform_data; } if (!pdata) { pr_err("%s: no pdata\n", __func__); return -ENOMEM; } adev = kzalloc(sizeof(struct earjack_debugger_device), GFP_KERNEL); if (!adev) { pr_err("%s: no memory\n", __func__); return -ENOMEM; } adev->gpio = pdata->gpio_trigger; adev->irq = gpio_to_irq(pdata->gpio_trigger); adev->set_uart_console = msm_serial_set_uart_console; platform_set_drvdata(pdev, adev); ret = gpio_request_one(adev->gpio, GPIOF_IN, "gpio_earjack_debugger"); if (ret < 0) { pr_err("%s: failed to request gpio %d\n", __func__, adev->gpio); goto err_gpio_request; } ret = request_threaded_irq(adev->irq, NULL, earjack_debugger_irq_handler, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, "earjack_debugger_trigger", adev); if (ret < 0) { pr_err("%s: failed to request irq\n", __func__); goto err_request_irq; } um = lge_get_uart_mode(); if (earjack_debugger_detected(adev)) adev->set_uart_console(1); #ifdef CONFIG_ZERO_WAIT zw_notifier_chain_register(&zw_earjack_debugger_nb, adev); #endif pr_info("earjack debugger probed\n"); return ret; err_request_irq: gpio_free(adev->gpio); err_gpio_request: kfree(adev); return ret; }
static void __init msm7x2x_init(void) { if (socinfo_init() < 0) BUG(); msm_clock_init(msm_clocks_7x27, msm_num_clocks_7x27); #if defined(CONFIG_MSM_SERIAL_DEBUGGER) msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3, &msm_device_uart3.dev, 1); #endif if (cpu_is_msm7x27()) msm7x2x_clock_data.max_axi_khz = 200000; msm_acpu_clock_init(&msm7x2x_clock_data); msm_add_pmem_devices(); msm_add_fb_device(); #if !defined(CONFIG_MSM_SERIAL_DEBUGGER) if (lge_get_uart_mode()) platform_device_register(&msm_device_uart3); #endif platform_add_devices(devices, ARRAY_SIZE(devices)); #ifdef CONFIG_ARCH_MSM7X27 msm_add_kgsl_device(); #endif msm_add_usb_devices(); #ifdef CONFIG_MSM_CAMERA config_camera_off_gpios(); /* might not be necessary */ #endif msm_device_i2c_init(); i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices)); if (cpu_is_msm7x27()) msm_pm_set_platform_data(msm7x27_pm_data, ARRAY_SIZE(msm7x27_pm_data)); else msm_pm_set_platform_data(msm7x25_pm_data, ARRAY_SIZE(msm7x25_pm_data)); msm7x27_wlan_init(); swift_init_gpio_i2c_devices(); #ifdef CONFIG_ANDROID_RAM_CONSOLE lge_add_ramconsole_devices(); lge_add_ers_devices(); lge_add_panic_handler_devices(); #endif lge_add_camera_devices(); lge_add_lcd_devices(); lge_add_btpower_devices(); lge_add_mmc_devices(); lge_add_input_devices(); lge_add_misc_devices(); lge_add_pm_devices(); /* gpio i2c devices should be registered at latest point */ lge_add_gpio_i2c_devices(); /* initialize timed_output vibrator */ swift_init_timed_vibrator(); }