static int mt6229_io_init(void)
{
	iomux_set(GPIO2_D5);
	iomux_set(GPIO0_C6);
	iomux_set(GPIO2_D4);
	iomux_set(GPIO0_C4);
	iomux_set(GPIO0_C5);
	return 0;
}
예제 #2
0
static int rk29_backlight_io_init_q910_ipad3(void)
{
	int ret = 0;

	iomux_set(PWM_MODE);
	return ret;
}
static int rk29_backlight_io_init(void)
{
	int ret = 0, hubret = 0;

	iomux_set(PWM_MODE);
	
	ret = gpio_request(BL_EN_PIN, "bl_en");
	if (ret != 0) {
		gpio_free(BL_EN_PIN);
	} else {
		gpio_direction_output(BL_EN_PIN, 0);
		gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
	}

	hubret = gpio_request(HUB_RST_PIN, "hub_rst");
	if (hubret != 0) {
		gpio_free(HUB_RST_PIN);
	} else
	{
		gpio_direction_output(HUB_RST_PIN, 0);
		gpio_set_value(HUB_RST_PIN, GPIO_HIGH);
	}

	return ret;
}
예제 #4
0
static int rk29_sdmmc0_cfg_gpio(void)
{
#ifdef CONFIG_SDMMC_RK29_OLD
	rk30_mux_api_set(GPIO3B1_SDMMC0CMD_NAME, GPIO3B_SDMMC0_CMD);
	rk30_mux_api_set(GPIO3B0_SDMMC0CLKOUT_NAME, GPIO3B_SDMMC0_CLKOUT);
	rk30_mux_api_set(GPIO3B2_SDMMC0DATA0_NAME, GPIO3B_SDMMC0_DATA0);
	rk30_mux_api_set(GPIO3B3_SDMMC0DATA1_NAME, GPIO3B_SDMMC0_DATA1);
	rk30_mux_api_set(GPIO3B4_SDMMC0DATA2_NAME, GPIO3B_SDMMC0_DATA2);
	rk30_mux_api_set(GPIO3B5_SDMMC0DATA3_NAME, GPIO3B_SDMMC0_DATA3);

	rk30_mux_api_set(GPIO3B6_SDMMC0DETECTN_NAME, GPIO3B_GPIO3B6);

	rk30_mux_api_set(GPIO3A7_SDMMC0PWREN_NAME, GPIO3A_GPIO3A7);
	gpio_request(RK30_PIN3_PA7, "sdmmc-power");
	gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW);

#else
	    rk29_sdmmc_set_iomux(0, 0xFFFF);

    #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
        iomux_set_gpio_mode(iomux_mode_to_gpio(MMC0_DETN));
    #else
        iomux_set(MMC0_DETN);
    #endif	

    #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
	    gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp");
	    gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
    #endif

#endif

	return 0;
}
예제 #5
0
static int   es8323_i2c_suspend (struct i2c_client *client, pm_message_t mesg)
{
#if 0
	rk30_mux_api_set(I2C_CLK_NAME,I2C_CLK_GPIO_MODE);
	if (gpio_request(I2C_CLK_GPIO, NULL)) {
		printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
		return -1;
	}

	gpio_direction_output(I2C_CLK_GPIO,I2C_GPIO_OUTPUT);

	rk30_mux_api_set(I2C_MCLK_NAME,I2C_MCLK_GPIO_MODE);
	if (gpio_request(I2C_MCLK_GPIO, NULL)) {
		printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
		return -1;
	}

	gpio_direction_output(I2C_MCLK_GPIO,I2C_MGPIO_OUTPUT);
#endif
        iomux_set(GPIO1_C1);
        if (gpio_request(RK30_PIN1_PC1, NULL)) {
		printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
		return -1;
	}
        gpio_direction_input(RK30_PIN1_PC1);
        gpio_pull_updown(RK30_PIN1_PC1, PullDisable);

#if 0
        iomux_set(GPIO1_C2);
        gpio_direction_input(RK30_PIN1_PC2);
        gpio_pull_updown(RK30_PIN1_PC2, PullDisable);

        iomux_set(GPIO1_C3);
        gpio_direction_input(RK30_PIN1_PC3);
        gpio_pull_updown(RK30_PIN1_PC3, PullDisable);

        iomux_set(GPIO1_C4);
        gpio_direction_input(RK30_PIN1_PC4);
        gpio_pull_updown(RK30_PIN1_PC4, PullDisable);

        iomux_set(GPIO1_C5);
        gpio_direction_input(RK30_PIN1_PC5);
        gpio_pull_updown(RK30_PIN1_PC5, PullDisable);
#endif

	return 0;
}
예제 #6
0
static int rk_fb_io_init_c5(struct rk29_fb_setting_info *fb_setting)
{
	int ret;
	iomux_set(GPIO2_A1);
  ret = gpio_request(MIPI_RST, "mipi_rst");
  if (ret != 0) {
    printk("request mipi_rst fail.");
    goto ret0;
  }
	gpio_direction_output(MIPI_RST, MIPI_RST_VALUE);
	
//step 1
  ret = gpio_request(LCD_EN_PIN_C5, "led_en");
  if (ret != 0) {
    printk("request led_en fail.");
    goto ret0;
  }
	gpio_direction_output(LCD_EN_PIN_C5, LCD_EN_VALUE_C5);
	
	//step 0
	iomux_set(GPIO1_A7);
	ret = gpio_request(LCD_STBYB, "stbyb");
	if (ret != 0) {
		printk("request stbyb fail.");
		goto ret0;
  }
	gpio_direction_output(LCD_STBYB, LCD_STBYB_VALUE);
	
	//mdelay(10);

	
	//step 2
	iomux_set(GPIO2_D1);
	ret = gpio_request(LCD_CS_PIN_C5, "led_cs");
  if (ret != 0) {
    printk("request led_en fail.");
    goto ret0;
  }
	gpio_direction_output(LCD_CS_PIN_C5, LCD_CS_VALUE_C5);
	
	mdelay(1);
	gpio_direction_output(MIPI_RST, !MIPI_RST_VALUE);
	mdelay(100);
	//step 3
ret0:
	return ret;
}
예제 #7
0
void iomux_set_gpio_mode(int gpio)
{
	unsigned int mode;

	mode = iomux_gpio_to_mode(gpio);
	if(mode_is_valid(mode))
        	iomux_set(mode);
}
예제 #8
0
static int rk29_backlight_pwm_resume_q910_ipad3(void)
{
	int pwm_gpio = iomux_mode_to_gpio(PWM_MODE);

	gpio_free(pwm_gpio);
	iomux_set(PWM_MODE);
	return 0;
}
static int rk30_i2c_check_idle(struct rk30_i2c *i2c)
{
	int ret = 0;
	int sda_io, scl_io;
	int sda_lev, scl_lev;

	sda_io = iomux_mode_to_gpio(i2c->sda_mode);
	scl_io = iomux_mode_to_gpio(i2c->scl_mode);

printk("wax->sda_io=%d scl_io=%d$$$$$$$$$$$$$$$$$$$$$\n",sda_io,scl_io);
printk("wax->sda_io=%d scl_io=%d$$$$$$$$$$$$$$$$$$$$$\n",sda_io,scl_io);
       if(218==sda_io||219==sda_io)
       return I2C_IDLE;
	ret = gpio_request(sda_io, NULL);  //modify by nition
	if(unlikely(ret < 0)){
		dev_err(i2c->dev, "Failed to request gpio: SDA_GPIO\n");
		return ret;
	}
	ret = gpio_request(scl_io, NULL); //modify by nition
	if(unlikely(ret < 0)){
		dev_err(i2c->dev, "Failed to request gpio: SCL_GPIO\n");
		gpio_free(sda_io);
		return ret;
	}
	gpio_direction_input(sda_io);
	gpio_direction_input(scl_io);

	sda_lev = gpio_get_value(sda_io);
	scl_lev = gpio_get_value(scl_io);

	gpio_free(sda_io);
	gpio_free(scl_io);

	iomux_set(i2c->sda_mode);
	iomux_set(i2c->scl_mode);

	if(sda_lev == 1 && scl_lev == 1)
		return I2C_IDLE;
	else if(sda_lev == 0 && scl_lev == 1)
		return I2C_SDA_LOW;
	else if(sda_lev == 1 && scl_lev == 0)
		return I2C_SCL_LOW;
	else
		return BOTH_LOW;
}
예제 #10
0
static int rk29_backlight_pwm_resume_q97s_q98_ipad2(void)
{
	int pwm_gpio = iomux_mode_to_gpio(PWM_MODE);

	gpio_free(pwm_gpio);
	iomux_set(PWM_MODE);
	msleep(150);
	gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
	return 0;
}
예제 #11
0
void __init iomux_init(void)
{
        int i, len;

        len = ARRAY_SIZE(default_mode);
        for(i = 0; i < len; i++)
                iomux_set(default_mode[i]);
	
	return;
}
static int rk29_backlight_pwm_resume(void)
{
	int pwm_gpio = iomux_mode_to_gpio(bl_pwm_mode);

	gpio_free(pwm_gpio);
	iomux_set(bl_pwm_mode);
	msleep(30);
	port_output_on(bl_en);
	return 0;
}
예제 #13
0
// q97s ipad2 specifics
static int rk29_backlight_io_init_q97s_q98_ipad2(void)
{
	int ret = 0;

	iomux_set(PWM_MODE);
	ret = gpio_request(BL_EN_PIN, "bl_en");
	if (ret == 0) {
		gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
	}
	return ret;
}
static int rk29_backlight_pwm_resume(void)
{
	int pwm_gpio = iomux_mode_to_gpio(pwm_mode[BL_PWM]);

	gpio_free(pwm_gpio);
	iomux_set(pwm_mode[BL_PWM]);
#ifdef  LCD_DISP_ON_PIN
	msleep(30);
	gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
#endif
	return 0;
}
static int sensor_reset_usr_cb (struct rk29camera_gpio_res *res,int on)
{
	//#error "CONFIG_SENSOR_RESET_IOCTL_USR is 1, sensor_reset_usr_cb function must be writed!!";
		
    int camera_reset = res->gpio_reset;
    int camera_ioflag = res->gpio_flag;
    int camera_io_init = res->gpio_init;  
    int ret = 0;
    
    if (camera_reset != INVALID_GPIO) {
		if (camera_io_init & RK29_CAM_RESETACTIVE_MASK) {
			if (on) {
	        	gpio_set_value(camera_reset, ((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
	        	printk("%s ResetPin=%d ..PinLevel = %x\n",res->dev_name,camera_reset, ((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
				mdelay(6);
			} else {
				gpio_set_value(camera_reset,(((~camera_ioflag)&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
        		printk("%s ResetPin= %d..PinLevel = %x\n",res->dev_name, camera_reset, (((~camera_ioflag)&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
                mdelay(6);
        		iomux_set(SPI0_CLK);
        		iomux_set(SPI0_RXD);
        		iomux_set(SPI0_TXD);
        		iomux_set(SPI0_CS0);
        		iomux_set(I2C3_SDA);
        		iomux_set(I2C3_SCL);
                mdelay(6);
	        }
		} else {
static void rk29_sdmmc_set_iomux_mmc1(unsigned int bus_width)
{
    #if SDMMC_USE_NEW_IOMUX_API
    iomux_set(rksdmmc1_gpio_init.cmd_gpio.iomux.fmux);
    iomux_set(rksdmmc1_gpio_init.clk_gpio.iomux.fmux);
    iomux_set(rksdmmc1_gpio_init.data0_gpio.iomux.fmux);
    iomux_set(rksdmmc1_gpio_init.data1_gpio.iomux.fmux);
    iomux_set(rksdmmc1_gpio_init.data2_gpio.iomux.fmux);
    iomux_set(rksdmmc1_gpio_init.data3_gpio.iomux.fmux);
    #else
    rk30_mux_api_set(rksdmmc1_gpio_init.cmd_gpio.iomux.name, rksdmmc1_gpio_init.cmd_gpio.iomux.fmux);
    rk30_mux_api_set(rksdmmc1_gpio_init.clk_gpio.iomux.name, rksdmmc1_gpio_init.clk_gpio.iomux.fmux);
    rk30_mux_api_set(rksdmmc1_gpio_init.data0_gpio.iomux.name, rksdmmc1_gpio_init.data0_gpio.iomux.fmux);
    rk30_mux_api_set(rksdmmc1_gpio_init.data1_gpio.iomux.name, rksdmmc1_gpio_init.data1_gpio.iomux.fmux);
    rk30_mux_api_set(rksdmmc1_gpio_init.data2_gpio.iomux.name, rksdmmc1_gpio_init.data2_gpio.iomux.fmux);
    rk30_mux_api_set(rksdmmc1_gpio_init.data3_gpio.iomux.name, rksdmmc1_gpio_init.data3_gpio.iomux.fmux);
    #endif

     //IO voltage(vcc-ap0)
    if(rk31sdk_wifi_voltage_select())
        SDMMC_write_grf_reg(GRF_IO_CON4, (SDMMC1_IO_VOLTAGE_MASK|SDMMC1_IO_VOLTAGE_18));       
    else
        SDMMC_write_grf_reg(GRF_IO_CON4, (SDMMC1_IO_VOLTAGE_MASK|SDMMC1_IO_VOLTAGE_33));

    //sdmmc1 drive strength control
    SDMMC_write_grf_reg(GRF_IO_CON3, (SDMMC1_DRIVER_STRENGTH_MASK|SDMMC1_DRIVER_STRENGTH_12MA));
    
}
예제 #17
0
static int rk29_backlight_io_init(void)
{
	int ret = 0;

	iomux_set(pwm_mode[BL_PWM]);
	msleep(50);
#ifdef  LCD_DISP_ON_PIN
	ret = rk_gpio_request(BL_EN_PIN, GPIOF_DIR_OUT, BL_EN_VALUE, "bl_en");
	if(ret < 0)
		return ret;
#endif
	return 0;
}
static int rk29_backlight_io_init(void)
{
	int ret = 0;

	iomux_set(PWM_MODE);
#ifdef  LCD_DISP_ON_PIN
	ret = gpio_request(BL_EN_PIN, "bl_en");
	if (ret == 0) {
		gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
	}
#endif
	return ret;
}
static int rk29_backlight_pwm_resume(void)
{
	int pwm_gpio = iomux_mode_to_gpio(PWM_MODE);

	gpio_free(pwm_gpio);
	iomux_set(PWM_MODE);

	msleep(30);
	gpio_direction_output(BL_EN_PIN, 1);
	gpio_set_value(BL_EN_PIN, BL_EN_VALUE);

	return 0;
}
예제 #20
0
void usb20otg_hw_init(void)
{
#ifndef CONFIG_USB20_HOST
    // close USB 2.0 HOST phy and clock
    unsigned int * otg_phy_con1 = (unsigned int*)(RK319X_GRF_BASE + GRF_UOC1_CON1);
    *otg_phy_con1 = 0x55 |(0x7f<<16);   // enter suspend.
#endif

    // usb phy config init
    //pGRF_USBPHY_REG GRF_USBPHY0 = (pGRF_USBPHY_REG)GRF_USBPHY0_CON_BASE;

    // other hardware init
    iomux_set(OTG_DRV_VBUS);
}
static int rk29_sdmmc0_cfg_gpio(void)
{
	rk29_sdmmc_set_iomux(0, 0xFFFF);
	#if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
        iomux_set_gpio_mode(iomux_gpio_to_mode(RK29SDK_SD_CARD_DETECT_N));
    	#else
        iomux_set(MMC0_DETN);
    	#endif	

	#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
	gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp");
	gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
	#endif
	return 0;
}
예제 #22
0
static int   es8323_i2c_resume(struct i2c_client *client)
{
#if 0
	gpio_free(I2C_MCLK_GPIO);
	gpio_free(I2C_CLK_GPIO);

	rk30_mux_api_set(I2C_MCLK_NAME,I2C_MCLK_CLK_MODE);
	rk30_mux_api_set(I2C_CLK_NAME,I2C_CLK_CLK_MODE);
#endif

        gpio_free(RK30_PIN1_PC1);
        iomux_set(I2S0_SCLK);

	return 0;
}
예제 #23
0
// lcd_en 20ms
// lcd_cs 10ms //AVDD and VGH,VGL
static int rk29_backlight_io_init_c5(void)
{
	int ret = 0;
	
	iomux_set(PWM_MODE);
	
	ret = gpio_request(BL_EN_PIN, "bl_en");
	if (ret != 0) {
		printk("request bl_en fail.");
		goto ret0;
  }
	gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
ret0:
	return ret;
}
예제 #24
0
void usb20host_hw_init(void)
{
    // usb phy config init
    pGRF_USBPHY_REG GRF_USBPHY1 = (pGRF_USBPHY_REG)GRF_USBPHY1_CON_BASE;
    //GRF_USBPHY1->CON7 = 0x78000000;//host_discon_con 575mv
    GRF_USBPHY1->CON0 = 0xffff8518;
    GRF_USBPHY1->CON1 = 0xffffe007;
    GRF_USBPHY1->CON2 = 0xffff82c9;
    GRF_USBPHY1->CON3 = 0xffff0202;
    GRF_USBPHY1->CON4 = 0xffff5556;
    GRF_USBPHY1->CON5 = 0xffff5555;
    GRF_USBPHY1->CON6 = 0xffff0005;
    GRF_USBPHY1->CON7 = 0xffff68d0;

    // other haredware init
    iomux_set(HOST_DRV_VBUS);
}
예제 #25
0
static int rk29_backlight_io_init(void)
{
	int ret = 0;

	iomux_set(PWM_MODE);
#ifdef  LCD_DISP_ON_PIN
	ret = gpio_request(BL_EN_PIN, NULL);
	if (ret != 0) {
		gpio_free(BL_EN_PIN);
	}

	gpio_direction_output(BL_EN_PIN, 0);
	gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
#endif

	return ret;
}
static int rk29_backlight_io_init(void)
{
	int ret = 0;
	printk("rk29_backlight_io_init %d\n",bl_pwm_mode);
	iomux_set(bl_pwm_mode);
	msleep(50);	
	if(bl_en== -1)                
		return 0;  
	ret = port_output_init(bl_en, 1, "bl_en"); 
	if(ret < 0){                
	 	printk("%s: port output init faild\n", __func__);
		return ret;        
	}        
	port_output_on(bl_en);

	return ret;
	
}
static int rk29_sdmmc0_cfg_gpio(void)
{
#ifdef CONFIG_SDMMC_RK29_OLD
	iomux_set(MMC0_CMD);
	iomux_set(MMC0_CLKOUT);
	iomux_set(MMC0_D0);
	iomux_set(MMC0_D1);
	iomux_set(MMC0_D2);
	iomux_set(MMC0_D3);

	iomux_set_gpio_mode(iomux_mode_to_gpio(MMC0_DETN));

	gpio_request(RK30_PIN3_PA7, "sdmmc-power");
	gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW);

#else
	rk29_sdmmc_set_iomux(0, 0xFFFF);

    #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
        #if SDMMC_USE_NEW_IOMUX_API
        iomux_set_gpio_mode(iomux_gpio_to_mode(RK29SDK_SD_CARD_DETECT_N));
        #else
        rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO);
        #endif
    #else
        #if SDMMC_USE_NEW_IOMUX_API       
        iomux_set(MMC0_DETN);
        #else
        rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FMUX);
        #endif
    #endif	

#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
	gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp");
	gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
#endif

#endif

	return 0;
}
예제 #28
0
void usb20otg_hw_init(void)
{
#ifndef CONFIG_USB20_HOST
    // close USB 2.0 HOST phy and clock
    unsigned int * otg_phy_con1 = (unsigned int*)(USBGRF_UOC1_CON1);
    *otg_phy_con1 = 0x1D5 |(0x1ff<<16);   // enter suspend.
#endif

    // usb phy config init
    pGRF_USBPHY_REG GRF_USBPHY0 = (pGRF_USBPHY_REG)GRF_USBPHY0_CON_BASE;
    GRF_USBPHY0->CON0 = 0x00070007;//open pre-emphasize for otg

    // other hardware init
#ifdef CONFIG_RK_CONFIG
    otg_drv_init(0);
#else
#if(defined (CONFIG_MACH_RK3026_86V) ||defined (CONFIG_MACH_RK3026_86V_FAC))

#else
    iomux_set(OTG_DRV_VBUS);
#endif
#endif
}
예제 #29
0
static int rk3188_lcdc_init(struct rk_lcdc_device_driver *dev_drv)
{
	int i = 0;
	int __iomem *c;
	int v;
	struct rk3188_lcdc_device *lcdc_dev = container_of(dev_drv,struct rk3188_lcdc_device,driver);
	if(lcdc_dev->id == 0) //lcdc0
	{
		lcdc_dev->pd 	= clk_get(NULL,"pd_lcdc0");
		lcdc_dev->hclk 	= clk_get(NULL,"hclk_lcdc0"); 
		lcdc_dev->aclk 	= clk_get(NULL,"aclk_lcdc0");
		lcdc_dev->dclk 	= clk_get(NULL,"dclk_lcdc0");
	}
	else if(lcdc_dev->id == 1)
	{
		lcdc_dev->pd 	= clk_get(NULL,"pd_lcdc1");
		lcdc_dev->hclk 	= clk_get(NULL,"hclk_lcdc1");  
		lcdc_dev->aclk 	= clk_get(NULL,"aclk_lcdc1");
		lcdc_dev->dclk 	= clk_get(NULL,"dclk_lcdc1");
	}
	else
	{
		printk(KERN_ERR "invalid lcdc device!\n");
		return -EINVAL;
	}
	if (IS_ERR(lcdc_dev->pd) || (IS_ERR(lcdc_dev->aclk)) ||(IS_ERR(lcdc_dev->dclk)) || (IS_ERR(lcdc_dev->hclk)))
    	{
       		printk(KERN_ERR "failed to get lcdc%d clk source\n",lcdc_dev->id);
   	}
	
	rk3188_lcdc_clk_enable(lcdc_dev);

	if(lcdc_dev->id == 0)
	{
		#if defined(CONFIG_LCDC0_IO_18V)
		v = 0x40004000;               //bit14: 1,1.8v;0,3.3v
		writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
		#else
		v = 0x40000000;              
		writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
		#endif
	}

	if(lcdc_dev->id == 1) //iomux for lcdc1
	{
		#if defined(CONFIG_LCDC1_IO_18V)
		v = 0x80008000;               //bit14: 1,1.8v;0,3.3v
		writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
		#else
		v = 0x80000000;
		writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
		#endif
		iomux_set(LCDC1_DCLK);
		iomux_set(LCDC1_DEN);
		iomux_set(LCDC1_HSYNC);
		iomux_set(LCDC1_VSYNC);
		iomux_set(LCDC1_D0);
		iomux_set(LCDC1_D1);
		iomux_set(LCDC1_D2);
		iomux_set(LCDC1_D3);
		iomux_set(LCDC1_D4);
		iomux_set(LCDC1_D5);
		iomux_set(LCDC1_D6);
		iomux_set(LCDC1_D7);
		iomux_set(LCDC1_D8);
		iomux_set(LCDC1_D9);
		iomux_set(LCDC1_D10);
		iomux_set(LCDC1_D11);
		iomux_set(LCDC1_D12);
		iomux_set(LCDC1_D13);
		iomux_set(LCDC1_D14);
		iomux_set(LCDC1_D15);
		iomux_set(LCDC1_D16);
		iomux_set(LCDC1_D17);
		iomux_set(LCDC1_D18);
		iomux_set(LCDC1_D19);
		iomux_set(LCDC1_D20);
		iomux_set(LCDC1_D21);
		iomux_set(LCDC1_D22);
		iomux_set(LCDC1_D23);
		
	}
	lcdc_set_bit(lcdc_dev,SYS_CTRL,m_AUTO_GATING_EN);//eanble axi-clk auto gating for low power
	//lcdc_set_bit(lcdc_dev,DSP_CTRL0,m_WIN0_TOP);
        if(dev_drv->cur_screen->dsp_lut)
        {
        	lcdc_msk_reg(lcdc_dev,SYS_CTRL,m_DSP_LUT_EN,v_DSP_LUT_EN(0));
		lcdc_cfg_done(lcdc_dev);
		msleep(25);
		for(i=0;i<256;i++)
		{
			v = dev_drv->cur_screen->dsp_lut[i];
			c = lcdc_dev->dsp_lut_addr_base+i;
			writel_relaxed(v,c);
			
		}
		lcdc_msk_reg(lcdc_dev,SYS_CTRL,m_DSP_LUT_EN,v_DSP_LUT_EN(1));
        }
	
	lcdc_cfg_done(lcdc_dev);  // write any value to  REG_CFG_DONE let config become effective

	rk3188_lcdc_clk_disable(lcdc_dev);
	
	return 0;
}
static void rk29_sdmmc_set_iomux_mmc0(unsigned int bus_width)
{
    switch (bus_width)
    {
        
    	case 1://SDMMC_CTYPE_4BIT:
    	{
    	    #if SDMMC_USE_NEW_IOMUX_API
            iomux_set(rksdmmc0_gpio_init.data1_gpio.iomux.fmux);
            iomux_set(rksdmmc0_gpio_init.data2_gpio.iomux.fmux);
            iomux_set(rksdmmc0_gpio_init.data3_gpio.iomux.fmux);
    	    #else
        	rk30_mux_api_set(rksdmmc0_gpio_init.data1_gpio.iomux.name, rksdmmc0_gpio_init.data1_gpio.iomux.fmux);
        	rk30_mux_api_set(rksdmmc0_gpio_init.data2_gpio.iomux.name, rksdmmc0_gpio_init.data2_gpio.iomux.fmux);
        	rk30_mux_api_set(rksdmmc0_gpio_init.data3_gpio.iomux.name, rksdmmc0_gpio_init.data3_gpio.iomux.fmux);
        	#endif
    	}
    	break;

    	case 0x10000://SDMMC_CTYPE_8BIT:
    	    break;
    	case 0xFFFF: //gpio_reset
    	{
    	    #if (!!SDMMC_USE_NEW_IOMUX_API) && !defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
    	    iomux_set(MMC0_DETN);
    	    #endif
    	    
    	    #if !(!!SDMMC_USE_NEW_IOMUX_API)
            rk30_mux_api_set(rksdmmc0_gpio_init.power_en_gpio.iomux.name, rksdmmc0_gpio_init.power_en_gpio.iomux.fgpio);
            #endif
            gpio_request(rksdmmc0_gpio_init.power_en_gpio.io,"sdmmc-power");
            gpio_direction_output(rksdmmc0_gpio_init.power_en_gpio.io, !(rksdmmc0_gpio_init.power_en_gpio.enable)); //power-off

        #if 0 //replace the power control into rk29_sdmmc_set_ios(); modifyed by xbw at 2012-08-12
            rk29_sdmmc_gpio_open(0, 0);

            gpio_direction_output(rksdmmc0_gpio_init.power_en_gpio.io, rksdmmc0_gpio_init.power_en_gpio.enable); //power-on

            rk29_sdmmc_gpio_open(0, 1);
          #endif  
    	}
    	break;

    	default: //case 0://SDMMC_CTYPE_1BIT:
        {
            #if SDMMC_USE_NEW_IOMUX_API
        	iomux_set(rksdmmc0_gpio_init.cmd_gpio.iomux.fmux);
        	iomux_set(rksdmmc0_gpio_init.clk_gpio.iomux.fmux);
        	iomux_set(rksdmmc0_gpio_init.data0_gpio.iomux.fmux);
            #else
        	rk30_mux_api_set(rksdmmc0_gpio_init.cmd_gpio.iomux.name, rksdmmc0_gpio_init.cmd_gpio.iomux.fmux);
        	rk30_mux_api_set(rksdmmc0_gpio_init.clk_gpio.iomux.name, rksdmmc0_gpio_init.clk_gpio.iomux.fmux);
        	rk30_mux_api_set(rksdmmc0_gpio_init.data0_gpio.iomux.name, rksdmmc0_gpio_init.data0_gpio.iomux.fmux);
        	#endif

            //IO voltage(vccio);
            #ifdef RK31SDK_SET_SDMMC0_PIN_VOLTAGE
                if(rk31sdk_get_sdmmc0_pin_io_voltage() > 2700)
                    SDMMC_write_grf_reg(GRF_IO_CON4, (SDMMC0_IO_VOLTAGE_MASK |SDMMC0_IO_VOLTAGE_33)); //set SDMMC0 pin to 3.3v
                else
                    SDMMC_write_grf_reg(GRF_IO_CON4, (SDMMC0_IO_VOLTAGE_MASK |SDMMC0_IO_VOLTAGE_18));//set SDMMC0 pin to 1.8v
            #else
            //default set the voltage of SDMMC0 to 3.3V
            SDMMC_write_grf_reg(GRF_IO_CON4, (SDMMC0_IO_VOLTAGE_MASK |SDMMC0_IO_VOLTAGE_33));
            #endif
    
            //sdmmc drive strength control
            SDMMC_write_grf_reg(GRF_IO_CON2, (SDMMC0_DRIVER_STRENGTH_MASK |SDMMC0_DRIVER_STRENGTH_8MA));
            
            #if !(!!SDMMC_USE_NEW_IOMUX_API)
            rk30_mux_api_set(rksdmmc0_gpio_init.data1_gpio.iomux.name, rksdmmc0_gpio_init.data1_gpio.iomux.fgpio);
            #endif
            gpio_request(rksdmmc0_gpio_init.data1_gpio.io, "mmc0-data1");
            gpio_direction_output(rksdmmc0_gpio_init.data1_gpio.io,GPIO_HIGH);//set mmc0-data1 to high.

            #if !(!!SDMMC_USE_NEW_IOMUX_API)
            rk30_mux_api_set(rksdmmc0_gpio_init.data2_gpio.iomux.name, rksdmmc0_gpio_init.data2_gpio.iomux.fgpio);
            #endif
            gpio_request(rksdmmc0_gpio_init.data2_gpio.io, "mmc0-data2");
            gpio_direction_output(rksdmmc0_gpio_init.data2_gpio.io,GPIO_HIGH);//set mmc0-data2 to high.

            #if !(!!SDMMC_USE_NEW_IOMUX_API)
            rk30_mux_api_set(rksdmmc0_gpio_init.data3_gpio.iomux.name, rksdmmc0_gpio_init.data3_gpio.iomux.fgpio);
            #endif
            gpio_request(rksdmmc0_gpio_init.data3_gpio.io, "mmc0-data3");
            gpio_direction_output(rksdmmc0_gpio_init.data3_gpio.io,GPIO_HIGH);//set mmc0-data3 to high.
    	}
    	break;
	}
}