int s3cfb_clk_off(struct platform_device *pdev, struct clk **clk) { struct clk *lcd_clk = NULL; lcd_clk = clk_get(&pdev->dev, "lcd"); if (IS_ERR(lcd_clk)) { printk(KERN_ERR "failed to get ip clk for fimd0\n"); goto err_clk0; } clk_disable(lcd_clk); clk_put(lcd_clk); clk_disable(*clk); clk_put(*clk); *clk = NULL; #ifdef CONFIG_FB_S5P_MIPI_DSIM s3cfb_mipi_clk_off(); #endif #ifdef CONFIG_FB_S5P_MDNIE s3cfb_mdnie_clk_off(); s3cfb_mdnie_pwm_clk_off(); #endif return 0; err_clk0: clk_put(lcd_clk); return -EINVAL; }
int s3cfb_clk_off(struct platform_device *pdev, struct clk **clk) { int ret = 0; struct clk *lcd_clk = NULL; struct s3c_platform_fb *pdata = pdev->dev.platform_data; struct s3cfb_lcd *lcd = (struct s3cfb_lcd *)pdata->lcd; lcd_clk = clk_get(&pdev->dev, "lcd"); if (IS_ERR(lcd_clk)) { printk(KERN_ERR "failed to get ip clk for fimd0\n"); goto err_clk0; } clk_disable(lcd_clk); clk_put(lcd_clk); clk_disable(*clk); clk_put(*clk); *clk = NULL; #ifndef CONFIG_FB_I80_CLOCK_GATING #ifdef CONFIG_FB_S5P_MIPI_DSIM s3cfb_mipi_clk_enable(0); #endif #endif #ifdef CONFIG_FB_S5P_MDNIE s3cfb_mdnie_clk_off(); s3cfb_mdnie_pwm_clk_off(); #endif return 0; err_clk0: clk_put(lcd_clk); #if 0 err_mutex: mutex_unlock(&lcd->clk_mutex); #endif return ret; }