void __init msm8960_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	msm8960_sdc1_data.swfi_latency = msm_rpm_get_swfi_latency();
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	/* SDC2: SDIO slot for WLAN*/
	msm_add_sdcc(2, &msm8960_sdc2_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	msm8960_sdc3_data.swfi_latency = msm_rpm_get_swfi_latency();
	/* SDC3: External card slot */
#ifdef CONFIG_HUAWEI_KERNEL
    if(false == get_sdcard_drive_current_val("sdcard/TLMM_HDRV_SDC3_CLK/drive_current",&(sdc3_pad_drv_on_cfg[0].val)))
    {
       printk(KERN_WARNING "cannot read sdc3_clk drive current, use default");
    }
    printk(KERN_WARNING "sdc3_clk drive current is %d", sdc3_pad_drv_on_cfg[0].val);
#endif
	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	/* SDC4: SDIO slot for WLAN */
	msm_add_sdcc(4, &msm8960_sdc4_data);
#endif
}
Example #2
0
int __init buzz_init_mmc(unsigned int sys_rev)
{
	uint32_t id;
	wifi_status_cb = NULL;
	sdslot_vreg_enabled = 0;

	printk(KERN_INFO "%s\n", __func__);

	/* initial WIFI_SHUTDOWN */
	id = PCOM_GPIO_CFG(BUZZ_GPIO_WIFI_EN, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
	msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);

	msm_add_sdcc(1, &buzz_wifi_data, 0, 0);


	if (opt_disable_sdcard) {
		printk(KERN_INFO "buzz: SD-Card interface disabled\n");
		goto done;
	}

	vreg_sdslot = vreg_get(0, "gp6");
	if (IS_ERR(vreg_sdslot))
		return PTR_ERR(vreg_sdslot);

	set_irq_wake(MSM_GPIO_TO_INT(BUZZ_GPIO_SDMC_CD_N), 1);

	msm_add_sdcc(2, &buzz_sdslot_data,
		MSM_GPIO_TO_INT(BUZZ_GPIO_SDMC_CD_N),
		IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE);

done:

	return 0;
}
void __init msm8960_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/*
	 * When eMMC runs in DDR mode on CDP platform, we have
	 * seen instability due to DATA CRC errors. These errors are
	 * attributed to long physical path between MSM and eMMC on CDP.
	 * So let's not enable the DDR mode on CDP platform but let other
	 * platforms take advantage of eMMC DDR mode.
	 */
	if (!machine_is_msm8960_cdp())
		msm8960_sdc1_data.uhs_caps |= (MMC_CAP_1_8V_DDR |
					       MMC_CAP_UHS_DDR50);
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	/* SDC2: SDIO slot for WLAN*/
	msm_add_sdcc(2, &msm8960_sdc2_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/* SDC3: External card slot */
	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	/* SDC4: SDIO slot for WLAN */
	msm_add_sdcc(4, &msm8960_sdc4_data);
#endif
}
Example #4
0
static void __init msm9615_init_mmc(void)
{
	int ret;

	if (msm9615_sdc1_pdata) {
		ret = gpio_request(GPIO_SDCARD_PWR_EN, "SDCARD_PWR_EN");

		if (ret) {
			pr_err("%s: sdcc1: Error requesting GPIO "
				"SDCARD_PWR_EN:%d\n", __func__, ret);
		} else {
			ret = gpio_direction_output(GPIO_SDCARD_PWR_EN, 1);
			if (ret) {
				pr_err("%s: sdcc1: Error setting o/p direction"
					" for GPIO SDCARD_PWR_EN:%d\n",
					__func__, ret);
				gpio_free(GPIO_SDCARD_PWR_EN);
			} else {
				msm_add_sdcc(1, msm9615_sdc1_pdata);
			}
		}
	}

	if (msm9615_sdc2_pdata) {
		msm_gpiomux_install(msm9615_sdcc2_configs,
			ARRAY_SIZE(msm9615_sdcc2_configs));

		/* SDC2: External card slot */
		msm_add_sdcc(2, msm9615_sdc2_pdata);
	}
}
Example #5
0
static void __init msm7x27_init_mmc(void)
{
	if (machine_is_msm7x27_ffa()) {
		mpp_mmc = mpp_get(NULL, "mpp3");
		if (!mpp_mmc) {
			printk(KERN_ERR "%s: mpp get failed (%ld)\n",
			       __func__, PTR_ERR(vreg_mmc));
			return;
		}
	} else {
		vreg_mmc = vreg_get(NULL, "mmc");
		if (IS_ERR(vreg_mmc)) {
			printk(KERN_ERR "%s: vreg get failed (%ld)\n",
			       __func__, PTR_ERR(vreg_mmc));
			return;
		}
	}

	sdcc_gpio_init();
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	msm_add_sdcc(1, &msm7x27_sdcc_data, 0, 0);
#endif

	if (machine_is_msm7x27_surf()) {
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
		msm_add_sdcc(2, &msm7x27_sdcc_data, 0, 0);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
		msm_add_sdcc(3, &msm7x27_sdcc_data, 0, 0);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
		msm_add_sdcc(4, &msm7x27_sdcc_data, 0, 0);
#endif
	}
}
/* ---- MMC ---- */
int __init rider_init_mmc()
{
	uint32_t id;
	wifi_status_cb = NULL;

	printk(KERN_INFO "rider: %s\n", __func__);

	/* SDC2: WiMax */
	msm_add_sdcc(2, &mmc_wimax_data);

	// re-initialize wimax GPIO
	config_gpio_table(wimax_off_gpio_table,
			  ARRAY_SIZE(wimax_off_gpio_table));

	// Configure UART3 TX/RX
    config_gpio_table(wimax_uart_off_gpio_table,
			  ARRAY_SIZE(wimax_uart_off_gpio_table));

	// re-initialize HOST WAKEUP
    pm8058_gpio_config(RIDER_WIMAX_HOST_WAKEUP, &host_wakeup_withoutWIMAX_cfg);

	/* SDC4: WiFi */
	/* initial WIFI_SHUTDOWN# */
	id = GPIO_CFG(RIDER_GPIO_WIFI_SHUTDOWN_N, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
	gpio_tlmm_config(id, 0);
	gpio_set_value(RIDER_GPIO_WIFI_SHUTDOWN_N, 0);

	msm_add_sdcc(4, &rider_wifi_data);

	return 0;
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8930_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 2) ||
			machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.vreg_data->vdd_data->always_on = false;
		msm8930_sdc3_data.vreg_data->vdd_data->reset_at_init = false;
	}
	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8930_sdc3_data.wpswitch_gpio = 0;
		msm8930_sdc3_data.wpswitch_polarity = 0;
	}
	msm_add_sdcc(3, &msm8930_sdc3_data);
#endif
}
static void __init msm7x2x_init_mmc(void)
{
	if (!machine_is_msm7x25_ffa() && !machine_is_msm7x27_ffa()) {
		vreg_mmc = vreg_get(NULL, "wlan");
		if (IS_ERR(vreg_mmc)) {
			printk(KERN_ERR "%s: vreg get failed (%ld)\n",
			       __func__, PTR_ERR(vreg_mmc));
			return;
		}
	}

	sdcc_gpio_init();
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	msm_add_sdcc(1, &msm7x2x_sdc1_data);
#endif	
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
/* LGE_CHANGE_S [[email protected]] 2010-04-24, BCM4325 control */
#if defined(CONFIG_LGE_BCM432X_PATCH)
	/* GPIO config */
	gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_REGON, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
	gpio_set_value(CONFIG_BCM4325_GPIO_WL_REGON, 0);
	
	gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_RESET, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
	gpio_set_value(CONFIG_BCM4325_GPIO_WL_RESET, 0);
	
	gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_HOSTWAKEUP, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE);

	/* Register platform device */
    msm_add_sdcc(2, &bcm432x_sdcc_wlan_data);

	/* Enable RESET IRQ for wlan card detect */
	enable_irq(gpio_to_irq(CONFIG_BCM4325_GPIO_WL_RESET));
#endif
}
int __init vision_init_mmc(unsigned int sys_rev)
{
	uint32_t id;
	wifi_status_cb = NULL;
	sdslot_vreg_enabled = 0;

	printk(KERN_INFO "vision: %s\n", __func__);
	/* SDC2: MoviNAND */
	config_gpio_table(movinand_on_gpio_table,
			  ARRAY_SIZE(movinand_on_gpio_table));
	msm_add_sdcc(2, &vision_movinand_data, 0, 0);

	/* initial WIFI_SHUTDOWN# */
	id = PCOM_GPIO_CFG(VISION_GPIO_WIFI_SHUTDOWN_N, 0, GPIO_OUTPUT,
		GPIO_NO_PULL, GPIO_2MA),
	msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);
	gpio_set_value(VISION_GPIO_WIFI_SHUTDOWN_N, 0);

	msm_add_sdcc(3, &vision_wifi_data, 0, 0);

	if (opt_disable_sdcard) {
		printk(KERN_INFO "vision: SD-Card interface disabled\n");
		goto done;
	}

	vreg_sdslot = vreg_get(0, "gp10");
	if (IS_ERR(vreg_sdslot))
		return PTR_ERR(vreg_sdslot);

	msm_add_sdcc(4, &vision_sdslot_data, 0, 0);

done:

	return 0;
}
void __init msm8960_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	int ret = 0;
#endif

#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	/* SDC2: SDIO slot for WIMAX*/
	/* msm_add_sdcc(2, &msm8960_sdc2_data);*/
	/* SDC2 : WiMAX connected */
	ret = valente_wx_c9_init_mmc();
	if (ret != 0)
		printk(KERN_ERR "%s: Unable to initialize MMC (SDCC2)\n", __func__);

#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/* SDC3: External card slot */
	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	/* SDC4: SDIO slot for WLAN */
	msm_add_sdcc(4, &msm8960_sdc4_data);
#endif
}
Example #11
0
static void __init qsd8x50_init_mmc(void)
{
	if (machine_is_qsd8x50_ffa())
		vreg_mmc = vreg_get(NULL, "gp6");
	else
		vreg_mmc = vreg_get(NULL, "gp5");

	if (IS_ERR(vreg_mmc)) {
		printk(KERN_ERR "%s: vreg get failed (%ld)\n",
		       __func__, PTR_ERR(vreg_mmc));
		return;
	}

	sdcc_gpio_init();
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	msm_add_sdcc(1, &qsd8x50_sdcc_data);
#endif

	if (machine_is_qsd8x50_surf()) {
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
		msm_add_sdcc(2, &qsd8x50_sdcc_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
		msm_add_sdcc(3, &qsd8x50_sdcc_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
		msm_add_sdcc(4, &qsd8x50_sdcc_data);
#endif
	}

}
int __init desirec_init_mmc(unsigned int sys_rev)
{
	wifi_status_cb = NULL;
	sdslot_vreg_enabled = 0;

	vreg_wifi_osc = vreg_get(0, "gp4");
	if (IS_ERR(vreg_wifi_osc))
		return PTR_ERR(vreg_wifi_osc);
	vreg_set_level(vreg_wifi_osc, 1800);

	msm_add_sdcc(1, &desirec_wifi_data, 0, 0); /* r porting 29: change func*/

	if (opt_disable_sdcard) {
		printk(KERN_INFO "desirec: SD-Card interface disabled\n");
		goto done;
	}

	vreg_sdslot = vreg_get(0, "gp6");
	if (IS_ERR(vreg_sdslot))
		return PTR_ERR(vreg_sdslot);

	set_irq_wake(MSM_GPIO_TO_INT(DESIREC_GPIO_SDMC_CD_N), 1);

	msm_add_sdcc(2, &desirec_sdslot_data, MSM_GPIO_TO_INT(DESIREC_GPIO_SDMC_CD_N),
		IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE); /* r porting 29 */

done:
	return 0;
}
int __init htcleo_init_mmc(unsigned debug_uart)
{
	printk("%s()+\n", __func__);

	msm_add_sdcc(1, &htcleo_sdslot_data,0,0);
        msm_add_sdcc(2, &htcleo_wifi_data,0,0);

	return 0;
}
void __init msm9615_init_mmc(void)
{
	if (msm9615_sdc1_pdata)
		/* SDC1: External card slot for SD/MMC cards */
		msm_add_sdcc(1, msm9615_sdc1_pdata);

	if (msm9615_sdc2_pdata)
		/* SDC2: External card slot used for WLAN */
		msm_add_sdcc(2, msm9615_sdc2_pdata);
}
Example #15
0
int __init vision_init_mmc(unsigned int sys_rev)
{
	uint32_t id;
	wifi_status_cb = NULL;
	/*sdslot_vreg_enabled = 0;*/

	printk(KERN_INFO "vision: %s\n", __func__);
	/* SDC2: MoviNAND */
	/*
	register_msm_irq_mask(INT_SDC2_0);
	register_msm_irq_mask(INT_SDC2_1);
	*/
	config_gpio_table(movinand_on_gpio_table,
			  ARRAY_SIZE(movinand_on_gpio_table));
#if 0
	msm_add_sdcc(2, &vision_movinand_data, 0, 0);
#endif

	/* initial WIFI_SHUTDOWN# */
	id = PCOM_GPIO_CFG(VISION_GPIO_WIFI_SHUTDOWN_N, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
	msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);
	gpio_set_value(VISION_GPIO_WIFI_SHUTDOWN_N, 0);

	msm_add_sdcc(3, &vision_wifi_data);

#if 0
	register_msm_irq_mask(INT_SDC4_0);
	register_msm_irq_mask(INT_SDC4_1);
#endif

#if 0
	if (opt_disable_sdcard) {
		printk(KERN_INFO "vision: SD-Card interface disabled\n");
		goto done;
	}

	vreg_sdslot = vreg_get(0, "gp10");
	if (IS_ERR(vreg_sdslot))
		return PTR_ERR(vreg_sdslot);

	set_irq_wake(MSM_GPIO_TO_INT(VISION_SDMC_CD_N_TO_SYS), 1);

	msm_add_sdcc(4, &vision_sdslot_data,
			MSM_GPIO_TO_INT(VISION_SDMC_CD_N_TO_SYS),
			IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE);
done:
#endif

	/* reset eMMC for write protection test */
	gpio_set_value(VISION_GPIO_EMMC_RST, 0);	/* this should not work!!! */
	udelay(100);
	gpio_set_value(VISION_GPIO_EMMC_RST, 1);

	return 0;
}
Example #16
0
int __init bravo_init_mmc(unsigned int sys_rev, unsigned debug_uart)
{
	uint32_t id;

	printk("%s()+\n", __func__);

	/* initial WIFI_SHUTDOWN# */
	id = PCOM_GPIO_CFG(BRAVO_GPIO_WIFI_SHUTDOWN_N, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
	msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);

	msm_add_sdcc(1, &bravo_wifi_data, 0, 0);

	if (debug_uart) {
		pr_info("%s: sdcard disabled due to debug uart\n", __func__);
		goto done;
	}
	if (opt_disable_sdcard) {
		pr_info("%s: sdcard disabled on cmdline\n", __func__);
		goto done;
	}

	sdslot_vreg_enabled = 0;

	if (is_cdma_version(sys_rev)) {
		/* In the CDMA version, sdslot is supplied by a gpio. */
		int rc = gpio_request(BRAVO_CDMA_SD_2V85_EN, "sdslot_en");
		if (rc < 0) {
			pr_err("%s: gpio_request(%d) failed: %d\n", __func__,
				BRAVO_CDMA_SD_2V85_EN, rc);
			return rc;
		}
		bravo_sdslot_data.translate_vdd = bravo_cdma_sdslot_switchvdd;
	} else {
		/* in UMTS version, sdslot is supplied by pmic */
		sdslot_vreg = vreg_get(0, "gp6");
		if (IS_ERR(sdslot_vreg))
			return PTR_ERR(sdslot_vreg);
	}

//	if (system_rev > 0)
		bravo_sdslot_data.status = bravo_sdslot_status;
		msm_add_sdcc(2, &bravo_sdslot_data, 0, 0);
//	else {
//		bravo_sdslot_data.status = bravo_sdslot_status;
//		bravo_sdslot_data.register_status_notify = NULL;
//		set_irq_wake(MSM_GPIO_TO_INT(BRAVO_GPIO_SDMC_CD_N), 1);
//		msm_add_sdcc(2, &bravo_sdslot_data,
//			     MSM_GPIO_TO_INT(BRAVO_GPIO_SDMC_CD_N),
//			     IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE);
//	}

done:
	printk("%s()-\n", __func__);
	return 0;
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/* SDC3: External card slot */
	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
}
int __init bravo_init_mmc(unsigned int sys_rev)
{
	uint32_t id;
	struct cnf_driver *microp_sdcard_detect;

	wifi_status_cb = NULL;

	printk(KERN_INFO "%s()+\n", __func__);

	/* initial WIFI_SHUTDOWN# */
	id = PCOM_GPIO_CFG(127, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
	msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);
	gpio_set_value(127, 0);

	msm_add_sdcc(1, &bravo_wifi_data, 0, 0);

	if (opt_disable_sdcard) {
		pr_info("%s: sdcard disabled on cmdline\n", __func__);
		goto done;
	}

	sdslot_vreg_enabled = 0;

	sdslot_vreg = vreg_get(0, "gp6");
	if (IS_ERR(sdslot_vreg))
		return PTR_ERR(sdslot_vreg);

	if (bravo_sd_gpio()) {
		set_irq_wake(MSM_GPIO_TO_INT(BRAVO_GPIO_SDMC_CD_N), 1);

		msm_add_sdcc(2, &bravo_sdslot_data,
			     MSM_GPIO_TO_INT(BRAVO_GPIO_SDMC_CD_N),
			     IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE);
	} else {
		microp_sdcard_detect = kzalloc(sizeof(struct cnf_driver),
							GFP_KERNEL);
		if (microp_sdcard_detect) {
			microp_sdcard_detect->name = "sdcard_detect";
			microp_sdcard_detect->func = (void *) &microp_check_status;
		} else {
			printk(KERN_ERR "%s: Alloc SD callback func error\n",
						__func__);
			goto done;
		}
		cnf_driver_register(microp_sdcard_detect);

		msm_add_sdcc(2, &bravo_sdslot_data, 0, 0);
	}

done:
	printk(KERN_INFO "%s()-\n", __func__);
	return 0;
}
static int __init delta_platform_wifi_init(void)
{
    if (!strncmp("TI1271", driver, 6)) {
        printk(KERN_INFO "Adding platform driver for TI1271...\n");
        return msm_add_sdcc(3, &msm7x27_sdcc_data2_TIWLAN);
    }
    else {
        printk(KERN_INFO "Adding platform driver for WL12XX...\n");
        delta_wifi_init();
        return msm_add_sdcc(2, &msm7x27_sdcc_data2);
    }
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/*
	 * When eMMC runs in DDR mode on CDP platform, we have
	 * seen instability due to DATA CRC errors. These errors are
	 * attributed to long physical path between MSM and eMMC on CDP.
	 * So let's not enable the DDR mode on CDP platform but let other
	 * platforms take advantage of eMMC DDR mode.
	 */
	if (!machine_is_msm8930_cdp())
		msm8960_sdc1_data.uhs_caps |= (MMC_CAP_1_8V_DDR |
					       MMC_CAP_UHS_DDR50);
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) >= 2) ||
			machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.vreg_data->vdd_data->always_on = false;
		msm8960_sdc3_data.vreg_data->vdd_data->reset_at_init = false;
	}

	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.wpswitch_gpio = 0;
		msm8960_sdc3_data.is_wpswitch_active_low = false;
	}
	
	/* Emily Jiang, 20130326, modify clk rate from MMC_CAP_UHS_SDR104 to MMC_CAP_UHS_SDR25,in order to support UHS-1 SDR104 sd card. {*/  
	if ( msm_project_id <= SAPPORO && system_rev >= EVT0) {
		msm8960_sdc3_data.uhs_caps |= (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
			MMC_CAP_MAX_CURRENT_800);
	} else { 
		// unknown project
		msm8960_sdc3_data.uhs_caps |= (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
			MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 |
			MMC_CAP_UHS_SDR104 | MMC_CAP_MAX_CURRENT_800);
	}
	/* } Emily Jiang, 20130326, modify clk rate from MMC_CAP_UHS_SDR104 to MMC_CAP_UHS_SDR25,in order to support UHS-1 SDR104 sd card. */
	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
}
int __init mecha_init_mmc(unsigned int sys_rev)
{
	uint32_t id;
	wifi_status_cb = NULL;
	/*sdslot_vreg_enabled = 0;*/

	printk(KERN_INFO "mecha: %s\n", __func__);
	/* SDC1: MoviNAND */
#if 0
	register_msm_irq_mask(INT_SDC1_0);
	register_msm_irq_mask(INT_SDC1_1);
	config_gpio_table(movinand_on_gpio_table,
			  ARRAY_SIZE(movinand_on_gpio_table));
	msm_add_sdcc(1, &mecha_movinand_data, 0, 0);

	/* SDC2: SVLTE (MDM9K) */
	config_gpio_table(svlte_on_gpio_table,
			  ARRAY_SIZE(svlte_on_gpio_table));
	msm_add_sdcc(2, &mecha_svlte_data, 0, 0);
#endif

	/* SDC3: WIFI */
	/* initial WIFI_SHUTDOWN# */
	id = PCOM_GPIO_CFG(MECHA_GPIO_WIFI_SHUTDOWN_N, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
	msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);
	gpio_set_value(MECHA_GPIO_WIFI_SHUTDOWN_N, 0);
	msm_add_sdcc(3, &mecha_wifi_data);

#if 0
	/* SDC4: SD */
	register_msm_irq_mask(INT_SDC4_0);
	register_msm_irq_mask(INT_SDC4_1);
	if (opt_disable_sdcard) {
		printk(KERN_INFO "mecha: SD-Card interface disabled\n");
		goto done;
	}

	vreg_sdslot = vreg_get(0, "gp10");
	if (IS_ERR(vreg_sdslot))
		return PTR_ERR(vreg_sdslot);

	msm_add_sdcc(4, &mecha_sdslot_data, 0, 0);
done:
#endif

	/* reset eMMC for write protection test */
	gpio_set_value(MECHA_GPIO_EMMC_RST, 0);	/* this should not work!!! */
	udelay(100);
	gpio_set_value(MECHA_GPIO_EMMC_RST, 1);

	return 0;
}
Example #22
0
static void __init msm7x2x_init_mmc(void)
{
	if (!machine_is_msm7x25_ffa() && !machine_is_msm7x27_ffa()) {
		vreg_mmc = vreg_get(NULL, "gp6");
		if (IS_ERR(vreg_mmc)) {
			printk(KERN_ERR "%s: vreg get failed (%ld)\n",
			       __func__, PTR_ERR(vreg_mmc));
			return;
		}
	}

	sdcc_gpio_init();
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	msm_add_sdcc(1, &msm7x2x_sdcc_data);
#endif	
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT


#if defined(CONFIG_LGE_BCM432X_PATCH)

	
	gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_REGON, 0, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_2MA), GPIO_ENABLE);
	gpio_configure(CONFIG_BCM4325_GPIO_WL_REGON, GPIOF_DRIVE_OUTPUT);
	gpio_set_value(CONFIG_BCM4325_GPIO_WL_REGON, 0);
	
	gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_RESET, 0, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_2MA), GPIO_ENABLE);
	gpio_configure(CONFIG_BCM4325_GPIO_WL_RESET, GPIOF_DRIVE_OUTPUT);
	gpio_set_value(CONFIG_BCM4325_GPIO_WL_RESET, 0);
	
	
	gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_HOSTWAKEUP, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), GPIO_ENABLE);
	
	gpio_configure(CONFIG_BCM4325_GPIO_WL_HOSTWAKEUP, GPIOF_INPUT);

	
    msm_add_sdcc(2, &bcm432x_sdcc_wlan_data);

	
	enable_irq(gpio_to_irq(CONFIG_BCM4325_GPIO_WL_RESET));
#else 
    msm_add_sdcc(2, &msm7x2x_sdcc_data);
#endif 


#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	msm_add_sdcc(3, &msm7x2x_sdcc_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	msm_add_sdcc(4, &msm7x2x_sdcc_data);
#endif
}
void __init msm8960_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	msm8960_sdc1_data.swfi_latency = msm_rpm_get_swfi_latency();
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	msm8960_sdc3_data.swfi_latency = msm_rpm_get_swfi_latency();
	/* SDC3: External card slot */
	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
}
Example #24
0
void __init msm7627a_init_mmc(void)
{
/* LGE_CHANGE_S : SD card detect GPIO configuration
	 * 2012-02-02, [email protected]
	 * added in msm7627a_sdcc_slot_status
	 */
//	sdcc_gpio_init();
/* LGE_CHANGE_E : SD card detect GPIO configuration */
	/* LGE_CHANGE_S : eMMC Power Control
	 * 2011-12-13, [email protected]
	 * mmc power is set wrong power domain. It affects the LCD blinking.
	 * emmc[L10] -> mmc[L13] 
	 */
	/* eMMC slot */
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	if (mmc_regulator_init(3, "gp2", 2850000))//L12
                return;
/*LGE_CHANGE_S:Introducing latency to prevent Idle power collapse [[email protected]] 2012-03-20*/
	sdc3_plat_data.swfi_latency = msm7627a_power_collapse_latency(
                                         MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT);
/*LGE_CHANGE_E*/
	msm_add_sdcc(3, &sdc3_plat_data);
#endif /* LGE_CHANGE_E : eMMC Power Control */ 
	/* Micro-SD slot */
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
//	gpio_sdc1_config();
	if (mmc_regulator_init(1, "mmc", 2850000))
                return;
/*LGE_CHANGE_S:Introducing latency to prevent Idle power collapse [[email protected]] 2012-03-20*/
	sdc1_plat_data.swfi_latency = msm7627a_power_collapse_latency(
                                        MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT);
/*LGE_CHANGE_E*/
//	sdc1_plat_data.status_irq = MSM_GPIO_TO_INT(gpio_sdc1_hw_det);
	msm_add_sdcc(1, &sdc1_plat_data);
#endif
	/* SDIO WLAN slot */
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 if (mmc_regulator_init(2, "mmc", 2850000))
                return;
	msm_add_sdcc(2, &sdc2_plat_data);
#endif
	/* Not Used */
#if (defined(CONFIG_MMC_MSM_SDC4_SUPPORT)\
		&& !defined(CONFIG_MMC_MSM_SDC3_8_BIT_SUPPORT))
	if (mmc_regulator_init(4, "mmc", 2850000))
                return;
	msm_add_sdcc(4, &sdc4_plat_data);
#endif
}
void __init msm8930_init_mmc(void)
{
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	/*
	 * When eMMC runs in DDR mode on CDP platform, we have
	 * seen instability due to DATA CRC errors. These errors are
	 * attributed to long physical path between MSM and eMMC on CDP.
	 * So let's not enable the DDR mode on CDP platform but let other
	 * platforms take advantage of eMMC DDR mode.
	 */
	if (!machine_is_msm8930_cdp())
		msm8960_sdc1_data.uhs_caps |= (MMC_CAP_1_8V_DDR |
					       MMC_CAP_UHS_DDR50);
	/* SDC1 : eMMC card connected */
	msm_add_sdcc(1, &msm8960_sdc1_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	/*
	 * All 8930 platform boards using the 1.2 SoC have been reworked so that
	 * the sd card detect line's esd circuit is no longer powered by the sd
	 * card's voltage regulator. So this means we can turn the regulator off
	 * to save power without affecting the sd card detect functionality.
	 * This change to the boards will be true for newer versions of the SoC
	 * as well.
	 */
	if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1 &&
			SOCINFO_VERSION_MINOR(socinfo_get_version()) < 2) {
		msm8960_sdc3_data.vreg_data->vdd_data->always_on = true;
		msm8960_sdc3_data.vreg_data->vdd_data->reset_at_init = true;
	}
	/* SDC3: External card slot */
	if (!machine_is_msm8930_cdp()) {
		msm8960_sdc3_data.wpswitch_gpio = 0;
		msm8960_sdc3_data.is_wpswitch_active_low = false;
	}

	if (machine_is_msm8930_evt()) {
		msm8960_sdc3_data.status_gpio = 90;
		msm8960_sdc3_data.status_irq = MSM_GPIO_TO_INT(90);
	}

	msm_add_sdcc(3, &msm8960_sdc3_data);
#endif
#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	/* SDC4: WIFI BCM4334 */
	msm_add_sdcc(4, &msm8960_sdc4_data);
#endif
}
Example #26
0
static void __init msm7x2x_init_mmc(void)
{
    vreg_mmc = vreg_get(NULL, "mmc");
    if (IS_ERR(vreg_mmc)) {
        printk(KERN_ERR "%s: vreg get failed (%ld)\n",
               __func__, PTR_ERR(vreg_mmc));
        return;
    }
	sdcc_gpio_init();
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	msm_add_sdcc(1, &msm7x2x_sdcc_data,0,0);
#endif
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
    msm_add_sdcc(2, &msm7x2x_sdcc_data_wifi,0,0);
#endif
}
int __init supersonic_init_mmc(unsigned int sys_rev)
{
	uint32_t id;

	wifi_status_cb = NULL;

	printk(KERN_INFO "%s()+\n", __func__);

	/* initial WIFI_SHUTDOWN# */
	id = PCOM_GPIO_CFG(SUPERSONIC_GPIO_WIFI_SHUTDOWN_N, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
	msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);
	gpio_set_value(SUPERSONIC_GPIO_WIFI_SHUTDOWN_N, 0);

	msm_add_sdcc(1, &supersonic_wifi_data, 0, 0);

        /* Initial WiMAX */
	printk("config wimax power gpio table\n");
	config_gpio_table(wimax_power_pin_gpio_table,
			  ARRAY_SIZE(wimax_power_pin_gpio_table));

	msm_add_sdcc(3, &supersonic_wimax_data,0,0);

	if (opt_disable_sdcard) {
		pr_info("%s: sdcard disabled on cmdline\n", __func__);
		goto done;
	}

	sdslot_vreg_enabled = 0;

	sdslot_vreg = vreg_get(0, "gp6");
	if (IS_ERR(sdslot_vreg))
		return PTR_ERR(sdslot_vreg);

	if (system_rev == 0) { /* XA board */
		set_irq_wake(MSM_GPIO_TO_INT(SUPERSONIC_GPIO_SDMC_CD_N), 1);

		msm_add_sdcc(2, &supersonic_sdslot_data,
			MSM_GPIO_TO_INT(SUPERSONIC_GPIO_SDMC_CD_N),
			IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE);
	} else
		msm_add_sdcc(2, &supersonic_sdslot_data, 0, 0);

done:
	printk(KERN_INFO "%s()-\n", __func__);
	return 0;
}
static void __init msm7x27a_init_mmc(void)
{
	vreg_emmc = vreg_get(NULL, "emmc");
	if (IS_ERR(vreg_emmc)) {
		pr_err("%s: vreg get failed (%ld)\n",
				__func__, PTR_ERR(vreg_emmc));
		return;
	}

	vreg_mmc = vreg_get(NULL, "mmc");
	if (IS_ERR(vreg_mmc)) {
		pr_err("%s: vreg get failed (%ld)\n",
				__func__, PTR_ERR(vreg_mmc));
		return;
	}

	sdcc_gpio_init();

	/* eMMC slot */
#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	sdcc_vreg_data[2].vreg_data = vreg_emmc;
	sdcc_vreg_data[2].level = 2850;
	msm_add_sdcc(3, &sdc3_plat_data);
#endif
	/* Micro-SD slot */
#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
	sdcc_vreg_data[0].vreg_data = vreg_mmc;
	sdcc_vreg_data[0].level = VREG_SD_LEVEL;
	msm_add_sdcc(1, &sdc1_plat_data);
#endif
	/* SDIO WLAN slot */
#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	sdcc_vreg_data[1].vreg_data = vreg_mmc;
	sdcc_vreg_data[1].level = 2850;
	msm_add_sdcc(2, &sdc2_plat_data);
#endif
	/* Not Used */
#if (defined(CONFIG_MMC_MSM_SDC4_SUPPORT)\
		&& !defined(CONFIG_MMC_MSM_SDC3_8_BIT_SUPPORT))
	sdcc_vreg_data[3].vreg_data = vreg_mmc;
	sdcc_vreg_data[3].level = 2850;
	msm_add_sdcc(4, &sdc4_plat_data);
#endif
}
int __init legend_init_mmc(unsigned int sys_rev)
{

	uint32_t id;
	sdslot_vreg_enabled = 0;


	/* initial LEVEL_SHIT_EN */
	id = PCOM_GPIO_CFG(30, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
	msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);

	/* let level shifter alaways enabled,
	   and remove all GPIO30 configuration codes */
	gpio_set_value(30, 0);

	wifi_status_cb = NULL;

	printk(KERN_INFO "%s\n", __func__);

	vreg_wifi_osc = vreg_get(0, "rftx");
	if (IS_ERR(vreg_wifi_osc))
		return PTR_ERR(vreg_wifi_osc);
	vreg_set_level(vreg_wifi_osc, 1800);

	msm_add_sdcc(1, &legend_wifi_data, 0, 0);


	if (opt_disable_sdcard) {
		printk(KERN_INFO "legend: SD-Card interface disabled\n");
		goto done;
	}

	vreg_sdslot = vreg_get(0, "gp6");
	if (IS_ERR(vreg_sdslot))
		return PTR_ERR(vreg_sdslot);

	set_irq_wake(MSM_GPIO_TO_INT(LEGEND_GPIO_SDMC_CD_N), 1);

	msm_add_sdcc(2, &legend_sdslot_data, MSM_GPIO_TO_INT(LEGEND_GPIO_SDMC_CD_N),
			IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE);

done:
	return 0;
}
Example #30
0
int __init saga_init_mmc(unsigned int sys_rev)
{
    uint32_t id;
    wifi_status_cb = NULL;
    sdslot_vreg_enabled = 0;

    printk(KERN_INFO "saga: %s\n", __func__);
    /* SDC2: MoviNAND */
    register_msm_irq_mask(INT_SDC2_0);
    register_msm_irq_mask(INT_SDC2_1);
    config_gpio_table(movinand_on_gpio_table,
                      ARRAY_SIZE(movinand_on_gpio_table));
    msm_add_sdcc(2, &saga_movinand_data, 0, 0);

    /* initial WIFI_SHUTDOWN# */
    id = PCOM_GPIO_CFG(SAGA_GPIO_WIFI_SHUTDOWN_N, 0, GPIO_OUTPUT,
                       GPIO_NO_PULL, GPIO_2MA),
         msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);
    gpio_set_value(SAGA_GPIO_WIFI_SHUTDOWN_N, 0);

    msm_add_sdcc(3, &saga_wifi_data, 0, 0);

    register_msm_irq_mask(INT_SDC4_0);
    register_msm_irq_mask(INT_SDC4_1);
    /* SDCC4: SD card */
    if (opt_disable_sdcard) {
        printk(KERN_INFO "saga: SD-Card interface disabled\n");
        goto done;
    }

    vreg_sdslot = vreg_get(0, "gp10");
    if (IS_ERR(vreg_sdslot))
        return PTR_ERR(vreg_sdslot);

    set_irq_wake(MSM_GPIO_TO_INT(SAGA_SDMC_CD_N_SYS), 1);

    msm_add_sdcc(4, &saga_sdslot_data,
                 MSM_GPIO_TO_INT(SAGA_SDMC_CD_N_SYS),
                 IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE);

done:

    return 0;
}