int cmc221_init_modemctl_device(struct modem_ctl *mc,
			struct modem_data *pdata)
{
	int ret = 0;
	struct platform_device *pdev;

	mc->gpio_cp_on = pdata->gpio_cp_on;
	mc->gpio_reset_req_n = pdata->gpio_reset_req_n;
	mc->gpio_cp_reset = pdata->gpio_cp_reset;
	mc->gpio_pda_active = pdata->gpio_pda_active;
	mc->gpio_phone_active = pdata->gpio_phone_active;
	mc->gpio_cp_dump_int = pdata->gpio_cp_dump_int;
	mc->gpio_flm_uart_sel = pdata->gpio_flm_uart_sel;
	mc->gpio_cp_warm_reset = pdata->gpio_cp_warm_reset;
	mc->gpio_cp_off = pdata->gpio_cp_off;
	mc->gpio_slave_wakeup = pdata->gpio_slave_wakeup;
	mc->gpio_host_active = pdata->gpio_host_active;
	mc->gpio_host_wakeup = pdata->gpio_host_wakeup;

	pdev = to_platform_device(mc->dev);
	mc->irq_phone_active = platform_get_irq(pdev, 0);
	mc->irq_host_wakeup = platform_get_irq(pdev, 1);

	cmc221_get_ops(mc);

	dev_set_drvdata(mc->dev, mc);

	INIT_DELAYED_WORK(&mc->dwork, mc_work);

	ret = request_irq(mc->irq_phone_active, phone_active_irq_handler,
			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
			"phone_active", mc);
	if (ret) {
		pr_err("[MODEM_IF] Failed to allocate an interrupt(%d)\n",
							mc->irq_phone_active);
		goto irq_fail;
	}
	mc->irq[0] = mc->irq_phone_active;
	enable_irq_wake(mc->irq_phone_active);
	/*disable_irq(mc->irq_phone_active);*/

	return ret;

irq_fail:
	kfree(mc);
	return ret;
}
int cmc221_init_modemctl_device(struct modem_ctl *mc, struct modem_data *pdata)
{
	int ret = 0;
	int irq = 0;
	unsigned long flag = 0;
	struct platform_device *pdev = NULL;

	mc->gpio_cp_on        = pdata->gpio_cp_on;
	mc->gpio_cp_reset     = pdata->gpio_cp_reset;
	mc->gpio_phone_active = pdata->gpio_phone_active;
	mc->gpio_pda_active   = pdata->gpio_pda_active;
#if 0	/*TODO: check the GPIO map*/
	mc->gpio_cp_dump_int  = pdata->gpio_cp_dump_int;
	mc->gpio_flm_uart_sel = pdata->gpio_flm_uart_sel;
	mc->gpio_slave_wakeup = pdata->gpio_slave_wakeup;
	mc->gpio_host_active  = pdata->gpio_host_active;
	mc->gpio_host_wakeup  = pdata->gpio_host_wakeup;
#endif
	mc->gpio_dynamic_switching = pdata->gpio_dynamic_switching;
	mc->need_switch_to_usb = false;

	if (!mc->gpio_cp_on || !mc->gpio_cp_reset || !mc->gpio_phone_active) {
		mif_err("%s: ERR! no GPIO data\n", mc->name);
		return -ENXIO;
	}

	gpio_set_value(mc->gpio_cp_reset, 0);
	gpio_set_value(mc->gpio_cp_on, 0);

	cmc221_get_ops(mc);
	dev_set_drvdata(mc->dev, mc);

	pdev = to_platform_device(mc->dev);
	mc->irq_phone_active = platform_get_irq_byname(pdev, "cp_active_irq");
	if (!mc->irq_phone_active) {
		mif_err("%s: ERR! get cp_active_irq fail\n", mc->name);
		return -1;
	}
	mif_err("%s: PHONE_ACTIVE IRQ# = %d\n", mc->name, mc->irq_phone_active);

	wake_lock_init(&mc->mc_wake_lock, WAKE_LOCK_SUSPEND, "cmc_wake_lock");

	flag = IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND;
	irq = mc->irq_phone_active;
	ret = request_irq(irq, phone_active_handler, flag, "cmc_active", mc);
	if (ret) {
		mif_err("%s: ERR! request_irq(#%d) fail (err %d)\n",
			mc->name, irq, ret);
		return ret;
	}
	ret = enable_irq_wake(irq);
	if (ret) {
		mif_err("%s: WARNING! enable_irq_wake(#%d) fail (err %d)\n",
			mc->name, irq, ret);
	}

	flag = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND;
	if (mc->gpio_dynamic_switching) {
		irq = gpio_to_irq(mc->gpio_dynamic_switching);
		mif_err("%s: DYNAMIC_SWITCH IRQ# = %d\n", mc->name, irq);
		ret = request_irq(irq, dynamic_switching_handler, flag,
				"dynamic_switching", mc);
		if (ret) {
			mif_err("%s: ERR! request_irq(#%d) fail (err %d)\n",
				mc->name, irq, ret);
			return ret;
		}
	}

	return 0;
}
int cmc221_init_modemctl_device(struct modem_ctl *mc, struct modem_data *pdata)
{
	int ret = 0;
	int irq = 0;
	unsigned long flag = 0;

	mc->gpio_cp_on = pdata->gpio_cp_on;
	mc->gpio_cp_reset = pdata->gpio_cp_reset;
	mc->gpio_phone_active = pdata->gpio_phone_active;
	mc->gpio_pda_active = pdata->gpio_pda_active;
#if 0	/*TODO: check the GPIO map*/
	mc->gpio_cp_dump_int = pdata->gpio_cp_dump_int;
	mc->gpio_flm_uart_sel = pdata->gpio_flm_uart_sel;
	mc->gpio_slave_wakeup = pdata->gpio_slave_wakeup;
	mc->gpio_host_active = pdata->gpio_host_active;
	mc->gpio_host_wakeup = pdata->gpio_host_wakeup;
#endif
	mc->gpio_link_switch = pdata->gpio_link_switch;
	mc->need_switch_to_usb = false;
#ifdef CONFIG_EXYNOS4_CPUFREQ
	mc->gpio_cpufreq_lock = pdata->gpio_cpufreq_lock;
#endif
	if (!mc->gpio_cp_on || !mc->gpio_cp_reset || !mc->gpio_phone_active) {
		mif_err("%s: ERR! no GPIO data\n", mc->name);
		return -ENXIO;
	}

	gpio_set_value(mc->gpio_cp_reset, 0);
	gpio_set_value(mc->gpio_cp_on, 0);

	cmc221_get_ops(mc);
	dev_set_drvdata(mc->dev, mc);

	mc->irq_phone_active = pdata->irq_phone_active;
	if (!mc->irq_phone_active) {
		mif_err("%s: ERR! get irq_phone_active fail\n", mc->name);
		return -1;
	}
	mif_err("%s: PHONE_ACTIVE IRQ# = %d\n", mc->name, mc->irq_phone_active);

	wake_lock_init(&mc->mc_wake_lock, WAKE_LOCK_SUSPEND, "cmc_wake_lock");

	flag = IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND;
	irq = mc->irq_phone_active;
	ret = request_irq(irq, phone_active_handler, flag, "cmc_active", mc);
	if (ret) {
		mif_err("%s: ERR! request_irq(#%d) fail (err %d)\n",
			mc->name, irq, ret);
		return ret;
	}
	ret = enable_irq_wake(irq);
	if (ret) {
		mif_err("%s: WARNING! enable_irq_wake(#%d) fail (err %d)\n",
			mc->name, irq, ret);
	}

	flag = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND;
	if (mc->gpio_link_switch) {
		irq = gpio_to_irq(mc->gpio_link_switch);
		mif_err("%s: DYNAMIC_SWITCH IRQ# = %d\n", mc->name, irq);
		ret = request_irq(irq, dynamic_switching_handler, flag,
				"dynamic_switching", mc);
		if (ret) {
			mif_err("%s: ERR! request_irq(#%d) fail (err %d)\n",
				mc->name, irq, ret);
			return ret;
		}
	}

#ifdef CONFIG_EXYNOS4_CPUFREQ
	INIT_DELAYED_WORK(&mc->work_cpu_lock, cmc221_cpufreq_lock);
	INIT_DELAYED_WORK(&mc->work_cpu_unlock, cmc221_cpufreq_unlock);

	flag = IRQF_TRIGGER_RISING;
	if (mc->gpio_cpufreq_lock) {
		irq = gpio_to_irq(mc->gpio_cpufreq_lock);
		mif_err("%s: CPUFREQ_LOCK_CNT IRQ# = %d\n", mc->name, irq);
		ret = request_irq(irq, cpufreq_lock_handler, flag,
				"cpufreq_lock", mc);
		if (ret) {
			mif_err("%s: ERR! request_irq(#%d) fail (err %d)\n",
				mc->name, irq, ret);
			return ret;
		}
	}
#endif

	return 0;
}