rockchip: video: Check for device in use
authorSimon Glass <sjg@chromium.org>
Sun, 13 Nov 2016 21:22:08 +0000 (14:22 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 26 Nov 2016 00:59:31 +0000 (17:59 -0700)
Check whether a display device is in use before using it. Add a comment as
to why two displays cannot currently be used at the same time.

This allows us to remove the device-tree change that disables vopb on
jerry.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/arm/dts/rk3288-jerry.dts
arch/arm/dts/rk3288-veyron-chromebook.dtsi
drivers/video/rockchip/rk_vop.c

index 2aa3b9f97149a5ae36a4f4381ef027d70d6e8361..da37ea8e7add5c9c1de1ffa9da2ba150bdab6ef3 100644 (file)
        pinctrl-0 = <&vcc50_hdmi_en>;
 };
 
-&vopb {
-       /* Disable this so that we use vopl */
-       status = "disabled";
-};
-
 &edp {
        pinctrl-names = "default";
        pinctrl-0 = <&edp_hpd>;
index bbbc2f408d632a6d6e3d65ea2903bece8db1ddf3..f88a8680bfa5afdcf06ff3438df94139e155a900 100644 (file)
@@ -13,6 +13,8 @@
 / {
        aliases {
                i2c20 = &i2c_tunnel;
+               video0 = &vopl;
+               video1 = &vopb;
        };
 
        gpio_keys: gpio-keys {
index 130dace74009e183a5b834dd5fed514818e3fa27..eab548699f74e1830966ebf08fa799c18a04c82f 100644 (file)
@@ -221,6 +221,11 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
 
        disp_uc_plat = dev_get_uclass_platdata(disp);
        debug("Found device '%s', disp_uc_priv=%p\n", disp->name, disp_uc_plat);
+       if (display_in_use(disp)) {
+               debug("   - device in use\n");
+               return -EBUSY;
+       }
+
        disp_uc_plat->source_id = remote_vop_id;
        disp_uc_plat->src_dev = dev;
 
@@ -311,6 +316,10 @@ static int rk_vop_probe(struct udevice *dev)
        /*
         * Try all the ports until we find one that works. In practice this
         * tries EDP first if available, then HDMI.
+        *
+        * Note that rockchip_vop_set_clk() always uses NPLL as the source
+        * clock so it is currently not possible to use more than one display
+        * device simultaneously.
         */
        port = fdt_subnode_offset(blob, dev->of_offset, "port");
        if (port < 0)