ARM: DT: Add DT entry for PWMs and Backlight
[linux-3.10.git] / arch / arm / mach-tegra / panel-a-1080p-14-0.c
index 8375047..90a31a2 100644 (file)
@@ -199,14 +199,21 @@ static int laguna_dsi_gpio_get(void)
                goto fail;
        }
 
-
-       /* free pwm GPIO */
        err = gpio_request(LCD_TE, "lcd_te");
        if (err < 0) {
                pr_err("panel lcd te request failed\n");
                goto fail;
        }
 
+       err = gpio_request(DSI_PANEL_BL_PWM_GPIO, "panel pwm");
+       if (err < 0) {
+               pr_err("panel pwm gpio request failed\n");
+               goto fail;
+       }
+
+       /* Free pwm GPIO */
+       gpio_free(DSI_PANEL_BL_PWM_GPIO);
+
        err = gpio_request(lvds_en, "edp bridge 1v8 enable");
        if (err < 0) {
                pr_err("edp bridge 1v8 enable gpio request failed\n");
@@ -393,7 +400,7 @@ static struct platform_device __maybe_unused
        &dsi_a_1080p_14_0_bl_device,
 };
 
-static int  __init dsi_a_1080p_14_0_register_bl_dev(void)
+static int  __init __dsi_a_1080p_14_0_register_bl_dev(void)
 {
        int err = 0;
        err = platform_add_devices(dsi_a_1080p_14_0_bl_devices,
@@ -405,6 +412,14 @@ static int  __init dsi_a_1080p_14_0_register_bl_dev(void)
        return err;
 }
 
+static int  __init dsi_a_1080p_14_0_register_bl_dev(void)
+{
+       int err = 0;
+       if (!of_have_populated_dt())
+               err = __dsi_a_1080p_14_0_register_bl_dev();
+       return err;
+}
+
 static void dsi_a_1080p_14_0_set_disp_device(
        struct platform_device *laguna_display_device)
 {