]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
media: i2c: adv7511: Fix use with DT
authorMatthew Fornero <mfornero@mathworks.com>
Tue, 29 Mar 2016 14:36:03 +0000 (10:36 -0400)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 1 Apr 2016 10:46:00 +0000 (12:46 +0200)
The DT bindings added in commit:

b983a5a3303f68a2b9422deb452ff5e5cd3b806c
("media: i2c: adv7511: Add DT binding to this driver")

were added before support for infoframes were added in commit:

b4dbad8fe3b60466e0d364b34c075117757838f2
("[media] adv7511: log the currently set infoframes")

With the infoframes added, DT based use of the driver will fail to find
the pktmem I2C device and fail to load.

Add a pktmem-addr device tree binding (similar to the edid-addr)
to enable this address to be specified.

Add a cec-addr device tree binding as well, for future use.

Signed-off-by: Matthew Fornero <mfornero@mathworks.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/media/i2c/adv7511.c

index fc1e847f6603ff6a013ee90decd6568ed476fcf4..bc7aaf206dc837865c65f607c8c157df58467da4 100644 (file)
@@ -1729,6 +1729,14 @@ static void adv7511_get_ofdt_config(struct i2c_client *client,
        if (prop)
                state->pdata.i2c_edid = (uint8_t)be32_to_cpup(prop);
 
+       prop = of_get_property(dn, "pktmem-addr", &size);
+       if (prop)
+               state->pdata.i2c_pktmem = (uint8_t)be32_to_cpup(prop);
+
+       prop = of_get_property(dn, "cec-addr", &size);
+       if (prop)
+               state->pdata.i2c_cec = (uint8_t)be32_to_cpup(prop);
+
        np = of_find_node_by_name(dn, "video-input");
        if (np) {
                prop = of_get_property(np, "input-id", &size);