]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
omapdss: hdmi: Add an i2c adapter node as a possible DT phandle
authorArchit Taneja <archit@ti.com>
Tue, 30 Apr 2013 12:08:29 +0000 (14:08 +0200)
committerArchit Taneja <archit@ti.com>
Thu, 30 May 2013 15:39:18 +0000 (21:09 +0530)
The hdmi driver supports reading edid either via HDMI IP's ddc in the case
of omap4. We support a bitbanged gpio i2c mode for omap5. For Vayu, the pins
muxed with HDMI IP's ddc are the I2C2 lines, so we provide a mode where we allow
the i2c adapter to be passed as a phandle by DT.

Add a DT node for hdmi similar to that as of omap5-uevm. The difference on Vayu
evm is that it the hdmi ddc lines are the I2C2 line instead of bitbanged gpio
lines. There is a also a PCF level shifter on I2C2 which is used to drive LS_OE
and CT_HPD pins in the TPS level shifter. The HPD gpio is connected directly to
a Vayu GPIO bank.

Signed-off-by: Archit Taneja <archit@ti.com>
arch/arm/boot/dts/dra7-evm.dts
drivers/video/omap2/dss/hdmi.c

index 46cf5cf394002d1d2447bfb1c6e52f45d0db69a1..eeced45ce4ce8c7a1424a2dead3958082762bce8 100644 (file)
 
 &i2c2 {
        clock-frequency = <400000>;
+
+       pcf_hdmi: pcf8575@26 {
+               compatible = "ti,pcf8575";
+               reg = <0x26>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
 };
 
 &i2c3 {
                data-lines = <24>;
        };
 };
+
+&hdmi {
+       tpd12s015: tpd12s015 {
+               compatible = "ti,tpd12s015";
+
+               gpios = <&pcf_hdmi 4 0>,        /* pcf8575@22 P4, CT_CP_HDP */
+                       <&pcf_hdmi 5 0>,        /* pcf8575@22 P5, LS_OE */
+                       <&gpio7 12 0>;          /* gpio7_12/sp1_cs2, HPD */
+
+               hdmi_ddc = <&i2c2>;
+
+               hdmi-monitor {
+                       compatible = "ti,hdmi_panel";
+               };
+       };
+};
index 15c9d011ddc82d656798c1aced82697a3164e01f..6719c2d3d64cce0fcd231c0eae7c41e9d41c8e12 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/of_gpio.h>
+#include <linux/of_i2c.h>
 #include <video/omapdss.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
@@ -77,8 +78,13 @@ static struct {
        /* level shifter state */
        enum level_shifter_state ls_state;
 
-       /* i2c adapter info */
+       /*
+        * i2c adapter info(this could be either a bitbanged adapter, or a
+        * 'real' i2c adapter
+        */
        struct i2c_adapter *adap;
+
+       /* these are needed in case it's a bitbanged adapter */
        struct i2c_algo_bit_data bit_data;
        int scl_pin;
        int sda_pin;
@@ -1543,6 +1549,8 @@ static void __init hdmi_probe_of(struct platform_device *pdev)
        struct device_node *node = pdev->dev.of_node;
        struct device_node *child;
        struct omap_dss_device *dssdev;
+       struct device_node *adapter_node;
+       struct i2c_adapter *adapter = NULL;
        int r, gpio;
        enum omap_channel channel;
        u32 v;
@@ -1596,8 +1604,16 @@ static void __init hdmi_probe_of(struct platform_device *pdev)
                return;
        }
 
-       /* if I2C SCL and SDA pins are defined, parse them */
-       /* these will only be valid for OMAP5 derivatives */
+       adapter_node = of_parse_phandle(node, "hdmi_ddc", 0);
+       if (adapter_node)
+               adapter = of_find_i2c_adapter_by_node(adapter_node);
+
+       /*
+        * if I2C SCL and SDA pins are defined, parse them, if an adapter is
+        * present, use the i2c adapter rather than bitbanging i2c. If there
+        * isn't an adapter either, assume that we are using the hdmi core IP's
+        * ddc.
+        */
        if (gpio_count == 5) {
                gpio = of_get_gpio(node, 3);
                if (gpio_is_valid(gpio)) {