[media] rc: raw IR drivers cannot handle cec, unknown or other
authorSean Young <sean@mess.org>
Sat, 3 Dec 2016 10:55:56 +0000 (08:55 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 30 Jan 2017 14:40:50 +0000 (12:40 -0200)
unknown and other are for IR protocols for which we have no decoder,
so the raw IR drivers have no chance of generating them. cec is not
an IR protocol.

Signed-off-by: Sean Young <sean@mess.org>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
24 files changed:
drivers/hid/hid-picolcd_cir.c
drivers/media/common/siano/smsir.c
drivers/media/pci/cx23885/cx23885-input.c
drivers/media/rc/ene_ir.c
drivers/media/rc/fintek-cir.c
drivers/media/rc/gpio-ir-recv.c
drivers/media/rc/igorplugusb.c
drivers/media/rc/iguanair.c
drivers/media/rc/ir-hix5hd2.c
drivers/media/rc/ite-cir.c
drivers/media/rc/mceusb.c
drivers/media/rc/meson-ir.c
drivers/media/rc/nuvoton-cir.c
drivers/media/rc/rc-loopback.c
drivers/media/rc/redrat3.c
drivers/media/rc/serial_ir.c
drivers/media/rc/st_rc.c
drivers/media/rc/streamzap.c
drivers/media/rc/sunxi-cir.c
drivers/media/rc/ttusbir.c
drivers/media/rc/winbond-cir.c
drivers/media/usb/dvb-usb-v2/rtl28xxu.c
drivers/media/usb/dvb-usb/technisat-usb2.c
include/media/rc-map.h

index 96286510f42e990eef1a0fd6a03abfd57fd42f57..90add97cc54dd535d54d9d6561018e2fba448ad8 100644 (file)
@@ -114,7 +114,7 @@ int picolcd_init_cir(struct picolcd_data *data, struct hid_report *report)
 
        rdev->priv             = data;
        rdev->driver_type      = RC_DRIVER_IR_RAW;
-       rdev->allowed_protocols = RC_BIT_ALL;
+       rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rdev->open             = picolcd_cir_open;
        rdev->close            = picolcd_cir_close;
        rdev->input_name       = data->hdev->name;
index 41f2a39399792e55fb6217163a6906ad66837229..480d8bf3d26a6fb40c2b074fa29c1942b32c431e 100644 (file)
@@ -87,7 +87,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
 
        dev->priv = coredev;
        dev->driver_type = RC_DRIVER_IR_RAW;
-       dev->allowed_protocols = RC_BIT_ALL;
+       dev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        dev->map_name = sms_get_board(board_id)->rc_codes;
        dev->driver_name = MODULE_NAME;
 
index 1f092febdbd18fead84f8569787c28d96750f6e3..2d4e703b689332eadd46987e104d1535893a2987 100644 (file)
@@ -286,28 +286,28 @@ int cx23885_input_init(struct cx23885_dev *dev)
        case CX23885_BOARD_HAUPPAUGE_HVR1250:
                /* Integrated CX2388[58] IR controller */
                driver_type = RC_DRIVER_IR_RAW;
-               allowed_protos = RC_BIT_ALL;
+               allowed_protos = RC_BIT_ALL_IR_DECODER;
                /* The grey Hauppauge RC-5 remote */
                rc_map = RC_MAP_HAUPPAUGE;
                break;
        case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL:
                /* Integrated CX23885 IR controller */
                driver_type = RC_DRIVER_IR_RAW;
-               allowed_protos = RC_BIT_ALL;
+               allowed_protos = RC_BIT_ALL_IR_DECODER;
                /* The grey Terratec remote with orange buttons */
                rc_map = RC_MAP_NEC_TERRATEC_CINERGY_XS;
                break;
        case CX23885_BOARD_TEVII_S470:
                /* Integrated CX23885 IR controller */
                driver_type = RC_DRIVER_IR_RAW;
-               allowed_protos = RC_BIT_ALL;
+               allowed_protos = RC_BIT_ALL_IR_DECODER;
                /* A guess at the remote */
                rc_map = RC_MAP_TEVII_NEC;
                break;
        case CX23885_BOARD_MYGICA_X8507:
                /* Integrated CX23885 IR controller */
                driver_type = RC_DRIVER_IR_RAW;
-               allowed_protos = RC_BIT_ALL;
+               allowed_protos = RC_BIT_ALL_IR_DECODER;
                /* A guess at the remote */
                rc_map = RC_MAP_TOTAL_MEDIA_IN_HAND_02;
                break;
@@ -315,7 +315,7 @@ int cx23885_input_init(struct cx23885_dev *dev)
        case CX23885_BOARD_TBS_6981:
                /* Integrated CX23885 IR controller */
                driver_type = RC_DRIVER_IR_RAW;
-               allowed_protos = RC_BIT_ALL;
+               allowed_protos = RC_BIT_ALL_IR_DECODER;
                /* A guess at the remote */
                rc_map = RC_MAP_TBS_NEC;
                break;
@@ -327,13 +327,13 @@ int cx23885_input_init(struct cx23885_dev *dev)
        case CX23885_BOARD_DVBSKY_T982:
                /* Integrated CX23885 IR controller */
                driver_type = RC_DRIVER_IR_RAW;
-               allowed_protos = RC_BIT_ALL;
+               allowed_protos = RC_BIT_ALL_IR_DECODER;
                rc_map = RC_MAP_DVBSKY;
                break;
        case CX23885_BOARD_TT_CT2_4500_CI:
                /* Integrated CX23885 IR controller */
                driver_type = RC_DRIVER_IR_RAW;
-               allowed_protos = RC_BIT_ALL;
+               allowed_protos = RC_BIT_ALL_IR_DECODER;
                rc_map = RC_MAP_TT_1500;
                break;
        default:
index ce3cb81902ca5cf4d0133027e69fc64f931d2f9a..fbfefb7a5f7d5fa4fd9d08e7143e4e3f0f1565ec 100644 (file)
@@ -1054,7 +1054,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
                learning_mode_force = false;
 
        rdev->driver_type = RC_DRIVER_IR_RAW;
-       rdev->allowed_protocols = RC_BIT_ALL;
+       rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rdev->priv = dev;
        rdev->open = ene_open;
        rdev->close = ene_close;
index 308efec57cc1b0d126c18a79142c4233da2da40f..b391b2f8ab7990d7d8b5ec8f130ad5b774173a2a 100644 (file)
@@ -530,7 +530,7 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
        /* Set up the rc device */
        rdev->priv = fintek;
        rdev->driver_type = RC_DRIVER_IR_RAW;
-       rdev->allowed_protocols = RC_BIT_ALL;
+       rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rdev->open = fintek_open;
        rdev->close = fintek_close;
        rdev->input_name = FINTEK_DESCRIPTION;
index 5b63b1f15cb18b4431c872923b88d1cd2c0bf764..0b5aec4b9c9d5b527fcb3e06342d4d09d031a589 100644 (file)
@@ -165,7 +165,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
        if (pdata->allowed_protos)
                rcdev->allowed_protocols = pdata->allowed_protos;
        else
-               rcdev->allowed_protocols = RC_BIT_ALL;
+               rcdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY;
 
        gpio_dev->rcdev = rcdev;
index 5cf983be07a207f896dc11621095e21ebd91c79a..4c4827c3408b6a1868cb3d149bec0092dfdaa14b 100644 (file)
@@ -203,8 +203,8 @@ static int igorplugusb_probe(struct usb_interface *intf,
         * This device can only store 36 pulses + spaces, which is not enough
         * for the NEC protocol and many others.
         */
-       rc->allowed_protocols = RC_BIT_ALL & ~(RC_BIT_NEC | RC_BIT_NECX |
-                       RC_BIT_NEC32 | RC_BIT_RC6_6A_20 |
+       rc->allowed_protocols = RC_BIT_ALL_IR_DECODER & ~(RC_BIT_NEC |
+                       RC_BIT_NECX | RC_BIT_NEC32 | RC_BIT_RC6_6A_20 |
                        RC_BIT_RC6_6A_24 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE |
                        RC_BIT_SONY20 | RC_BIT_MCE_KBD | RC_BIT_SANYO);
 
index 9554585df8b88a56d6b5b609b997e92707107923..75e1dfb1be26b469e2e592f5556d85ffc30dc4b0 100644 (file)
@@ -491,7 +491,7 @@ static int iguanair_probe(struct usb_interface *intf,
        usb_to_input_id(ir->udev, &rc->input_id);
        rc->dev.parent = &intf->dev;
        rc->driver_type = RC_DRIVER_IR_RAW;
-       rc->allowed_protocols = RC_BIT_ALL;
+       rc->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rc->priv = ir;
        rc->open = iguanair_open;
        rc->close = iguanair_close;
index d26907e684dc2ba7bcd1e0af846b573c7c4f055d..d95056ad26dcb3f8206016db8b4fc13b252c86d9 100644 (file)
@@ -243,7 +243,7 @@ static int hix5hd2_ir_probe(struct platform_device *pdev)
        priv->rate = clk_get_rate(priv->clock);
 
        rdev->driver_type = RC_DRIVER_IR_RAW;
-       rdev->allowed_protocols = RC_BIT_ALL;
+       rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rdev->priv = priv;
        rdev->open = hix5hd2_ir_open;
        rdev->close = hix5hd2_ir_close;
index b955a79608e00ba78dd101b05802fd159262e570..3bffc169b31e82d7fa2c21b9c71e1735c9b645f3 100644 (file)
@@ -1557,7 +1557,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
        /* set up ir-core props */
        rdev->priv = itdev;
        rdev->driver_type = RC_DRIVER_IR_RAW;
-       rdev->allowed_protocols = RC_BIT_ALL;
+       rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rdev->open = ite_open;
        rdev->close = ite_close;
        rdev->s_idle = ite_s_idle;
index b814ead58e0e9fda3a306060286889e68f8e42bd..85b220435ff55056fbd74e51b1c5abc8edbf8cf0 100644 (file)
@@ -1198,7 +1198,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir)
        rc->dev.parent = dev;
        rc->priv = ir;
        rc->driver_type = RC_DRIVER_IR_RAW;
-       rc->allowed_protocols = RC_BIT_ALL;
+       rc->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rc->timeout = MS_TO_NS(100);
        if (!ir->flags.no_tx) {
                rc->s_tx_mask = mceusb_set_tx_mask;
index 7eb3f4f1ddcd670d501432528a2472dc0775d55f..3e96e6f1b0c56e2c98ca26f971d12b47875a45e5 100644 (file)
@@ -145,7 +145,7 @@ static int meson_ir_probe(struct platform_device *pdev)
        ir->rc->map_name = map_name ? map_name : RC_MAP_EMPTY;
        ir->rc->dev.parent = dev;
        ir->rc->driver_type = RC_DRIVER_IR_RAW;
-       ir->rc->allowed_protocols = RC_BIT_ALL;
+       ir->rc->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        ir->rc->rx_resolution = US_TO_NS(MESON_TRATE);
        ir->rc->timeout = MS_TO_NS(200);
        ir->rc->driver_name = DRIVER_NAME;
index 0f7e2b4d3beea0d847e4843845cb25c92e1adc71..77c05145c04e79b0d42be61e46082d1d6ba33698 100644 (file)
@@ -1057,7 +1057,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
        /* Set up the rc device */
        rdev->priv = nvt;
        rdev->driver_type = RC_DRIVER_IR_RAW;
-       rdev->allowed_protocols = RC_BIT_ALL;
+       rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rdev->open = nvt_open;
        rdev->close = nvt_close;
        rdev->tx_ir = nvt_tx_ir;
index 698927b3b039ff0efd10652c892b2622d135154f..06dd97d4b7cd8e14dd5ed04fcf8049a2c48df6ec 100644 (file)
@@ -191,7 +191,7 @@ static int __init loop_init(void)
        rc->map_name            = RC_MAP_EMPTY;
        rc->priv                = &loopdev;
        rc->driver_type         = RC_DRIVER_IR_RAW;
-       rc->allowed_protocols   = RC_BIT_ALL;
+       rc->allowed_protocols   = RC_BIT_ALL_IR_DECODER;
        rc->timeout             = 100 * 1000 * 1000; /* 100 ms */
        rc->min_timeout         = 1;
        rc->max_timeout         = UINT_MAX;
index 06bea6c00620bdb8ad5bdea9bc33e375e49829a4..4ab0ea02a309be47e5caa826762d13c04289053f 100644 (file)
@@ -957,7 +957,7 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3)
        rc->dev.parent = dev;
        rc->priv = rr3;
        rc->driver_type = RC_DRIVER_IR_RAW;
-       rc->allowed_protocols = RC_BIT_ALL;
+       rc->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rc->min_timeout = MS_TO_NS(RR3_RX_MIN_TIMEOUT);
        rc->max_timeout = MS_TO_NS(RR3_RX_MAX_TIMEOUT);
        rc->timeout = US_TO_NS(redrat3_get_timeout(rr3));
index 2cb6471641bde9d6c500e42d3c55bc4be3a52962..408594ea896c347bab1bb7f429b0aec9b5a28d96 100644 (file)
@@ -797,7 +797,7 @@ static int __init serial_ir_init_module(void)
        rcdev->close = serial_ir_close;
        rcdev->dev.parent = &serial_ir.pdev->dev;
        rcdev->driver_type = RC_DRIVER_IR_RAW;
-       rcdev->allowed_protocols = RC_BIT_ALL;
+       rcdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rcdev->driver_name = KBUILD_MODNAME;
        rcdev->map_name = RC_MAP_RC6_MCE;
        rcdev->min_timeout = 1;
index 1fa0c9d1c5083766c53bafe11d5e955bdd6c838a..80a46e7a779f2b0400bd05ab5ea78272abc54b8c 100644 (file)
@@ -291,7 +291,7 @@ static int st_rc_probe(struct platform_device *pdev)
        st_rc_hardware_init(rc_dev);
 
        rdev->driver_type = RC_DRIVER_IR_RAW;
-       rdev->allowed_protocols = RC_BIT_ALL;
+       rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        /* rx sampling rate is 10Mhz */
        rdev->rx_resolution = 100;
        rdev->timeout = US_TO_NS(MAX_SYMB_TIME);
index 26f6076ae584e4f933dc7b1a6cbed339c4356b40..f6391dd6e29f73d7e57c7bfae7178e23b8d54933 100644 (file)
@@ -305,7 +305,7 @@ static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz)
        rdev->dev.parent = dev;
        rdev->priv = sz;
        rdev->driver_type = RC_DRIVER_IR_RAW;
-       rdev->allowed_protocols = RC_BIT_ALL;
+       rdev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rdev->driver_name = DRIVER_NAME;
        rdev->map_name = RC_MAP_STREAMZAP;
 
index eaadc081760ae1ec21a5a3ff018ad42ee497c5f0..42bca8d7b4514f67d78402addcc0bdc842149dbc 100644 (file)
@@ -230,7 +230,7 @@ static int sunxi_ir_probe(struct platform_device *pdev)
        ir->rc->map_name = ir->map_name ?: RC_MAP_EMPTY;
        ir->rc->dev.parent = dev;
        ir->rc->driver_type = RC_DRIVER_IR_RAW;
-       ir->rc->allowed_protocols = RC_BIT_ALL;
+       ir->rc->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        ir->rc->rx_resolution = SUNXI_IR_SAMPLE;
        ir->rc->timeout = MS_TO_NS(SUNXI_IR_TIMEOUT);
        ir->rc->driver_name = SUNXI_IR_DEV;
index bc7c091d657255184fd0efc1a1894c7120b37dde..cf70e0403294cfec52f96b5c3726cd2e212e03fb 100644 (file)
@@ -314,7 +314,7 @@ static int ttusbir_probe(struct usb_interface *intf,
        usb_to_input_id(tt->udev, &rc->input_id);
        rc->dev.parent = &intf->dev;
        rc->driver_type = RC_DRIVER_IR_RAW;
-       rc->allowed_protocols = RC_BIT_ALL;
+       rc->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        rc->priv = tt;
        rc->driver_name = DRIVER_NAME;
        rc->map_name = RC_MAP_TT_1500;
index 38eae9ebef6a00425594c2b2ea56cbb5e3860604..068e81a78125f2d8c5427f9fbff92bfe585cf5eb 100644 (file)
@@ -1085,7 +1085,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
        data->dev->dev.parent = &device->dev;
        data->dev->timeout = MS_TO_NS(100);
        data->dev->rx_resolution = US_TO_NS(2);
-       data->dev->allowed_protocols = RC_BIT_ALL;
+       data->dev->allowed_protocols = RC_BIT_ALL_IR_DECODER;
        data->dev->allowed_wakeup_protocols = RC_BIT_NEC | RC_BIT_NECX |
                        RC_BIT_NEC32 | RC_BIT_RC5 | RC_BIT_RC6_0 |
                        RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 |
index c583c638e4681878ff46d1596f40f54b456b2848..e16ca07acf1db68b337e5adae429aac976e20d6b 100644 (file)
@@ -1778,7 +1778,7 @@ static int rtl2832u_get_rc_config(struct dvb_usb_device *d,
        /* load empty to enable rc */
        if (!rc->map_name)
                rc->map_name = RC_MAP_EMPTY;
-       rc->allowed_protos = RC_BIT_ALL;
+       rc->allowed_protos = RC_BIT_ALL_IR_DECODER;
        rc->driver_type = RC_DRIVER_IR_RAW;
        rc->query = rtl2832u_rc_query;
        rc->interval = 200;
index 134e7436d56b37d69c86f49b322cdca9501e210e..9f7dd1afcb15714db883074824d1fe484556b982 100644 (file)
@@ -749,7 +749,7 @@ static struct dvb_usb_device_properties technisat_usb2_devices = {
                .rc_codes    = RC_MAP_TECHNISAT_USB2,
                .module_name = "technisat-usb2",
                .rc_query    = technisat_usb2_rc_query,
-               .allowed_protos = RC_BIT_ALL,
+               .allowed_protos = RC_BIT_ALL_IR_DECODER,
                .driver_type    = RC_DRIVER_IR_RAW,
        }
 };
index 4bd091414551b3c20dc0080edb2f90ec42424347..40f36b8f762a1a86c73bd7704bd02f1eebbb18bf 100644 (file)
@@ -95,6 +95,16 @@ enum rc_type {
                         RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \
                         RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SHARP | \
                         RC_BIT_XMP | RC_BIT_CEC)
+/* All rc protocols for which we have decoders */
+#define RC_BIT_ALL_IR_DECODER \
+                       (RC_BIT_RC5 | RC_BIT_RC5X_20 | RC_BIT_RC5_SZ | \
+                        RC_BIT_JVC | \
+                        RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \
+                        RC_BIT_NEC | RC_BIT_NECX | RC_BIT_NEC32 | \
+                        RC_BIT_SANYO | RC_BIT_MCE_KBD | RC_BIT_RC6_0 | \
+                        RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \
+                        RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE | RC_BIT_SHARP | \
+                        RC_BIT_XMP)
 
 
 #define RC_SCANCODE_UNKNOWN(x)                 (x)