static int lcd_gpio_cfg_lateresume(void)
{
	int ret = 0;

	ret = nmk_config_pins(codina_lcd_spi_pins_enable,
		ARRAY_SIZE(codina_lcd_spi_pins_enable));

	return ret;
}
Example #2
0
static void ux500_uart0_init(void)
{
	int ret;

	ret = nmk_config_pins(mop500_pins_uart0,
			ARRAY_SIZE(mop500_pins_uart0));
	if (ret < 0)
		pr_err("pl011: uart pins_enable failed\n");
}
static int lcd_gpio_cfg_earlysuspend(void)
{
	int ret = 0;

	ret = nmk_config_pins(codina_lcd_spi_pins_disable,
		ARRAY_SIZE(codina_lcd_spi_pins_disable));

	return ret;
}
static int lcd_gpio_cfg_earlysuspend(void)
{
	int ret = 0;
	printk("%s\n",__func__);
	
	ret=nmk_config_pins(gavini_lcd_spi_pins_disable,
		ARRAY_SIZE(gavini_lcd_spi_pins_disable));

	return ret;
}
static int lcd_gpio_cfg_lateresume(void)
{
	int ret = 0;
	printk("%s\n",__func__);
	
	ret=nmk_config_pins(gavini_lcd_spi_pins_enable,
		ARRAY_SIZE(gavini_lcd_spi_pins_enable));

	return ret;
}
void __init ssg_pins_init(void)
{
	nmk_config_pins(golden_bringup_pins,
		ARRAY_SIZE(golden_bringup_pins));
	ux500_pins_add(golden_bringup_lookup_pins,
		ARRAY_SIZE(golden_bringup_lookup_pins));
	gps_pins_init();
	sdmmc_pins_init();
	suspend_set_pins_force_fn(golden_pins_suspend_force,
				  golden_pins_suspend_force_mux);
}
void __init ssg_pins_init(void)
{
	if (system_rev == GTI9060_R0_1) {
		nmk_config_pins(gti9060_r0_1_pins, ARRAY_SIZE(gti9060_r0_1_pins));
		ux500_pins_add(gti9060_r0_1_lookup_pins, ARRAY_SIZE(gti9060_r0_1_lookup_pins));
		gps_pins_init();
		sdmmc_pins_init();
		suspend_set_pins_force_fn(gti9060_pins_suspend_force,
					  gti9060_pins_suspend_force_mux);
	} 
}
/*
 * This function is called to force gpio power save
 * settings during suspend.
 * This is a temporary solution until all drivers are
 * controlling their pin settings when in inactive mode.
 */
static void janice_pins_suspend_force(void)
{
	sleep_pins_config_pm(janice_r0_0_power_save_bank0,
				ARRAY_SIZE(janice_r0_0_power_save_bank0));

	if (!(sec_debug_settings & (SEC_DBG_STM_APE_OPT | SEC_DBG_STM_MODEM_OPT))) {
		/* not using SD card I/F for modem trace */
		sleep_pins_config_pm(janice_r0_0_sdmmc_sleep,
					ARRAY_SIZE(janice_r0_0_sdmmc_sleep));
	}

	nmk_config_pins(janice_common_sleep_table,
		ARRAY_SIZE(janice_common_sleep_table));

	if (system_rev == JANICE_R0_0 || system_rev == JANICE_R0_1)
		nmk_config_pins(janice_r0_0_sleep_table,
			ARRAY_SIZE(janice_r0_0_sleep_table));
	else if (system_rev == JANICE_R0_2)
		nmk_config_pins(janice_r0_2_sleep_table,
			ARRAY_SIZE(janice_r0_2_sleep_table));
	else if (system_rev >= JANICE_R0_3)
		nmk_config_pins(janice_r0_3_sleep_table,
			ARRAY_SIZE(janice_r0_3_sleep_table));

/*	sleep_pins_config_pm(janice_r0_0_sleep_bank1,
				ARRAY_SIZE(janice_r0_0_sleep_bank1));
	sleep_pins_config_pm(janice_r0_0_sleep_bank2,
				ARRAY_SIZE(janice_r0_0_sleep_bank2));
	sleep_pins_config_pm(janice_r0_0_sleep_bank3,
				ARRAY_SIZE(janice_r0_0_sleep_bank3));
	sleep_pins_config_pm(janice_r0_0_sleep_bank4,
				ARRAY_SIZE(janice_r0_0_sleep_bank4));
	sleep_pins_config_pm(janice_r0_0_sleep_bank5,
				ARRAY_SIZE(janice_r0_0_sleep_bank5));
	sleep_pins_config_pm(janice_r0_0_sleep_bank6,
				ARRAY_SIZE(janice_r0_0_sleep_bank6));
	sleep_pins_config_pm(janice_r0_0_sleep_bank7,
				ARRAY_SIZE(janice_r0_0_sleep_bank7));
	sleep_pins_config_pm(janice_r0_0_sleep_bank8,
				ARRAY_SIZE(janice_r0_0_sleep_bank8));	*/
}
static void __init gps_pins_init(void)
{
	gps_dev = device_create(sec_class, NULL, 0, NULL, "gps");
	if (!gps_dev)
		pr_err("Failed to create device(gps)!\n");

	BUG_ON(!gps_dev);

#ifdef CONFIG_DEBUG_PRINTK
	printk("gps_pins_init!!\n");
#else
	;
#endif

	nmk_config_pins(codina_gps_uart_pins,
		ARRAY_SIZE(codina_gps_uart_pins));

	if(system_rev == CODINA_R0_5) {
		gpio_request(GPS_RST_N_CODINA_BRINGUP_R0_5, "GPS_nRST");
        	gpio_direction_output(GPS_RST_N_CODINA_BRINGUP_R0_5, 1);
        	gpio_export(GPS_RST_N_CODINA_BRINGUP_R0_5, 1);
        	gpio_export_link(gps_dev, "GPS_nRST", GPS_RST_N_CODINA_BRINGUP_R0_5);
	}
#if defined(CONFIG_MACH_CODINA_EURO)
    else if(system_rev == CODINA_R0_4) {
            gpio_request(GPS_RST_N_CODINA_BRINGUP_R0_4, "GPS_nRST");
            gpio_direction_output(GPS_RST_N_CODINA_BRINGUP_R0_4, 1);
            gpio_export(GPS_RST_N_CODINA_BRINGUP_R0_4, 1);
            gpio_export_link(gps_dev, "GPS_nRST", GPS_RST_N_CODINA_BRINGUP_R0_4);
    }
#endif
	else
	{
		gpio_request(GPS_RST_N_CODINA_BRINGUP, "GPS_nRST");
		gpio_direction_output(GPS_RST_N_CODINA_BRINGUP, 1);
		gpio_export(GPS_RST_N_CODINA_BRINGUP, 1);
		gpio_export_link(gps_dev, "GPS_nRST", GPS_RST_N_CODINA_BRINGUP);
	}
	gpio_request(GPS_ON_OFF_CODINA_BRINGUP, "GPS_ON_OFF");
	gpio_direction_output(GPS_ON_OFF_CODINA_BRINGUP, 0);

	
	gpio_export(GPS_ON_OFF_CODINA_BRINGUP, 1);

	
	gpio_export_link(gps_dev, "GPS_ON_OFF", GPS_ON_OFF_CODINA_BRINGUP);

#ifdef CONFIG_DEBUG_PRINTK
	printk("gps_pins_init done!!\n");
#else
	;
#endif
}
void __init ssg_pins_init(void)
{
	nmk_config_pins(codina_common_pins,
		ARRAY_SIZE(codina_common_pins));

	if (system_rev < CODINA_TMO_R0_4){
		nmk_config_pins(codina_r0_0_pins,
			ARRAY_SIZE(codina_r0_0_pins));
	}
	else {
		nmk_config_pins(codina_r0_4_pins,
			ARRAY_SIZE(codina_r0_4_pins));
	}

	ux500_pins_add(codina_r0_0_lookup_pins,
		ARRAY_SIZE(codina_r0_0_lookup_pins));
	gps_pins_init();
	sdmmc_pins_init();
	suspend_set_pins_force_fn(codina_pins_suspend_force,
				  codina_pins_suspend_force_mux);
}
static int mmio_config_i2c_pins(struct mmio_platform_data *pdata,
				enum mmio_select_i2c_t select)
{
	int err = 0;
	dev_dbg(pdata->dev , "Board %s() Enter\n", __func__);
	switch (select) {
	case MMIO_ACTIVATE_I2C_HOST:
		err = nmk_config_pins(i2c2_pins, ARRAY_SIZE(i2c2_pins));
		break;
	case MMIO_ACTIVATE_IPI2C2:
		err = nmk_config_pins(ipi2c_pins, ARRAY_SIZE(ipi2c_pins));
		break;
	case MMIO_DEACTIVATE_I2C:
		err = nmk_config_pins(i2c_disable_pins,
			ARRAY_SIZE(i2c_disable_pins));
		break;
	default:
		break;
	}

	return err;
}
Example #12
0
static int dcg2900_enable_uart(struct cg2900_chip_dev *dev)
{
	int err;
	struct cg2900_platform_data *pdata = dev_get_platdata(dev->dev);

	/* Restore UART settings. */
	err = nmk_config_pins(pdata->uart.uart_enabled,
			      pdata->uart.n_uart_gpios);
	if (err)
		dev_err(dev->dev, "Unable to enable UART (%d)\n", err);

	return err;
}
static int stm_ste_disable_ape_on_mipi60(void)
{
	int retval;

	retval = nmk_config_pins_sleep(ARRAY_AND_SIZE(mop500_stm_mipi60_pins));
	if (retval)
		STM_ERR("Failed to disable MIPI60\n");
	else {
		retval = nmk_config_pins(ARRAY_AND_SIZE(mop500_ske_pins));
		if (retval)
			STM_ERR("Failed to enable SKE gpio\n");
	}
	return retval;
}
int msp13_i2s_init(void)
{
	int retval = 0;
	unsigned long flags;

	spin_lock_irqsave(&msp_rxtx_lock, flags);
	if (msp_rxtx_ref == 0)
		retval = nmk_config_pins(
				ARRAY_AND_SIZE(mop500_msp1_pins_init));
	if (!retval)
		msp_rxtx_ref++;
	spin_unlock_irqrestore(&msp_rxtx_lock, flags);

	return retval;
}
/*
 * This function is called to force gpio power save
 * settings during suspend.
 * This is a temporary solution until all drivers are
 * controlling their pin settings when in inactive mode.
 */
static void gti9060_pins_suspend_force(void)
{
	if(system_rev == GTI9060_R0_1) {
//		pr_info("%s - set gpio status before suspend..\n", __func__);

		sleep_pins_config_pm(gti9060_r0_1_power_save_bank0,
					ARRAY_SIZE(gti9060_r0_1_power_save_bank0));

	 	if (!(sec_debug_settings & (SEC_DBG_STM_APE_OPT | SEC_DBG_STM_MODEM_OPT))) {
			/* not using SD card I/F for modem trace */
			sleep_pins_config_pm(gti9060_r0_1_sdmmc_sleep,
						ARRAY_SIZE(gti9060_r0_1_sdmmc_sleep));
		}

		nmk_config_pins(gti9060_r0_1_sleep_table, ARRAY_SIZE(gti9060_r0_1_sleep_table));
	}
}
static int stm_enable_modem_microsd(void)
{
	int retval;

	/*
	 * Configure STM APE on GPIO23,GPIO28,GPIO27,GPIO26,GPIO25
	 * On HREF board an external SD buffer exist (ST6G3244ME)
	 * to perform level conversion from 1.8v to 3.3V on SD card
	 * signals. When STM is redirected on micro SD connector
	 * GPIO18,GP19,GPIO20 are configured in standard GPIO mode
	 * and are used to configure direction on external SD buffer
	 * ST6G3244ME.
	 */

	retval = nmk_config_pins(ARRAY_AND_SIZE(mop500_stm_modem_microsd_pins));
	if (retval)
		STM_ERR("Failed to enable STM MODEM on MICRO SD\n");

	return retval;
}
static void __init gps_pins_init(void)
{
	gps_dev = device_create(sec_class, NULL, 0, NULL, "gps");
	if (!gps_dev)
		pr_err("Failed to create device(gps)!\n");

	nmk_config_pins(gti9060_gps_rev0_1_pins, ARRAY_SIZE(gti9060_gps_rev0_1_pins));

	gpio_request(GPS_RST_N_GTI9060_R0_1, "GPS_nRST");
	gpio_direction_output(GPS_RST_N_GTI9060_R0_1,0);
	gpio_request(EN_GPS_GTI060_R0_1, "GPS_PWR_EN");
	gpio_direction_output(EN_GPS_GTI060_R0_1,1);
	gpio_request(GPS_ON_OFF_GTI9060_R0_1, "GPS_ON_OFF");
	gpio_direction_output(GPS_ON_OFF_GTI9060_R0_1,0);

	gpio_export(GPS_RST_N_GTI9060_R0_1, 1);
	gpio_export(EN_GPS_GTI060_R0_1, 1);
	gpio_export(GPS_ON_OFF_GTI9060_R0_1, 1);

	BUG_ON(!gps_dev);
	gpio_export_link(gps_dev, "GPS_nRST", GPS_RST_N_GTI9060_R0_1);
	gpio_export_link(gps_dev, "GPS_PWR_EN", EN_GPS_GTI060_R0_1);
	gpio_export_link(gps_dev, "GPS_ON_OFF", GPS_ON_OFF_GTI9060_R0_1);
}
static void __init u8500_init_machine(void)
{
	int i;

	u8500_init_devices();

	nmk_config_pins(mop500_pins, ARRAY_SIZE(mop500_pins));

	u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data;
	ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data;
	ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data;
	ux500_i2c3_device.dev.platform_data = &u8500_i2c3_data;

	u8500_ssp0_device.dev.platform_data = &ssp0_platform_data;

	/* Register the active AMBA devices on this board */
	for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
		amba_device_register(amba_devs[i], &iomem_resource);

	platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));

	spi_register_board_info(u8500_spi_devices,
			ARRAY_SIZE(u8500_spi_devices));
}
void __init mop500_pins_init(void)
{
	nmk_config_pins(mop500_pins_common,
				ARRAY_SIZE(mop500_pins_common));

	ux500_pins_add(mop500_runtime_pins, ARRAY_SIZE(mop500_runtime_pins));

	if (machine_is_hrefv60() || machine_is_u8520() || machine_is_u9540())
		ux500_pins_add(mop500_runtime_pins_v60,
			       ARRAY_SIZE(mop500_runtime_pins_v60));
	else if (machine_is_snowball())
		ux500_pins_add(mop500_runtime_pins_snowball,
			       ARRAY_SIZE(mop500_runtime_pins_snowball));
	else
		ux500_pins_add(mop500_runtime_pins_pre_v60,
			       ARRAY_SIZE(mop500_runtime_pins_pre_v60));

	if (machine_is_hrefv60() || machine_is_u8520() || machine_is_u9540())
		nmk_config_pins(mop500_pins_hrefv60,
				ARRAY_SIZE(mop500_pins_hrefv60));
	else if (machine_is_snowball())
		nmk_config_pins(snowball_pins,
				ARRAY_SIZE(snowball_pins));
	else
		nmk_config_pins(mop500_pins_default,
				ARRAY_SIZE(mop500_pins_default));

	switch (pinsfor) {
	case PINS_FOR_U9500:
		nmk_config_pins(u9500_pins, ARRAY_SIZE(u9500_pins));
		break;

	case PINS_FOR_DEFAULT:
		nmk_config_pins(u8500_pins, ARRAY_SIZE(u8500_pins));
	default:
		break;
	}

	suspend_set_pins_force_fn(mop500_pins_suspend_force,
				  mop500_pins_suspend_force_mux);
}
static void __init sdmmc_pins_init(void)
{
	u32 value;
	const void *prcm_gpiocr = __io_address(U8500_PRCMU_BASE) + 0x138;

	if (sec_debug_settings & SEC_DBG_STM_APE_OPT) {

		/* Set GPIO ALT to C3 */
		value = readl(prcm_gpiocr);
		value |= 0x00000200;	/* Set bit 9 */
		writel(value, prcm_gpiocr);

		nmk_config_pins(golden_bringup_ape_trace,
			ARRAY_SIZE(golden_bringup_ape_trace));

		/* also need to ensure VAUX3 turned on (defaults to 2.91V) */
		golden_ab8500_regulators[AB8500_LDO_AUX3].constraints.valid_ops_mask = 0;
		golden_ab8500_regulators[AB8500_LDO_AUX3].constraints.always_on = 1;
		golden_ab8505_regulators[AB9540_LDO_AUX3].constraints.valid_ops_mask = 0;
		golden_ab8505_regulators[AB9540_LDO_AUX3].constraints.always_on = 1;

#ifdef CONFIG_DEBUG_PRINTK
		printk(KERN_INFO "SD Card I/F set for STM APE Trace\n");
#else
		;
#endif

	} else if (sec_debug_settings & SEC_DBG_STM_MODEM_OPT) {

		/* Set GPIO ALT to B */
		value = readl(prcm_gpiocr);
		value &= ~0x00002202; /* For UART_MOD */
		writel(value, prcm_gpiocr);

		nmk_config_pins(golden_bringup_modem_trace,
			ARRAY_SIZE(golden_bringup_modem_trace));

		/* also need to ensure VAUX3 turned on (defaults to 2.91V) */
		golden_ab8500_regulators[AB8500_LDO_AUX3].constraints.valid_ops_mask = 0;
		golden_ab8500_regulators[AB8500_LDO_AUX3].constraints.always_on = 1;
		golden_ab8505_regulators[AB9540_LDO_AUX3].constraints.valid_ops_mask = 0;
		golden_ab8505_regulators[AB9540_LDO_AUX3].constraints.always_on = 1;

#ifdef CONFIG_DEBUG_PRINTK
		printk(KERN_INFO "SD Card I/F set for STM Modem Trace\n");
#else
		;
#endif
	} else if (sec_debug_settings & SEC_DBG_STM_FIDO_OPT) {

		value = readl(prcm_gpiocr);
		value |= 0x00002002;
		writel(value, prcm_gpiocr);

		nmk_config_pins(golden_bringup_fidobox_trace,
			ARRAY_SIZE(golden_bringup_fidobox_trace));

#ifdef CONFIG_DEBUG_PRINTK
		printk(KERN_INFO "XTI I/F set for STM Fidobox Trace\n");
#else
		;
#endif
	} else {
		/* Set GPIO ALT to A */
		value = readl(prcm_gpiocr);
		value &= ~0x00000200; /* clear bit 9 */
		writel(value, prcm_gpiocr);

		ux500_pins_add(golden_bringup_lookup_sdmmc_pins,
			ARRAY_SIZE(golden_bringup_lookup_sdmmc_pins));
	}
}
static void __init sdmmc_pins_init(void)
{
	u32 value;
	const void *prcm_gpiocr = __io_address(U8500_PRCMU_BASE) + 0x138;

	if (sec_debug_settings & SEC_DBG_STM_APE_OPT) {

		/* Set GPIO ALT to C3 */
		value = readl(prcm_gpiocr);
		value |= 0x00000200;	/* Set bit 9 */
		writel(value, prcm_gpiocr);

		nmk_config_pins(codina_r0_0_ape_trace,
			ARRAY_SIZE(codina_r0_0_ape_trace));

		/* also need to ensure VAUX3 turned on (defaults to 2.91V) */
		codina_ab8500_regulators[AB8500_LDO_AUX3].constraints.valid_ops_mask = 0;
		codina_ab8500_regulators[AB8500_LDO_AUX3].constraints.always_on = 1;
		if(system_rev >= CODINA_TMO_R0_4) {
			codina_ab8505_r0_4_regulators[AB9540_LDO_AUX3].constraints.valid_ops_mask = 0;
			codina_ab8505_r0_4_regulators[AB9540_LDO_AUX3].constraints.always_on = 1;
		}
		else {
			codina_ab8505_regulators[AB9540_LDO_AUX3].constraints.valid_ops_mask = 0;
			codina_ab8505_regulators[AB9540_LDO_AUX3].constraints.always_on = 1;
		}

		printk(KERN_INFO "SD Card I/F set for STM APE Trace\n");

	} else if (sec_debug_settings & SEC_DBG_STM_MODEM_OPT) {

		/* Set GPIO ALT to B */
		value = readl(prcm_gpiocr);
		value &= ~0x00002202; /* For UART_MOD */
		writel(value, prcm_gpiocr);

		nmk_config_pins(codina_r0_0_modem_trace,
			ARRAY_SIZE(codina_r0_0_modem_trace));

		/* also need to ensure VAUX3 turned on (defaults to 2.91V) */
		codina_ab8500_regulators[AB8500_LDO_AUX3].constraints.valid_ops_mask = 0;
		codina_ab8500_regulators[AB8500_LDO_AUX3].constraints.always_on = 1;
		if(system_rev >= CODINA_TMO_R0_4) {
			codina_ab8505_r0_4_regulators[AB9540_LDO_AUX3].constraints.valid_ops_mask = 0;
			codina_ab8505_r0_4_regulators[AB9540_LDO_AUX3].constraints.always_on = 1;
		}
		else {
			codina_ab8505_regulators[AB9540_LDO_AUX3].constraints.valid_ops_mask = 0;
			codina_ab8505_regulators[AB9540_LDO_AUX3].constraints.always_on = 1;
		}

		printk(KERN_INFO "SD Card I/F set for STM Modem Trace\n");
	} else if (sec_debug_settings & SEC_DBG_STM_FIDO_OPT) {

		value = readl(prcm_gpiocr);
		value |= 0x00002002;
		writel(value, prcm_gpiocr);

		nmk_config_pins(codina_r0_0_fidobox_trace,
			ARRAY_SIZE(codina_r0_0_fidobox_trace));

		printk(KERN_INFO "XTI I/F set for STM Fidobox Trace\n");
	} else {
		/* Set GPIO ALT to A */
		value = readl(prcm_gpiocr);
		value &= ~0x00000200; /* clear bit 9 */
		writel(value, prcm_gpiocr);

		nmk_config_pins(codina_r0_0_sdmmc,
			ARRAY_SIZE(codina_r0_0_sdmmc));
	}
}
static int keypad_power(const struct gpio_event_platform_data *pdata, bool on)
{
	if (on)
		nmk_config_pins(gpio_keypad_pins, ARRAY_SIZE(gpio_keypad_pins));
	return 0;
}
void __init u5500_sdi_init(void)
{
    nmk_config_pins(u5500_sdi_pins, ARRAY_SIZE(u5500_sdi_pins));

    db5500_add_sdi0(&u5500_sdi0_data);
}
static int stm_ste_connection(enum stm_connection_type con_type)
{
	int retval = -EINVAL;

	/* Check if connection type has been changed */
	if (con_type == stm_current_connection)
		return 0;

	if (con_type != STM_DISCONNECT) {
		/*  Always enable MIPI34 GPIO pins */
		retval = nmk_config_pins(
				ARRAY_AND_SIZE(mop500_stm_mipi34_pins));
		if (retval) {
			STM_ERR("Failed to enable MIPI34\n");
			goto stm_ste_connection_error;
		}
	}

	switch (con_type) {
	case STM_DEFAULT_CONNECTION:
	case STM_STE_MODEM_ON_MIPI34_NONE_ON_MIPI60:
		/* Enable altC3 on GPIO70-74 (STMMOD) & GPIO75-76 (UARTMOD) */
		prcmu_enable_stm_mod_uart();
		retval = stm_ste_disable_ape_on_mipi60();
		break;

	case STM_STE_APE_ON_MIPI34_NONE_ON_MIPI60:
		/* Disable altC3 on GPIO70-74 (STMMOD) & GPIO75-76 (UARTMOD) */
		prcmu_disable_stm_mod_uart();
		retval = stm_ste_disable_ape_on_mipi60();
		break;

	case STM_STE_MODEM_ON_MIPI34_APE_ON_MIPI60:
		/* Enable altC3 on GPIO70-74 (STMMOD) and GPIO75-76 (UARTMOD) */
		prcmu_enable_stm_mod_uart();
		/* Enable APE on MIPI60 */
		if (!machine_is_snowball())
			retval = nmk_config_pins_sleep(ARRAY_AND_SIZE(mop500_ske_pins));
		if (retval)
			STM_ERR("Failed to disable SKE GPIO\n");
		else {
			retval = nmk_config_pins(
					ARRAY_AND_SIZE(mop500_stm_mipi60_pins));
			if (retval)
				STM_ERR("Failed to enable MIPI60\n");
		}
		break;

	case STM_STE_MODEM_ON_MICROSD:
		/* Disable APE on micro SD */
		retval = stm_disable_ape_microsd();
		/* Enable modem on micro SD */
		if (!retval)
			retval = stm_enable_modem_microsd();
		/* Enable SD card buffer and regulator on href */
		if (!retval && (stm_current_connection
			!= STM_STE_APE_ON_MICROSD)) {
			enable_level_shifter_for_microsd();
			enable_vaux3_for_microsd_cable();
		}
		break;

	case STM_STE_APE_ON_MICROSD:
		/* Disable modem on micro SD */
		retval = stm_disable_modem_microsd();
		/* Enable ape on micro SD */
		if (!retval)
			retval = stm_enable_ape_microsd();
		/* Enable SD card buffer and regulator on href */
		if (!retval && (stm_current_connection
			!= STM_STE_MODEM_ON_MICROSD)) {
			enable_level_shifter_for_microsd();
			enable_vaux3_for_microsd_cable();
		}
		break;

	case STM_DISCONNECT:
		retval = nmk_config_pins_sleep(
				ARRAY_AND_SIZE(mop500_stm_mipi34_pins));
		if (retval)
			STM_ERR("Failed to disable MIPI34\n");

		retval = stm_ste_disable_ape_on_mipi60();
		if (retval)
			STM_ERR("Failed to disable MIPI60\n");

		retval = stm_disable_modem_microsd();
		if (retval)
			STM_ERR("Failed to disable modem on microsd\n");

		retval = stm_disable_ape_microsd();
		if (retval)
			STM_ERR("Failed to disable ape on microsd\n");
		break;

	default:
		STM_ERR("Bad connection type\n");
		goto stm_ste_connection_error;
	}

	/* Disable power for microsd */
	if ((stm_current_connection == STM_STE_MODEM_ON_MICROSD)
	|| (stm_current_connection == STM_STE_APE_ON_MICROSD)) {
		if ((con_type != STM_STE_MODEM_ON_MICROSD)
		&& (con_type != STM_STE_APE_ON_MICROSD)) {
			disable_vaux3_for_microsd_cable();
			disable_level_shifter_for_microsd();
		}
	}

	stm_current_connection = con_type;

stm_ste_connection_error:
	return retval;
}