#endif
#ifdef CONFIG_FB_ROCKCHIP
+
+#define LCD_EN_MUX_NAME GPIO4C7_SMCDATA7_TRACEDATA7_NAME
+#define LCD_EN_PIN RK30_PIN4_PC7
+#define LCD_EN_VALUE GPIO_HIGH
+
+static int rk_fb_io_init(void)
+{
+ int ret = 0;
+ rk30_mux_api_set(LCD_EN_MUX_NAME, GPIO4C_GPIO4C7);
+ ret = gpio_request(LCD_EN_PIN, NULL);
+ if (ret != 0)
+ {
+ gpio_free(LCD_EN_PIN);
+ printk(KERN_ERR "request lcd en pin fail!\n");
+ return -1;
+ }
+ else
+ {
+ gpio_direction_output(LCD_EN_PIN, 1);
+ gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE);
+ }
+ return 0;
+}
+static struct rk29lcd_info rk_fb_info = {
+ .io_init = rk_fb_io_init,
+};
+
static struct resource resource_fb[] = {
[0] = {
.name = "fb0 buf",
.id = -1,
.num_resources = ARRAY_SIZE(resource_fb),
.resource = resource_fb,
+ .dev = {
+ .platform_data = &rk_fb_info,
+ }
};
#endif
- // ret = clk_set_rate(lcdc_dev->dclk, screen->pixclock);
+ ret = clk_set_rate(lcdc_dev->dclk, screen->pixclock);
if(ret)
{
printk(KERN_ERR ">>>>>> set lcdc dclk failed\n");
lcdc_dev->driver->pixclock = lcdc_dev->pixclock = div_u64(1000000000000llu, clk_get_rate(lcdc_dev->dclk));
if(initscreen)
{
- //ret = clk_set_parent(lcdc_dev->aclk, lcdc_dev->aclk_parent);
if(screen->lcdc_aclk){
aclk_rate = screen->lcdc_aclk;
}
- // ret = clk_set_rate(lcdc_dev->aclk, aclk_rate);
+ ret = clk_set_rate(lcdc_dev->aclk, aclk_rate);
if(ret){
printk(KERN_ERR ">>>>>> set lcdc aclk failed\n");
}
}
fbi->fix.mmio_start = res->start;
fbi->fix.mmio_len = res->end - res->start + 1;
- break;
#endif
+ break;
case 2:
res = platform_get_resource_byname(g_fb_pdev, IORESOURCE_MEM, "fb2 buf");
if (res == NULL)
static int __devinit rk_fb_probe (struct platform_device *pdev)
{
struct rk_fb_inf *fb_inf = NULL;
+ struct rk29lcd_info *lcd_info = NULL;
int ret = 0;
g_fb_pdev=pdev;
- /* Malloc rk29fb_inf and set it to pdev for drvdata */
- fb_inf = kmalloc(sizeof(struct rk_fb_inf), GFP_KERNEL);
- if(!fb_inf)
- {
- dev_err(&pdev->dev, ">>fb inf kmalloc fail!");
- ret = -ENOMEM;
- }
- memset(fb_inf, 0, sizeof(struct rk_fb_inf));
+ lcd_info = pdev->dev.platform_data;
+ /* Malloc rk_fb_inf and set it to pdev for drvdata */
+ fb_inf = kmalloc(sizeof(struct rk_fb_inf), GFP_KERNEL);
+ if(!fb_inf)
+ {
+ dev_err(&pdev->dev, ">>fb inf kmalloc fail!");
+ ret = -ENOMEM;
+ }
+ memset(fb_inf, 0, sizeof(struct rk_fb_inf));
platform_set_drvdata(pdev, fb_inf);
+ if(lcd_info->io_init)
+ lcd_info->io_init();
printk("rk fb probe ok!\n");
return 0;
}