((*(p + LCD_UKEY_PCLK + 1)) << 8) |
((*(p + LCD_UKEY_PCLK + 2)) << 16) |
((*(p + LCD_UKEY_PCLK + 3)) << 24));
+ if (pconf->lcd_timing.lcd_clk == 0) { /* avoid 0 mistake */
+ pconf->lcd_timing.lcd_clk = 60;
+ LCDERR("lcd_clk is 0, default to 60Hz\n");
+ }
pconf->lcd_basic.h_period_min = (*(p + LCD_UKEY_H_PERIOD_MIN) |
((*(p + LCD_UKEY_H_PERIOD_MIN + 1)) << 8));
pconf->lcd_basic.h_period_max = (*(p + LCD_UKEY_H_PERIOD_MAX) |
LCDPR("detect lcd_auto_test: %d\n", lcd_driver->lcd_auto_test);
}
- ret = of_property_read_string_index(lcd_driver->dev->of_node,
- "interrupt-names", 0, &str);
- if (ret == 0) {
- lcd_driver->res_vsync_irq = platform_get_resource(pdev,
- IORESOURCE_IRQ, 0);
- }
- ret = of_property_read_string_index(lcd_driver->dev->of_node,
- "interrupt-names", 1, &str);
- if (ret == 0) {
- if (strcmp(str, "vbyone") == 0) {
- lcd_driver->res_vx1_irq =
- platform_get_resource(pdev, IORESOURCE_IRQ, 1);
- } else if (strcmp(str, "vsync2") == 0) {
- lcd_driver->res_vsync2_irq =
- platform_get_resource(pdev, IORESOURCE_IRQ, 1);
- }
- }
- ret = of_property_read_string_index(lcd_driver->dev->of_node,
- "interrupt-names", 2, &str);
- if (ret == 0) {
- lcd_driver->res_tcon_irq = platform_get_resource(pdev,
- IORESOURCE_IRQ, 2);
- }
+ lcd_driver->res_vsync_irq = platform_get_resource_byname(pdev,
+ IORESOURCE_IRQ, "vsync");
+ lcd_driver->res_vsync2_irq = platform_get_resource_byname(pdev,
+ IORESOURCE_IRQ, "vsync2");
+ lcd_driver->res_vx1_irq = platform_get_resource_byname(pdev,
+ IORESOURCE_IRQ, "vbyone");
+ lcd_driver->res_tcon_irq = platform_get_resource_byname(pdev,
+ IORESOURCE_IRQ, "tcon");
lcd_driver->lcd_info = &lcd_vinfo;
lcd_driver->lcd_config = &lcd_config_dft;