static void exynos_dwmci_save_drv_st(void *data, u32 slot_id)
{
	struct dw_mci *host = (struct dw_mci *)data;
	struct drv_strength * drv_st = &host->pdata->__drv_st;

	drv_st->val = s5p_gpio_get_drvstr(drv_st->pin);
}
static void exynos_dwmci_restore_drv_st_with_compensation
				(void *data, u32 slot_id, int *compensation)
{
	struct dw_mci *host = (struct dw_mci *)data;
	struct drv_strength * drv_st = &host->pdata->__drv_st;
	s5p_gpio_drvstr_t cur, org;

	/*
		LV1	LV3	LV2	LV4 (org)
	 LV1	0	-1	0	-1
	 LV3	1	0	1	0
	 LV2	0	-1	0	-1
	 LV4	1	0	1	0
	 (cur)
	*/

	int compensation_tbl[4][4] = {
		{0,	-1,	0,	 -1},
		{1,	0,	1,	0},
		{0,	-1,	0,	-1},
		{1,	0,	1,	0}
	};

	cur = s5p_gpio_get_drvstr(drv_st->pin);
	org = drv_st->val;
	s5p_gpio_set_drvstr(drv_st->pin, drv_st->val);
	*compensation = compensation_tbl[cur][org];
}
static void exynos_dwmci_tuning_drv_st(void *data, u32 slot_id)
{
	struct dw_mci *host = (struct dw_mci *)data;
	struct drv_strength * drv_st = &host->pdata->__drv_st;
	unsigned int gpio = drv_st->pin;
	s5p_gpio_drvstr_t next_ds[4] = {S5P_GPIO_DRVSTR_LV3,   /* LV1 -> LV3 */
					S5P_GPIO_DRVSTR_LV4,   /* LV3 -> LV4 */
					S5P_GPIO_DRVSTR_LV1,   /* LV2 -> LV1 */
					S5P_GPIO_DRVSTR_LV2};  /* LV4 -> LV2 */
					
	s5p_gpio_set_drvstr(gpio, next_ds[s5p_gpio_get_drvstr(gpio)]);
}
Exemplo n.º 4
0
static void exynos_dwmci_tuning_drv_st(void *data, u32 slot_id)
{
	struct dw_mci *host = (struct dw_mci *)data;
	struct drv_strength * drv_st = &host->pdata->__drv_st;
	unsigned int gpio = drv_st->pin;
	s5p_gpio_drvstr_t drv;

	drv = s5p_gpio_get_drvstr(gpio);
	if (drv == S5P_GPIO_DRVSTR_LV1)
		drv = S5P_GPIO_DRVSTR_LV4;
	else
		drv--;

	s5p_gpio_set_drvstr(gpio, drv);
}