]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
media: rc: gpio-ir: add delay/protocols DT support
authorDaniel Fu <danifu@nvidia.com>
Wed, 24 Sep 2014 13:39:11 +0000 (21:39 +0800)
committerLaxman Dewangan <ldewangan@nvidia.com>
Mon, 13 Oct 2014 08:15:20 +0000 (01:15 -0700)
-IR driver to have the capability to read allowed
 IR protocols through DT.
-Add optional min-delay DT support.

Bug 1353511

Change-Id: I4209d6a9af06b37ffc9650c7096fdcf7216eb034
Signed-off-by: Jun Yan <juyan@nvidia.com>
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: http://git-master/r/538435
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
drivers/media/rc/gpio-ir-recv.c
include/media/gpio-ir-recv.h

index 56e726ef4bf26f0faa561e5f5aec663d7def9a1c..4a68620a9793e2eecd69301b52f924be202a25c4 100644 (file)
@@ -5,12 +5,17 @@ Required properties:
        - gpios: specifies GPIO used for IR signal reception.
 
 Optional properties:
+       - min-delay: minimum delay(ms) to send IR event reset for raw IR decoding.
        - linux,rc-map-name: Linux specific remote control map name.
+       - allowed-protos: 64 bit integer, platform specific allowed
+                         IR protocols.
 
 Example node:
 
        ir: ir-receiver {
                compatible = "gpio-ir-receiver";
                gpios = <&gpio0 19 1>;
+               min-delay = <500>;
                linux,rc-map-name = "rc-rc6-mce";
+               allowed-protos = <0x00000000 0x00000080>;
        };
index 8b82ae9bd686b5ccd06de9b3a62e0d0df48f077d..1bacf0d7ceee47eff419274001b77c71bab45cd6 100644 (file)
@@ -51,9 +51,13 @@ static int gpio_ir_recv_get_devtree_pdata(struct device *dev,
 
        pdata->gpio_nr = gpio;
        pdata->active_low = (flags & OF_GPIO_ACTIVE_LOW);
+       if (of_property_read_u32(np, "min-delay", &pdata->min_delay))
+               pdata->min_delay = 0;
        /* probe() takes care of map_name == NULL or allowed_protos == 0 */
        pdata->map_name = of_get_property(np, "linux,rc-map-name", NULL);
-       pdata->allowed_protos = 0;
+
+       if (of_property_read_u64(np, "allowed-protos", &pdata->allowed_protos))
+               pdata->allowed_protos = 0;
 
        return 0;
 }
@@ -143,6 +147,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
        rcdev->input_id.version = 0x0100;
        rcdev->dev.parent = &pdev->dev;
        rcdev->driver_name = GPIO_IR_DRIVER_NAME;
+       rcdev->min_delay = pdata->min_delay;
        if (pdata->allowed_protos)
                rcdev->allowed_protos = pdata->allowed_protos;
        else
index 0142736a59db86a3dff4c9592793c6f6f6193e72..214fe67696579874f00abc3d23ccc614c0f87a49 100644 (file)
@@ -17,6 +17,7 @@ struct gpio_ir_recv_platform_data {
        int             gpio_nr;
        bool            active_low;
        u64             allowed_protos;
+       u32             min_delay;
        const char      *map_name;
 };