* [PATCH 00/10] rc-core: my current patchqueue
@ 2011-04-28 15:13 David Härdeman
2011-04-28 15:13 ` [PATCH 01/10] rc-core: int to bool conversion for winbond-cir David Härdeman
` (9 more replies)
0 siblings, 10 replies; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
The following series is what's in my current patch queue for rc-core.
It only been lightly tested so far and it's based on the "for_v2.6.39" branch,
but I still wanted to send it to the list so that I can get some feedback while
I refresh the patches to "for_v2.6.40" and do more testing.
The most interesting change is that the scancode that is passed to/from
the EVIOC[GS]KEYCODE_V2 ioctl has been extended so that this struct:
struct input_keymap_entry {
__u8 flags;
__u8 len;
__u16 index;
__u32 keycode;
__u8 scancode[32];
};
Is parsed like this:
struct rc_scancode {
__u16 protocol;
__u16 reserved[3];
__u64 scancode;
}
struct rc_keymap_entry {
__u8 flags;
__u8 len;
__u16 index;
__u32 keycode;
union {
struct rc_scancode rc;
__u8 raw[32];
};
};
Which allows the protocol to be specified along with the scancode.
Some heuristics are in place to guess the correct protocol when it is
missing (i.e. when the legacy ioctl's are used or when the new ioctl's
are used but with a shorter len).
The advantage is that rc-core doesn't throw away its knowledge of
the protocol used to generate a given scancode. This also means that
e.g. merging the rc5 and streamzap decoders is made easier (see one
of the last patches in this series). In addition, it makes it possible
to have mixed-protocol keytables, should anyone wish to do that.
This unfortunately means that every keymap had to be changed as well which
is the reason for the large number of lines changed in the combined diffstat
(the number of lines changed would probably be in the hundreds rather than
thousands if keymaps were excluded).
Comments?
---
David Härdeman (10):
rc-core: int to bool conversion for winbond-cir
rc-core: add TX support to the winbond-cir driver
rc-core: use ir_raw_event_store_with_filter in winbond-cir
rc-core: add trailing silence in rc-loopback tx
rc-core: add separate defines for protocol bitmaps and numbers
rc-core: don't throw away protocol information
rc-core: use the full 32 bits for NEC scancodes
rc-core: merge rc5 and streamzap decoders
rc-core: lirc use unsigned int
rc-core: move timeout and checks to lirc
drivers/media/dvb/dm1105/dm1105.c | 3
drivers/media/dvb/dvb-usb/af9015.c | 34 +-
drivers/media/dvb/dvb-usb/anysee.c | 4
drivers/media/dvb/dvb-usb/dib0700_core.c | 10
drivers/media/dvb/dvb-usb/dib0700_devices.c | 126 +++---
drivers/media/dvb/dvb-usb/dvb-usb.h | 2
drivers/media/dvb/dvb-usb/lmedm04.c | 2
drivers/media/dvb/dvb-usb/technisat-usb2.c | 2
drivers/media/dvb/dvb-usb/ttusb2.c | 4
drivers/media/dvb/mantis/mantis_input.c | 117 +++--
drivers/media/dvb/siano/smsir.c | 2
drivers/media/dvb/ttpci/budget-ci.c | 7
drivers/media/rc/Kconfig | 12 -
drivers/media/rc/Makefile | 1
drivers/media/rc/ene_ir.c | 6
drivers/media/rc/ene_ir.h | 2
drivers/media/rc/imon.c | 35 +-
drivers/media/rc/ir-jvc-decoder.c | 6
drivers/media/rc/ir-lirc-codec.c | 46 ++
drivers/media/rc/ir-nec-decoder.c | 32 -
drivers/media/rc/ir-raw.c | 2
drivers/media/rc/ir-rc5-decoder.c | 62 ++-
drivers/media/rc/ir-rc5-sz-decoder.c | 153 -------
drivers/media/rc/ir-rc6-decoder.c | 6
drivers/media/rc/ir-sony-decoder.c | 17 +
drivers/media/rc/ite-cir.c | 7
drivers/media/rc/keymaps/rc-adstech-dvb-t-pci.c | 89 ++--
drivers/media/rc/keymaps/rc-alink-dtu-m.c | 37 +-
drivers/media/rc/keymaps/rc-anysee.c | 89 ++--
drivers/media/rc/keymaps/rc-apac-viewcomp.c | 65 +--
drivers/media/rc/keymaps/rc-asus-pc39.c | 79 ++--
drivers/media/rc/keymaps/rc-ati-tv-wonder-hd-600.c | 49 +-
drivers/media/rc/keymaps/rc-avermedia-a16d.c | 69 ++-
drivers/media/rc/keymaps/rc-avermedia-cardbus.c | 109 ++---
drivers/media/rc/keymaps/rc-avermedia-dvbt.c | 69 ++-
drivers/media/rc/keymaps/rc-avermedia-m135a.c | 187 ++++----
.../media/rc/keymaps/rc-avermedia-m733a-rm-k6.c | 89 ++--
drivers/media/rc/keymaps/rc-avermedia-rm-ks.c | 55 +-
drivers/media/rc/keymaps/rc-avermedia.c | 73 ++-
drivers/media/rc/keymaps/rc-avertv-303.c | 73 ++-
drivers/media/rc/keymaps/rc-azurewave-ad-tu700.c | 107 ++---
drivers/media/rc/keymaps/rc-behold-columbus.c | 73 ++-
drivers/media/rc/keymaps/rc-behold.c | 69 ++-
drivers/media/rc/keymaps/rc-budget-ci-old.c | 91 ++--
drivers/media/rc/keymaps/rc-cinergy-1400.c | 75 ++-
drivers/media/rc/keymaps/rc-cinergy.c | 73 ++-
drivers/media/rc/keymaps/rc-dib0700-nec.c | 141 +++---
drivers/media/rc/keymaps/rc-dib0700-rc5.c | 361 ++++++++--------
drivers/media/rc/keymaps/rc-digitalnow-tinytwin.c | 99 ++--
drivers/media/rc/keymaps/rc-digittrade.c | 57 +--
drivers/media/rc/keymaps/rc-dm1105-nec.c | 63 +--
drivers/media/rc/keymaps/rc-dntv-live-dvb-t.c | 65 +--
drivers/media/rc/keymaps/rc-dntv-live-dvbt-pro.c | 107 ++---
drivers/media/rc/keymaps/rc-em-terratec.c | 57 +--
drivers/media/rc/keymaps/rc-encore-enltv-fm53.c | 59 +--
drivers/media/rc/keymaps/rc-encore-enltv.c | 131 +++---
drivers/media/rc/keymaps/rc-encore-enltv2.c | 79 ++--
drivers/media/rc/keymaps/rc-evga-indtube.c | 33 +
drivers/media/rc/keymaps/rc-eztv.c | 89 ++--
drivers/media/rc/keymaps/rc-flydvb.c | 65 +--
drivers/media/rc/keymaps/rc-flyvideo.c | 53 +-
drivers/media/rc/keymaps/rc-fusionhdtv-mce.c | 105 ++---
drivers/media/rc/keymaps/rc-gadmei-rm008z.c | 63 +--
drivers/media/rc/keymaps/rc-genius-tvgo-a11mce.c | 65 +--
drivers/media/rc/keymaps/rc-gotview7135.c | 69 ++-
drivers/media/rc/keymaps/rc-hauppauge.c | 287 ++++++-------
drivers/media/rc/keymaps/rc-imon-mce.c | 173 ++++----
drivers/media/rc/keymaps/rc-imon-pad.c | 215 +++++-----
drivers/media/rc/keymaps/rc-iodata-bctv7e.c | 87 ++--
drivers/media/rc/keymaps/rc-kaiomy.c | 65 +--
drivers/media/rc/keymaps/rc-kworld-315u.c | 65 +--
.../media/rc/keymaps/rc-kworld-plus-tv-analog.c | 71 ++-
drivers/media/rc/keymaps/rc-leadtek-y04g0051.c | 101 ++---
drivers/media/rc/keymaps/rc-lirc.c | 1
drivers/media/rc/keymaps/rc-lme2510.c | 133 +++---
drivers/media/rc/keymaps/rc-manli.c | 97 ++--
drivers/media/rc/keymaps/rc-msi-digivox-ii.c | 37 +-
drivers/media/rc/keymaps/rc-msi-digivox-iii.c | 65 +--
drivers/media/rc/keymaps/rc-msi-tvanywhere-plus.c | 89 ++--
drivers/media/rc/keymaps/rc-msi-tvanywhere.c | 49 +-
drivers/media/rc/keymaps/rc-nebula.c | 111 ++---
.../media/rc/keymaps/rc-nec-terratec-cinergy-xs.c | 121 +++--
drivers/media/rc/keymaps/rc-norwood.c | 69 +--
drivers/media/rc/keymaps/rc-npgtech.c | 71 ++-
drivers/media/rc/keymaps/rc-pctv-sedna.c | 65 +--
drivers/media/rc/keymaps/rc-pinnacle-color.c | 107 ++---
drivers/media/rc/keymaps/rc-pinnacle-grey.c | 83 ++--
drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c | 51 +-
drivers/media/rc/keymaps/rc-pixelview-002t.c | 53 +-
drivers/media/rc/keymaps/rc-pixelview-mk12.c | 63 +--
drivers/media/rc/keymaps/rc-pixelview-new.c | 63 +--
drivers/media/rc/keymaps/rc-pixelview.c | 77 ++-
.../media/rc/keymaps/rc-powercolor-real-angel.c | 71 ++-
drivers/media/rc/keymaps/rc-proteus-2309.c | 49 +-
drivers/media/rc/keymaps/rc-purpletv.c | 71 ++-
drivers/media/rc/keymaps/rc-pv951.c | 63 +--
drivers/media/rc/keymaps/rc-rc6-mce.c | 151 +++----
.../media/rc/keymaps/rc-real-audio-220-32-keys.c | 57 +--
drivers/media/rc/keymaps/rc-streamzap.c | 75 ++-
drivers/media/rc/keymaps/rc-tbs-nec.c | 69 ++-
drivers/media/rc/keymaps/rc-technisat-usb2.c | 67 +--
drivers/media/rc/keymaps/rc-terratec-cinergy-xs.c | 95 ++--
drivers/media/rc/keymaps/rc-terratec-slim-2.c | 37 +-
drivers/media/rc/keymaps/rc-terratec-slim.c | 57 +--
drivers/media/rc/keymaps/rc-tevii-nec.c | 95 ++--
drivers/media/rc/keymaps/rc-total-media-in-hand.c | 71 ++-
drivers/media/rc/keymaps/rc-trekstor.c | 57 +--
drivers/media/rc/keymaps/rc-tt-1500.c | 79 ++--
drivers/media/rc/keymaps/rc-twinhan1027.c | 107 ++---
drivers/media/rc/keymaps/rc-videomate-m1f.c | 103 ++---
drivers/media/rc/keymaps/rc-videomate-s350.c | 89 ++--
drivers/media/rc/keymaps/rc-videomate-tv-pvr.c | 93 ++--
drivers/media/rc/keymaps/rc-winfast-usbii-deluxe.c | 57 +--
drivers/media/rc/keymaps/rc-winfast.c | 113 +++--
drivers/media/rc/mceusb.c | 30 -
drivers/media/rc/nuvoton-cir.c | 14 -
drivers/media/rc/rc-core-priv.h | 9
drivers/media/rc/rc-loopback.c | 33 -
drivers/media/rc/rc-main.c | 248 ++++++++---
drivers/media/rc/streamzap.c | 12 -
drivers/media/rc/winbond-cir.c | 442 ++++++++++++++++----
drivers/media/video/bt8xx/bttv-input.c | 10
drivers/media/video/cx18/cx18-i2c.c | 2
drivers/media/video/cx231xx/cx231xx-input.c | 2
drivers/media/video/cx23885/cx23885-input.c | 4
drivers/media/video/cx88/cx88-input.c | 18 -
drivers/media/video/em28xx/em28xx-cards.c | 17 +
drivers/media/video/em28xx/em28xx-input.c | 38 +-
drivers/media/video/em28xx/em28xx.h | 1
drivers/media/video/hdpvr/hdpvr-i2c.c | 2
drivers/media/video/ir-kbd-i2c.c | 26 +
drivers/media/video/ivtv/ivtv-i2c.c | 8
drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 4
drivers/media/video/saa7134/saa7134-input.c | 8
drivers/staging/tm6000/tm6000-cards.c | 2
drivers/staging/tm6000/tm6000-input.c | 46 +-
include/media/rc-core.h | 30 +
include/media/rc-map.h | 62 ++-
138 files changed, 4735 insertions(+), 4609 deletions(-)
delete mode 100644 drivers/media/rc/ir-rc5-sz-decoder.c
--
David Härdeman
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 01/10] rc-core: int to bool conversion for winbond-cir
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
@ 2011-04-28 15:13 ` David Härdeman
2011-04-28 15:13 ` [PATCH 02/10] rc-core: add TX support to the winbond-cir driver David Härdeman
` (8 subsequent siblings)
9 siblings, 0 replies; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
Using bool instead of an int helps readability a bit.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/rc/winbond-cir.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index b0a5fdc..cdb5ef4 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -382,7 +382,7 @@ wbcir_shutdown(struct pnp_dev *device)
{
struct device *dev = &device->dev;
struct wbcir_data *data = pnp_get_drvdata(device);
- int do_wake = 1;
+ bool do_wake = true;
u8 match[11];
u8 mask[11];
u8 rc6_csl = 0;
@@ -392,14 +392,14 @@ wbcir_shutdown(struct pnp_dev *device)
memset(mask, 0, sizeof(mask));
if (wake_sc == INVALID_SCANCODE || !device_may_wakeup(dev)) {
- do_wake = 0;
+ do_wake = false;
goto finish;
}
switch (protocol) {
case IR_PROTOCOL_RC5:
if (wake_sc > 0xFFF) {
- do_wake = 0;
+ do_wake = false;
dev_err(dev, "RC5 - Invalid wake scancode\n");
break;
}
@@ -418,7 +418,7 @@ wbcir_shutdown(struct pnp_dev *device)
case IR_PROTOCOL_NEC:
if (wake_sc > 0xFFFFFF) {
- do_wake = 0;
+ do_wake = false;
dev_err(dev, "NEC - Invalid wake scancode\n");
break;
}
@@ -440,7 +440,7 @@ wbcir_shutdown(struct pnp_dev *device)
if (wake_rc6mode == 0) {
if (wake_sc > 0xFFFF) {
- do_wake = 0;
+ do_wake = false;
dev_err(dev, "RC6 - Invalid wake scancode\n");
break;
}
@@ -496,7 +496,7 @@ wbcir_shutdown(struct pnp_dev *device)
} else if (wake_sc <= 0x007FFFFF) {
rc6_csl = 60;
} else {
- do_wake = 0;
+ do_wake = false;
dev_err(dev, "RC6 - Invalid wake scancode\n");
break;
}
@@ -508,14 +508,14 @@ wbcir_shutdown(struct pnp_dev *device)
mask[i++] = 0x0F;
} else {
- do_wake = 0;
+ do_wake = false;
dev_err(dev, "RC6 - Invalid wake mode\n");
}
break;
default:
- do_wake = 0;
+ do_wake = false;
break;
}
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 02/10] rc-core: add TX support to the winbond-cir driver
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
2011-04-28 15:13 ` [PATCH 01/10] rc-core: int to bool conversion for winbond-cir David Härdeman
@ 2011-04-28 15:13 ` David Härdeman
2011-04-28 15:13 ` [PATCH 03/10] rc-core: use ir_raw_event_store_with_filter in winbond-cir David Härdeman
` (7 subsequent siblings)
9 siblings, 0 replies; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
This patch adds preliminary IR TX capabilities to the
winbond-cir driver.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/rc/winbond-cir.c | 431 +++++++++++++++++++++++++++++++++-------
1 files changed, 356 insertions(+), 75 deletions(-)
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index cdb5ef4..6ba4438 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -19,11 +19,12 @@
* o DSDT dumps
*
* Supported features:
+ * o IR Receive
+ * o IR Transmit
* o Wake-On-CIR functionality
*
* To do:
* o Learning
- * o IR Transmit
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,6 +51,8 @@
#include <linux/io.h>
#include <linux/bitrev.h>
#include <linux/slab.h>
+#include <linux/wait.h>
+#include <linux/sched.h>
#include <media/rc-core.h>
#define DRVNAME "winbond-cir"
@@ -118,14 +121,24 @@
#define WBCIR_IRQ_NONE 0x00
/* RX data bit for WBCIR_REG_SP3_IER and WBCIR_REG_SP3_EIR */
#define WBCIR_IRQ_RX 0x01
+/* TX data low bit for WBCIR_REG_SP3_IER and WBCIR_REG_SP3_EIR */
+#define WBCIR_IRQ_TX_LOW 0x02
/* Over/Under-flow bit for WBCIR_REG_SP3_IER and WBCIR_REG_SP3_EIR */
#define WBCIR_IRQ_ERR 0x04
+/* TX data empty bit for WBCEIR_REG_SP3_IER and WBCIR_REG_SP3_EIR */
+#define WBCIR_IRQ_TX_EMPTY 0x20
/* Led enable/disable bit for WBCIR_REG_ECEIR_CTS */
#define WBCIR_LED_ENABLE 0x80
/* RX data available bit for WBCIR_REG_SP3_LSR */
#define WBCIR_RX_AVAIL 0x01
+/* RX data overrun error bit for WBCIR_REG_SP3_LSR */
+#define WBCIR_RX_OVERRUN 0x02
+/* TX End-Of-Transmission bit for WBCIR_REG_SP3_ASCR */
+#define WBCIR_TX_EOT 0x04
/* RX disable bit for WBCIR_REG_SP3_ASCR */
#define WBCIR_RX_DISABLE 0x20
+/* TX data underrun error bit for WBCIR_REG_SP3_ASCR */
+#define WBCIR_TX_UNDERRUN 0x40
/* Extended mode enable bit for WBCIR_REG_SP3_EXCR1 */
#define WBCIR_EXT_ENABLE 0x01
/* Select compare register in WBCIR_REG_WCEIR_INDEX (bits 5 & 6) */
@@ -154,6 +167,21 @@ enum wbcir_protocol {
IR_PROTOCOL_RC6 = 0x2,
};
+/* Possible states for IR reception */
+enum wbcir_rxstate {
+ WBCIR_RXSTATE_INACTIVE = 0,
+ WBCIR_RXSTATE_ACTIVE,
+ WBCIR_RXSTATE_ERROR
+};
+
+/* Possible states for IR transmission */
+enum wbcir_txstate {
+ WBCIR_TXSTATE_INACTIVE = 0,
+ WBCIR_TXSTATE_ACTIVE,
+ WBCIR_TXSTATE_DONE,
+ WBCIR_TXSTATE_ERROR
+};
+
/* Misc */
#define WBCIR_NAME "Winbond CIR"
#define WBCIR_ID_FAMILY 0xF1 /* Family ID for the WPCD376I */
@@ -166,22 +194,29 @@ enum wbcir_protocol {
/* Per-device data */
struct wbcir_data {
spinlock_t spinlock;
+ struct rc_dev *dev;
+ struct led_classdev led;
unsigned long wbase; /* Wake-Up Baseaddr */
unsigned long ebase; /* Enhanced Func. Baseaddr */
unsigned long sbase; /* Serial Port Baseaddr */
unsigned int irq; /* Serial Port IRQ */
+ u8 irqmask;
- struct rc_dev *dev;
-
+ /* RX state */
+ enum wbcir_rxstate rxstate;
struct led_trigger *rxtrigger;
- struct led_trigger *txtrigger;
- struct led_classdev led;
+ struct ir_raw_event rxev;
- /* RX irdata state */
- bool irdata_active;
- bool irdata_error;
- struct ir_raw_event ev;
+ /* TX state */
+ enum wbcir_txstate txstate;
+ struct led_trigger *txtrigger;
+ u32 txlen;
+ u32 txoff;
+ u32 *txbuf;
+ wait_queue_head_t txwaitq;
+ u8 txmask;
+ u32 txcarrier;
};
static enum wbcir_protocol protocol = IR_PROTOCOL_RC6;
@@ -193,6 +228,10 @@ static int invert; /* default = 0 */
module_param(invert, bool, 0444);
MODULE_PARM_DESC(invert, "Invert the signal from the IR receiver");
+static int txandrx; /* default = 0 */
+module_param(txandrx, bool, 0444);
+MODULE_PARM_DESC(invert, "Allow simultaneous TX and RX");
+
static unsigned int wake_sc = 0x800F040C;
module_param(wake_sc, uint, 0644);
MODULE_PARM_DESC(wake_sc, "Scancode of the power-on IR command");
@@ -228,6 +267,17 @@ wbcir_select_bank(struct wbcir_data *data, enum wbcir_bank bank)
outb(bank, data->sbase + WBCIR_REG_SP3_BSR);
}
+static inline void
+wbcir_set_irqmask(struct wbcir_data *data, u8 irqmask)
+{
+ if (data->irqmask == irqmask)
+ return;
+
+ wbcir_select_bank(data, WBCIR_BANK_0);
+ outb(irqmask, data->sbase + WBCIR_REG_SP3_IER);
+ data->irqmask = irqmask;
+}
+
static enum led_brightness
wbcir_led_brightness_get(struct led_classdev *led_cdev)
{
@@ -279,39 +329,15 @@ wbcir_to_rc6cells(u8 val)
*
*****************************************************************************/
-static irqreturn_t
-wbcir_irq_handler(int irqno, void *cookie)
+static void
+wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device)
{
- struct pnp_dev *device = cookie;
- struct wbcir_data *data = pnp_get_drvdata(device);
- unsigned long flags;
u8 irdata[8];
- u8 disable = true;
- u8 status;
- int i;
-
- spin_lock_irqsave(&data->spinlock, flags);
-
- wbcir_select_bank(data, WBCIR_BANK_0);
-
- status = inb(data->sbase + WBCIR_REG_SP3_EIR);
-
- if (!(status & (WBCIR_IRQ_RX | WBCIR_IRQ_ERR))) {
- spin_unlock_irqrestore(&data->spinlock, flags);
- return IRQ_NONE;
- }
-
- /* Check for e.g. buffer overflow */
- if (status & WBCIR_IRQ_ERR) {
- data->irdata_error = true;
- ir_raw_event_reset(data->dev);
- }
-
- if (!(status & WBCIR_IRQ_RX))
- goto out;
+ bool disable = true;
+ unsigned int i;
- if (!data->irdata_active) {
- data->irdata_active = true;
+ if (data->rxstate == WBCIR_RXSTATE_INACTIVE) {
+ data->rxstate = WBCIR_RXSTATE_ACTIVE;
led_trigger_event(data->rxtrigger, LED_FULL);
}
@@ -325,28 +351,29 @@ wbcir_irq_handler(int irqno, void *cookie)
if (irdata[i] != 0xFF && irdata[i] != 0x00)
disable = false;
- if (data->irdata_error)
+ if (data->rxstate == WBCIR_RXSTATE_ERROR)
continue;
pulse = irdata[i] & 0x80 ? false : true;
duration = (irdata[i] & 0x7F) * 10000; /* ns */
- if (data->ev.pulse != pulse) {
- if (data->ev.duration != 0) {
- ir_raw_event_store(data->dev, &data->ev);
- data->ev.duration = 0;
+ if (data->rxev.pulse != pulse) {
+ if (data->rxev.duration != 0) {
+ ir_raw_event_store(data->dev, &data->rxev);
+ data->rxev.duration = 0;
}
- data->ev.pulse = pulse;
+ data->rxev.pulse = pulse;
}
- data->ev.duration += duration;
+ data->rxev.duration += duration;
}
if (disable) {
- if (data->ev.duration != 0 && !data->irdata_error) {
- ir_raw_event_store(data->dev, &data->ev);
- data->ev.duration = 0;
+ if (data->rxev.duration != 0 &&
+ data->rxstate != WBCIR_RXSTATE_ERROR) {
+ ir_raw_event_store(data->dev, &data->rxev);
+ data->rxev.duration = 0;
}
/* Set RXINACTIVE */
@@ -357,19 +384,264 @@ wbcir_irq_handler(int irqno, void *cookie)
inb(data->sbase + WBCIR_REG_SP3_RXDATA);
ir_raw_event_reset(data->dev);
- data->irdata_error = false;
- data->irdata_active = false;
led_trigger_event(data->rxtrigger, LED_OFF);
+ data->rxstate = WBCIR_RXSTATE_INACTIVE;
}
ir_raw_event_handle(data->dev);
+}
+
+static void
+wbcir_irq_tx(struct wbcir_data *data)
+{
+ unsigned int space;
+ unsigned int used;
+ u8 bytes[16];
+ u8 byte;
+
+ if (!data->txbuf)
+ return;
+
+ switch (data->txstate) {
+ case WBCIR_TXSTATE_INACTIVE:
+ /* TX FIFO empty */
+ space = 16;
+ led_trigger_event(data->txtrigger, LED_FULL);
+ break;
+ case WBCIR_TXSTATE_ACTIVE:
+ /* TX FIFO low (3 bytes or less) */
+ space = 13;
+ break;
+ case WBCIR_TXSTATE_ERROR:
+ space = 0;
+ break;
+ default:
+ return;
+ }
+
+ /*
+ * TX data is run-length coded in bytes: YXXXXXXX
+ * Y = space (1) or pulse (0)
+ * X = duration, encoded as (X + 1) * 10us (i.e 10 to 1280 us)
+ */
+ for (used = 0; used < space && data->txoff != data->txlen; used++) {
+ if (data->txbuf[data->txoff] == 0) {
+ data->txoff++;
+ continue;
+ }
+ byte = min((u32)0x80, data->txbuf[data->txoff]);
+ data->txbuf[data->txoff] -= byte;
+ byte--;
+ byte |= (data->txoff % 2 ? 0x80 : 0x00); /* pulse/space */
+ bytes[used] = byte;
+ }
+
+ while (data->txbuf[data->txoff] == 0 && data->txoff != data->txlen)
+ data->txoff++;
+
+ if (used == 0) {
+ /* Finished */
+ if (data->txstate == WBCIR_TXSTATE_ERROR)
+ /* Clear TX underrun bit */
+ outb(WBCIR_TX_UNDERRUN, data->sbase + WBCIR_REG_SP3_ASCR);
+ else
+ data->txstate = WBCIR_TXSTATE_DONE;
+ wbcir_set_irqmask(data, WBCIR_IRQ_RX | WBCIR_IRQ_ERR);
+ led_trigger_event(data->txtrigger, LED_OFF);
+ wake_up(&data->txwaitq);
+ } else if (data->txoff == data->txlen) {
+ /* At the end of transmission, tell the hw before last byte */
+ outsb(data->sbase + WBCIR_REG_SP3_TXDATA, bytes, used - 1);
+ outb(WBCIR_TX_EOT, data->sbase + WBCIR_REG_SP3_ASCR);
+ outb(bytes[used - 1], data->sbase + WBCIR_REG_SP3_TXDATA);
+ wbcir_set_irqmask(data, WBCIR_IRQ_RX | WBCIR_IRQ_ERR |
+ WBCIR_IRQ_TX_EMPTY);
+ } else {
+ /* More data to follow... */
+ outsb(data->sbase + WBCIR_REG_SP3_RXDATA, bytes, used);
+ if (data->txstate == WBCIR_TXSTATE_INACTIVE) {
+ wbcir_set_irqmask(data, WBCIR_IRQ_RX | WBCIR_IRQ_ERR |
+ WBCIR_IRQ_TX_LOW);
+ data->txstate = WBCIR_TXSTATE_ACTIVE;
+ }
+ }
+}
+
+static irqreturn_t
+wbcir_irq_handler(int irqno, void *cookie)
+{
+ struct pnp_dev *device = cookie;
+ struct wbcir_data *data = pnp_get_drvdata(device);
+ unsigned long flags;
+ u8 status;
+
+ spin_lock_irqsave(&data->spinlock, flags);
+ wbcir_select_bank(data, WBCIR_BANK_0);
+ status = inb(data->sbase + WBCIR_REG_SP3_EIR);
+ status &= data->irqmask;
+
+ if (!status) {
+ spin_unlock_irqrestore(&data->spinlock, flags);
+ return IRQ_NONE;
+ }
+
+ if (status & WBCIR_IRQ_ERR) {
+ /* RX overflow? (read clears bit) */
+ if (inb(data->sbase + WBCIR_REG_SP3_LSR) & WBCIR_RX_OVERRUN) {
+ data->rxstate = WBCIR_RXSTATE_ERROR;
+ ir_raw_event_reset(data->dev);
+ }
+
+ /* TX underflow? */
+ if (inb(data->sbase + WBCIR_REG_SP3_ASCR) & WBCIR_TX_UNDERRUN)
+ data->txstate = WBCIR_TXSTATE_ERROR;
+ }
+
+ if (status & WBCIR_IRQ_RX)
+ wbcir_irq_rx(data, device);
+
+ if (status & (WBCIR_IRQ_TX_LOW | WBCIR_IRQ_TX_EMPTY))
+ wbcir_irq_tx(data);
-out:
spin_unlock_irqrestore(&data->spinlock, flags);
return IRQ_HANDLED;
}
+/*****************************************************************************
+ *
+ * RC-CORE INTERFACE FUNCTIONS
+ *
+ *****************************************************************************/
+
+static int
+wbcir_txcarrier(struct rc_dev *dev, u32 carrier)
+{
+ struct wbcir_data *data = dev->priv;
+ unsigned long flags;
+ u8 val;
+ u32 freq;
+
+ freq = DIV_ROUND_CLOSEST(carrier, 1000);
+ if (freq < 30 || freq > 60)
+ return -EINVAL;
+
+ switch (freq) {
+ case 58:
+ case 59:
+ case 60:
+ val = freq - 58;
+ freq *= 1000;
+ break;
+ case 57:
+ val = freq - 27;
+ freq = 56900;
+ break;
+ default:
+ val = freq - 27;
+ freq *= 1000;
+ break;
+ }
+
+ spin_lock_irqsave(&data->spinlock, flags);
+ if (data->txstate != WBCIR_TXSTATE_INACTIVE) {
+ spin_unlock_irqrestore(&data->spinlock, flags);
+ return -EBUSY;
+ }
+
+ if (data->txcarrier != freq) {
+ wbcir_select_bank(data, WBCIR_BANK_7);
+ wbcir_set_bits(data->sbase + WBCIR_REG_SP3_IRTXMC, val, 0x1F);
+ data->txcarrier = freq;
+ }
+
+ spin_unlock_irqrestore(&data->spinlock, flags);
+ return 0;
+}
+
+static int
+wbcir_txmask(struct rc_dev *dev, u32 mask)
+{
+ struct wbcir_data *data = dev->priv;
+ unsigned long flags;
+ u8 val;
+
+ /* Four outputs, only one output can be enabled at a time */
+ switch (mask) {
+ case 0x1:
+ val = 0x0;
+ break;
+ case 0x2:
+ val = 0x1;
+ break;
+ case 0x4:
+ val = 0x2;
+ break;
+ case 0x8:
+ val = 0x3;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ spin_lock_irqsave(&data->spinlock, flags);
+ if (data->txstate != WBCIR_TXSTATE_INACTIVE) {
+ spin_unlock_irqrestore(&data->spinlock, flags);
+ return -EBUSY;
+ }
+
+ if (data->txmask != mask) {
+ wbcir_set_bits(data->ebase + WBCIR_REG_ECEIR_CTS, val, 0x0c);
+ data->txmask = mask;
+ }
+
+ spin_unlock_irqrestore(&data->spinlock, flags);
+ return 0;
+}
+
+static int
+wbcir_tx(struct rc_dev *dev, int *buf, u32 bufsize)
+{
+ struct wbcir_data *data = dev->priv;
+ u32 count;
+ unsigned i;
+ unsigned long flags;
+
+ /* bufsize has been sanity checked by the caller */
+ count = bufsize / sizeof(int);
+
+ /* Not sure if this is possible, but better safe than sorry */
+ spin_lock_irqsave(&data->spinlock, flags);
+ if (data->txstate != WBCIR_TXSTATE_INACTIVE) {
+ spin_unlock_irqrestore(&data->spinlock, flags);
+ return -EBUSY;
+ }
+
+ /* Convert values to multiples of 10us */
+ for (i = 0; i < count; i++)
+ buf[i] = DIV_ROUND_CLOSEST(buf[i], 10);
+
+ /* Fill the TX fifo once, the irq handler will do the rest */
+ data->txbuf = buf;
+ data->txlen = count;
+ data->txoff = 0;
+ wbcir_irq_tx(data);
+
+ /* Wait for the TX to complete */
+ while (data->txstate == WBCIR_TXSTATE_ACTIVE) {
+ spin_unlock_irqrestore(&data->spinlock, flags);
+ wait_event(data->txwaitq, data->txstate != WBCIR_TXSTATE_ACTIVE);
+ spin_lock_irqsave(&data->spinlock, flags);
+ }
+
+ /* We're done */
+ if (data->txstate == WBCIR_TXSTATE_ERROR)
+ count = -EAGAIN;
+ data->txstate = WBCIR_TXSTATE_INACTIVE;
+ data->txbuf = NULL;
+ spin_unlock_irqrestore(&data->spinlock, flags);
+ return count;
+}
/*****************************************************************************
*
@@ -551,21 +823,18 @@ finish:
wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, 0x00, 0x01);
}
- /* Disable interrupts */
- wbcir_select_bank(data, WBCIR_BANK_0);
- outb(WBCIR_IRQ_NONE, data->sbase + WBCIR_REG_SP3_IER);
-
- /* Disable LED */
- data->irdata_active = false;
- led_trigger_event(data->rxtrigger, LED_OFF);
-
/*
* ACPI will set the HW disable bit for SP3 which means that the
* output signals are left in an undefined state which may cause
* spurious interrupts which we need to ignore until the hardware
* is reinitialized.
*/
+ wbcir_set_irqmask(data, WBCIR_IRQ_NONE);
disable_irq(data->irq);
+
+ /* Disable LED */
+ led_trigger_event(data->rxtrigger, LED_OFF);
+ led_trigger_event(data->txtrigger, LED_OFF);
}
static int
@@ -581,8 +850,7 @@ wbcir_init_hw(struct wbcir_data *data)
u8 tmp;
/* Disable interrupts */
- wbcir_select_bank(data, WBCIR_BANK_0);
- outb(WBCIR_IRQ_NONE, data->sbase + WBCIR_REG_SP3_IER);
+ wbcir_set_irqmask(data, WBCIR_IRQ_NONE);
/* Set PROT_SEL, RX_INV, Clear CEIR_EN (needed for the led) */
tmp = protocol << 4;
@@ -606,10 +874,11 @@ wbcir_init_hw(struct wbcir_data *data)
outb(0x00, data->ebase + WBCIR_REG_ECEIR_CCTL);
/*
- * Clear IR LED, set SP3 clock to 24Mhz
+ * Clear IR LED, set SP3 clock to 24Mhz, set TX mask to IRTX1,
* set SP3_IRRX_SW to binary 01, helpfully not documented
*/
outb(0x10, data->ebase + WBCIR_REG_ECEIR_CTS);
+ data->txmask = 0x1;
/* Enable extended mode */
wbcir_select_bank(data, WBCIR_BANK_2);
@@ -647,18 +916,21 @@ wbcir_init_hw(struct wbcir_data *data)
wbcir_select_bank(data, WBCIR_BANK_4);
outb(0x00, data->sbase + WBCIR_REG_SP3_IRCR1);
- /* Enable MSR interrupt, Clear AUX_IRX */
+ /* Disable MSR interrupt, clear AUX_IRX, mask RX during TX? */
wbcir_select_bank(data, WBCIR_BANK_5);
- outb(0x00, data->sbase + WBCIR_REG_SP3_IRCR2);
+ outb(txandrx ? 0x03 : 0x02, data->sbase + WBCIR_REG_SP3_IRCR2);
/* Disable CRC */
wbcir_select_bank(data, WBCIR_BANK_6);
outb(0x20, data->sbase + WBCIR_REG_SP3_IRCR3);
- /* Set RX/TX (de)modulation freq, not really used */
+ /* Set RX demodulation freq, not really used */
wbcir_select_bank(data, WBCIR_BANK_7);
outb(0xF2, data->sbase + WBCIR_REG_SP3_IRRXDC);
+
+ /* Set TX modulation, 36kHz, 7us pulse width */
outb(0x69, data->sbase + WBCIR_REG_SP3_IRTXMC);
+ data->txcarrier = 36000;
/* Set invert and pin direction */
if (invert)
@@ -673,16 +945,23 @@ wbcir_init_hw(struct wbcir_data *data)
/* Clear AUX status bits */
outb(0xE0, data->sbase + WBCIR_REG_SP3_ASCR);
- /* Clear IR decoding state */
- data->irdata_active = false;
- led_trigger_event(data->rxtrigger, LED_OFF);
- data->irdata_error = false;
- data->ev.duration = 0;
+ /* Clear RX state */
+ data->rxstate = WBCIR_RXSTATE_INACTIVE;
+ data->rxev.duration = 0;
ir_raw_event_reset(data->dev);
ir_raw_event_handle(data->dev);
+ /*
+ * Check TX state, if we did a suspend/resume cycle while TX was
+ * active, we will have a process waiting in txwaitq.
+ */
+ if (data->txstate == WBCIR_TXSTATE_ACTIVE) {
+ data->txstate = WBCIR_TXSTATE_ERROR;
+ wake_up(&data->txwaitq);
+ }
+
/* Enable interrupts */
- outb(WBCIR_IRQ_RX | WBCIR_IRQ_ERR, data->sbase + WBCIR_REG_SP3_IER);
+ wbcir_set_irqmask(data, WBCIR_IRQ_RX | WBCIR_IRQ_ERR);
}
static int
@@ -719,6 +998,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
pnp_set_drvdata(device, data);
spin_lock_init(&data->spinlock);
+ init_waitqueue_head(&data->txwaitq);
data->ebase = pnp_port_start(device, 0);
data->wbase = pnp_port_start(device, 1);
data->sbase = pnp_port_start(device, 2);
@@ -799,6 +1079,9 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
data->dev->input_id.product = WBCIR_ID_FAMILY;
data->dev->input_id.version = WBCIR_ID_CHIP;
data->dev->map_name = RC_MAP_RC6_MCE;
+ data->dev->s_tx_mask = wbcir_txmask;
+ data->dev->s_tx_carrier = wbcir_txcarrier;
+ data->dev->tx_ir = wbcir_tx;
data->dev->priv = data;
data->dev->dev.parent = &device->dev;
@@ -841,9 +1124,7 @@ wbcir_remove(struct pnp_dev *device)
struct wbcir_data *data = pnp_get_drvdata(device);
/* Disable interrupts */
- wbcir_select_bank(data, WBCIR_BANK_0);
- outb(WBCIR_IRQ_NONE, data->sbase + WBCIR_REG_SP3_IER);
-
+ wbcir_set_irqmask(data, WBCIR_IRQ_NONE);
free_irq(data->irq, device);
/* Clear status bits NEC_REP, BUFF, MSG_END, MATCH */
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 03/10] rc-core: use ir_raw_event_store_with_filter in winbond-cir
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
2011-04-28 15:13 ` [PATCH 01/10] rc-core: int to bool conversion for winbond-cir David Härdeman
2011-04-28 15:13 ` [PATCH 02/10] rc-core: add TX support to the winbond-cir driver David Härdeman
@ 2011-04-28 15:13 ` David Härdeman
2011-04-28 15:13 ` [PATCH 04/10] rc-core: add trailing silence in rc-loopback tx David Härdeman
` (6 subsequent siblings)
9 siblings, 0 replies; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
Using ir_raw_event_store_with_filter() saves about 20 lines of code.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/rc/winbond-cir.c | 63 +++++++++++++---------------------------
1 files changed, 21 insertions(+), 42 deletions(-)
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 6ba4438..48bafa2 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -330,60 +330,38 @@ wbcir_to_rc6cells(u8 val)
*****************************************************************************/
static void
-wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device)
+wbcir_idle_rx(struct rc_dev *dev, bool idle)
{
- u8 irdata[8];
- bool disable = true;
- unsigned int i;
+ struct wbcir_data *data = dev->priv;
- if (data->rxstate == WBCIR_RXSTATE_INACTIVE) {
+ if (!idle && data->rxstate == WBCIR_RXSTATE_INACTIVE) {
data->rxstate = WBCIR_RXSTATE_ACTIVE;
led_trigger_event(data->rxtrigger, LED_FULL);
}
- /* Since RXHDLEV is set, at least 8 bytes are in the FIFO */
- insb(data->sbase + WBCIR_REG_SP3_RXDATA, &irdata[0], 8);
-
- for (i = 0; i < 8; i++) {
- u8 pulse;
- u32 duration;
+ if (idle && data->rxstate != WBCIR_RXSTATE_INACTIVE)
+ /* Tell hardware to go idle by setting RXINACTIVE */
+ outb(WBCIR_RX_DISABLE, data->sbase + WBCIR_REG_SP3_ASCR);
+}
- if (irdata[i] != 0xFF && irdata[i] != 0x00)
- disable = false;
+static void
+wbcir_irq_rx(struct wbcir_data *data, struct pnp_dev *device)
+{
+ u8 irdata;
+ DEFINE_IR_RAW_EVENT(rawir);
+ /* Since RXHDLEV is set, at least 8 bytes are in the FIFO */
+ while (inb(data->sbase + WBCIR_REG_SP3_LSR) & WBCIR_RX_AVAIL) {
+ irdata = inb(data->sbase + WBCIR_REG_SP3_RXDATA);
if (data->rxstate == WBCIR_RXSTATE_ERROR)
continue;
-
- pulse = irdata[i] & 0x80 ? false : true;
- duration = (irdata[i] & 0x7F) * 10000; /* ns */
-
- if (data->rxev.pulse != pulse) {
- if (data->rxev.duration != 0) {
- ir_raw_event_store(data->dev, &data->rxev);
- data->rxev.duration = 0;
- }
-
- data->rxev.pulse = pulse;
- }
-
- data->rxev.duration += duration;
+ rawir.pulse = irdata & 0x80 ? false : true;
+ rawir.duration = US_TO_NS((irdata & 0x7F) * 10);
+ ir_raw_event_store_with_filter(data->dev, &rawir);
}
- if (disable) {
- if (data->rxev.duration != 0 &&
- data->rxstate != WBCIR_RXSTATE_ERROR) {
- ir_raw_event_store(data->dev, &data->rxev);
- data->rxev.duration = 0;
- }
-
- /* Set RXINACTIVE */
- outb(WBCIR_RX_DISABLE, data->sbase + WBCIR_REG_SP3_ASCR);
-
- /* Drain the FIFO */
- while (inb(data->sbase + WBCIR_REG_SP3_LSR) & WBCIR_RX_AVAIL)
- inb(data->sbase + WBCIR_REG_SP3_RXDATA);
-
- ir_raw_event_reset(data->dev);
+ /* Check if we should go idle */
+ if (data->dev->idle) {
led_trigger_event(data->rxtrigger, LED_OFF);
data->rxstate = WBCIR_RXSTATE_INACTIVE;
}
@@ -1079,6 +1057,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
data->dev->input_id.product = WBCIR_ID_FAMILY;
data->dev->input_id.version = WBCIR_ID_CHIP;
data->dev->map_name = RC_MAP_RC6_MCE;
+ data->dev->s_idle = wbcir_idle_rx;
data->dev->s_tx_mask = wbcir_txmask;
data->dev->s_tx_carrier = wbcir_txcarrier;
data->dev->tx_ir = wbcir_tx;
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 04/10] rc-core: add trailing silence in rc-loopback tx
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
` (2 preceding siblings ...)
2011-04-28 15:13 ` [PATCH 03/10] rc-core: use ir_raw_event_store_with_filter in winbond-cir David Härdeman
@ 2011-04-28 15:13 ` David Härdeman
2011-04-28 15:13 ` [PATCH 05/10] rc-core: add separate defines for protocol bitmaps and numbers David Härdeman
` (5 subsequent siblings)
9 siblings, 0 replies; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
If an IR command is sent (using the LIRC userspace) to rc-loopback
which doesn't include a trailing space, the result is that the message
won't be completely decoded. In addition, "leftovers" from a previous
transmission can be left until the next one. Fix this by faking a long
silence after the end of TX data.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/rc/rc-loopback.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index 49cee61..cc846b2 100644
--- a/drivers/media/rc/rc-loopback.c
+++ b/drivers/media/rc/rc-loopback.c
@@ -146,6 +146,12 @@ static int loop_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
if (rawir.duration)
ir_raw_event_store_with_filter(dev, &rawir);
}
+
+ /* Fake a silence long enough to cause us to go idle */
+ rawir.pulse = false;
+ rawir.duration = dev->timeout;
+ ir_raw_event_store_with_filter(dev, &rawir);
+
ir_raw_event_handle(dev);
out:
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 05/10] rc-core: add separate defines for protocol bitmaps and numbers
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
` (3 preceding siblings ...)
2011-04-28 15:13 ` [PATCH 04/10] rc-core: add trailing silence in rc-loopback tx David Härdeman
@ 2011-04-28 15:13 ` David Härdeman
2011-05-04 14:56 ` Mauro Carvalho Chehab
2011-04-28 15:13 ` [PATCH 07/10] rc-core: use the full 32 bits for NEC scancodes David Härdeman
` (4 subsequent siblings)
9 siblings, 1 reply; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
The RC_TYPE_* defines are currently used both where a single protocol is
expected and where a bitmap of protocols is expected. This patch tries
to separate the two in preparation for the following patches.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/dvb/dvb-usb/af9015.c | 12 +-
drivers/media/dvb/dvb-usb/anysee.c | 2
drivers/media/dvb/dvb-usb/dib0700_core.c | 8 +
drivers/media/dvb/dvb-usb/dib0700_devices.c | 116 ++++++++++----------
drivers/media/dvb/dvb-usb/technisat-usb2.c | 2
drivers/media/dvb/dvb-usb/ttusb2.c | 2
drivers/media/dvb/mantis/mantis_input.c | 2
drivers/media/dvb/siano/smsir.c | 2
drivers/media/rc/ene_ir.c | 2
drivers/media/rc/imon.c | 26 ++--
drivers/media/rc/ir-jvc-decoder.c | 4 -
drivers/media/rc/ir-lirc-codec.c | 4 -
drivers/media/rc/ir-nec-decoder.c | 4 -
drivers/media/rc/ir-rc5-decoder.c | 12 ++
drivers/media/rc/ir-rc5-sz-decoder.c | 4 -
drivers/media/rc/ir-rc6-decoder.c | 4 -
drivers/media/rc/ir-sony-decoder.c | 17 +++
drivers/media/rc/ite-cir.c | 2
drivers/media/rc/keymaps/rc-adstech-dvb-t-pci.c | 2
drivers/media/rc/keymaps/rc-alink-dtu-m.c | 2
drivers/media/rc/keymaps/rc-anysee.c | 2
drivers/media/rc/keymaps/rc-apac-viewcomp.c | 2
drivers/media/rc/keymaps/rc-asus-pc39.c | 2
drivers/media/rc/keymaps/rc-ati-tv-wonder-hd-600.c | 2
drivers/media/rc/keymaps/rc-avermedia-a16d.c | 2
drivers/media/rc/keymaps/rc-avermedia-cardbus.c | 2
drivers/media/rc/keymaps/rc-avermedia-dvbt.c | 2
drivers/media/rc/keymaps/rc-avermedia-m135a.c | 2
.../media/rc/keymaps/rc-avermedia-m733a-rm-k6.c | 2
drivers/media/rc/keymaps/rc-avermedia-rm-ks.c | 2
drivers/media/rc/keymaps/rc-avermedia.c | 2
drivers/media/rc/keymaps/rc-avertv-303.c | 2
drivers/media/rc/keymaps/rc-azurewave-ad-tu700.c | 2
drivers/media/rc/keymaps/rc-behold-columbus.c | 2
drivers/media/rc/keymaps/rc-behold.c | 2
drivers/media/rc/keymaps/rc-budget-ci-old.c | 2
drivers/media/rc/keymaps/rc-cinergy-1400.c | 2
drivers/media/rc/keymaps/rc-cinergy.c | 2
drivers/media/rc/keymaps/rc-dib0700-nec.c | 2
drivers/media/rc/keymaps/rc-dib0700-rc5.c | 2
drivers/media/rc/keymaps/rc-digitalnow-tinytwin.c | 2
drivers/media/rc/keymaps/rc-digittrade.c | 2
drivers/media/rc/keymaps/rc-dm1105-nec.c | 2
drivers/media/rc/keymaps/rc-dntv-live-dvb-t.c | 2
drivers/media/rc/keymaps/rc-dntv-live-dvbt-pro.c | 2
drivers/media/rc/keymaps/rc-em-terratec.c | 2
drivers/media/rc/keymaps/rc-encore-enltv-fm53.c | 2
drivers/media/rc/keymaps/rc-encore-enltv.c | 2
drivers/media/rc/keymaps/rc-encore-enltv2.c | 2
drivers/media/rc/keymaps/rc-evga-indtube.c | 2
drivers/media/rc/keymaps/rc-eztv.c | 2
drivers/media/rc/keymaps/rc-flydvb.c | 2
drivers/media/rc/keymaps/rc-flyvideo.c | 2
drivers/media/rc/keymaps/rc-fusionhdtv-mce.c | 2
drivers/media/rc/keymaps/rc-gadmei-rm008z.c | 2
drivers/media/rc/keymaps/rc-genius-tvgo-a11mce.c | 2
drivers/media/rc/keymaps/rc-gotview7135.c | 2
drivers/media/rc/keymaps/rc-hauppauge.c | 2
drivers/media/rc/keymaps/rc-imon-mce.c | 2
drivers/media/rc/keymaps/rc-imon-pad.c | 2
drivers/media/rc/keymaps/rc-iodata-bctv7e.c | 2
drivers/media/rc/keymaps/rc-kaiomy.c | 2
drivers/media/rc/keymaps/rc-kworld-315u.c | 2
.../media/rc/keymaps/rc-kworld-plus-tv-analog.c | 2
drivers/media/rc/keymaps/rc-leadtek-y04g0051.c | 2
drivers/media/rc/keymaps/rc-lirc.c | 2
drivers/media/rc/keymaps/rc-lme2510.c | 2
drivers/media/rc/keymaps/rc-manli.c | 2
drivers/media/rc/keymaps/rc-msi-digivox-ii.c | 2
drivers/media/rc/keymaps/rc-msi-digivox-iii.c | 2
drivers/media/rc/keymaps/rc-msi-tvanywhere-plus.c | 2
drivers/media/rc/keymaps/rc-msi-tvanywhere.c | 2
drivers/media/rc/keymaps/rc-nebula.c | 2
.../media/rc/keymaps/rc-nec-terratec-cinergy-xs.c | 2
drivers/media/rc/keymaps/rc-norwood.c | 2
drivers/media/rc/keymaps/rc-npgtech.c | 2
drivers/media/rc/keymaps/rc-pctv-sedna.c | 2
drivers/media/rc/keymaps/rc-pinnacle-color.c | 2
drivers/media/rc/keymaps/rc-pinnacle-grey.c | 2
drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c | 2
drivers/media/rc/keymaps/rc-pixelview-002t.c | 2
drivers/media/rc/keymaps/rc-pixelview-mk12.c | 2
drivers/media/rc/keymaps/rc-pixelview-new.c | 2
drivers/media/rc/keymaps/rc-pixelview.c | 2
.../media/rc/keymaps/rc-powercolor-real-angel.c | 2
drivers/media/rc/keymaps/rc-proteus-2309.c | 2
drivers/media/rc/keymaps/rc-purpletv.c | 2
drivers/media/rc/keymaps/rc-pv951.c | 2
drivers/media/rc/keymaps/rc-rc6-mce.c | 2
.../media/rc/keymaps/rc-real-audio-220-32-keys.c | 2
drivers/media/rc/keymaps/rc-streamzap.c | 2
drivers/media/rc/keymaps/rc-tbs-nec.c | 2
drivers/media/rc/keymaps/rc-technisat-usb2.c | 2
drivers/media/rc/keymaps/rc-terratec-cinergy-xs.c | 2
drivers/media/rc/keymaps/rc-terratec-slim-2.c | 2
drivers/media/rc/keymaps/rc-terratec-slim.c | 2
drivers/media/rc/keymaps/rc-tevii-nec.c | 2
drivers/media/rc/keymaps/rc-total-media-in-hand.c | 2
drivers/media/rc/keymaps/rc-trekstor.c | 2
drivers/media/rc/keymaps/rc-tt-1500.c | 2
drivers/media/rc/keymaps/rc-twinhan1027.c | 2
drivers/media/rc/keymaps/rc-videomate-m1f.c | 2
drivers/media/rc/keymaps/rc-videomate-s350.c | 2
drivers/media/rc/keymaps/rc-videomate-tv-pvr.c | 2
drivers/media/rc/keymaps/rc-winfast-usbii-deluxe.c | 2
drivers/media/rc/keymaps/rc-winfast.c | 2
drivers/media/rc/mceusb.c | 2
drivers/media/rc/nuvoton-cir.c | 2
drivers/media/rc/rc-loopback.c | 2
drivers/media/rc/rc-main.c | 21 ++--
drivers/media/rc/streamzap.c | 2
drivers/media/video/cx18/cx18-i2c.c | 2
drivers/media/video/cx231xx/cx231xx-input.c | 2
drivers/media/video/cx23885/cx23885-input.c | 4 -
drivers/media/video/cx88/cx88-input.c | 8 +
drivers/media/video/em28xx/em28xx-input.c | 10 +-
drivers/media/video/hdpvr/hdpvr-i2c.c | 2
drivers/media/video/ir-kbd-i2c.c | 14 +-
drivers/media/video/ivtv/ivtv-i2c.c | 8 +
drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 4 -
drivers/media/video/saa7134/saa7134-input.c | 2
drivers/staging/tm6000/tm6000-input.c | 14 +-
include/media/rc-map.h | 41 +++++--
123 files changed, 291 insertions(+), 250 deletions(-)
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
index 100ebc3..a4f4324 100644
--- a/drivers/media/dvb/dvb-usb/af9015.c
+++ b/drivers/media/dvb/dvb-usb/af9015.c
@@ -1365,11 +1365,11 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.identify_state = af9015_identify_state,
.rc.core = {
- .protocol = RC_TYPE_NEC,
+ .protocol = RC_BIT_NEC,
.module_name = "af9015",
.rc_query = af9015_rc_query,
.rc_interval = AF9015_RC_INTERVAL,
- .allowed_protos = RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_NEC,
},
.i2c_algo = &af9015_i2c_algo,
@@ -1493,11 +1493,11 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.identify_state = af9015_identify_state,
.rc.core = {
- .protocol = RC_TYPE_NEC,
+ .protocol = RC_BIT_NEC,
.module_name = "af9015",
.rc_query = af9015_rc_query,
.rc_interval = AF9015_RC_INTERVAL,
- .allowed_protos = RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_NEC,
},
.i2c_algo = &af9015_i2c_algo,
@@ -1605,11 +1605,11 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.identify_state = af9015_identify_state,
.rc.core = {
- .protocol = RC_TYPE_NEC,
+ .protocol = RC_BIT_NEC,
.module_name = "af9015",
.rc_query = af9015_rc_query,
.rc_interval = AF9015_RC_INTERVAL,
- .allowed_protos = RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_NEC,
},
.i2c_algo = &af9015_i2c_algo,
diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c
index 6b402e9..58a709a 100644
--- a/drivers/media/dvb/dvb-usb/anysee.c
+++ b/drivers/media/dvb/dvb-usb/anysee.c
@@ -476,7 +476,7 @@ static struct dvb_usb_device_properties anysee_properties = {
.rc.core = {
.rc_codes = RC_MAP_ANYSEE,
- .protocol = RC_TYPE_OTHER,
+ .protocol = RC_BIT_OTHER,
.module_name = "anysee",
.rc_query = anysee_rc_query,
.rc_interval = 250, /* windows driver uses 500ms */
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index b79af68..268c46b 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -514,11 +514,11 @@ int dib0700_change_protocol(struct rc_dev *rc, u64 rc_type)
int new_proto, ret;
/* Set the IR mode */
- if (rc_type == RC_TYPE_RC5)
+ if (rc_type == RC_BIT_RC5)
new_proto = 1;
- else if (rc_type == RC_TYPE_NEC)
+ else if (rc_type == RC_BIT_NEC)
new_proto = 0;
- else if (rc_type == RC_TYPE_RC6) {
+ else if (rc_type == RC_BIT_RC6) {
if (st->fw_version < 0x10200)
return -EINVAL;
@@ -597,7 +597,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
purb->actual_length);
switch (d->props.rc.core.protocol) {
- case RC_TYPE_NEC:
+ case RC_BIT_NEC:
toggle = 0;
/* NEC protocol sends repeat code as 0 0 0 FF */
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 97af266..f76003b 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -512,7 +512,7 @@ static int dib0700_rc_query_old_firmware(struct dvb_usb_device *d)
d->last_event = 0;
switch (d->props.rc.core.protocol) {
- case RC_TYPE_NEC:
+ case RC_BIT_NEC:
/* NEC protocol sends repeat code as 0 0 0 FF */
if ((key[3-2] == 0x00) && (key[3-3] == 0x00) &&
(key[3] == 0xff))
@@ -2887,9 +2887,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_interval = DEFAULT_RC_INTERVAL,
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -2921,9 +2921,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_interval = DEFAULT_RC_INTERVAL,
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -2980,9 +2980,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_interval = DEFAULT_RC_INTERVAL,
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3022,9 +3022,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3098,9 +3098,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3142,9 +3142,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3210,9 +3210,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3257,9 +3257,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_NEC_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3326,9 +3326,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3362,9 +3362,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3434,9 +3434,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3478,9 +3478,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_NEC_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3527,9 +3527,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3564,9 +3564,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3601,9 +3601,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3638,9 +3638,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3675,9 +3675,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3712,9 +3712,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
@@ -3763,9 +3763,9 @@ struct dvb_usb_device_properties dib0700_devices[] = {
.rc_codes = RC_MAP_DIB0700_RC5_TABLE,
.module_name = "dib0700",
.rc_query = dib0700_rc_query_old_firmware,
- .allowed_protos = RC_TYPE_RC5 |
- RC_TYPE_RC6 |
- RC_TYPE_NEC,
+ .allowed_protos = RC_BIT_RC5 |
+ RC_BIT_RC6 |
+ RC_BIT_NEC,
.change_protocol = dib0700_change_protocol,
},
},
diff --git a/drivers/media/dvb/dvb-usb/technisat-usb2.c b/drivers/media/dvb/dvb-usb/technisat-usb2.c
index 08f8842..544f56c 100644
--- a/drivers/media/dvb/dvb-usb/technisat-usb2.c
+++ b/drivers/media/dvb/dvb-usb/technisat-usb2.c
@@ -729,7 +729,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_TYPE_ALL,
+ .allowed_protos = RC_BIT_ALL,
.driver_type = RC_DRIVER_IR_RAW,
}
};
diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c
index 0d4709f..c22ef1a 100644
--- a/drivers/media/dvb/dvb-usb/ttusb2.c
+++ b/drivers/media/dvb/dvb-usb/ttusb2.c
@@ -377,7 +377,7 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = {
.rc_interval = 150, /* Less than IR_KEYPRESS_TIMEOUT */
.rc_codes = RC_MAP_TT_1500,
.rc_query = tt3650_rc_query,
- .allowed_protos = RC_TYPE_UNKNOWN,
+ .allowed_protos = RC_BIT_UNKNOWN,
},
.num_adapters = 1,
diff --git a/drivers/media/dvb/mantis/mantis_input.c b/drivers/media/dvb/mantis/mantis_input.c
index db6d54d..8efd971 100644
--- a/drivers/media/dvb/mantis/mantis_input.c
+++ b/drivers/media/dvb/mantis/mantis_input.c
@@ -99,7 +99,7 @@ static struct rc_map_list ir_mantis_map = {
.map = {
.scan = mantis_ir_table,
.size = ARRAY_SIZE(mantis_ir_table),
- .rc_type = RC_TYPE_UNKNOWN,
+ .rc_type = RC_BIT_UNKNOWN,
.name = RC_MAP_MANTIS,
}
};
diff --git a/drivers/media/dvb/siano/smsir.c b/drivers/media/dvb/siano/smsir.c
index 37bc5c4..b8c5cad 100644
--- a/drivers/media/dvb/siano/smsir.c
+++ b/drivers/media/dvb/siano/smsir.c
@@ -88,7 +88,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
dev->priv = coredev;
dev->driver_type = RC_DRIVER_IR_RAW;
- dev->allowed_protos = RC_TYPE_ALL;
+ dev->allowed_protos = RC_BIT_ALL;
dev->map_name = sms_get_board(board_id)->rc_codes;
dev->driver_name = MODULE_NAME;
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index 1ac4913..569b07b 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -1056,7 +1056,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_protos = RC_TYPE_ALL;
+ rdev->allowed_protos = RC_BIT_ALL;
rdev->priv = dev;
rdev->open = ene_open;
rdev->close = ene_close;
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index f714e1a..3819760 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -1005,17 +1005,17 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
"this device does not support\n");
switch (rc_type) {
- case RC_TYPE_RC6:
+ case RC_BIT_RC6:
dev_dbg(dev, "Configuring IR receiver for MCE protocol\n");
ir_proto_packet[0] = 0x01;
break;
- case RC_TYPE_UNKNOWN:
- case RC_TYPE_OTHER:
+ case RC_BIT_UNKNOWN:
+ case RC_BIT_OTHER:
dev_dbg(dev, "Configuring IR receiver for iMON protocol\n");
if (!pad_stabilize)
dev_dbg(dev, "PAD stabilize functionality disabled\n");
/* ir_proto_packet[0] = 0x00; // already the default */
- rc_type = RC_TYPE_OTHER;
+ rc_type = RC_BIT_OTHER;
break;
default:
dev_warn(dev, "Unsupported IR protocol specified, overriding "
@@ -1023,7 +1023,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
if (!pad_stabilize)
dev_dbg(dev, "PAD stabilize functionality disabled\n");
/* ir_proto_packet[0] = 0x00; // already the default */
- rc_type = RC_TYPE_OTHER;
+ rc_type = RC_BIT_OTHER;
break;
}
@@ -1305,7 +1305,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
rel_x = buf[2];
rel_y = buf[3];
- if (ictx->rc_type == RC_TYPE_OTHER && pad_stabilize) {
+ if (ictx->rc_type == RC_BIT_OTHER && pad_stabilize) {
if ((buf[1] == 0) && ((rel_x != 0) || (rel_y != 0))) {
dir = stabilize((int)rel_x, (int)rel_y,
timeout, threshold);
@@ -1372,7 +1372,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
buf[0] = 0x01;
buf[1] = buf[4] = buf[5] = buf[6] = buf[7] = 0;
- if (ictx->rc_type == RC_TYPE_OTHER && pad_stabilize) {
+ if (ictx->rc_type == RC_BIT_OTHER && pad_stabilize) {
dir = stabilize((int)rel_x, (int)rel_y,
timeout, threshold);
if (!dir) {
@@ -1494,7 +1494,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
kc = imon_panel_key_lookup(scancode);
} else {
scancode = be32_to_cpu(*((u32 *)buf));
- if (ictx->rc_type == RC_TYPE_RC6) {
+ if (ictx->rc_type == RC_BIT_RC6) {
ktype = IMON_KEY_IMON;
if (buf[0] == 0x80)
ktype = IMON_KEY_MCE;
@@ -1708,7 +1708,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
{
u8 ffdc_cfg_byte = ictx->usb_rx_buf[6];
u8 detected_display_type = IMON_DISPLAY_TYPE_NONE;
- u64 allowed_protos = RC_TYPE_OTHER;
+ u64 allowed_protos = RC_BIT_OTHER;
switch (ffdc_cfg_byte) {
/* iMON Knob, no display, iMON IR + vol knob */
@@ -1737,13 +1737,13 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
case 0x9e:
dev_info(ictx->dev, "0xffdc iMON VFD, MCE IR");
detected_display_type = IMON_DISPLAY_TYPE_VFD;
- allowed_protos = RC_TYPE_RC6;
+ allowed_protos = RC_BIT_RC6;
break;
/* iMON LCD, MCE IR */
case 0x9f:
dev_info(ictx->dev, "0xffdc iMON LCD, MCE IR");
detected_display_type = IMON_DISPLAY_TYPE_LCD;
- allowed_protos = RC_TYPE_RC6;
+ allowed_protos = RC_BIT_RC6;
break;
default:
dev_info(ictx->dev, "Unknown 0xffdc device, "
@@ -1834,7 +1834,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
rdev->priv = ictx;
rdev->driver_type = RC_DRIVER_SCANCODE;
- rdev->allowed_protos = RC_TYPE_OTHER | RC_TYPE_RC6; /* iMON PAD or MCE */
+ rdev->allowed_protos = RC_BIT_OTHER | RC_BIT_RC6; /* iMON PAD or MCE */
rdev->change_protocol = imon_ir_change_protocol;
rdev->driver_name = MOD_NAME;
@@ -1852,7 +1852,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
imon_set_display_type(ictx);
- if (ictx->rc_type == RC_TYPE_RC6)
+ if (ictx->rc_type == RC_BIT_RC6)
rdev->map_name = RC_MAP_IMON_MCE;
else
rdev->map_name = RC_MAP_IMON_PAD;
diff --git a/drivers/media/rc/ir-jvc-decoder.c b/drivers/media/rc/ir-jvc-decoder.c
index 624449a..480a4a4 100644
--- a/drivers/media/rc/ir-jvc-decoder.c
+++ b/drivers/media/rc/ir-jvc-decoder.c
@@ -46,7 +46,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)
{
struct jvc_dec *data = &dev->raw->jvc;
- if (!(dev->raw->enabled_protocols & RC_TYPE_JVC))
+ if (!(dev->raw->enabled_protocols & RC_BIT_JVC))
return 0;
if (!is_timing_event(ev)) {
@@ -173,7 +173,7 @@ out:
}
static struct ir_raw_handler jvc_handler = {
- .protocols = RC_TYPE_JVC,
+ .protocols = RC_BIT_JVC,
.decode = ir_jvc_decode,
};
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index 1c5cc65..9ea93b6 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -34,7 +34,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)
struct lirc_codec *lirc = &dev->raw->lirc;
int sample;
- if (!(dev->raw->enabled_protocols & RC_TYPE_LIRC))
+ if (!(dev->raw->enabled_protocols & RC_BIT_LIRC))
return 0;
if (!dev->raw->lirc.drv || !dev->raw->lirc.drv->rbuf)
@@ -378,7 +378,7 @@ static int ir_lirc_unregister(struct rc_dev *dev)
}
static struct ir_raw_handler lirc_handler = {
- .protocols = RC_TYPE_LIRC,
+ .protocols = RC_BIT_LIRC,
.decode = ir_lirc_decode,
.raw_register = ir_lirc_register,
.raw_unregister = ir_lirc_unregister,
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
index 63ee722..68fcab6 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -51,7 +51,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
u8 address, not_address, command, not_command;
bool send_32bits = false;
- if (!(dev->raw->enabled_protocols & RC_TYPE_NEC))
+ if (!(dev->raw->enabled_protocols & RC_BIT_NEC))
return 0;
if (!is_timing_event(ev)) {
@@ -200,7 +200,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
}
static struct ir_raw_handler nec_handler = {
- .protocols = RC_TYPE_NEC,
+ .protocols = RC_BIT_NEC,
.decode = ir_nec_decode,
};
diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c
index ebdba55..598fca4 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -51,7 +51,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
u8 toggle;
u32 scancode;
- if (!(dev->raw->enabled_protocols & RC_TYPE_RC5))
+ if (!(dev->raw->enabled_protocols & (RC_BIT_RC5 | RC_BIT_RC5X)))
return 0;
if (!is_timing_event(ev)) {
@@ -126,6 +126,10 @@ again:
if (data->wanted_bits == RC5X_NBITS) {
/* RC5X */
+ if (!(dev->raw->enabled_protocols & RC_BIT_RC5X)) {
+ data->state = STATE_INACTIVE;
+ return 0;
+ }
u8 xdata, command, system;
xdata = (data->bits & 0x0003F) >> 0;
command = (data->bits & 0x00FC0) >> 6;
@@ -139,6 +143,10 @@ again:
} else {
/* RC5 */
+ if (!(dev->raw->enabled_protocols & RC_BIT_RC5)) {
+ data->state = STATE_INACTIVE;
+ return 0;
+ }
u8 command, system;
command = (data->bits & 0x0003F) >> 0;
system = (data->bits & 0x007C0) >> 6;
@@ -163,7 +171,7 @@ out:
}
static struct ir_raw_handler rc5_handler = {
- .protocols = RC_TYPE_RC5,
+ .protocols = RC_BIT_RC5 | RC_BIT_RC5X,
.decode = ir_rc5_decode,
};
diff --git a/drivers/media/rc/ir-rc5-sz-decoder.c b/drivers/media/rc/ir-rc5-sz-decoder.c
index 90aa886..ff6f66e 100644
--- a/drivers/media/rc/ir-rc5-sz-decoder.c
+++ b/drivers/media/rc/ir-rc5-sz-decoder.c
@@ -47,7 +47,7 @@ static int ir_rc5_sz_decode(struct rc_dev *dev, struct ir_raw_event ev)
u8 toggle, command, system;
u32 scancode;
- if (!(dev->raw->enabled_protocols & RC_TYPE_RC5_SZ))
+ if (!(dev->raw->enabled_protocols & RC_BIT_RC5_SZ))
return 0;
if (!is_timing_event(ev)) {
@@ -127,7 +127,7 @@ out:
}
static struct ir_raw_handler rc5_sz_handler = {
- .protocols = RC_TYPE_RC5_SZ,
+ .protocols = RC_BIT_RC5_SZ,
.decode = ir_rc5_sz_decode,
};
diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c
index 755dafa..73123e8 100644
--- a/drivers/media/rc/ir-rc6-decoder.c
+++ b/drivers/media/rc/ir-rc6-decoder.c
@@ -81,7 +81,7 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
u32 scancode;
u8 toggle;
- if (!(dev->raw->enabled_protocols & RC_TYPE_RC6))
+ if (!(dev->raw->enabled_protocols & RC_BIT_RC6))
return 0;
if (!is_timing_event(ev)) {
@@ -255,7 +255,7 @@ out:
}
static struct ir_raw_handler rc6_handler = {
- .protocols = RC_TYPE_RC6,
+ .protocols = RC_BIT_RC6,
.decode = ir_rc6_decode,
};
diff --git a/drivers/media/rc/ir-sony-decoder.c b/drivers/media/rc/ir-sony-decoder.c
index a92de80..dba56e5 100644
--- a/drivers/media/rc/ir-sony-decoder.c
+++ b/drivers/media/rc/ir-sony-decoder.c
@@ -44,7 +44,8 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
u32 scancode;
u8 device, subdevice, function;
- if (!(dev->raw->enabled_protocols & RC_TYPE_SONY))
+ if (!(dev->raw->enabled_protocols &
+ (RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20)))
return 0;
if (!is_timing_event(ev)) {
@@ -122,16 +123,28 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
switch (data->count) {
case 12:
+ if (!(dev->raw->enabled_protocols & RC_BIT_SONY12)) {
+ data->state = STATE_INACTIVE;
+ return 0;
+ }
device = bitrev8((data->bits << 3) & 0xF8);
subdevice = 0;
function = bitrev8((data->bits >> 4) & 0xFE);
break;
case 15:
+ if (!(dev->raw->enabled_protocols & RC_BIT_SONY15)) {
+ data->state = STATE_INACTIVE;
+ return 0;
+ }
device = bitrev8((data->bits >> 0) & 0xFF);
subdevice = 0;
function = bitrev8((data->bits >> 7) & 0xFD);
break;
case 20:
+ if (!(dev->raw->enabled_protocols & RC_BIT_SONY20)) {
+ data->state = STATE_INACTIVE;
+ return 0;
+ }
device = bitrev8((data->bits >> 5) & 0xF8);
subdevice = bitrev8((data->bits >> 0) & 0xFF);
function = bitrev8((data->bits >> 12) & 0xFE);
@@ -156,7 +169,7 @@ out:
}
static struct ir_raw_handler sony_handler = {
- .protocols = RC_TYPE_SONY,
+ .protocols = RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20,
.decode = ir_sony_decode,
};
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 9be6a83..3d13fcb 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -1578,7 +1578,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_protos = RC_TYPE_ALL;
+ rdev->allowed_protos = RC_BIT_ALL;
rdev->open = ite_open;
rdev->close = ite_close;
rdev->s_idle = ite_s_idle;
diff --git a/drivers/media/rc/keymaps/rc-adstech-dvb-t-pci.c b/drivers/media/rc/keymaps/rc-adstech-dvb-t-pci.c
index 9a8752f..643dc7d 100644
--- a/drivers/media/rc/keymaps/rc-adstech-dvb-t-pci.c
+++ b/drivers/media/rc/keymaps/rc-adstech-dvb-t-pci.c
@@ -67,7 +67,7 @@ static struct rc_map_list adstech_dvb_t_pci_map = {
.map = {
.scan = adstech_dvb_t_pci,
.size = ARRAY_SIZE(adstech_dvb_t_pci),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_ADSTECH_DVB_T_PCI,
}
};
diff --git a/drivers/media/rc/keymaps/rc-alink-dtu-m.c b/drivers/media/rc/keymaps/rc-alink-dtu-m.c
index fe652e9..0ecb39e 100644
--- a/drivers/media/rc/keymaps/rc-alink-dtu-m.c
+++ b/drivers/media/rc/keymaps/rc-alink-dtu-m.c
@@ -46,7 +46,7 @@ static struct rc_map_list alink_dtu_m_map = {
.map = {
.scan = alink_dtu_m,
.size = ARRAY_SIZE(alink_dtu_m),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_ALINK_DTU_M,
}
};
diff --git a/drivers/media/rc/keymaps/rc-anysee.c b/drivers/media/rc/keymaps/rc-anysee.c
index 884f1b5..28783e3 100644
--- a/drivers/media/rc/keymaps/rc-anysee.c
+++ b/drivers/media/rc/keymaps/rc-anysee.c
@@ -71,7 +71,7 @@ static struct rc_map_list anysee_map = {
.map = {
.scan = anysee,
.size = ARRAY_SIZE(anysee),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_ANYSEE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-apac-viewcomp.c b/drivers/media/rc/keymaps/rc-apac-viewcomp.c
index 7af1882..7603de8 100644
--- a/drivers/media/rc/keymaps/rc-apac-viewcomp.c
+++ b/drivers/media/rc/keymaps/rc-apac-viewcomp.c
@@ -58,7 +58,7 @@ static struct rc_map_list apac_viewcomp_map = {
.map = {
.scan = apac_viewcomp,
.size = ARRAY_SIZE(apac_viewcomp),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_APAC_VIEWCOMP,
}
};
diff --git a/drivers/media/rc/keymaps/rc-asus-pc39.c b/drivers/media/rc/keymaps/rc-asus-pc39.c
index b248115..73c7029 100644
--- a/drivers/media/rc/keymaps/rc-asus-pc39.c
+++ b/drivers/media/rc/keymaps/rc-asus-pc39.c
@@ -69,7 +69,7 @@ static struct rc_map_list asus_pc39_map = {
.map = {
.scan = asus_pc39,
.size = ARRAY_SIZE(asus_pc39),
- .rc_type = RC_TYPE_RC5,
+ .rc_type = RC_BIT_RC5,
.name = RC_MAP_ASUS_PC39,
}
};
diff --git a/drivers/media/rc/keymaps/rc-ati-tv-wonder-hd-600.c b/drivers/media/rc/keymaps/rc-ati-tv-wonder-hd-600.c
index f766b24..98f62a2 100644
--- a/drivers/media/rc/keymaps/rc-ati-tv-wonder-hd-600.c
+++ b/drivers/media/rc/keymaps/rc-ati-tv-wonder-hd-600.c
@@ -47,7 +47,7 @@ static struct rc_map_list ati_tv_wonder_hd_600_map = {
.map = {
.scan = ati_tv_wonder_hd_600,
.size = ARRAY_SIZE(ati_tv_wonder_hd_600),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_ATI_TV_WONDER_HD_600,
}
};
diff --git a/drivers/media/rc/keymaps/rc-avermedia-a16d.c b/drivers/media/rc/keymaps/rc-avermedia-a16d.c
index ec9beee..407afc3 100644
--- a/drivers/media/rc/keymaps/rc-avermedia-a16d.c
+++ b/drivers/media/rc/keymaps/rc-avermedia-a16d.c
@@ -53,7 +53,7 @@ static struct rc_map_list avermedia_a16d_map = {
.map = {
.scan = avermedia_a16d,
.size = ARRAY_SIZE(avermedia_a16d),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_AVERMEDIA_A16D,
}
};
diff --git a/drivers/media/rc/keymaps/rc-avermedia-cardbus.c b/drivers/media/rc/keymaps/rc-avermedia-cardbus.c
index bdf97b7..1f56f8f 100644
--- a/drivers/media/rc/keymaps/rc-avermedia-cardbus.c
+++ b/drivers/media/rc/keymaps/rc-avermedia-cardbus.c
@@ -75,7 +75,7 @@ static struct rc_map_list avermedia_cardbus_map = {
.map = {
.scan = avermedia_cardbus,
.size = ARRAY_SIZE(avermedia_cardbus),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_AVERMEDIA_CARDBUS,
}
};
diff --git a/drivers/media/rc/keymaps/rc-avermedia-dvbt.c b/drivers/media/rc/keymaps/rc-avermedia-dvbt.c
index c25809d..9e86e2e 100644
--- a/drivers/media/rc/keymaps/rc-avermedia-dvbt.c
+++ b/drivers/media/rc/keymaps/rc-avermedia-dvbt.c
@@ -56,7 +56,7 @@ static struct rc_map_list avermedia_dvbt_map = {
.map = {
.scan = avermedia_dvbt,
.size = ARRAY_SIZE(avermedia_dvbt),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_AVERMEDIA_DVBT,
}
};
diff --git a/drivers/media/rc/keymaps/rc-avermedia-m135a.c b/drivers/media/rc/keymaps/rc-avermedia-m135a.c
index 3d2cbe4..f0dff61 100644
--- a/drivers/media/rc/keymaps/rc-avermedia-m135a.c
+++ b/drivers/media/rc/keymaps/rc-avermedia-m135a.c
@@ -125,7 +125,7 @@ static struct rc_map_list avermedia_m135a_map = {
.map = {
.scan = avermedia_m135a,
.size = ARRAY_SIZE(avermedia_m135a),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_AVERMEDIA_M135A,
}
};
diff --git a/drivers/media/rc/keymaps/rc-avermedia-m733a-rm-k6.c b/drivers/media/rc/keymaps/rc-avermedia-m733a-rm-k6.c
index 8cd7f28..ddb0baa 100644
--- a/drivers/media/rc/keymaps/rc-avermedia-m733a-rm-k6.c
+++ b/drivers/media/rc/keymaps/rc-avermedia-m733a-rm-k6.c
@@ -73,7 +73,7 @@ static struct rc_map_list avermedia_m733a_rm_k6_map = {
.map = {
.scan = avermedia_m733a_rm_k6,
.size = ARRAY_SIZE(avermedia_m733a_rm_k6),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_AVERMEDIA_M733A_RM_K6,
}
};
diff --git a/drivers/media/rc/keymaps/rc-avermedia-rm-ks.c b/drivers/media/rc/keymaps/rc-avermedia-rm-ks.c
index 9d68af2..a3371b3 100644
--- a/drivers/media/rc/keymaps/rc-avermedia-rm-ks.c
+++ b/drivers/media/rc/keymaps/rc-avermedia-rm-ks.c
@@ -57,7 +57,7 @@ static struct rc_map_list avermedia_rm_ks_map = {
.map = {
.scan = avermedia_rm_ks,
.size = ARRAY_SIZE(avermedia_rm_ks),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_AVERMEDIA_RM_KS,
}
};
diff --git a/drivers/media/rc/keymaps/rc-avermedia.c b/drivers/media/rc/keymaps/rc-avermedia.c
index edfa715..3bc64cb 100644
--- a/drivers/media/rc/keymaps/rc-avermedia.c
+++ b/drivers/media/rc/keymaps/rc-avermedia.c
@@ -64,7 +64,7 @@ static struct rc_map_list avermedia_map = {
.map = {
.scan = avermedia,
.size = ARRAY_SIZE(avermedia),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_AVERMEDIA,
}
};
diff --git a/drivers/media/rc/keymaps/rc-avertv-303.c b/drivers/media/rc/keymaps/rc-avertv-303.c
index 32e9498..38e4619 100644
--- a/drivers/media/rc/keymaps/rc-avertv-303.c
+++ b/drivers/media/rc/keymaps/rc-avertv-303.c
@@ -63,7 +63,7 @@ static struct rc_map_list avertv_303_map = {
.map = {
.scan = avertv_303,
.size = ARRAY_SIZE(avertv_303),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_AVERTV_303,
}
};
diff --git a/drivers/media/rc/keymaps/rc-azurewave-ad-tu700.c b/drivers/media/rc/keymaps/rc-azurewave-ad-tu700.c
index c3f6d62..e049bde 100644
--- a/drivers/media/rc/keymaps/rc-azurewave-ad-tu700.c
+++ b/drivers/media/rc/keymaps/rc-azurewave-ad-tu700.c
@@ -80,7 +80,7 @@ static struct rc_map_list azurewave_ad_tu700_map = {
.map = {
.scan = azurewave_ad_tu700,
.size = ARRAY_SIZE(azurewave_ad_tu700),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_AZUREWAVE_AD_TU700,
}
};
diff --git a/drivers/media/rc/keymaps/rc-behold-columbus.c b/drivers/media/rc/keymaps/rc-behold-columbus.c
index 8bf058f..71cc1b4 100644
--- a/drivers/media/rc/keymaps/rc-behold-columbus.c
+++ b/drivers/media/rc/keymaps/rc-behold-columbus.c
@@ -86,7 +86,7 @@ static struct rc_map_list behold_columbus_map = {
.map = {
.scan = behold_columbus,
.size = ARRAY_SIZE(behold_columbus),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_BEHOLD_COLUMBUS,
}
};
diff --git a/drivers/media/rc/keymaps/rc-behold.c b/drivers/media/rc/keymaps/rc-behold.c
index c909a23..093b31b 100644
--- a/drivers/media/rc/keymaps/rc-behold.c
+++ b/drivers/media/rc/keymaps/rc-behold.c
@@ -119,7 +119,7 @@ static struct rc_map_list behold_map = {
.map = {
.scan = behold,
.size = ARRAY_SIZE(behold),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_BEHOLD,
}
};
diff --git a/drivers/media/rc/keymaps/rc-budget-ci-old.c b/drivers/media/rc/keymaps/rc-budget-ci-old.c
index 2f66e43..afd479e 100644
--- a/drivers/media/rc/keymaps/rc-budget-ci-old.c
+++ b/drivers/media/rc/keymaps/rc-budget-ci-old.c
@@ -71,7 +71,7 @@ static struct rc_map_list budget_ci_old_map = {
.map = {
.scan = budget_ci_old,
.size = ARRAY_SIZE(budget_ci_old),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_BUDGET_CI_OLD,
}
};
diff --git a/drivers/media/rc/keymaps/rc-cinergy-1400.c b/drivers/media/rc/keymaps/rc-cinergy-1400.c
index 284534b..91cef8e 100644
--- a/drivers/media/rc/keymaps/rc-cinergy-1400.c
+++ b/drivers/media/rc/keymaps/rc-cinergy-1400.c
@@ -62,7 +62,7 @@ static struct rc_map_list cinergy_1400_map = {
.map = {
.scan = cinergy_1400,
.size = ARRAY_SIZE(cinergy_1400),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_CINERGY_1400,
}
};
diff --git a/drivers/media/rc/keymaps/rc-cinergy.c b/drivers/media/rc/keymaps/rc-cinergy.c
index cf3a6bf..06abebe 100644
--- a/drivers/media/rc/keymaps/rc-cinergy.c
+++ b/drivers/media/rc/keymaps/rc-cinergy.c
@@ -56,7 +56,7 @@ static struct rc_map_list cinergy_map = {
.map = {
.scan = cinergy,
.size = ARRAY_SIZE(cinergy),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_CINERGY,
}
};
diff --git a/drivers/media/rc/keymaps/rc-dib0700-nec.c b/drivers/media/rc/keymaps/rc-dib0700-nec.c
index 7a5f530..c946ec0 100644
--- a/drivers/media/rc/keymaps/rc-dib0700-nec.c
+++ b/drivers/media/rc/keymaps/rc-dib0700-nec.c
@@ -102,7 +102,7 @@ static struct rc_map_list dib0700_nec_map = {
.map = {
.scan = dib0700_nec_table,
.size = ARRAY_SIZE(dib0700_nec_table),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_DIB0700_NEC_TABLE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-dib0700-rc5.c b/drivers/media/rc/keymaps/rc-dib0700-rc5.c
index 4af12e4..3fe9378 100644
--- a/drivers/media/rc/keymaps/rc-dib0700-rc5.c
+++ b/drivers/media/rc/keymaps/rc-dib0700-rc5.c
@@ -213,7 +213,7 @@ static struct rc_map_list dib0700_rc5_map = {
.map = {
.scan = dib0700_rc5_table,
.size = ARRAY_SIZE(dib0700_rc5_table),
- .rc_type = RC_TYPE_RC5,
+ .rc_type = RC_BIT_RC5,
.name = RC_MAP_DIB0700_RC5_TABLE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-digitalnow-tinytwin.c b/drivers/media/rc/keymaps/rc-digitalnow-tinytwin.c
index f68b450..6ce7bba 100644
--- a/drivers/media/rc/keymaps/rc-digitalnow-tinytwin.c
+++ b/drivers/media/rc/keymaps/rc-digitalnow-tinytwin.c
@@ -76,7 +76,7 @@ static struct rc_map_list digitalnow_tinytwin_map = {
.map = {
.scan = digitalnow_tinytwin,
.size = ARRAY_SIZE(digitalnow_tinytwin),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_DIGITALNOW_TINYTWIN,
}
};
diff --git a/drivers/media/rc/keymaps/rc-digittrade.c b/drivers/media/rc/keymaps/rc-digittrade.c
index 21d4987..34ec26d 100644
--- a/drivers/media/rc/keymaps/rc-digittrade.c
+++ b/drivers/media/rc/keymaps/rc-digittrade.c
@@ -60,7 +60,7 @@ static struct rc_map_list digittrade_map = {
.map = {
.scan = digittrade,
.size = ARRAY_SIZE(digittrade),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_DIGITTRADE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-dm1105-nec.c b/drivers/media/rc/keymaps/rc-dm1105-nec.c
index d024fbf..dbae7b4 100644
--- a/drivers/media/rc/keymaps/rc-dm1105-nec.c
+++ b/drivers/media/rc/keymaps/rc-dm1105-nec.c
@@ -54,7 +54,7 @@ static struct rc_map_list dm1105_nec_map = {
.map = {
.scan = dm1105_nec,
.size = ARRAY_SIZE(dm1105_nec),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_DM1105_NEC,
}
};
diff --git a/drivers/media/rc/keymaps/rc-dntv-live-dvb-t.c b/drivers/media/rc/keymaps/rc-dntv-live-dvb-t.c
index 82c0200..4d291c36 100644
--- a/drivers/media/rc/keymaps/rc-dntv-live-dvb-t.c
+++ b/drivers/media/rc/keymaps/rc-dntv-live-dvb-t.c
@@ -56,7 +56,7 @@ static struct rc_map_list dntv_live_dvb_t_map = {
.map = {
.scan = dntv_live_dvb_t,
.size = ARRAY_SIZE(dntv_live_dvb_t),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_DNTV_LIVE_DVB_T,
}
};
diff --git a/drivers/media/rc/keymaps/rc-dntv-live-dvbt-pro.c b/drivers/media/rc/keymaps/rc-dntv-live-dvbt-pro.c
index 015e99d..0a4239f 100644
--- a/drivers/media/rc/keymaps/rc-dntv-live-dvbt-pro.c
+++ b/drivers/media/rc/keymaps/rc-dntv-live-dvbt-pro.c
@@ -75,7 +75,7 @@ static struct rc_map_list dntv_live_dvbt_pro_map = {
.map = {
.scan = dntv_live_dvbt_pro,
.size = ARRAY_SIZE(dntv_live_dvbt_pro),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_DNTV_LIVE_DVBT_PRO,
}
};
diff --git a/drivers/media/rc/keymaps/rc-em-terratec.c b/drivers/media/rc/keymaps/rc-em-terratec.c
index 269d429..2f5a7ce 100644
--- a/drivers/media/rc/keymaps/rc-em-terratec.c
+++ b/drivers/media/rc/keymaps/rc-em-terratec.c
@@ -47,7 +47,7 @@ static struct rc_map_list em_terratec_map = {
.map = {
.scan = em_terratec,
.size = ARRAY_SIZE(em_terratec),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_EM_TERRATEC,
}
};
diff --git a/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c b/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c
index e388698..6bdb35e 100644
--- a/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c
+++ b/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c
@@ -59,7 +59,7 @@ static struct rc_map_list encore_enltv_fm53_map = {
.map = {
.scan = encore_enltv_fm53,
.size = ARRAY_SIZE(encore_enltv_fm53),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_ENCORE_ENLTV_FM53,
}
};
diff --git a/drivers/media/rc/keymaps/rc-encore-enltv.c b/drivers/media/rc/keymaps/rc-encore-enltv.c
index e56ac6e..8f2155f 100644
--- a/drivers/media/rc/keymaps/rc-encore-enltv.c
+++ b/drivers/media/rc/keymaps/rc-encore-enltv.c
@@ -90,7 +90,7 @@ static struct rc_map_list encore_enltv_map = {
.map = {
.scan = encore_enltv,
.size = ARRAY_SIZE(encore_enltv),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_ENCORE_ENLTV,
}
};
diff --git a/drivers/media/rc/keymaps/rc-encore-enltv2.c b/drivers/media/rc/keymaps/rc-encore-enltv2.c
index b6264f1..6d964b0 100644
--- a/drivers/media/rc/keymaps/rc-encore-enltv2.c
+++ b/drivers/media/rc/keymaps/rc-encore-enltv2.c
@@ -68,7 +68,7 @@ static struct rc_map_list encore_enltv2_map = {
.map = {
.scan = encore_enltv2,
.size = ARRAY_SIZE(encore_enltv2),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_ENCORE_ENLTV2,
}
};
diff --git a/drivers/media/rc/keymaps/rc-evga-indtube.c b/drivers/media/rc/keymaps/rc-evga-indtube.c
index a2bf24f..e2f334d 100644
--- a/drivers/media/rc/keymaps/rc-evga-indtube.c
+++ b/drivers/media/rc/keymaps/rc-evga-indtube.c
@@ -39,7 +39,7 @@ static struct rc_map_list evga_indtube_map = {
.map = {
.scan = evga_indtube,
.size = ARRAY_SIZE(evga_indtube),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_EVGA_INDTUBE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-eztv.c b/drivers/media/rc/keymaps/rc-eztv.c
index 1e8e5b2..c54e7eb 100644
--- a/drivers/media/rc/keymaps/rc-eztv.c
+++ b/drivers/media/rc/keymaps/rc-eztv.c
@@ -74,7 +74,7 @@ static struct rc_map_list eztv_map = {
.map = {
.scan = eztv,
.size = ARRAY_SIZE(eztv),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_EZTV,
}
};
diff --git a/drivers/media/rc/keymaps/rc-flydvb.c b/drivers/media/rc/keymaps/rc-flydvb.c
index a8b0f66..2d813c2 100644
--- a/drivers/media/rc/keymaps/rc-flydvb.c
+++ b/drivers/media/rc/keymaps/rc-flydvb.c
@@ -55,7 +55,7 @@ static struct rc_map_list flydvb_map = {
.map = {
.scan = flydvb,
.size = ARRAY_SIZE(flydvb),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_FLYDVB,
}
};
diff --git a/drivers/media/rc/keymaps/rc-flyvideo.c b/drivers/media/rc/keymaps/rc-flyvideo.c
index 5bbe683..925f42f 100644
--- a/drivers/media/rc/keymaps/rc-flyvideo.c
+++ b/drivers/media/rc/keymaps/rc-flyvideo.c
@@ -48,7 +48,7 @@ static struct rc_map_list flyvideo_map = {
.map = {
.scan = flyvideo,
.size = ARRAY_SIZE(flyvideo),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_FLYVIDEO,
}
};
diff --git a/drivers/media/rc/keymaps/rc-fusionhdtv-mce.c b/drivers/media/rc/keymaps/rc-fusionhdtv-mce.c
index c80b25c..50e3f70 100644
--- a/drivers/media/rc/keymaps/rc-fusionhdtv-mce.c
+++ b/drivers/media/rc/keymaps/rc-fusionhdtv-mce.c
@@ -76,7 +76,7 @@ static struct rc_map_list fusionhdtv_mce_map = {
.map = {
.scan = fusionhdtv_mce,
.size = ARRAY_SIZE(fusionhdtv_mce),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_FUSIONHDTV_MCE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-gadmei-rm008z.c b/drivers/media/rc/keymaps/rc-gadmei-rm008z.c
index 068c9ea..db3964d 100644
--- a/drivers/media/rc/keymaps/rc-gadmei-rm008z.c
+++ b/drivers/media/rc/keymaps/rc-gadmei-rm008z.c
@@ -59,7 +59,7 @@ static struct rc_map_list gadmei_rm008z_map = {
.map = {
.scan = gadmei_rm008z,
.size = ARRAY_SIZE(gadmei_rm008z),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_GADMEI_RM008Z,
}
};
diff --git a/drivers/media/rc/keymaps/rc-genius-tvgo-a11mce.c b/drivers/media/rc/keymaps/rc-genius-tvgo-a11mce.c
index cdbbed4..7dfdfef 100644
--- a/drivers/media/rc/keymaps/rc-genius-tvgo-a11mce.c
+++ b/drivers/media/rc/keymaps/rc-genius-tvgo-a11mce.c
@@ -62,7 +62,7 @@ static struct rc_map_list genius_tvgo_a11mce_map = {
.map = {
.scan = genius_tvgo_a11mce,
.size = ARRAY_SIZE(genius_tvgo_a11mce),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_GENIUS_TVGO_A11MCE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-gotview7135.c b/drivers/media/rc/keymaps/rc-gotview7135.c
index a38bdde..83ee207 100644
--- a/drivers/media/rc/keymaps/rc-gotview7135.c
+++ b/drivers/media/rc/keymaps/rc-gotview7135.c
@@ -57,7 +57,7 @@ static struct rc_map_list gotview7135_map = {
.map = {
.scan = gotview7135,
.size = ARRAY_SIZE(gotview7135),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_GOTVIEW7135,
}
};
diff --git a/drivers/media/rc/keymaps/rc-hauppauge.c b/drivers/media/rc/keymaps/rc-hauppauge.c
index cd3db77..afa0e9a 100644
--- a/drivers/media/rc/keymaps/rc-hauppauge.c
+++ b/drivers/media/rc/keymaps/rc-hauppauge.c
@@ -219,7 +219,7 @@ static struct rc_map_list rc5_hauppauge_new_map = {
.map = {
.scan = rc5_hauppauge_new,
.size = ARRAY_SIZE(rc5_hauppauge_new),
- .rc_type = RC_TYPE_RC5,
+ .rc_type = RC_BIT_RC5,
.name = RC_MAP_HAUPPAUGE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-imon-mce.c b/drivers/media/rc/keymaps/rc-imon-mce.c
index 937a819..7564607 100644
--- a/drivers/media/rc/keymaps/rc-imon-mce.c
+++ b/drivers/media/rc/keymaps/rc-imon-mce.c
@@ -120,7 +120,7 @@ static struct rc_map_list imon_mce_map = {
.scan = imon_mce,
.size = ARRAY_SIZE(imon_mce),
/* its RC6, but w/a hardware decoder */
- .rc_type = RC_TYPE_RC6,
+ .rc_type = RC_BIT_RC6,
.name = RC_MAP_IMON_MCE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-imon-pad.c b/drivers/media/rc/keymaps/rc-imon-pad.c
index 63d42bd..dcd2501 100644
--- a/drivers/media/rc/keymaps/rc-imon-pad.c
+++ b/drivers/media/rc/keymaps/rc-imon-pad.c
@@ -134,7 +134,7 @@ static struct rc_map_list imon_pad_map = {
.scan = imon_pad,
.size = ARRAY_SIZE(imon_pad),
/* actual protocol details unknown, hardware decoder */
- .rc_type = RC_TYPE_OTHER,
+ .rc_type = RC_BIT_OTHER,
.name = RC_MAP_IMON_PAD,
}
};
diff --git a/drivers/media/rc/keymaps/rc-iodata-bctv7e.c b/drivers/media/rc/keymaps/rc-iodata-bctv7e.c
index 1f59e16..77be76f 100644
--- a/drivers/media/rc/keymaps/rc-iodata-bctv7e.c
+++ b/drivers/media/rc/keymaps/rc-iodata-bctv7e.c
@@ -66,7 +66,7 @@ static struct rc_map_list iodata_bctv7e_map = {
.map = {
.scan = iodata_bctv7e,
.size = ARRAY_SIZE(iodata_bctv7e),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_IODATA_BCTV7E,
}
};
diff --git a/drivers/media/rc/keymaps/rc-kaiomy.c b/drivers/media/rc/keymaps/rc-kaiomy.c
index f31dc5c..2806b04 100644
--- a/drivers/media/rc/keymaps/rc-kaiomy.c
+++ b/drivers/media/rc/keymaps/rc-kaiomy.c
@@ -65,7 +65,7 @@ static struct rc_map_list kaiomy_map = {
.map = {
.scan = kaiomy,
.size = ARRAY_SIZE(kaiomy),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_KAIOMY,
}
};
diff --git a/drivers/media/rc/keymaps/rc-kworld-315u.c b/drivers/media/rc/keymaps/rc-kworld-315u.c
index 7f33edb..be43dd3 100644
--- a/drivers/media/rc/keymaps/rc-kworld-315u.c
+++ b/drivers/media/rc/keymaps/rc-kworld-315u.c
@@ -61,7 +61,7 @@ static struct rc_map_list kworld_315u_map = {
.map = {
.scan = kworld_315u,
.size = ARRAY_SIZE(kworld_315u),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_KWORLD_315U,
}
};
diff --git a/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c b/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c
index 08d1831..3244113 100644
--- a/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c
+++ b/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c
@@ -77,7 +77,7 @@ static struct rc_map_list kworld_plus_tv_analog_map = {
.map = {
.scan = kworld_plus_tv_analog,
.size = ARRAY_SIZE(kworld_plus_tv_analog),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_KWORLD_PLUS_TV_ANALOG,
}
};
diff --git a/drivers/media/rc/keymaps/rc-leadtek-y04g0051.c b/drivers/media/rc/keymaps/rc-leadtek-y04g0051.c
index 8faa54f..20ded0c 100644
--- a/drivers/media/rc/keymaps/rc-leadtek-y04g0051.c
+++ b/drivers/media/rc/keymaps/rc-leadtek-y04g0051.c
@@ -77,7 +77,7 @@ static struct rc_map_list leadtek_y04g0051_map = {
.map = {
.scan = leadtek_y04g0051,
.size = ARRAY_SIZE(leadtek_y04g0051),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_LEADTEK_Y04G0051,
}
};
diff --git a/drivers/media/rc/keymaps/rc-lirc.c b/drivers/media/rc/keymaps/rc-lirc.c
index e8e23e2..dd4d7c9 100644
--- a/drivers/media/rc/keymaps/rc-lirc.c
+++ b/drivers/media/rc/keymaps/rc-lirc.c
@@ -19,7 +19,7 @@ static struct rc_map_list lirc_map = {
.map = {
.scan = lirc,
.size = ARRAY_SIZE(lirc),
- .rc_type = RC_TYPE_LIRC,
+ .rc_type = RC_BIT_LIRC,
.name = RC_MAP_LIRC,
}
};
diff --git a/drivers/media/rc/keymaps/rc-lme2510.c b/drivers/media/rc/keymaps/rc-lme2510.c
index 3c19139..f95895f 100644
--- a/drivers/media/rc/keymaps/rc-lme2510.c
+++ b/drivers/media/rc/keymaps/rc-lme2510.c
@@ -88,7 +88,7 @@ static struct rc_map_list lme2510_map = {
.map = {
.scan = lme2510_rc,
.size = ARRAY_SIZE(lme2510_rc),
- .rc_type = RC_TYPE_UNKNOWN,
+ .rc_type = RC_BIT_UNKNOWN,
.name = RC_MAP_LME2510,
}
};
diff --git a/drivers/media/rc/keymaps/rc-manli.c b/drivers/media/rc/keymaps/rc-manli.c
index 23b2d04..d113a3b 100644
--- a/drivers/media/rc/keymaps/rc-manli.c
+++ b/drivers/media/rc/keymaps/rc-manli.c
@@ -112,7 +112,7 @@ static struct rc_map_list manli_map = {
.map = {
.scan = manli,
.size = ARRAY_SIZE(manli),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_MANLI,
}
};
diff --git a/drivers/media/rc/keymaps/rc-msi-digivox-ii.c b/drivers/media/rc/keymaps/rc-msi-digivox-ii.c
index 7b9a01b..1142eac 100644
--- a/drivers/media/rc/keymaps/rc-msi-digivox-ii.c
+++ b/drivers/media/rc/keymaps/rc-msi-digivox-ii.c
@@ -45,7 +45,7 @@ static struct rc_map_list msi_digivox_ii_map = {
.map = {
.scan = msi_digivox_ii,
.size = ARRAY_SIZE(msi_digivox_ii),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_MSI_DIGIVOX_II,
}
};
diff --git a/drivers/media/rc/keymaps/rc-msi-digivox-iii.c b/drivers/media/rc/keymaps/rc-msi-digivox-iii.c
index ae9d06b..f3c0d16 100644
--- a/drivers/media/rc/keymaps/rc-msi-digivox-iii.c
+++ b/drivers/media/rc/keymaps/rc-msi-digivox-iii.c
@@ -63,7 +63,7 @@ static struct rc_map_list msi_digivox_iii_map = {
.map = {
.scan = msi_digivox_iii,
.size = ARRAY_SIZE(msi_digivox_iii),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_MSI_DIGIVOX_III,
}
};
diff --git a/drivers/media/rc/keymaps/rc-msi-tvanywhere-plus.c b/drivers/media/rc/keymaps/rc-msi-tvanywhere-plus.c
index 8e9969d..429e6af 100644
--- a/drivers/media/rc/keymaps/rc-msi-tvanywhere-plus.c
+++ b/drivers/media/rc/keymaps/rc-msi-tvanywhere-plus.c
@@ -101,7 +101,7 @@ static struct rc_map_list msi_tvanywhere_plus_map = {
.map = {
.scan = msi_tvanywhere_plus,
.size = ARRAY_SIZE(msi_tvanywhere_plus),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_MSI_TVANYWHERE_PLUS,
}
};
diff --git a/drivers/media/rc/keymaps/rc-msi-tvanywhere.c b/drivers/media/rc/keymaps/rc-msi-tvanywhere.c
index 18b37fa..52cf5f1 100644
--- a/drivers/media/rc/keymaps/rc-msi-tvanywhere.c
+++ b/drivers/media/rc/keymaps/rc-msi-tvanywhere.c
@@ -47,7 +47,7 @@ static struct rc_map_list msi_tvanywhere_map = {
.map = {
.scan = msi_tvanywhere,
.size = ARRAY_SIZE(msi_tvanywhere),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_MSI_TVANYWHERE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-nebula.c b/drivers/media/rc/keymaps/rc-nebula.c
index ddae20e..91f24c6 100644
--- a/drivers/media/rc/keymaps/rc-nebula.c
+++ b/drivers/media/rc/keymaps/rc-nebula.c
@@ -74,7 +74,7 @@ static struct rc_map_list nebula_map = {
.map = {
.scan = nebula,
.size = ARRAY_SIZE(nebula),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_NEBULA,
}
};
diff --git a/drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c b/drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c
index 26f114c..558276e 100644
--- a/drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c
+++ b/drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c
@@ -83,7 +83,7 @@ static struct rc_map_list nec_terratec_cinergy_xs_map = {
.map = {
.scan = nec_terratec_cinergy_xs,
.size = ARRAY_SIZE(nec_terratec_cinergy_xs),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_NEC_TERRATEC_CINERGY_XS,
}
};
diff --git a/drivers/media/rc/keymaps/rc-norwood.c b/drivers/media/rc/keymaps/rc-norwood.c
index f1c1281..8093ad5 100644
--- a/drivers/media/rc/keymaps/rc-norwood.c
+++ b/drivers/media/rc/keymaps/rc-norwood.c
@@ -63,7 +63,7 @@ static struct rc_map_list norwood_map = {
.map = {
.scan = norwood,
.size = ARRAY_SIZE(norwood),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_NORWOOD,
}
};
diff --git a/drivers/media/rc/keymaps/rc-npgtech.c b/drivers/media/rc/keymaps/rc-npgtech.c
index 4aa588b..07f5f7a 100644
--- a/drivers/media/rc/keymaps/rc-npgtech.c
+++ b/drivers/media/rc/keymaps/rc-npgtech.c
@@ -58,7 +58,7 @@ static struct rc_map_list npgtech_map = {
.map = {
.scan = npgtech,
.size = ARRAY_SIZE(npgtech),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_NPGTECH,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pctv-sedna.c b/drivers/media/rc/keymaps/rc-pctv-sedna.c
index 7cdef6e..30b7862 100644
--- a/drivers/media/rc/keymaps/rc-pctv-sedna.c
+++ b/drivers/media/rc/keymaps/rc-pctv-sedna.c
@@ -58,7 +58,7 @@ static struct rc_map_list pctv_sedna_map = {
.map = {
.scan = pctv_sedna,
.size = ARRAY_SIZE(pctv_sedna),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PCTV_SEDNA,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pinnacle-color.c b/drivers/media/rc/keymaps/rc-pinnacle-color.c
index 23b8c50..203c5c6 100644
--- a/drivers/media/rc/keymaps/rc-pinnacle-color.c
+++ b/drivers/media/rc/keymaps/rc-pinnacle-color.c
@@ -72,7 +72,7 @@ static struct rc_map_list pinnacle_color_map = {
.map = {
.scan = pinnacle_color,
.size = ARRAY_SIZE(pinnacle_color),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PINNACLE_COLOR,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pinnacle-grey.c b/drivers/media/rc/keymaps/rc-pinnacle-grey.c
index 6ba8c36..94eda32 100644
--- a/drivers/media/rc/keymaps/rc-pinnacle-grey.c
+++ b/drivers/media/rc/keymaps/rc-pinnacle-grey.c
@@ -67,7 +67,7 @@ static struct rc_map_list pinnacle_grey_map = {
.map = {
.scan = pinnacle_grey,
.size = ARRAY_SIZE(pinnacle_grey),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PINNACLE_GREY,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c b/drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c
index bb10ffe..186454e 100644
--- a/drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c
+++ b/drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c
@@ -51,7 +51,7 @@ static struct rc_map_list pinnacle_pctv_hd_map = {
.map = {
.scan = pinnacle_pctv_hd,
.size = ARRAY_SIZE(pinnacle_pctv_hd),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PINNACLE_PCTV_HD,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pixelview-002t.c b/drivers/media/rc/keymaps/rc-pixelview-002t.c
index e5ab071..f8ab181 100644
--- a/drivers/media/rc/keymaps/rc-pixelview-002t.c
+++ b/drivers/media/rc/keymaps/rc-pixelview-002t.c
@@ -55,7 +55,7 @@ static struct rc_map_list pixelview_map = {
.map = {
.scan = pixelview_002t,
.size = ARRAY_SIZE(pixelview_002t),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_PIXELVIEW_002T,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pixelview-mk12.c b/drivers/media/rc/keymaps/rc-pixelview-mk12.c
index 125fc39..6cde384 100644
--- a/drivers/media/rc/keymaps/rc-pixelview-mk12.c
+++ b/drivers/media/rc/keymaps/rc-pixelview-mk12.c
@@ -61,7 +61,7 @@ static struct rc_map_list pixelview_map = {
.map = {
.scan = pixelview_mk12,
.size = ARRAY_SIZE(pixelview_mk12),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_PIXELVIEW_MK12,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pixelview-new.c b/drivers/media/rc/keymaps/rc-pixelview-new.c
index bd78d6a..c3d0486 100644
--- a/drivers/media/rc/keymaps/rc-pixelview-new.c
+++ b/drivers/media/rc/keymaps/rc-pixelview-new.c
@@ -61,7 +61,7 @@ static struct rc_map_list pixelview_new_map = {
.map = {
.scan = pixelview_new,
.size = ARRAY_SIZE(pixelview_new),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PIXELVIEW_NEW,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pixelview.c b/drivers/media/rc/keymaps/rc-pixelview.c
index 06187e7..de7e820 100644
--- a/drivers/media/rc/keymaps/rc-pixelview.c
+++ b/drivers/media/rc/keymaps/rc-pixelview.c
@@ -60,7 +60,7 @@ static struct rc_map_list pixelview_map = {
.map = {
.scan = pixelview,
.size = ARRAY_SIZE(pixelview),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PIXELVIEW,
}
};
diff --git a/drivers/media/rc/keymaps/rc-powercolor-real-angel.c b/drivers/media/rc/keymaps/rc-powercolor-real-angel.c
index 5f9d546..c3f41a8 100644
--- a/drivers/media/rc/keymaps/rc-powercolor-real-angel.c
+++ b/drivers/media/rc/keymaps/rc-powercolor-real-angel.c
@@ -59,7 +59,7 @@ static struct rc_map_list powercolor_real_angel_map = {
.map = {
.scan = powercolor_real_angel,
.size = ARRAY_SIZE(powercolor_real_angel),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_POWERCOLOR_REAL_ANGEL,
}
};
diff --git a/drivers/media/rc/keymaps/rc-proteus-2309.c b/drivers/media/rc/keymaps/rc-proteus-2309.c
index 8a3a643..9c013a4 100644
--- a/drivers/media/rc/keymaps/rc-proteus-2309.c
+++ b/drivers/media/rc/keymaps/rc-proteus-2309.c
@@ -47,7 +47,7 @@ static struct rc_map_list proteus_2309_map = {
.map = {
.scan = proteus_2309,
.size = ARRAY_SIZE(proteus_2309),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PROTEUS_2309,
}
};
diff --git a/drivers/media/rc/keymaps/rc-purpletv.c b/drivers/media/rc/keymaps/rc-purpletv.c
index ef90296..4266744 100644
--- a/drivers/media/rc/keymaps/rc-purpletv.c
+++ b/drivers/media/rc/keymaps/rc-purpletv.c
@@ -59,7 +59,7 @@ static struct rc_map_list purpletv_map = {
.map = {
.scan = purpletv,
.size = ARRAY_SIZE(purpletv),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PURPLETV,
}
};
diff --git a/drivers/media/rc/keymaps/rc-pv951.c b/drivers/media/rc/keymaps/rc-pv951.c
index 5e8beee..f3ff8e4 100644
--- a/drivers/media/rc/keymaps/rc-pv951.c
+++ b/drivers/media/rc/keymaps/rc-pv951.c
@@ -56,7 +56,7 @@ static struct rc_map_list pv951_map = {
.map = {
.scan = pv951,
.size = ARRAY_SIZE(pv951),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_PV951,
}
};
diff --git a/drivers/media/rc/keymaps/rc-rc6-mce.c b/drivers/media/rc/keymaps/rc-rc6-mce.c
index 8dd519e..68e87c2 100644
--- a/drivers/media/rc/keymaps/rc-rc6-mce.c
+++ b/drivers/media/rc/keymaps/rc-rc6-mce.c
@@ -97,7 +97,7 @@ static struct rc_map_list rc6_mce_map = {
.map = {
.scan = rc6_mce,
.size = ARRAY_SIZE(rc6_mce),
- .rc_type = RC_TYPE_RC6,
+ .rc_type = RC_BIT_RC6,
.name = RC_MAP_RC6_MCE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-real-audio-220-32-keys.c b/drivers/media/rc/keymaps/rc-real-audio-220-32-keys.c
index 6813d11..f42addf 100644
--- a/drivers/media/rc/keymaps/rc-real-audio-220-32-keys.c
+++ b/drivers/media/rc/keymaps/rc-real-audio-220-32-keys.c
@@ -56,7 +56,7 @@ static struct rc_map_list real_audio_220_32_keys_map = {
.map = {
.scan = real_audio_220_32_keys,
.size = ARRAY_SIZE(real_audio_220_32_keys),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_REAL_AUDIO_220_32_KEYS,
}
};
diff --git a/drivers/media/rc/keymaps/rc-streamzap.c b/drivers/media/rc/keymaps/rc-streamzap.c
index 92cc10d..93052d5 100644
--- a/drivers/media/rc/keymaps/rc-streamzap.c
+++ b/drivers/media/rc/keymaps/rc-streamzap.c
@@ -60,7 +60,7 @@ static struct rc_map_list streamzap_map = {
.map = {
.scan = streamzap,
.size = ARRAY_SIZE(streamzap),
- .rc_type = RC_TYPE_RC5_SZ,
+ .rc_type = RC_BIT_RC5_SZ,
.name = RC_MAP_STREAMZAP,
}
};
diff --git a/drivers/media/rc/keymaps/rc-tbs-nec.c b/drivers/media/rc/keymaps/rc-tbs-nec.c
index 7242ee6..ed756d0 100644
--- a/drivers/media/rc/keymaps/rc-tbs-nec.c
+++ b/drivers/media/rc/keymaps/rc-tbs-nec.c
@@ -53,7 +53,7 @@ static struct rc_map_list tbs_nec_map = {
.map = {
.scan = tbs_nec,
.size = ARRAY_SIZE(tbs_nec),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_TBS_NEC,
}
};
diff --git a/drivers/media/rc/keymaps/rc-technisat-usb2.c b/drivers/media/rc/keymaps/rc-technisat-usb2.c
index 4afe577..1786948 100644
--- a/drivers/media/rc/keymaps/rc-technisat-usb2.c
+++ b/drivers/media/rc/keymaps/rc-technisat-usb2.c
@@ -71,7 +71,7 @@ static struct rc_map_list technisat_usb2_map = {
.map = {
.scan = technisat_usb2,
.size = ARRAY_SIZE(technisat_usb2),
- .rc_type = RC_TYPE_RC5,
+ .rc_type = RC_BIT_RC5,
.name = RC_MAP_TECHNISAT_USB2,
}
};
diff --git a/drivers/media/rc/keymaps/rc-terratec-cinergy-xs.c b/drivers/media/rc/keymaps/rc-terratec-cinergy-xs.c
index bc38e34..d7aa9d2 100644
--- a/drivers/media/rc/keymaps/rc-terratec-cinergy-xs.c
+++ b/drivers/media/rc/keymaps/rc-terratec-cinergy-xs.c
@@ -70,7 +70,7 @@ static struct rc_map_list terratec_cinergy_xs_map = {
.map = {
.scan = terratec_cinergy_xs,
.size = ARRAY_SIZE(terratec_cinergy_xs),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_TERRATEC_CINERGY_XS,
}
};
diff --git a/drivers/media/rc/keymaps/rc-terratec-slim-2.c b/drivers/media/rc/keymaps/rc-terratec-slim-2.c
index 4409391..7f5b8cd 100644
--- a/drivers/media/rc/keymaps/rc-terratec-slim-2.c
+++ b/drivers/media/rc/keymaps/rc-terratec-slim-2.c
@@ -50,7 +50,7 @@ static struct rc_map_list terratec_slim_2_map = {
.map = {
.scan = terratec_slim_2,
.size = ARRAY_SIZE(terratec_slim_2),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_TERRATEC_SLIM_2,
}
};
diff --git a/drivers/media/rc/keymaps/rc-terratec-slim.c b/drivers/media/rc/keymaps/rc-terratec-slim.c
index 1abafa5..68b9394 100644
--- a/drivers/media/rc/keymaps/rc-terratec-slim.c
+++ b/drivers/media/rc/keymaps/rc-terratec-slim.c
@@ -57,7 +57,7 @@ static struct rc_map_list terratec_slim_map = {
.map = {
.scan = terratec_slim,
.size = ARRAY_SIZE(terratec_slim),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_TERRATEC_SLIM,
}
};
diff --git a/drivers/media/rc/keymaps/rc-tevii-nec.c b/drivers/media/rc/keymaps/rc-tevii-nec.c
index ef5ba3f..864f2ca 100644
--- a/drivers/media/rc/keymaps/rc-tevii-nec.c
+++ b/drivers/media/rc/keymaps/rc-tevii-nec.c
@@ -66,7 +66,7 @@ static struct rc_map_list tevii_nec_map = {
.map = {
.scan = tevii_nec,
.size = ARRAY_SIZE(tevii_nec),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_TEVII_NEC,
}
};
diff --git a/drivers/media/rc/keymaps/rc-total-media-in-hand.c b/drivers/media/rc/keymaps/rc-total-media-in-hand.c
index 20ac4e1..181eaa4 100644
--- a/drivers/media/rc/keymaps/rc-total-media-in-hand.c
+++ b/drivers/media/rc/keymaps/rc-total-media-in-hand.c
@@ -63,7 +63,7 @@ static struct rc_map_list total_media_in_hand_map = {
.map = {
.scan = total_media_in_hand,
.size = ARRAY_SIZE(total_media_in_hand),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_TOTAL_MEDIA_IN_HAND,
}
};
diff --git a/drivers/media/rc/keymaps/rc-trekstor.c b/drivers/media/rc/keymaps/rc-trekstor.c
index f8190ea..5bb283a 100644
--- a/drivers/media/rc/keymaps/rc-trekstor.c
+++ b/drivers/media/rc/keymaps/rc-trekstor.c
@@ -58,7 +58,7 @@ static struct rc_map_list trekstor_map = {
.map = {
.scan = trekstor,
.size = ARRAY_SIZE(trekstor),
- .rc_type = RC_TYPE_NEC,
+ .rc_type = RC_BIT_NEC,
.name = RC_MAP_TREKSTOR,
}
};
diff --git a/drivers/media/rc/keymaps/rc-tt-1500.c b/drivers/media/rc/keymaps/rc-tt-1500.c
index 295f373..d5d7903 100644
--- a/drivers/media/rc/keymaps/rc-tt-1500.c
+++ b/drivers/media/rc/keymaps/rc-tt-1500.c
@@ -60,7 +60,7 @@ static struct rc_map_list tt_1500_map = {
.map = {
.scan = tt_1500,
.size = ARRAY_SIZE(tt_1500),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_TT_1500,
}
};
diff --git a/drivers/media/rc/keymaps/rc-twinhan1027.c b/drivers/media/rc/keymaps/rc-twinhan1027.c
index 8bf8df6..4a6aef6 100644
--- a/drivers/media/rc/keymaps/rc-twinhan1027.c
+++ b/drivers/media/rc/keymaps/rc-twinhan1027.c
@@ -65,7 +65,7 @@ static struct rc_map_list twinhan_vp1027_map = {
.map = {
.scan = twinhan_vp1027,
.size = ARRAY_SIZE(twinhan_vp1027),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_TWINHAN_VP1027_DVBS,
}
};
diff --git a/drivers/media/rc/keymaps/rc-videomate-m1f.c b/drivers/media/rc/keymaps/rc-videomate-m1f.c
index 4994d40..916b641 100644
--- a/drivers/media/rc/keymaps/rc-videomate-m1f.c
+++ b/drivers/media/rc/keymaps/rc-videomate-m1f.c
@@ -70,7 +70,7 @@ static struct rc_map_list videomate_m1f_map = {
.map = {
.scan = videomate_m1f,
.size = ARRAY_SIZE(videomate_m1f),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_VIDEOMATE_M1F,
}
};
diff --git a/drivers/media/rc/keymaps/rc-videomate-s350.c b/drivers/media/rc/keymaps/rc-videomate-s350.c
index 9e474a6..26ca260 100644
--- a/drivers/media/rc/keymaps/rc-videomate-s350.c
+++ b/drivers/media/rc/keymaps/rc-videomate-s350.c
@@ -63,7 +63,7 @@ static struct rc_map_list videomate_s350_map = {
.map = {
.scan = videomate_s350,
.size = ARRAY_SIZE(videomate_s350),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_VIDEOMATE_S350,
}
};
diff --git a/drivers/media/rc/keymaps/rc-videomate-tv-pvr.c b/drivers/media/rc/keymaps/rc-videomate-tv-pvr.c
index 5f2a46e..edc169b 100644
--- a/drivers/media/rc/keymaps/rc-videomate-tv-pvr.c
+++ b/drivers/media/rc/keymaps/rc-videomate-tv-pvr.c
@@ -65,7 +65,7 @@ static struct rc_map_list videomate_tv_pvr_map = {
.map = {
.scan = videomate_tv_pvr,
.size = ARRAY_SIZE(videomate_tv_pvr),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_VIDEOMATE_TV_PVR,
}
};
diff --git a/drivers/media/rc/keymaps/rc-winfast-usbii-deluxe.c b/drivers/media/rc/keymaps/rc-winfast-usbii-deluxe.c
index bd8d021..44a5d6f 100644
--- a/drivers/media/rc/keymaps/rc-winfast-usbii-deluxe.c
+++ b/drivers/media/rc/keymaps/rc-winfast-usbii-deluxe.c
@@ -60,7 +60,7 @@ static struct rc_map_list winfast_usbii_deluxe_map = {
.map = {
.scan = winfast_usbii_deluxe,
.size = ARRAY_SIZE(winfast_usbii_deluxe),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_WINFAST_USBII_DELUXE,
}
};
diff --git a/drivers/media/rc/keymaps/rc-winfast.c b/drivers/media/rc/keymaps/rc-winfast.c
index 0062ca2..4c8b4b1 100644
--- a/drivers/media/rc/keymaps/rc-winfast.c
+++ b/drivers/media/rc/keymaps/rc-winfast.c
@@ -80,7 +80,7 @@ static struct rc_map_list winfast_map = {
.map = {
.scan = winfast,
.size = ARRAY_SIZE(winfast),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_WINFAST,
}
};
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 044fb7a..c51e7c2 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1067,7 +1067,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_protos = RC_TYPE_ALL;
+ rc->allowed_protos = RC_BIT_ALL;
rc->timeout = US_TO_NS(1000);
if (!ir->flags.no_tx) {
rc->s_tx_mask = mceusb_set_tx_mask;
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index d4d6449..dba02b5 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -1064,7 +1064,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_protos = RC_TYPE_ALL;
+ rdev->allowed_protos = RC_BIT_ALL;
rdev->open = nvt_open;
rdev->close = nvt_close;
rdev->tx_ir = nvt_tx_ir;
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index cc846b2..6dee719 100644
--- a/drivers/media/rc/rc-loopback.c
+++ b/drivers/media/rc/rc-loopback.c
@@ -214,7 +214,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_protos = RC_TYPE_ALL;
+ rc->allowed_protos = RC_BIT_ALL;
rc->timeout = 100 * 1000 * 1000; /* 100 ms */
rc->min_timeout = 1;
rc->max_timeout = UINT_MAX;
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 5b4422e..5a182b2 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -102,7 +102,7 @@ static struct rc_map_list empty_map = {
.map = {
.scan = empty,
.size = ARRAY_SIZE(empty),
- .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
+ .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
.name = RC_MAP_EMPTY,
}
};
@@ -725,14 +725,17 @@ static struct {
u64 type;
char *name;
} proto_names[] = {
- { RC_TYPE_UNKNOWN, "unknown" },
- { RC_TYPE_RC5, "rc-5" },
- { RC_TYPE_NEC, "nec" },
- { RC_TYPE_RC6, "rc-6" },
- { RC_TYPE_JVC, "jvc" },
- { RC_TYPE_SONY, "sony" },
- { RC_TYPE_RC5_SZ, "rc-5-sz" },
- { RC_TYPE_LIRC, "lirc" },
+ { RC_BIT_OTHER, "other" },
+ { RC_BIT_RC5, "rc-5" },
+ { RC_BIT_RC5X, "rc-5-x" },
+ { RC_BIT_RC5_SZ, "rc-5-sz" },
+ { RC_BIT_RC6, "rc-6" },
+ { RC_BIT_JVC, "jvc" },
+ { RC_BIT_SONY12, "sony12" },
+ { RC_BIT_SONY15, "sony15" },
+ { RC_BIT_SONY20, "sony20" },
+ { RC_BIT_NEC, "nec" },
+ { RC_BIT_LIRC, "lirc" },
};
#define PROTO_NONE "none"
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c
index e435d94..48cf47f 100644
--- a/drivers/media/rc/streamzap.c
+++ b/drivers/media/rc/streamzap.c
@@ -322,7 +322,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_protos = RC_TYPE_ALL;
+ rdev->allowed_protos = RC_BIT_ALL;
rdev->driver_name = DRIVER_NAME;
rdev->map_name = RC_MAP_STREAMZAP;
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c
index 040aaa8..d5e249c 100644
--- a/drivers/media/video/cx18/cx18-i2c.c
+++ b/drivers/media/video/cx18/cx18-i2c.c
@@ -98,7 +98,7 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,
case CX18_HW_Z8F0811_IR_RX_HAUP:
init_data->ir_codes = RC_MAP_HAUPPAUGE;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
- init_data->type = RC_TYPE_RC5;
+ init_data->type = RC_BIT_RC5;
init_data->name = cx->card_name;
info.platform_data = init_data;
break;
diff --git a/drivers/media/video/cx231xx/cx231xx-input.c b/drivers/media/video/cx231xx/cx231xx-input.c
index 45e14ca..8f44703 100644
--- a/drivers/media/video/cx231xx/cx231xx-input.c
+++ b/drivers/media/video/cx231xx/cx231xx-input.c
@@ -95,7 +95,7 @@ int cx231xx_ir_init(struct cx231xx *dev)
/* The i2c micro-controller only outputs the cmd part of NEC protocol */
dev->init_data.rc_dev->scanmask = 0xff;
dev->init_data.rc_dev->driver_name = "cx231xx";
- dev->init_data.type = RC_TYPE_NEC;
+ dev->init_data.type = RC_BIT_NEC;
info.addr = 0x30;
/* Load and bind ir-kbd-i2c */
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index e97cafd..7e5c4cb 100644
--- a/drivers/media/video/cx23885/cx23885-input.c
+++ b/drivers/media/video/cx23885/cx23885-input.c
@@ -262,14 +262,14 @@ 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_TYPE_ALL;
+ allowed_protos = RC_BIT_ALL;
/* The grey Hauppauge RC-5 remote */
rc_map = RC_MAP_HAUPPAUGE;
break;
case CX23885_BOARD_TEVII_S470:
/* Integrated CX23885 IR controller */
driver_type = RC_DRIVER_IR_RAW;
- allowed_protos = RC_TYPE_ALL;
+ allowed_protos = RC_BIT_ALL;
/* A guess at the remote */
rc_map = RC_MAP_TEVII_NEC;
break;
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index c820e2f..5ce488d 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -244,7 +244,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
struct cx88_IR *ir;
struct rc_dev *dev;
char *ir_codes = NULL;
- u64 rc_type = RC_TYPE_OTHER;
+ u64 rc_type = RC_BIT_OTHER;
int err = -ENOMEM;
u32 hardware_mask = 0; /* For devices with a hardware mask, when
* used with a full-code IR table
@@ -408,7 +408,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
break;
case CX88_BOARD_TWINHAN_VP1027_DVBS:
ir_codes = RC_MAP_TWINHAN_VP1027_DVBS;
- rc_type = RC_TYPE_NEC;
+ rc_type = RC_BIT_NEC;
ir->sampling = 0xff00; /* address */
break;
}
@@ -584,7 +584,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)
case CX88_BOARD_LEADTEK_PVR2000:
addr_list = pvr2000_addr_list;
core->init_data.name = "cx88 Leadtek PVR 2000 remote";
- core->init_data.type = RC_TYPE_UNKNOWN;
+ core->init_data.type = RC_BIT_UNKNOWN;
core->init_data.get_key = get_key_pvr2000;
core->init_data.ir_codes = RC_MAP_EMPTY;
break;
@@ -605,7 +605,7 @@ void cx88_i2c_init_ir(struct cx88_core *core)
/* Hauppauge XVR */
core->init_data.name = "cx88 Hauppauge XVR remote";
core->init_data.ir_codes = RC_MAP_HAUPPAUGE;
- core->init_data.type = RC_TYPE_RC5;
+ core->init_data.type = RC_BIT_RC5;
core->init_data.internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
info.platform_data = &core->init_data;
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index ba1ba86..cfae6aa 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -352,14 +352,14 @@ int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 rc_type)
/* Adjust xclk based o IR table for RC5/NEC tables */
- if (rc_type == RC_TYPE_RC5) {
+ if (rc_type == RC_BIT_RC5) {
dev->board.xclk |= EM28XX_XCLK_IR_RC5_MODE;
ir->full_code = 1;
- } else if (rc_type == RC_TYPE_NEC) {
+ } else if (rc_type == RC_BIT_NEC) {
dev->board.xclk &= ~EM28XX_XCLK_IR_RC5_MODE;
ir_config = EM2874_IR_NEC;
ir->full_code = 1;
- } else if (rc_type != RC_TYPE_UNKNOWN)
+ } else if (rc_type != RC_BIT_UNKNOWN)
rc = -EINVAL;
em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, dev->board.xclk,
@@ -408,14 +408,14 @@ int em28xx_ir_init(struct em28xx *dev)
* em2874 supports more protocols. For now, let's just announce
* the two protocols that were already tested
*/
- rc->allowed_protos = RC_TYPE_RC5 | RC_TYPE_NEC;
+ rc->allowed_protos = RC_BIT_RC5 | RC_BIT_NEC;
rc->priv = ir;
rc->change_protocol = em28xx_ir_change_protocol;
rc->open = em28xx_ir_start;
rc->close = em28xx_ir_stop;
/* By default, keep protocol field untouched */
- err = em28xx_ir_change_protocol(rc, RC_TYPE_UNKNOWN);
+ err = em28xx_ir_change_protocol(rc, RC_BIT_UNKNOWN);
if (err)
goto err_out_free;
diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c
index 2a1ac28..0a21abb 100644
--- a/drivers/media/video/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/video/hdpvr/hdpvr-i2c.c
@@ -54,7 +54,7 @@ struct i2c_client *hdpvr_register_ir_rx_i2c(struct hdpvr_device *dev)
/* Our default information for ir-kbd-i2c.c to use */
init_data->ir_codes = RC_MAP_HAUPPAUGE;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
- init_data->type = RC_TYPE_RC5;
+ init_data->type = RC_BIT_RC5;
init_data->name = "HD-PVR";
init_data->polling_interval = 405; /* ms, duplicated from Windows */
hdpvr_ir_rx_i2c_board_info.platform_data = init_data;
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 3ab875d..479a892 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -276,7 +276,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
char *ir_codes = NULL;
const char *name = NULL;
- u64 rc_type = RC_TYPE_UNKNOWN;
+ u64 rc_type = RC_BIT_UNKNOWN;
struct IR_i2c *ir;
struct rc_dev *rc = NULL;
struct i2c_adapter *adap = client->adapter;
@@ -295,7 +295,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
case 0x64:
name = "Pixelview";
ir->get_key = get_key_pixelview;
- rc_type = RC_TYPE_OTHER;
+ rc_type = RC_BIT_OTHER;
ir_codes = RC_MAP_EMPTY;
break;
case 0x18:
@@ -303,31 +303,31 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
case 0x1a:
name = "Hauppauge";
ir->get_key = get_key_haup;
- rc_type = RC_TYPE_RC5;
+ rc_type = RC_BIT_RC5;
ir_codes = RC_MAP_HAUPPAUGE;
break;
case 0x30:
name = "KNC One";
ir->get_key = get_key_knc1;
- rc_type = RC_TYPE_OTHER;
+ rc_type = RC_BIT_OTHER;
ir_codes = RC_MAP_EMPTY;
break;
case 0x6b:
name = "FusionHDTV";
ir->get_key = get_key_fusionhdtv;
- rc_type = RC_TYPE_RC5;
+ rc_type = RC_BIT_RC5;
ir_codes = RC_MAP_FUSIONHDTV_MCE;
break;
case 0x40:
name = "AVerMedia Cardbus remote";
ir->get_key = get_key_avermedia_cardbus;
- rc_type = RC_TYPE_OTHER;
+ rc_type = RC_BIT_OTHER;
ir_codes = RC_MAP_AVERMEDIA_CARDBUS;
break;
case 0x71:
name = "Hauppauge/Zilog Z8";
ir->get_key = get_key_haup_xvr;
- rc_type = RC_TYPE_RC5;
+ rc_type = RC_BIT_RC5;
ir_codes = RC_MAP_HAUPPAUGE;
break;
}
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index d47f41a..46e262b 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -200,21 +200,21 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
init_data->ir_codes = RC_MAP_AVERMEDIA_CARDBUS;
init_data->internal_get_key_func =
IR_KBD_GET_KEY_AVERMEDIA_CARDBUS;
- init_data->type = RC_TYPE_OTHER;
+ init_data->type = RC_BIT_OTHER;
init_data->name = "AVerMedia AVerTV card";
break;
case IVTV_HW_I2C_IR_RX_HAUP_EXT:
case IVTV_HW_I2C_IR_RX_HAUP_INT:
init_data->ir_codes = RC_MAP_HAUPPAUGE;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;
- init_data->type = RC_TYPE_RC5;
+ init_data->type = RC_BIT_RC5;
init_data->name = itv->card_name;
break;
case IVTV_HW_Z8F0811_IR_RX_HAUP:
/* Default to grey remote */
init_data->ir_codes = RC_MAP_HAUPPAUGE;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
- init_data->type = RC_TYPE_RC5;
+ init_data->type = RC_BIT_RC5;
init_data->name = itv->card_name;
break;
case IVTV_HW_I2C_IR_RX_ADAPTEC:
@@ -222,7 +222,7 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
init_data->name = itv->card_name;
/* FIXME: The protocol and RC_MAP needs to be corrected */
init_data->ir_codes = RC_MAP_EMPTY;
- init_data->type = RC_TYPE_UNKNOWN;
+ init_data->type = RC_BIT_UNKNOWN;
break;
}
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
index e72d510..ad0e033 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
@@ -580,7 +580,7 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)
case PVR2_IR_SCHEME_29XXX: /* Original 29xxx device */
init_data->ir_codes = RC_MAP_HAUPPAUGE;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;
- init_data->type = RC_TYPE_RC5;
+ init_data->type = RC_BIT_RC5;
init_data->name = hdw->hdw_desc->description;
init_data->polling_interval = 100; /* ms From ir-kbd-i2c */
/* IR Receiver */
@@ -595,7 +595,7 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)
case PVR2_IR_SCHEME_24XXX_MCE: /* 24xxx MCE device */
init_data->ir_codes = RC_MAP_HAUPPAUGE;
init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
- init_data->type = RC_TYPE_RC5;
+ init_data->type = RC_BIT_RC5;
init_data->name = hdw->hdw_desc->description;
/* IR Receiver */
info.addr = 0x71;
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index be1c2a2..f00f4bd 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -914,7 +914,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
dev->init_data.name = "BeholdTV";
dev->init_data.get_key = get_key_beholdm6xx;
dev->init_data.ir_codes = RC_MAP_BEHOLD;
- dev->init_data.type = RC_TYPE_NEC;
+ dev->init_data.type = RC_BIT_NEC;
info.addr = 0x2d;
break;
case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
diff --git a/drivers/staging/tm6000/tm6000-input.c b/drivers/staging/tm6000/tm6000-input.c
index 21e7da4..715629b 100644
--- a/drivers/staging/tm6000/tm6000-input.c
+++ b/drivers/staging/tm6000/tm6000-input.c
@@ -97,7 +97,7 @@ static int tm6000_ir_config(struct tm6000_IR *ir)
int rc;
switch (ir->rc_type) {
- case RC_TYPE_NEC:
+ case RC_BIT_NEC:
/* Setup IR decoder for NEC standard 12MHz system clock */
/* IR_LEADER_CNT = 0.9ms */
tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_LEADER1, 0xaa);
@@ -174,10 +174,10 @@ static int default_polling_getkey(struct tm6000_IR *ir,
if (&dev->int_in) {
switch (ir->rc_type) {
- case RC_TYPE_RC5:
+ case RC_BIT_RC5:
poll_result->rc_data = ir->urb_data[0];
break;
- case RC_TYPE_NEC:
+ case RC_BIT_NEC:
if (ir->urb_data[1] == ((ir->key_addr >> 8) & 0xff)) {
poll_result->rc_data = ir->urb_data[0]
| ir->urb_data[1] << 8;
@@ -194,7 +194,7 @@ static int default_polling_getkey(struct tm6000_IR *ir,
tm6000_set_reg(dev, REQ_04_EN_DISABLE_MCU_INT, 2, 1);
msleep(10);
- if (ir->rc_type == RC_TYPE_RC5) {
+ if (ir->rc_type == RC_BIT_RC5) {
rc = tm6000_read_write_usb(dev, USB_DIR_IN |
USB_TYPE_VENDOR | USB_RECIP_DEVICE,
REQ_02_GET_IR_CODE, 0, 0, buf, 1);
@@ -291,7 +291,7 @@ int tm6000_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
if (!ir)
return 0;
- if ((rc->rc_map.scan) && (rc_type == RC_TYPE_NEC))
+ if ((rc->rc_map.scan) && (rc_type == RC_BIT_NEC))
ir->key_addr = ((rc->rc_map.scan[0].scancode >> 8) & 0xffff);
ir->get_key = default_polling_getkey;
@@ -383,7 +383,7 @@ int tm6000_ir_init(struct tm6000_core *dev)
ir->rc = rc;
/* input einrichten */
- rc->allowed_protos = RC_TYPE_RC5 | RC_TYPE_NEC;
+ rc->allowed_protos = RC_BIT_RC5 | RC_BIT_NEC;
rc->priv = ir;
rc->change_protocol = tm6000_ir_change_protocol;
rc->open = tm6000_ir_start;
@@ -401,7 +401,7 @@ int tm6000_ir_init(struct tm6000_core *dev)
usb_make_path(dev->udev, ir->phys, sizeof(ir->phys));
strlcat(ir->phys, "/input0", sizeof(ir->phys));
- tm6000_ir_change_protocol(rc, RC_TYPE_UNKNOWN);
+ tm6000_ir_change_protocol(rc, RC_BIT_UNKNOWN);
rc->input_name = ir->name;
rc->input_phys = ir->phys;
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 9184751..2c68ca6 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -11,19 +11,36 @@
#include <linux/input.h>
-#define RC_TYPE_UNKNOWN 0
-#define RC_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */
-#define RC_TYPE_NEC (1 << 1)
-#define RC_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */
-#define RC_TYPE_JVC (1 << 3) /* JVC protocol */
-#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
-#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
-#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
-#define RC_TYPE_OTHER (1u << 31)
+#define RC_TYPE_UNKNOWN 0 /* Protocol not known */
+#define RC_TYPE_OTHER 0 /* Protocol known but proprietary */
+#define RC_TYPE_RC5 1 /* Philips RC5 protocol */
+#define RC_TYPE_RC5X 2 /* Philips RC5x protocol */
+#define RC_TYPE_RC5_SZ 3 /* StreamZap variant of RC5 */
+#define RC_TYPE_RC6 4 /* Philips RC6 protocol */
+#define RC_TYPE_JVC 5 /* JVC protocol */
+#define RC_TYPE_SONY12 6 /* Sony 12 bit protocol */
+#define RC_TYPE_SONY15 7 /* Sony 15 bit protocol */
+#define RC_TYPE_SONY20 8 /* Sony 20 bit protocol */
+#define RC_TYPE_NEC 9 /* NEC protocol */
+#define RC_TYPE_LIRC 10 /* Pass raw IR to lirc userspace */
-#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \
- RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \
- RC_TYPE_RC5_SZ | RC_TYPE_OTHER)
+#define RC_BIT_UNKNOWN (1 << RC_TYPE_UNKNOWN)
+#define RC_BIT_OTHER (1 << RC_TYPE_OTHER)
+#define RC_BIT_RC5 (1 << RC_TYPE_RC5)
+#define RC_BIT_RC5X (1 << RC_TYPE_RC5X)
+#define RC_BIT_RC5_SZ (1 << RC_TYPE_RC5_SZ)
+#define RC_BIT_RC6 (1 << RC_TYPE_RC6)
+#define RC_BIT_JVC (1 << RC_TYPE_JVC)
+#define RC_BIT_SONY12 (1 << RC_TYPE_SONY12)
+#define RC_BIT_SONY15 (1 << RC_TYPE_SONY15)
+#define RC_BIT_SONY20 (1 << RC_TYPE_SONY20)
+#define RC_BIT_NEC (1 << RC_TYPE_NEC)
+#define RC_BIT_LIRC (1 << RC_TYPE_LIRC)
+
+#define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | RC_BIT_RC5 | \
+ RC_BIT_RC5X | RC_BIT_RC6 | RC_BIT_JVC | \
+ RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \
+ RC_BIT_NEC | RC_BIT_LIRC)
struct rc_map_table {
u32 scancode;
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 07/10] rc-core: use the full 32 bits for NEC scancodes
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
` (4 preceding siblings ...)
2011-04-28 15:13 ` [PATCH 05/10] rc-core: add separate defines for protocol bitmaps and numbers David Härdeman
@ 2011-04-28 15:13 ` David Härdeman
2011-05-04 15:16 ` Mauro Carvalho Chehab
2011-04-28 15:13 ` [PATCH 08/10] rc-core: merge rc5 and streamzap decoders David Härdeman
` (3 subsequent siblings)
9 siblings, 1 reply; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
Using the full 32 bits for all kinds of NEC scancodes simplifies rc-core
and the nec decoder without any loss of functionality.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/dvb/dvb-usb/af9015.c | 22 ++++++----------------
drivers/media/rc/ir-nec-decoder.c | 28 ++++------------------------
include/media/rc-map.h | 11 +++++++++--
3 files changed, 19 insertions(+), 42 deletions(-)
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
index 08975f3..4ee8bb7 100644
--- a/drivers/media/dvb/dvb-usb/af9015.c
+++ b/drivers/media/dvb/dvb-usb/af9015.c
@@ -1034,7 +1034,8 @@ static int af9015_rc_query(struct dvb_usb_device *d)
if ((priv->rc_repeat != buf[6] || buf[0]) &&
!memcmp(&buf[12], priv->rc_last, 4)) {
deb_rc("%s: key repeated\n", __func__);
- rc_keydown(d->rc_dev, RC_TYPE_NEC, priv->rc_keycode, 0);
+ rc_keydown(d->rc_dev, RC_TYPE_NEC,
+ RC_SCANCODE_NEC32(priv->rc_keycode), 0);
priv->rc_repeat = buf[6];
return ret;
}
@@ -1051,21 +1052,10 @@ static int af9015_rc_query(struct dvb_usb_device *d)
/* Remember this key */
memcpy(priv->rc_last, &buf[12], 4);
- if (buf[14] == (u8) ~buf[15]) {
- if (buf[12] == (u8) ~buf[13]) {
- /* NEC */
- priv->rc_keycode = buf[12] << 8 | buf[14];
- } else {
- /* NEC extended*/
- priv->rc_keycode = buf[12] << 16 |
- buf[13] << 8 | buf[14];
- }
- } else {
- /* 32 bit NEC */
- priv->rc_keycode = buf[12] << 24 | buf[13] << 16 |
- buf[14] << 8 | buf[15];
- }
- rc_keydown(d->rc_dev, RC_TYPE_NEC, priv->rc_keycode, 0);
+ priv->rc_keycode = buf[12] << 24 | buf[13] << 16 |
+ buf[14] << 8 | buf[15];
+ rc_keydown(d->rc_dev, RC_TYPE_NEC,
+ RC_SCANCODE_NEC32(priv->rc_keycode), 0);
} else {
deb_rc("%s: no key press\n", __func__);
/* Invalidate last keypress */
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
index edd8543..0b1eef1 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -49,7 +49,6 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
struct nec_dec *data = &dev->raw->nec;
u32 scancode;
u8 address, not_address, command, not_command;
- bool send_32bits = false;
if (!(dev->enabled_protocols & RC_BIT_NEC))
return 0;
@@ -162,33 +161,14 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
command = bitrev8((data->bits >> 8) & 0xff);
not_command = bitrev8((data->bits >> 0) & 0xff);
- if ((command ^ not_command) != 0xff) {
- IR_dprintk(1, "NEC checksum error: received 0x%08x\n",
- data->bits);
- send_32bits = true;
- }
-
- if (send_32bits) {
- /* NEC transport, but modified protocol, used by at
- * least Apple and TiVo remotes */
- scancode = data->bits;
- IR_dprintk(1, "NEC (modified) scancode 0x%08x\n", scancode);
- } else if ((address ^ not_address) != 0xff) {
- /* Extended NEC */
- scancode = address << 16 |
- not_address << 8 |
- command;
- IR_dprintk(1, "NEC (Ext) scancode 0x%06x\n", scancode);
- } else {
- /* Normal NEC */
- scancode = address << 8 | command;
- IR_dprintk(1, "NEC scancode 0x%04x\n", scancode);
- }
+ scancode = address << 24 | not_address << 16 |
+ command << 8 | not_command;
+ IR_dprintk(1, "NEC scancode 0x%08x\n", scancode);
if (data->is_nec_x)
data->necx_repeat = true;
- rc_keydown(dev, RC_TYPE_NEC, scancode, 0);
+ rc_keydown(dev, RC_TYPE_NEC, RC_SCANCODE_NEC32(scancode), 0);
data->state = STATE_INACTIVE;
return 0;
}
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 42c8ad9..aa503f0 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -44,8 +44,15 @@
#define RC_SCANCODE_UNKNOWN(x) (x)
#define RC_SCANCODE_OTHER(x) (x)
-#define RC_SCANCODE_NEC(addr, cmd) (((addr) << 8) | (cmd))
-#define RC_SCANCODE_NECX(addr, cmd) (((addr) << 8) | (cmd))
+#define RC_SCANCODE_NEC(addr, cmd) \
+ ((( (addr) & 0xff) << 24) | \
+ ((~(addr) & 0xff) << 16) | \
+ (( (cmd) & 0xff) << 8 ) | \
+ ((~(cmd) & 0xff) << 0 ))
+#define RC_SCANCODE_NECX(addr, cmd) \
+ ((( (addr) & 0xffff) << 16) | \
+ (( (cmd) & 0x00ff) << 8) | \
+ ((~(cmd) & 0x00ff) << 0))
#define RC_SCANCODE_NEC32(data) ((data) & 0xffffffff)
#define RC_SCANCODE_RC5(sys, cmd) (((sys) << 8) | (cmd))
#define RC_SCANCODE_RC5_SZ(sys, cmd) (((sys) << 8) | (cmd))
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 08/10] rc-core: merge rc5 and streamzap decoders
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
` (5 preceding siblings ...)
2011-04-28 15:13 ` [PATCH 07/10] rc-core: use the full 32 bits for NEC scancodes David Härdeman
@ 2011-04-28 15:13 ` David Härdeman
2011-05-04 15:19 ` Mauro Carvalho Chehab
2011-04-28 15:13 ` [PATCH 09/10] rc-core: lirc use unsigned int David Härdeman
` (2 subsequent siblings)
9 siblings, 1 reply; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
Now that the protocol is part of the scancode, it is pretty easy to merge
the rc5 and streamzap decoders. An additional advantage is that the decoder
is now stricter as it waits for the trailing silence before determining that
a command is a valid rc5/streamzap command (which avoids collisions that I've
seen with e.g. Sony protocols).
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/rc/Kconfig | 12 --
drivers/media/rc/Makefile | 1
drivers/media/rc/ir-rc5-decoder.c | 51 ++++++----
drivers/media/rc/ir-rc5-sz-decoder.c | 153 -------------------------------
drivers/media/rc/keymaps/rc-streamzap.c | 4 -
drivers/media/rc/rc-core-priv.h | 8 --
drivers/media/rc/streamzap.c | 10 --
7 files changed, 31 insertions(+), 208 deletions(-)
delete mode 100644 drivers/media/rc/ir-rc5-sz-decoder.c
diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
index 7f03142..7242b0d 100644
--- a/drivers/media/rc/Kconfig
+++ b/drivers/media/rc/Kconfig
@@ -75,18 +75,6 @@ config IR_SONY_DECODER
Enable this option if you have an infrared remote control which
uses the Sony protocol, and you need software decoding support.
-config IR_RC5_SZ_DECODER
- tristate "Enable IR raw decoder for the RC-5 (streamzap) protocol"
- depends on RC_CORE
- select BITREVERSE
- default y
-
- ---help---
- Enable this option if you have IR with RC-5 (streamzap) protocol,
- and if the IR is decoded in software. (The Streamzap PC Remote
- uses an IR protocol that is almost standard RC-5, but not quite,
- as it uses an additional bit).
-
config IR_LIRC_CODEC
tristate "Enable IR to LIRC bridge"
depends on RC_CORE
diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
index c6cfe70..2d9ddde 100644
--- a/drivers/media/rc/Makefile
+++ b/drivers/media/rc/Makefile
@@ -9,7 +9,6 @@ obj-$(CONFIG_IR_RC5_DECODER) += ir-rc5-decoder.o
obj-$(CONFIG_IR_RC6_DECODER) += ir-rc6-decoder.o
obj-$(CONFIG_IR_JVC_DECODER) += ir-jvc-decoder.o
obj-$(CONFIG_IR_SONY_DECODER) += ir-sony-decoder.o
-obj-$(CONFIG_IR_RC5_SZ_DECODER) += ir-rc5-sz-decoder.o
obj-$(CONFIG_IR_LIRC_CODEC) += ir-lirc-codec.o
# stand-alone IR receivers/transmitters
diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c
index ed726ca..159e57f 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -1,6 +1,7 @@
-/* ir-rc5-decoder.c - handle RC5(x) IR Pulse/Space protocol
+/* ir-rc5-decoder.c - decoder for RC5(x) and StreamZap protocols
*
* Copyright (C) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
+ * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,22 +14,21 @@
*/
/*
- * This code handles 14 bits RC5 protocols and 20 bits RC5x protocols.
- * There are other variants that use a different number of bits.
- * This is currently unsupported.
- * It considers a carrier of 36 kHz, with a total of 14/20 bits, where
- * the first two bits are start bits, and a third one is a filing bit
+ * This decoder handles the 14 bit RC5 protocol, 15 bit "StreamZap" protocol
+ * and 20 bit RC5x protocol.
*/
#include "rc-core-priv.h"
#define RC5_NBITS 14
+#define RC5_SZ_NBITS 15
#define RC5X_NBITS 20
#define CHECK_RC5X_NBITS 8
#define RC5_UNIT 888888 /* ns */
#define RC5_BIT_START (1 * RC5_UNIT)
#define RC5_BIT_END (1 * RC5_UNIT)
#define RC5X_SPACE (4 * RC5_UNIT)
+#define RC5_TRAILER (10 * RC5_UNIT) /* In reality, approx 100 */
enum rc5_state {
STATE_INACTIVE,
@@ -79,12 +79,15 @@ again:
data->state = STATE_BIT_START;
data->count = 1;
- /* We just need enough bits to get to STATE_CHECK_RC5X */
- data->wanted_bits = RC5X_NBITS;
decrease_duration(&ev, RC5_BIT_START);
goto again;
case STATE_BIT_START:
+ if (!ev.pulse && geq_margin(ev.duration, RC5_TRAILER, RC5_UNIT / 2)) {
+ data->state = STATE_FINISHED;
+ goto again;
+ }
+
if (!eq_margin(ev.duration, RC5_BIT_START, RC5_UNIT / 2))
break;
@@ -99,9 +102,7 @@ again:
if (!is_transition(&ev, &dev->raw->prev_ev))
break;
- if (data->count == data->wanted_bits)
- data->state = STATE_FINISHED;
- else if (data->count == CHECK_RC5X_NBITS)
+ if (data->count == CHECK_RC5X_NBITS)
data->state = STATE_CHECK_RC5X;
else
data->state = STATE_BIT_START;
@@ -111,13 +112,10 @@ again:
case STATE_CHECK_RC5X:
if (!ev.pulse && geq_margin(ev.duration, RC5X_SPACE, RC5_UNIT / 2)) {
- /* RC5X */
- data->wanted_bits = RC5X_NBITS;
+ data->is_rc5x = true;
decrease_duration(&ev, RC5X_SPACE);
- } else {
- /* RC5 */
- data->wanted_bits = RC5_NBITS;
- }
+ } else
+ data->is_rc5x = false;
data->state = STATE_BIT_START;
goto again;
@@ -125,7 +123,7 @@ again:
if (ev.pulse)
break;
- if (data->wanted_bits == RC5X_NBITS) {
+ if (data->is_rc5x && data->count == RC5X_NBITS) {
/* RC5X */
u8 xdata, command, system;
xdata = (data->bits & 0x0003F) >> 0;
@@ -135,7 +133,7 @@ again:
command += (data->bits & 0x01000) ? 0 : 0x40;
scancode = system << 16 | command << 8 | xdata;
protocol = RC_TYPE_RC5X;
- } else {
+ } else if (!data->is_rc5x && data->count == RC5_NBITS) {
/* RC5 */
u8 command, system;
command = (data->bits & 0x0003F) >> 0;
@@ -144,10 +142,19 @@ again:
command += (data->bits & 0x01000) ? 0 : 0x40;
scancode = system << 8 | command;
protocol = RC_TYPE_RC5;
- }
+ } else if (!data->is_rc5x && data->count == RC5_SZ_NBITS) {
+ /* RC5 StreamZap */
+ u8 command, system;
+ command = (data->bits & 0x0003F) >> 0;
+ system = (data->bits & 0x02FC0) >> 6;
+ toggle = (data->bits & 0x01000) ? 1 : 0;
+ scancode = system << 6 | command;
+ protocol = RC_TYPE_RC5_SZ;
+ } else
+ break;
if (dev->enabled_protocols & (1 << protocol)) {
- IR_dprintk(1, "RC5(x) scancode 0x%06x (toggle: %u)\n",
+ IR_dprintk(1, "RC5(x/sz) scancode 0x%06x (toggle: %u)\n",
scancode, toggle);
rc_keydown(dev, protocol, scancode, toggle);
}
@@ -164,7 +171,7 @@ out:
}
static struct ir_raw_handler rc5_handler = {
- .protocols = RC_BIT_RC5 | RC_BIT_RC5X,
+ .protocols = RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ,
.decode = ir_rc5_decode,
};
diff --git a/drivers/media/rc/ir-rc5-sz-decoder.c b/drivers/media/rc/ir-rc5-sz-decoder.c
deleted file mode 100644
index 7e9e9c5..0000000
--- a/drivers/media/rc/ir-rc5-sz-decoder.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* ir-rc5-sz-decoder.c - handle RC5 Streamzap IR Pulse/Space protocol
- *
- * Copyright (C) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
- * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-/*
- * This code handles the 15 bit RC5-ish protocol used by the Streamzap
- * PC Remote.
- * It considers a carrier of 36 kHz, with a total of 15 bits, where
- * the first two bits are start bits, and a third one is a filing bit
- */
-
-#include "rc-core-priv.h"
-
-#define RC5_SZ_NBITS 15
-#define RC5_UNIT 888888 /* ns */
-#define RC5_BIT_START (1 * RC5_UNIT)
-#define RC5_BIT_END (1 * RC5_UNIT)
-
-enum rc5_sz_state {
- STATE_INACTIVE,
- STATE_BIT_START,
- STATE_BIT_END,
- STATE_FINISHED,
-};
-
-/**
- * ir_rc5_sz_decode() - Decode one RC-5 Streamzap pulse or space
- * @dev: the struct rc_dev descriptor of the device
- * @ev: the struct ir_raw_event descriptor of the pulse/space
- *
- * This function returns -EINVAL if the pulse violates the state machine
- */
-static int ir_rc5_sz_decode(struct rc_dev *dev, struct ir_raw_event ev)
-{
- struct rc5_sz_dec *data = &dev->raw->rc5_sz;
- u8 toggle, command, system;
- u32 scancode;
-
- if (!(dev->enabled_protocols & RC_BIT_RC5_SZ))
- return 0;
-
- if (!is_timing_event(ev)) {
- if (ev.reset)
- data->state = STATE_INACTIVE;
- return 0;
- }
-
- if (!geq_margin(ev.duration, RC5_UNIT, RC5_UNIT / 2))
- goto out;
-
-again:
- IR_dprintk(2, "RC5-sz decode started at state %i (%uus %s)\n",
- data->state, TO_US(ev.duration), TO_STR(ev.pulse));
-
- if (!geq_margin(ev.duration, RC5_UNIT, RC5_UNIT / 2))
- return 0;
-
- switch (data->state) {
-
- case STATE_INACTIVE:
- if (!ev.pulse)
- break;
-
- data->state = STATE_BIT_START;
- data->count = 1;
- data->wanted_bits = RC5_SZ_NBITS;
- decrease_duration(&ev, RC5_BIT_START);
- goto again;
-
- case STATE_BIT_START:
- if (!eq_margin(ev.duration, RC5_BIT_START, RC5_UNIT / 2))
- break;
-
- data->bits <<= 1;
- if (!ev.pulse)
- data->bits |= 1;
- data->count++;
- data->state = STATE_BIT_END;
- return 0;
-
- case STATE_BIT_END:
- if (!is_transition(&ev, &dev->raw->prev_ev))
- break;
-
- if (data->count == data->wanted_bits)
- data->state = STATE_FINISHED;
- else
- data->state = STATE_BIT_START;
-
- decrease_duration(&ev, RC5_BIT_END);
- goto again;
-
- case STATE_FINISHED:
- if (ev.pulse)
- break;
-
- /* RC5-sz */
- command = (data->bits & 0x0003F) >> 0;
- system = (data->bits & 0x02FC0) >> 6;
- toggle = (data->bits & 0x01000) ? 1 : 0;
- scancode = system << 6 | command;
-
- IR_dprintk(1, "RC5-sz scancode 0x%04x (toggle: %u)\n",
- scancode, toggle);
-
- rc_keydown(dev, RC_TYPE_RC5_SZ, scancode, toggle);
- data->state = STATE_INACTIVE;
- return 0;
- }
-
-out:
- IR_dprintk(1, "RC5-sz decode failed at state %i (%uus %s)\n",
- data->state, TO_US(ev.duration), TO_STR(ev.pulse));
- data->state = STATE_INACTIVE;
- return -EINVAL;
-}
-
-static struct ir_raw_handler rc5_sz_handler = {
- .protocols = RC_BIT_RC5_SZ,
- .decode = ir_rc5_sz_decode,
-};
-
-static int __init ir_rc5_sz_decode_init(void)
-{
- ir_raw_handler_register(&rc5_sz_handler);
-
- printk(KERN_INFO "IR RC5 (streamzap) protocol handler initialized\n");
- return 0;
-}
-
-static void __exit ir_rc5_sz_decode_exit(void)
-{
- ir_raw_handler_unregister(&rc5_sz_handler);
-}
-
-module_init(ir_rc5_sz_decode_init);
-module_exit(ir_rc5_sz_decode_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");
-MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)");
-MODULE_DESCRIPTION("RC5 (streamzap) IR protocol decoder");
diff --git a/drivers/media/rc/keymaps/rc-streamzap.c b/drivers/media/rc/keymaps/rc-streamzap.c
index 3e4d62f..d8d097a 100644
--- a/drivers/media/rc/keymaps/rc-streamzap.c
+++ b/drivers/media/rc/keymaps/rc-streamzap.c
@@ -14,9 +14,7 @@
static struct rc_map_table streamzap[] = {
/*
* The Streamzap remote is almost, but not quite, RC-5, as it has an extra
- * bit in it, which throws the in-kernel RC-5 decoder for a loop. Currently,
- * an additional RC-5-sz decoder is being deployed to support it, but it
- * may be possible to merge it back with the standard RC-5 decoder.
+ * bit in it.
*/
{ RC_TYPE_RC5_SZ, RC_SCANCODE_RC5_SZ(0x28,0xc0), KEY_NUMERIC_0 },
{ RC_TYPE_RC5_SZ, RC_SCANCODE_RC5_SZ(0x28,0xc1), KEY_NUMERIC_1 },
diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h
index 729b6a7..bcdf7b5 100644
--- a/drivers/media/rc/rc-core-priv.h
+++ b/drivers/media/rc/rc-core-priv.h
@@ -54,7 +54,7 @@ struct ir_raw_event_ctrl {
int state;
u32 bits;
unsigned count;
- unsigned wanted_bits;
+ bool is_rc5x;
} rc5;
struct rc6_dec {
int state;
@@ -77,12 +77,6 @@ struct ir_raw_event_ctrl {
bool first;
bool toggle;
} jvc;
- struct rc5_sz_dec {
- int state;
- u32 bits;
- unsigned count;
- unsigned wanted_bits;
- } rc5_sz;
struct lirc_codec {
struct rc_dev *dev;
struct lirc_driver *drv;
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c
index 48cf47f..eccfbb4 100644
--- a/drivers/media/rc/streamzap.c
+++ b/drivers/media/rc/streamzap.c
@@ -69,13 +69,6 @@ MODULE_DEVICE_TABLE(usb, streamzap_table);
/* number of samples buffered */
#define SZ_BUF_LEN 128
-/* from ir-rc5-sz-decoder.c */
-#ifdef CONFIG_IR_RC5_SZ_DECODER_MODULE
-#define load_rc5_sz_decode() request_module("ir-rc5-sz-decoder")
-#else
-#define load_rc5_sz_decode() {}
-#endif
-
enum StreamzapDecoderState {
PulseSpace,
FullPulse,
@@ -458,9 +451,6 @@ static int __devinit streamzap_probe(struct usb_interface *intf,
dev_info(sz->dev, "Registered %s on usb%d:%d\n", name,
usbdev->bus->busnum, usbdev->devnum);
- /* Load the streamzap not-quite-rc5 decoder too */
- load_rc5_sz_decode();
-
return 0;
rc_dev_fail:
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 09/10] rc-core: lirc use unsigned int
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
` (6 preceding siblings ...)
2011-04-28 15:13 ` [PATCH 08/10] rc-core: merge rc5 and streamzap decoders David Härdeman
@ 2011-04-28 15:13 ` David Härdeman
2011-05-04 15:23 ` Mauro Carvalho Chehab
2011-04-28 15:14 ` [PATCH 10/10] rc-core: move timeout and checks to lirc David Härdeman
2011-04-28 20:13 ` [PATCH 00/10] rc-core: my current patchqueue Malcolm Priestley
9 siblings, 1 reply; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:13 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
Durations can never be negative, so it makes sense to consistently use
unsigned int for LIRC transmission. Contrary to the initial impression,
this shouldn't actually change the userspace API.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/rc/ene_ir.c | 4 ++--
drivers/media/rc/ene_ir.h | 2 +-
drivers/media/rc/ir-lirc-codec.c | 15 +++++++++------
drivers/media/rc/ite-cir.c | 5 +----
drivers/media/rc/mceusb.c | 10 ++++------
drivers/media/rc/nuvoton-cir.c | 12 +++---------
drivers/media/rc/rc-loopback.c | 13 +++----------
drivers/media/rc/winbond-cir.c | 6 +-----
include/media/rc-core.h | 2 +-
9 files changed, 25 insertions(+), 44 deletions(-)
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index 569b07b..2b1d2df 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -953,13 +953,13 @@ static void ene_set_idle(struct rc_dev *rdev, bool idle)
}
/* outside interface: transmit */
-static int ene_transmit(struct rc_dev *rdev, int *buf, u32 n)
+static int ene_transmit(struct rc_dev *rdev, unsigned *buf, unsigned n)
{
struct ene_device *dev = rdev->priv;
unsigned long flags;
dev->tx_buffer = buf;
- dev->tx_len = n / sizeof(int);
+ dev->tx_len = n;
dev->tx_pos = 0;
dev->tx_reg = 0;
dev->tx_done = 0;
diff --git a/drivers/media/rc/ene_ir.h b/drivers/media/rc/ene_ir.h
index 337a41d..017c209 100644
--- a/drivers/media/rc/ene_ir.h
+++ b/drivers/media/rc/ene_ir.h
@@ -235,7 +235,7 @@ struct ene_device {
bool tx_sample_pulse; /* current sample is pulse */
/* TX buffer */
- int *tx_buffer; /* input samples buffer*/
+ unsigned *tx_buffer; /* input samples buffer*/
int tx_pos; /* position in that bufer */
int tx_len; /* current len of tx buffer */
int tx_done; /* done transmitting */
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index b4119f8..ac54139 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -103,19 +103,19 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
{
struct lirc_codec *lirc;
struct rc_dev *dev;
- int *txbuf; /* buffer with values to transmit */
- int ret = 0;
+ unsigned int *txbuf; /* buffer with values to transmit */
+ ssize_t ret = 0;
size_t count;
lirc = lirc_get_pdata(file);
if (!lirc)
return -EFAULT;
- if (n % sizeof(int))
+ if (n < sizeof(unsigned) || n % sizeof(unsigned))
return -EINVAL;
- count = n / sizeof(int);
- if (count > LIRCBUF_SIZE || count % 2 == 0 || n % sizeof(int) != 0)
+ count = n / sizeof(unsigned);
+ if (count > LIRCBUF_SIZE || count % 2 == 0)
return -EINVAL;
txbuf = memdup_user(buf, n);
@@ -129,7 +129,10 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
}
if (dev->tx_ir)
- ret = dev->tx_ir(dev, txbuf, (u32)n);
+ ret = dev->tx_ir(dev, txbuf, count);
+
+ if (ret > 0)
+ ret *= sizeof(unsigned);
out:
kfree(txbuf);
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 3d13fcb..e8f7847 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -381,7 +381,7 @@ static int ite_set_tx_duty_cycle(struct rc_dev *rcdev, u32 duty_cycle)
/* transmit out IR pulses; what you get here is a batch of alternating
* pulse/space/pulse/space lengths that we should write out completely through
* the FIFO, blocking on a full FIFO */
-static int ite_tx_ir(struct rc_dev *rcdev, int *txbuf, u32 n)
+static int ite_tx_ir(struct rc_dev *rcdev, unsigned *txbuf, unsigned n)
{
unsigned long flags;
struct ite_dev *dev = rcdev->priv;
@@ -397,9 +397,6 @@ static int ite_tx_ir(struct rc_dev *rcdev, int *txbuf, u32 n)
/* clear the array just in case */
memset(last_sent, 0, ARRAY_SIZE(last_sent));
- /* n comes in bytes; convert to ints */
- n /= sizeof(int);
-
spin_lock_irqsave(&dev->lock, flags);
/* let everybody know we're now transmitting */
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index c51e7c2..c1cd00d 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -665,20 +665,18 @@ static void mce_sync_in(struct mceusb_dev *ir, unsigned char *data, int size)
}
/* Send data out the IR blaster port(s) */
-static int mceusb_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
+static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
{
struct mceusb_dev *ir = dev->priv;
int i, ret = 0;
- int count, cmdcount = 0;
+ int cmdcount = 0;
unsigned char *cmdbuf; /* MCE command buffer */
long signal_duration = 0; /* Singnal length in us */
struct timeval start_time, end_time;
do_gettimeofday(&start_time);
- count = n / sizeof(int);
-
- cmdbuf = kzalloc(sizeof(int) * MCE_CMDBUF_SIZE, GFP_KERNEL);
+ cmdbuf = kzalloc(sizeof(unsigned) * MCE_CMDBUF_SIZE, GFP_KERNEL);
if (!cmdbuf)
return -ENOMEM;
@@ -747,7 +745,7 @@ static int mceusb_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
out:
kfree(cmdbuf);
- return ret ? ret : n;
+ return ret ? ret : count;
}
/* Sets active IR outputs -- mce devices typically have two */
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index dba02b5..64fea04 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -512,24 +512,18 @@ static int nvt_set_tx_carrier(struct rc_dev *dev, u32 carrier)
* number may larger than TXFCONT (0xff). So in interrupt_handler, it has to
* set TXFCONT as 0xff, until buf_count less than 0xff.
*/
-static int nvt_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
+static int nvt_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned n)
{
struct nvt_dev *nvt = dev->priv;
unsigned long flags;
- size_t cur_count;
unsigned int i;
u8 iren;
int ret;
spin_lock_irqsave(&nvt->tx.lock, flags);
- if (n >= TX_BUF_LEN) {
- nvt->tx.buf_count = cur_count = TX_BUF_LEN;
- ret = TX_BUF_LEN;
- } else {
- nvt->tx.buf_count = cur_count = n;
- ret = n;
- }
+ ret = min((unsigned)(TX_BUF_LEN / sizeof(unsigned)), n);
+ nvt->tx.buf_count = (ret * sizeof(unsigned));
memcpy(nvt->tx.buf, txbuf, nvt->tx.buf_count);
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index 6dee719..fb8ca81 100644
--- a/drivers/media/rc/rc-loopback.c
+++ b/drivers/media/rc/rc-loopback.c
@@ -101,21 +101,14 @@ static int loop_set_rx_carrier_range(struct rc_dev *dev, u32 min, u32 max)
return 0;
}
-static int loop_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
+static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
{
struct loopback_dev *lodev = dev->priv;
u32 rxmask;
- unsigned count;
unsigned total_duration = 0;
unsigned i;
DEFINE_IR_RAW_EVENT(rawir);
- if (n == 0 || n % sizeof(int)) {
- dprintk("invalid tx buffer size\n");
- return -EINVAL;
- }
-
- count = n / sizeof(int);
for (i = 0; i < count; i++)
total_duration += abs(txbuf[i]);
@@ -142,7 +135,7 @@ static int loop_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
for (i = 0; i < count; i++) {
rawir.pulse = i % 2 ? false : true;
- rawir.duration = abs(txbuf[i]) * 1000;
+ rawir.duration = txbuf[i] * 1000;
if (rawir.duration)
ir_raw_event_store_with_filter(dev, &rawir);
}
@@ -158,7 +151,7 @@ out:
/* Lirc expects this function to take as long as the total duration */
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(usecs_to_jiffies(total_duration));
- return n;
+ return count;
}
static void loop_set_idle(struct rc_dev *dev, bool enable)
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 48bafa2..b74d0fd 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -577,16 +577,12 @@ wbcir_txmask(struct rc_dev *dev, u32 mask)
}
static int
-wbcir_tx(struct rc_dev *dev, int *buf, u32 bufsize)
+wbcir_tx(struct rc_dev *dev, unsigned *buf, unsigned count)
{
struct wbcir_data *data = dev->priv;
- u32 count;
unsigned i;
unsigned long flags;
- /* bufsize has been sanity checked by the caller */
- count = bufsize / sizeof(int);
-
/* Not sure if this is possible, but better safe than sorry */
spin_lock_irqsave(&data->spinlock, flags);
if (data->txstate != WBCIR_TXSTATE_INACTIVE) {
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 1e6b6fc..052ce79 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -134,7 +134,7 @@ struct rc_dev {
int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier);
int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle);
int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max);
- int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n);
+ int (*tx_ir)(struct rc_dev *dev, unsigned *txbuf, unsigned n);
void (*s_idle)(struct rc_dev *dev, bool enable);
int (*s_learning_mode)(struct rc_dev *dev, int enable);
int (*s_carrier_report) (struct rc_dev *dev, int enable);
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH 10/10] rc-core: move timeout and checks to lirc
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
` (7 preceding siblings ...)
2011-04-28 15:13 ` [PATCH 09/10] rc-core: lirc use unsigned int David Härdeman
@ 2011-04-28 15:14 ` David Härdeman
2011-09-21 16:40 ` Mauro Carvalho Chehab
2011-04-28 20:13 ` [PATCH 00/10] rc-core: my current patchqueue Malcolm Priestley
9 siblings, 1 reply; 25+ messages in thread
From: David Härdeman @ 2011-04-28 15:14 UTC (permalink / raw)
To: linux-media; +Cc: jarod, mchehab
The lirc TX functionality expects the process which writes (TX) data to
the lirc dev to sleep until the actual data has been transmitted by the
hardware.
Since the same timeout calculation is duplicated in more than one driver
(and would have to be duplicated in even more drivers as they gain TX
support), it makes sense to move this timeout calculation to the lirc
layer instead.
At the same time, centralize some of the sanity checks.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/rc/ir-lirc-codec.c | 33 +++++++++++++++++++++++++++++----
drivers/media/rc/mceusb.c | 18 ------------------
drivers/media/rc/rc-loopback.c | 12 ------------
3 files changed, 29 insertions(+), 34 deletions(-)
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index ac54139..a58c7fe 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -106,6 +106,12 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
unsigned int *txbuf; /* buffer with values to transmit */
ssize_t ret = 0;
size_t count;
+ ktime_t start;
+ s64 towait;
+ unsigned int duration = 0; /* signal duration in us */
+ int i;
+
+ start = ktime_get();
lirc = lirc_get_pdata(file);
if (!lirc)
@@ -128,11 +134,30 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
goto out;
}
- if (dev->tx_ir)
- ret = dev->tx_ir(dev, txbuf, count);
+ if (!dev->tx_ir) {
+ ret = -ENOSYS;
+ goto out;
+ }
+
+ ret = dev->tx_ir(dev, txbuf, (u32)n);
+ if (ret < 0)
+ goto out;
+
+ for (i = 0; i < ret; i++)
+ duration += txbuf[i];
- if (ret > 0)
- ret *= sizeof(unsigned);
+ ret *= sizeof(unsigned int);
+
+ /*
+ * The lircd gap calculation expects the write function to
+ * wait for the actual IR signal to be transmitted before
+ * returning.
+ */
+ towait = ktime_us_delta(ktime_add_us(start, duration), ktime_get());
+ if (towait > 0) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(usecs_to_jiffies(towait));
+ }
out:
kfree(txbuf);
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index c1cd00d..7b08797 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -671,10 +671,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
int i, ret = 0;
int cmdcount = 0;
unsigned char *cmdbuf; /* MCE command buffer */
- long signal_duration = 0; /* Singnal length in us */
- struct timeval start_time, end_time;
-
- do_gettimeofday(&start_time);
cmdbuf = kzalloc(sizeof(unsigned) * MCE_CMDBUF_SIZE, GFP_KERNEL);
if (!cmdbuf)
@@ -687,7 +683,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
/* Generate mce packet data */
for (i = 0; (i < count) && (cmdcount < MCE_CMDBUF_SIZE); i++) {
- signal_duration += txbuf[i];
txbuf[i] = txbuf[i] / MCE_TIME_UNIT;
do { /* loop to support long pulses/spaces > 127*50us=6.35ms */
@@ -730,19 +725,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
/* Transmit the command to the mce device */
mce_async_out(ir, cmdbuf, cmdcount);
- /*
- * The lircd gap calculation expects the write function to
- * wait the time it takes for the ircommand to be sent before
- * it returns.
- */
- do_gettimeofday(&end_time);
- signal_duration -= (end_time.tv_usec - start_time.tv_usec) +
- (end_time.tv_sec - start_time.tv_sec) * 1000000;
-
- /* delay with the closest number of ticks */
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(usecs_to_jiffies(signal_duration));
-
out:
kfree(cmdbuf);
return ret ? ret : count;
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index fb8ca81..5cb7057 100644
--- a/drivers/media/rc/rc-loopback.c
+++ b/drivers/media/rc/rc-loopback.c
@@ -105,18 +105,9 @@ static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
{
struct loopback_dev *lodev = dev->priv;
u32 rxmask;
- unsigned total_duration = 0;
unsigned i;
DEFINE_IR_RAW_EVENT(rawir);
- for (i = 0; i < count; i++)
- total_duration += abs(txbuf[i]);
-
- if (total_duration == 0) {
- dprintk("invalid tx data, total duration zero\n");
- return -EINVAL;
- }
-
if (lodev->txcarrier < lodev->rxcarriermin ||
lodev->txcarrier > lodev->rxcarriermax) {
dprintk("ignoring tx, carrier out of range\n");
@@ -148,9 +139,6 @@ static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
ir_raw_event_handle(dev);
out:
- /* Lirc expects this function to take as long as the total duration */
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(usecs_to_jiffies(total_duration));
return count;
}
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH 00/10] rc-core: my current patchqueue
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
` (8 preceding siblings ...)
2011-04-28 15:14 ` [PATCH 10/10] rc-core: move timeout and checks to lirc David Härdeman
@ 2011-04-28 20:13 ` Malcolm Priestley
2011-04-29 8:08 ` David Härdeman
2011-05-02 17:58 ` Mauro Carvalho Chehab
9 siblings, 2 replies; 25+ messages in thread
From: Malcolm Priestley @ 2011-04-28 20:13 UTC (permalink / raw)
To: David Härdeman; +Cc: linux-media
On Thu, 2011-04-28 at 17:13 +0200, David Härdeman wrote:
> The following series is what's in my current patch queue for rc-core.
>
> It only been lightly tested so far and it's based on the "for_v2.6.39" branch,
> but I still wanted to send it to the list so that I can get some feedback while
> I refresh the patches to "for_v2.6.40" and do more testing.
Patch [06/10] hasn't made it to gmane or spinics servers.
Patchwork appears to be down again :(
Regards
Malcolm
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 00/10] rc-core: my current patchqueue
2011-04-28 20:13 ` [PATCH 00/10] rc-core: my current patchqueue Malcolm Priestley
@ 2011-04-29 8:08 ` David Härdeman
2011-05-04 15:13 ` Mauro Carvalho Chehab
2011-05-02 17:58 ` Mauro Carvalho Chehab
1 sibling, 1 reply; 25+ messages in thread
From: David Härdeman @ 2011-04-29 8:08 UTC (permalink / raw)
To: Malcolm Priestley; +Cc: linux-media
On Thu, 28 Apr 2011 21:13:22 +0100, Malcolm Priestley <tvboxspy@gmail.com>
wrote:
> On Thu, 2011-04-28 at 17:13 +0200, David Härdeman wrote:
>> The following series is what's in my current patch queue for rc-core.
>>
>> It only been lightly tested so far and it's based on the "for_v2.6.39"
>> branch,
>> but I still wanted to send it to the list so that I can get some
>> feedback while
>> I refresh the patches to "for_v2.6.40" and do more testing.
>
> Patch [06/10] hasn't made it to gmane or spinics servers.
Looking through the postfix logs, vger.kernel.org did accept the mail. My
guess is that it wasn't distributed (or indexed) because of its size.
I've put patch 6/10 at http://david.hardeman.nu/rc-proto.patch for now,
and I've included the patch description inline below:
Setting and getting keycodes in the input subsystem used to be done via
the EVIOC[GS]KEYCODE ioctl and "unsigned int[2]" (one int for scancode
and one for the keycode).
The interface has now been extended to use the EVIOC[GS]KEYCODE_V2 ioctl
which uses the following struct:
struct input_keymap_entry {
__u8 flags;
__u8 len;
__u16 index;
__u32 keycode;
__u8 scancode[32];
};
(scancode can of course be even bigger, thanks to the len member).
This patch changes how the "input_keymap_entry" struct is interpreted
by rc-core by casting it to "rc_keymap_entry":
struct rc_scancode {
__u16 protocol;
__u16 reserved[3];
__u64 scancode;
}
struct rc_keymap_entry {
__u8 flags;
__u8 len;
__u16 index;
__u32 keycode;
union {
struct rc_scancode rc;
__u8 raw[32];
};
};
The u64 scancode member is large enough for all current protocols and it
would be possible to extend it in the future should it be necessary for
some exotic protocol.
The main advantage with this change is that the protocol is made explicit,
which means that we're not throwing away data (the protocol type) and that
it'll be easier to support multiple protocols with one decoder (think rc5
and rc5-streamzap).
Further down the road we should also have a way to report the protocol of
a received keypress to userspace.
Signed-off-by: David Härdeman <david@hardeman.nu>
---
drivers/media/dvb/dm1105/dm1105.c | 3
drivers/media/dvb/dvb-usb/af9015.c | 4
drivers/media/dvb/dvb-usb/anysee.c | 2
drivers/media/dvb/dvb-usb/dib0700_core.c | 2
drivers/media/dvb/dvb-usb/dib0700_devices.c | 10 -
drivers/media/dvb/dvb-usb/dvb-usb.h | 2
drivers/media/dvb/dvb-usb/lmedm04.c | 2
drivers/media/dvb/dvb-usb/ttusb2.c | 2
drivers/media/dvb/mantis/mantis_input.c | 117 +++---
drivers/media/dvb/ttpci/budget-ci.c | 7
drivers/media/rc/imon.c | 11 -
drivers/media/rc/ir-jvc-decoder.c | 4
drivers/media/rc/ir-lirc-codec.c | 2
drivers/media/rc/ir-nec-decoder.c | 4
drivers/media/rc/ir-raw.c | 2
drivers/media/rc/ir-rc5-decoder.c | 23 -
drivers/media/rc/ir-rc5-sz-decoder.c | 4
drivers/media/rc/ir-rc6-decoder.c | 4
drivers/media/rc/ir-sony-decoder.c | 26 +
drivers/media/rc/keymaps/rc-adstech-dvb-t-pci.c | 89 ++---
drivers/media/rc/keymaps/rc-alink-dtu-m.c | 37 +-
drivers/media/rc/keymaps/rc-anysee.c | 89 ++---
drivers/media/rc/keymaps/rc-apac-viewcomp.c | 65 ++--
drivers/media/rc/keymaps/rc-asus-pc39.c | 79 ++--
drivers/media/rc/keymaps/rc-ati-tv-wonder-hd-600.c | 49 +--
drivers/media/rc/keymaps/rc-avermedia-a16d.c | 69 ++--
drivers/media/rc/keymaps/rc-avermedia-cardbus.c | 109 +++---
drivers/media/rc/keymaps/rc-avermedia-dvbt.c | 69 ++--
drivers/media/rc/keymaps/rc-avermedia-m135a.c | 187 +++++-----
.../media/rc/keymaps/rc-avermedia-m733a-rm-k6.c | 89 ++---
drivers/media/rc/keymaps/rc-avermedia-rm-ks.c | 55 +--
drivers/media/rc/keymaps/rc-avermedia.c | 73 ++--
drivers/media/rc/keymaps/rc-avertv-303.c | 73 ++--
drivers/media/rc/keymaps/rc-azurewave-ad-tu700.c | 107 +++---
drivers/media/rc/keymaps/rc-behold-columbus.c | 73 ++--
drivers/media/rc/keymaps/rc-behold.c | 69 ++--
drivers/media/rc/keymaps/rc-budget-ci-old.c | 91 ++---
drivers/media/rc/keymaps/rc-cinergy-1400.c | 75 ++--
drivers/media/rc/keymaps/rc-cinergy.c | 73 ++--
drivers/media/rc/keymaps/rc-dib0700-nec.c | 141 ++++----
drivers/media/rc/keymaps/rc-dib0700-rc5.c | 361
++++++++++----------
drivers/media/rc/keymaps/rc-digitalnow-tinytwin.c | 99 +++--
drivers/media/rc/keymaps/rc-digittrade.c | 57 ++-
drivers/media/rc/keymaps/rc-dm1105-nec.c | 63 ++-
drivers/media/rc/keymaps/rc-dntv-live-dvb-t.c | 65 ++--
drivers/media/rc/keymaps/rc-dntv-live-dvbt-pro.c | 107 +++---
drivers/media/rc/keymaps/rc-em-terratec.c | 57 ++-
drivers/media/rc/keymaps/rc-encore-enltv-fm53.c | 59 ++-
drivers/media/rc/keymaps/rc-encore-enltv.c | 131 ++++---
drivers/media/rc/keymaps/rc-encore-enltv2.c | 79 ++--
drivers/media/rc/keymaps/rc-evga-indtube.c | 33 +-
drivers/media/rc/keymaps/rc-eztv.c | 89 ++---
drivers/media/rc/keymaps/rc-flydvb.c | 65 ++--
drivers/media/rc/keymaps/rc-flyvideo.c | 53 +--
drivers/media/rc/keymaps/rc-fusionhdtv-mce.c | 105 +++---
drivers/media/rc/keymaps/rc-gadmei-rm008z.c | 63 ++-
drivers/media/rc/keymaps/rc-genius-tvgo-a11mce.c | 65 ++--
drivers/media/rc/keymaps/rc-gotview7135.c | 69 ++--
drivers/media/rc/keymaps/rc-hauppauge.c | 287
++++++++--------
drivers/media/rc/keymaps/rc-imon-mce.c | 173 +++++-----
drivers/media/rc/keymaps/rc-imon-pad.c | 215 ++++++------
drivers/media/rc/keymaps/rc-iodata-bctv7e.c | 87 ++---
drivers/media/rc/keymaps/rc-kaiomy.c | 65 ++--
drivers/media/rc/keymaps/rc-kworld-315u.c | 65 ++--
.../media/rc/keymaps/rc-kworld-plus-tv-analog.c | 71 ++--
drivers/media/rc/keymaps/rc-leadtek-y04g0051.c | 101 +++---
drivers/media/rc/keymaps/rc-lirc.c | 1
drivers/media/rc/keymaps/rc-lme2510.c | 133 ++++---
drivers/media/rc/keymaps/rc-manli.c | 97 +++--
drivers/media/rc/keymaps/rc-msi-digivox-ii.c | 37 +-
drivers/media/rc/keymaps/rc-msi-digivox-iii.c | 65 ++--
drivers/media/rc/keymaps/rc-msi-tvanywhere-plus.c | 89 ++---
drivers/media/rc/keymaps/rc-msi-tvanywhere.c | 49 +--
drivers/media/rc/keymaps/rc-nebula.c | 111 +++---
.../media/rc/keymaps/rc-nec-terratec-cinergy-xs.c | 121 +++----
drivers/media/rc/keymaps/rc-norwood.c | 69 ++--
drivers/media/rc/keymaps/rc-npgtech.c | 71 ++--
drivers/media/rc/keymaps/rc-pctv-sedna.c | 65 ++--
drivers/media/rc/keymaps/rc-pinnacle-color.c | 107 +++---
drivers/media/rc/keymaps/rc-pinnacle-grey.c | 83 ++---
drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c | 51 +--
drivers/media/rc/keymaps/rc-pixelview-002t.c | 53 +--
drivers/media/rc/keymaps/rc-pixelview-mk12.c | 63 ++-
drivers/media/rc/keymaps/rc-pixelview-new.c | 63 ++-
drivers/media/rc/keymaps/rc-pixelview.c | 77 ++--
.../media/rc/keymaps/rc-powercolor-real-angel.c | 71 ++--
drivers/media/rc/keymaps/rc-proteus-2309.c | 49 +--
drivers/media/rc/keymaps/rc-purpletv.c | 71 ++--
drivers/media/rc/keymaps/rc-pv951.c | 63 ++-
drivers/media/rc/keymaps/rc-rc6-mce.c | 151 ++++----
.../media/rc/keymaps/rc-real-audio-220-32-keys.c | 57 ++-
drivers/media/rc/keymaps/rc-streamzap.c | 71 ++--
drivers/media/rc/keymaps/rc-tbs-nec.c | 69 ++--
drivers/media/rc/keymaps/rc-technisat-usb2.c | 67 ++--
drivers/media/rc/keymaps/rc-terratec-cinergy-xs.c | 95 +++--
drivers/media/rc/keymaps/rc-terratec-slim-2.c | 37 +-
drivers/media/rc/keymaps/rc-terratec-slim.c | 57 ++-
drivers/media/rc/keymaps/rc-tevii-nec.c | 95 +++--
drivers/media/rc/keymaps/rc-total-media-in-hand.c | 71 ++--
drivers/media/rc/keymaps/rc-trekstor.c | 57 ++-
drivers/media/rc/keymaps/rc-tt-1500.c | 79 ++--
drivers/media/rc/keymaps/rc-twinhan1027.c | 107 +++---
drivers/media/rc/keymaps/rc-videomate-m1f.c | 103 +++---
drivers/media/rc/keymaps/rc-videomate-s350.c | 89 ++---
drivers/media/rc/keymaps/rc-videomate-tv-pvr.c | 93 +++--
drivers/media/rc/keymaps/rc-winfast-usbii-deluxe.c | 57 ++-
drivers/media/rc/keymaps/rc-winfast.c | 113 +++---
drivers/media/rc/rc-core-priv.h | 1
drivers/media/rc/rc-main.c | 229 +++++++++----
drivers/media/video/bt8xx/bttv-input.c | 10 -
drivers/media/video/cx88/cx88-input.c | 10 -
drivers/media/video/em28xx/em28xx-cards.c | 17 +
drivers/media/video/em28xx/em28xx-input.c | 34 +-
drivers/media/video/em28xx/em28xx.h | 1
drivers/media/video/ir-kbd-i2c.c | 12 +
drivers/media/video/saa7134/saa7134-input.c | 6
drivers/staging/tm6000/tm6000-cards.c | 2
drivers/staging/tm6000/tm6000-input.c | 32 +-
include/media/rc-core.h | 28 +-
include/media/rc-map.h | 14 +
120 files changed, 4121 insertions(+), 4078 deletions(-)
> Patchwork appears to be down again :(
Mauro told me that it is and that someone is working on it...
--
David Härdeman
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 00/10] rc-core: my current patchqueue
2011-04-28 20:13 ` [PATCH 00/10] rc-core: my current patchqueue Malcolm Priestley
2011-04-29 8:08 ` David Härdeman
@ 2011-05-02 17:58 ` Mauro Carvalho Chehab
1 sibling, 0 replies; 25+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-02 17:58 UTC (permalink / raw)
To: Malcolm Priestley; +Cc: David Härdeman, linux-media, warthog9
Em 28-04-2011 17:13, Malcolm Priestley escreveu:
> On Thu, 2011-04-28 at 17:13 +0200, David Härdeman wrote:
>> The following series is what's in my current patch queue for rc-core.
>>
>> It only been lightly tested so far and it's based on the "for_v2.6.39" branch,
>> but I still wanted to send it to the list so that I can get some feedback while
>> I refresh the patches to "for_v2.6.40" and do more testing.
>
> Patch [06/10] hasn't made it to gmane or spinics servers.
>
> Patchwork appears to be down again :(
None of the patches of this series were caught by patchwork :(
Btw, patchwork is broke again today: it is refusing to accept any commands to
update via pwclient interface. On the last 7 days, I counted 7 days of partial
outage at patchwork :(
It is time for us move from patchwork to something that works.
I intend to finish to apply the patches that patchwork caught and work on another
process to get those patches from my imap server, probably writing a script using
perl Mail::IMAPClient. The bad news is that, without patchwork, we'll loose some
visibility about the patch status. I need to think a little more about that.
>
> Regards
>
> Malcolm
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 05/10] rc-core: add separate defines for protocol bitmaps and numbers
2011-04-28 15:13 ` [PATCH 05/10] rc-core: add separate defines for protocol bitmaps and numbers David Härdeman
@ 2011-05-04 14:56 ` Mauro Carvalho Chehab
2011-05-06 12:23 ` David Härdeman
0 siblings, 1 reply; 25+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-04 14:56 UTC (permalink / raw)
To: David Härdeman; +Cc: linux-media, jarod
Em 28-04-2011 12:13, David Härdeman escreveu:
> The RC_TYPE_* defines are currently used both where a single protocol is
> expected and where a bitmap of protocols is expected. This patch tries
> to separate the two in preparation for the following patches.
>
> Signed-off-by: David Härdeman <david@hardeman.nu>
Most of the patch is just renaming stuff. So, I'm commenting just the
rc-main.c/rc-map.h changes.
> diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
> index 5b4422e..5a182b2 100644
> --- a/drivers/media/rc/rc-main.c
> +++ b/drivers/media/rc/rc-main.c
> @@ -102,7 +102,7 @@ static struct rc_map_list empty_map = {
> .map = {
> .scan = empty,
> .size = ARRAY_SIZE(empty),
> - .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
> + .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
> .name = RC_MAP_EMPTY,
> }
> };
> @@ -725,14 +725,17 @@ static struct {
> u64 type;
> char *name;
> } proto_names[] = {
> - { RC_TYPE_UNKNOWN, "unknown" },
> - { RC_TYPE_RC5, "rc-5" },
> - { RC_TYPE_NEC, "nec" },
> - { RC_TYPE_RC6, "rc-6" },
> - { RC_TYPE_JVC, "jvc" },
> - { RC_TYPE_SONY, "sony" },
> - { RC_TYPE_RC5_SZ, "rc-5-sz" },
> - { RC_TYPE_LIRC, "lirc" },
> + { RC_BIT_OTHER, "other" },
> + { RC_BIT_RC5, "rc-5" },
> + { RC_BIT_RC5X, "rc-5-x" },
> + { RC_BIT_RC5_SZ, "rc-5-sz" },
> + { RC_BIT_RC6, "rc-6" },
> + { RC_BIT_JVC, "jvc" },
> + { RC_BIT_SONY12, "sony12" },
> + { RC_BIT_SONY15, "sony15" },
> + { RC_BIT_SONY20, "sony20" },
> + { RC_BIT_NEC, "nec" },
> + { RC_BIT_LIRC, "lirc" },
> };
There are some API breakages on the above. We shouln't do it, except
if strictly required, and, if we'll do it, we need to do it via
Documentation/feature-removal-schedule.txt.
There are two types of breakages on the above:
1) the removal of "unknown" and "sony" types;
2) the behaviour change of "rc-5" (that, currently, means
both rc-5 and rc-5x.
Also, while you've mapped rc5/sony variants, nec variants weren't mapped.
IMO, what we should do on the above is:
1) preserve the "unknown";
2) use "rc-5", "sony", "nec" with the meaning that they will
enable all variants of those protocols;
3) add a new set of protocols to indicate subsets, like "sony:20",
"rc-5:normal", "rc5:x", etc.
4) if you're changing the interface, please submit a patch also
to v4l-utils, adding a logic there to handle the changes.
>
> #define PROTO_NONE "none"
> diff --git a/include/media/rc-map.h b/include/media/rc-map.h
> index 9184751..2c68ca6 100644
> --- a/include/media/rc-map.h
> +++ b/include/media/rc-map.h
> @@ -11,19 +11,36 @@
>
> #include <linux/input.h>
>
> -#define RC_TYPE_UNKNOWN 0
> -#define RC_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */
> -#define RC_TYPE_NEC (1 << 1)
> -#define RC_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */
> -#define RC_TYPE_JVC (1 << 3) /* JVC protocol */
> -#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
> -#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
> -#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
> -#define RC_TYPE_OTHER (1u << 31)
> +#define RC_TYPE_UNKNOWN 0 /* Protocol not known */
> +#define RC_TYPE_OTHER 0 /* Protocol known but proprietary */
This change doesn't make sense: we should either remove other or use different
bits for different meanings. This is somewhat a mess currently, as there are, in
fact, 3 types of "protocols":
1) reverse-engineered drivers, where developer didn't care to check
what was the used protocol. It is there due to legacy IR handlers,
added before rc-core. The better is to not accept this type anymore
for new devices;
2) Other protocols that don't match at the list of supported protocols.
Reserved for the cases were the developer took the care to check if
the protocol is not NEC/RC-5/... and didn't find any protocol that
matches;
3) Standard protocols with broken hardware. In general, keycode tables
with just 8 bits for RC-5 or NEC, because the hardware uses a cheap
uC (generally KS007 or similar) that only decodes the last 8 bits of
the protocol. As the developer didn't have a full IR decoder, he was
not able to fill the RC/NEC table with the IR address.
The problem with (2) is that it may reflect a temporary state where the protocol
is not yet known. After adding a protocol decoder for it, case (2) turns into
case (1).
So, maybe we can just merge (1) and (2) into the same case: "unknown". Maybe we
should map (3) with a different option, internally (even exporting it as "unknown"
to userspace), as it helps us to identify such cases and fix it later.
> +#define RC_TYPE_RC5 1 /* Philips RC5 protocol */
> +#define RC_TYPE_RC5X 2 /* Philips RC5x protocol */
> +#define RC_TYPE_RC5_SZ 3 /* StreamZap variant of RC5 */
> +#define RC_TYPE_RC6 4 /* Philips RC6 protocol */
> +#define RC_TYPE_JVC 5 /* JVC protocol */
> +#define RC_TYPE_SONY12 6 /* Sony 12 bit protocol */
> +#define RC_TYPE_SONY15 7 /* Sony 15 bit protocol */
> +#define RC_TYPE_SONY20 8 /* Sony 20 bit protocol */
> +#define RC_TYPE_NEC 9 /* NEC protocol */
> +#define RC_TYPE_LIRC 10 /* Pass raw IR to lirc userspace */
>
> -#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \
> - RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \
> - RC_TYPE_RC5_SZ | RC_TYPE_OTHER)
> +#define RC_BIT_UNKNOWN (1 << RC_TYPE_UNKNOWN)
> +#define RC_BIT_OTHER (1 << RC_TYPE_OTHER)
> +#define RC_BIT_RC5 (1 << RC_TYPE_RC5)
> +#define RC_BIT_RC5X (1 << RC_TYPE_RC5X)
> +#define RC_BIT_RC5_SZ (1 << RC_TYPE_RC5_SZ)
> +#define RC_BIT_RC6 (1 << RC_TYPE_RC6)
> +#define RC_BIT_JVC (1 << RC_TYPE_JVC)
> +#define RC_BIT_SONY12 (1 << RC_TYPE_SONY12)
> +#define RC_BIT_SONY15 (1 << RC_TYPE_SONY15)
> +#define RC_BIT_SONY20 (1 << RC_TYPE_SONY20)
> +#define RC_BIT_NEC (1 << RC_TYPE_NEC)
> +#define RC_BIT_LIRC (1 << RC_TYPE_LIRC)
> +
> +#define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | RC_BIT_RC5 | \
> + RC_BIT_RC5X | RC_BIT_RC6 | RC_BIT_JVC | \
> + RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \
> + RC_BIT_NEC | RC_BIT_LIRC)
>
> struct rc_map_table {
> u32 scancode;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks,
Mauro
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 00/10] rc-core: my current patchqueue
2011-04-29 8:08 ` David Härdeman
@ 2011-05-04 15:13 ` Mauro Carvalho Chehab
2011-05-06 10:06 ` David Härdeman
0 siblings, 1 reply; 25+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-04 15:13 UTC (permalink / raw)
To: David Härdeman; +Cc: Malcolm Priestley, linux-media
Em 29-04-2011 05:08, David Härdeman escreveu:
> On Thu, 28 Apr 2011 21:13:22 +0100, Malcolm Priestley <tvboxspy@gmail.com>
> wrote:
>> On Thu, 2011-04-28 at 17:13 +0200, David Härdeman wrote:
>>> The following series is what's in my current patch queue for rc-core.
>>>
>>> It only been lightly tested so far and it's based on the "for_v2.6.39"
>>> branch,
>>> but I still wanted to send it to the list so that I can get some
>>> feedback while
>>> I refresh the patches to "for_v2.6.40" and do more testing.
>>
>> Patch [06/10] hasn't made it to gmane or spinics servers.
>
> Looking through the postfix logs, vger.kernel.org did accept the mail. My
> guess is that it wasn't distributed (or indexed) because of its size.
>
> I've put patch 6/10 at http://david.hardeman.nu/rc-proto.patch for now,
> and I've included the patch description inline below:
Big patches like that makes harder to comment. So, I'll just get one small
piece of the patch to add my comments.
> Setting and getting keycodes in the input subsystem used to be done via
> the EVIOC[GS]KEYCODE ioctl and "unsigned int[2]" (one int for scancode
> and one for the keycode).
>
> The interface has now been extended to use the EVIOC[GS]KEYCODE_V2 ioctl
> which uses the following struct:
>
> struct input_keymap_entry {
> __u8 flags;
> __u8 len;
> __u16 index;
> __u32 keycode;
> __u8 scancode[32];
> };
>
> (scancode can of course be even bigger, thanks to the len member).
>
> This patch changes how the "input_keymap_entry" struct is interpreted
> by rc-core by casting it to "rc_keymap_entry":
>
> struct rc_scancode {
> __u16 protocol;
> __u16 reserved[3];
> __u64 scancode;
> }
>
> struct rc_keymap_entry {
> __u8 flags;
> __u8 len;
> __u16 index;
> __u32 keycode;
> union {
> struct rc_scancode rc;
> __u8 raw[32];
> };
> };
>
> The u64 scancode member is large enough for all current protocols and it
> would be possible to extend it in the future should it be necessary for
> some exotic protocol.
>
> The main advantage with this change is that the protocol is made explicit,
> which means that we're not throwing away data (the protocol type) and that
> it'll be easier to support multiple protocols with one decoder (think rc5
> and rc5-streamzap).
>
> Further down the road we should also have a way to report the protocol of
> a received keypress to userspace.
>
> Signed-off-by: David Härdeman <david@hardeman.nu>
<snip/>
>- rc_keydown(d->rc_dev, priv->rc_keycode, 0);
>+ rc_keydown(d->rc_dev, RC_TYPE_NEC, priv->rc_keycode, 0);
I'm OK with a change like the above, as it allows having some sort of input raw event
to describe the protocol type, helping, for example, to have an userspace program that
will help people to create keytable maps.
<snip/>
> diff --git a/drivers/media/rc/keymaps/rc-videomate-s350.c b/drivers/media/rc/keymaps/rc-videomate-s350.c
> index 26ca260..2f0ec1f 100644
> --- a/drivers/media/rc/keymaps/rc-videomate-s350.c
> +++ b/drivers/media/rc/keymaps/rc-videomate-s350.c
> @@ -13,57 +13,56 @@
> #include <media/rc-map.h>
>
> static struct rc_map_table videomate_s350[] = {
> - { 0x00, KEY_TV},
> - { 0x01, KEY_DVD},
> - { 0x04, KEY_RECORD},
> - { 0x05, KEY_VIDEO}, /* TV/Video */
> - { 0x07, KEY_STOP},
> - { 0x08, KEY_PLAYPAUSE},
> - { 0x0a, KEY_REWIND},
> - { 0x0f, KEY_FASTFORWARD},
> - { 0x10, KEY_CHANNELUP},
> - { 0x12, KEY_VOLUMEUP},
> - { 0x13, KEY_CHANNELDOWN},
> - { 0x14, KEY_MUTE},
> - { 0x15, KEY_VOLUMEDOWN},
> - { 0x16, KEY_1},
> - { 0x17, KEY_2},
> - { 0x18, KEY_3},
> - { 0x19, KEY_4},
> - { 0x1a, KEY_5},
> - { 0x1b, KEY_6},
> - { 0x1c, KEY_7},
> - { 0x1d, KEY_8},
> - { 0x1e, KEY_9},
> - { 0x1f, KEY_0},
> - { 0x21, KEY_SLEEP},
> - { 0x24, KEY_ZOOM},
> - { 0x25, KEY_LAST}, /* Recall */
> - { 0x26, KEY_SUBTITLE}, /* CC */
> - { 0x27, KEY_LANGUAGE}, /* MTS */
> - { 0x29, KEY_CHANNEL}, /* SURF */
> - { 0x2b, KEY_A},
> - { 0x2c, KEY_B},
> - { 0x2f, KEY_CAMERA}, /* Snapshot */
> - { 0x23, KEY_RADIO},
> - { 0x02, KEY_PREVIOUSSONG},
> - { 0x06, KEY_NEXTSONG},
> - { 0x03, KEY_EPG},
> - { 0x09, KEY_SETUP},
> - { 0x22, KEY_BACKSPACE},
> - { 0x0c, KEY_UP},
> - { 0x0e, KEY_DOWN},
> - { 0x0b, KEY_LEFT},
> - { 0x0d, KEY_RIGHT},
> - { 0x11, KEY_ENTER},
> - { 0x20, KEY_TEXT},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x00), KEY_TV},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x01), KEY_DVD},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x04), KEY_RECORD},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x05), KEY_VIDEO}, /* TV/Video */
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x07), KEY_STOP},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x08), KEY_PLAYPAUSE},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x0a), KEY_REWIND},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x0f), KEY_FASTFORWARD},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x10), KEY_CHANNELUP},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x12), KEY_VOLUMEUP},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x13), KEY_CHANNELDOWN},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x14), KEY_MUTE},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x15), KEY_VOLUMEDOWN},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x16), KEY_1},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x17), KEY_2},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x18), KEY_3},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x19), KEY_4},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x1a), KEY_5},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x1b), KEY_6},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x1c), KEY_7},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x1d), KEY_8},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x1e), KEY_9},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x1f), KEY_0},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x21), KEY_SLEEP},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x24), KEY_ZOOM},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x25), KEY_LAST}, /* Recall */
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x26), KEY_SUBTITLE}, /* CC */
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x27), KEY_LANGUAGE}, /* MTS */
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x29), KEY_CHANNEL}, /* SURF */
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x2b), KEY_A},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x2c), KEY_B},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x2f), KEY_CAMERA}, /* Snapshot */
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x23), KEY_RADIO},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x02), KEY_PREVIOUSSONG},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x06), KEY_NEXTSONG},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x03), KEY_EPG},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x09), KEY_SETUP},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x22), KEY_BACKSPACE},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x0c), KEY_UP},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x0e), KEY_DOWN},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x0b), KEY_LEFT},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x0d), KEY_RIGHT},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x11), KEY_ENTER},
> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x20), KEY_TEXT},
> };
However, changes like the above makes the keymaps confusing and breaks the
v4l-utils sync scripts without a good reason.
A keymap maps one remote. All keys have the same protocol, so it doesn't make
sense to mix the RC_TYPEs inside each key definition.
Before you answer tha above, you may be thinking on showing some some special
remote type that might have more than one protocol. If this ever happens,
just create two keymap tables for it. I'm sure that 99% of the remotes
just use one protocol (except, of course, for Universal remotes,
but no default keymap table covers this case).
Mauro.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 07/10] rc-core: use the full 32 bits for NEC scancodes
2011-04-28 15:13 ` [PATCH 07/10] rc-core: use the full 32 bits for NEC scancodes David Härdeman
@ 2011-05-04 15:16 ` Mauro Carvalho Chehab
2011-05-06 9:58 ` David Härdeman
0 siblings, 1 reply; 25+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-04 15:16 UTC (permalink / raw)
To: David Härdeman; +Cc: linux-media, jarod
Em 28-04-2011 12:13, David Härdeman escreveu:
> Using the full 32 bits for all kinds of NEC scancodes simplifies rc-core
> and the nec decoder without any loss of functionality.
This seems to be a good strategy. However, it breaks the existing NEC keymap
tables (/me is not considering patch 6/10 macros), and changes those keytables
on userspace. Not sure how to address this.
Comments?
Thanks,
Mauro.
>
> Signed-off-by: David Härdeman <david@hardeman.nu>
> ---
> drivers/media/dvb/dvb-usb/af9015.c | 22 ++++++----------------
> drivers/media/rc/ir-nec-decoder.c | 28 ++++------------------------
> include/media/rc-map.h | 11 +++++++++--
> 3 files changed, 19 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
> index 08975f3..4ee8bb7 100644
> --- a/drivers/media/dvb/dvb-usb/af9015.c
> +++ b/drivers/media/dvb/dvb-usb/af9015.c
> @@ -1034,7 +1034,8 @@ static int af9015_rc_query(struct dvb_usb_device *d)
> if ((priv->rc_repeat != buf[6] || buf[0]) &&
> !memcmp(&buf[12], priv->rc_last, 4)) {
> deb_rc("%s: key repeated\n", __func__);
> - rc_keydown(d->rc_dev, RC_TYPE_NEC, priv->rc_keycode, 0);
> + rc_keydown(d->rc_dev, RC_TYPE_NEC,
> + RC_SCANCODE_NEC32(priv->rc_keycode), 0);
> priv->rc_repeat = buf[6];
> return ret;
> }
> @@ -1051,21 +1052,10 @@ static int af9015_rc_query(struct dvb_usb_device *d)
>
> /* Remember this key */
> memcpy(priv->rc_last, &buf[12], 4);
> - if (buf[14] == (u8) ~buf[15]) {
> - if (buf[12] == (u8) ~buf[13]) {
> - /* NEC */
> - priv->rc_keycode = buf[12] << 8 | buf[14];
> - } else {
> - /* NEC extended*/
> - priv->rc_keycode = buf[12] << 16 |
> - buf[13] << 8 | buf[14];
> - }
> - } else {
> - /* 32 bit NEC */
> - priv->rc_keycode = buf[12] << 24 | buf[13] << 16 |
> - buf[14] << 8 | buf[15];
> - }
> - rc_keydown(d->rc_dev, RC_TYPE_NEC, priv->rc_keycode, 0);
> + priv->rc_keycode = buf[12] << 24 | buf[13] << 16 |
> + buf[14] << 8 | buf[15];
> + rc_keydown(d->rc_dev, RC_TYPE_NEC,
> + RC_SCANCODE_NEC32(priv->rc_keycode), 0);
> } else {
> deb_rc("%s: no key press\n", __func__);
> /* Invalidate last keypress */
> diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
> index edd8543..0b1eef1 100644
> --- a/drivers/media/rc/ir-nec-decoder.c
> +++ b/drivers/media/rc/ir-nec-decoder.c
> @@ -49,7 +49,6 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
> struct nec_dec *data = &dev->raw->nec;
> u32 scancode;
> u8 address, not_address, command, not_command;
> - bool send_32bits = false;
>
> if (!(dev->enabled_protocols & RC_BIT_NEC))
> return 0;
> @@ -162,33 +161,14 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
> command = bitrev8((data->bits >> 8) & 0xff);
> not_command = bitrev8((data->bits >> 0) & 0xff);
>
> - if ((command ^ not_command) != 0xff) {
> - IR_dprintk(1, "NEC checksum error: received 0x%08x\n",
> - data->bits);
> - send_32bits = true;
> - }
> -
> - if (send_32bits) {
> - /* NEC transport, but modified protocol, used by at
> - * least Apple and TiVo remotes */
> - scancode = data->bits;
> - IR_dprintk(1, "NEC (modified) scancode 0x%08x\n", scancode);
> - } else if ((address ^ not_address) != 0xff) {
> - /* Extended NEC */
> - scancode = address << 16 |
> - not_address << 8 |
> - command;
> - IR_dprintk(1, "NEC (Ext) scancode 0x%06x\n", scancode);
> - } else {
> - /* Normal NEC */
> - scancode = address << 8 | command;
> - IR_dprintk(1, "NEC scancode 0x%04x\n", scancode);
> - }
> + scancode = address << 24 | not_address << 16 |
> + command << 8 | not_command;
> + IR_dprintk(1, "NEC scancode 0x%08x\n", scancode);
>
> if (data->is_nec_x)
> data->necx_repeat = true;
>
> - rc_keydown(dev, RC_TYPE_NEC, scancode, 0);
> + rc_keydown(dev, RC_TYPE_NEC, RC_SCANCODE_NEC32(scancode), 0);
> data->state = STATE_INACTIVE;
> return 0;
> }
> diff --git a/include/media/rc-map.h b/include/media/rc-map.h
> index 42c8ad9..aa503f0 100644
> --- a/include/media/rc-map.h
> +++ b/include/media/rc-map.h
> @@ -44,8 +44,15 @@
>
> #define RC_SCANCODE_UNKNOWN(x) (x)
> #define RC_SCANCODE_OTHER(x) (x)
> -#define RC_SCANCODE_NEC(addr, cmd) (((addr) << 8) | (cmd))
> -#define RC_SCANCODE_NECX(addr, cmd) (((addr) << 8) | (cmd))
> +#define RC_SCANCODE_NEC(addr, cmd) \
> + ((( (addr) & 0xff) << 24) | \
> + ((~(addr) & 0xff) << 16) | \
> + (( (cmd) & 0xff) << 8 ) | \
> + ((~(cmd) & 0xff) << 0 ))
> +#define RC_SCANCODE_NECX(addr, cmd) \
> + ((( (addr) & 0xffff) << 16) | \
> + (( (cmd) & 0x00ff) << 8) | \
> + ((~(cmd) & 0x00ff) << 0))
> #define RC_SCANCODE_NEC32(data) ((data) & 0xffffffff)
> #define RC_SCANCODE_RC5(sys, cmd) (((sys) << 8) | (cmd))
> #define RC_SCANCODE_RC5_SZ(sys, cmd) (((sys) << 8) | (cmd))
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 08/10] rc-core: merge rc5 and streamzap decoders
2011-04-28 15:13 ` [PATCH 08/10] rc-core: merge rc5 and streamzap decoders David Härdeman
@ 2011-05-04 15:19 ` Mauro Carvalho Chehab
2011-05-06 11:33 ` David Härdeman
0 siblings, 1 reply; 25+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-04 15:19 UTC (permalink / raw)
To: David Härdeman; +Cc: linux-media, jarod
Em 28-04-2011 12:13, David Härdeman escreveu:
> Now that the protocol is part of the scancode, it is pretty easy to merge
> the rc5 and streamzap decoders. An additional advantage is that the decoder
> is now stricter as it waits for the trailing silence before determining that
> a command is a valid rc5/streamzap command (which avoids collisions that I've
> seen with e.g. Sony protocols).
Makes sense for me.
(FYI, I probably won't be applying any patch after patch 6, due to dependency issues).
>
> Signed-off-by: David Härdeman <david@hardeman.nu>
> ---
> drivers/media/rc/Kconfig | 12 --
> drivers/media/rc/Makefile | 1
> drivers/media/rc/ir-rc5-decoder.c | 51 ++++++----
> drivers/media/rc/ir-rc5-sz-decoder.c | 153 -------------------------------
> drivers/media/rc/keymaps/rc-streamzap.c | 4 -
> drivers/media/rc/rc-core-priv.h | 8 --
> drivers/media/rc/streamzap.c | 10 --
> 7 files changed, 31 insertions(+), 208 deletions(-)
> delete mode 100644 drivers/media/rc/ir-rc5-sz-decoder.c
>
> diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
> index 7f03142..7242b0d 100644
> --- a/drivers/media/rc/Kconfig
> +++ b/drivers/media/rc/Kconfig
> @@ -75,18 +75,6 @@ config IR_SONY_DECODER
> Enable this option if you have an infrared remote control which
> uses the Sony protocol, and you need software decoding support.
>
> -config IR_RC5_SZ_DECODER
> - tristate "Enable IR raw decoder for the RC-5 (streamzap) protocol"
> - depends on RC_CORE
> - select BITREVERSE
> - default y
> -
> - ---help---
> - Enable this option if you have IR with RC-5 (streamzap) protocol,
> - and if the IR is decoded in software. (The Streamzap PC Remote
> - uses an IR protocol that is almost standard RC-5, but not quite,
> - as it uses an additional bit).
> -
> config IR_LIRC_CODEC
> tristate "Enable IR to LIRC bridge"
> depends on RC_CORE
> diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
> index c6cfe70..2d9ddde 100644
> --- a/drivers/media/rc/Makefile
> +++ b/drivers/media/rc/Makefile
> @@ -9,7 +9,6 @@ obj-$(CONFIG_IR_RC5_DECODER) += ir-rc5-decoder.o
> obj-$(CONFIG_IR_RC6_DECODER) += ir-rc6-decoder.o
> obj-$(CONFIG_IR_JVC_DECODER) += ir-jvc-decoder.o
> obj-$(CONFIG_IR_SONY_DECODER) += ir-sony-decoder.o
> -obj-$(CONFIG_IR_RC5_SZ_DECODER) += ir-rc5-sz-decoder.o
> obj-$(CONFIG_IR_LIRC_CODEC) += ir-lirc-codec.o
>
> # stand-alone IR receivers/transmitters
> diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c
> index ed726ca..159e57f 100644
> --- a/drivers/media/rc/ir-rc5-decoder.c
> +++ b/drivers/media/rc/ir-rc5-decoder.c
> @@ -1,6 +1,7 @@
> -/* ir-rc5-decoder.c - handle RC5(x) IR Pulse/Space protocol
> +/* ir-rc5-decoder.c - decoder for RC5(x) and StreamZap protocols
> *
> * Copyright (C) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
> + * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com>
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License as published by
> @@ -13,22 +14,21 @@
> */
>
> /*
> - * This code handles 14 bits RC5 protocols and 20 bits RC5x protocols.
> - * There are other variants that use a different number of bits.
> - * This is currently unsupported.
> - * It considers a carrier of 36 kHz, with a total of 14/20 bits, where
> - * the first two bits are start bits, and a third one is a filing bit
> + * This decoder handles the 14 bit RC5 protocol, 15 bit "StreamZap" protocol
> + * and 20 bit RC5x protocol.
> */
>
> #include "rc-core-priv.h"
>
> #define RC5_NBITS 14
> +#define RC5_SZ_NBITS 15
> #define RC5X_NBITS 20
> #define CHECK_RC5X_NBITS 8
> #define RC5_UNIT 888888 /* ns */
> #define RC5_BIT_START (1 * RC5_UNIT)
> #define RC5_BIT_END (1 * RC5_UNIT)
> #define RC5X_SPACE (4 * RC5_UNIT)
> +#define RC5_TRAILER (10 * RC5_UNIT) /* In reality, approx 100 */
>
> enum rc5_state {
> STATE_INACTIVE,
> @@ -79,12 +79,15 @@ again:
>
> data->state = STATE_BIT_START;
> data->count = 1;
> - /* We just need enough bits to get to STATE_CHECK_RC5X */
> - data->wanted_bits = RC5X_NBITS;
> decrease_duration(&ev, RC5_BIT_START);
> goto again;
>
> case STATE_BIT_START:
> + if (!ev.pulse && geq_margin(ev.duration, RC5_TRAILER, RC5_UNIT / 2)) {
> + data->state = STATE_FINISHED;
> + goto again;
> + }
> +
> if (!eq_margin(ev.duration, RC5_BIT_START, RC5_UNIT / 2))
> break;
>
> @@ -99,9 +102,7 @@ again:
> if (!is_transition(&ev, &dev->raw->prev_ev))
> break;
>
> - if (data->count == data->wanted_bits)
> - data->state = STATE_FINISHED;
> - else if (data->count == CHECK_RC5X_NBITS)
> + if (data->count == CHECK_RC5X_NBITS)
> data->state = STATE_CHECK_RC5X;
> else
> data->state = STATE_BIT_START;
> @@ -111,13 +112,10 @@ again:
>
> case STATE_CHECK_RC5X:
> if (!ev.pulse && geq_margin(ev.duration, RC5X_SPACE, RC5_UNIT / 2)) {
> - /* RC5X */
> - data->wanted_bits = RC5X_NBITS;
> + data->is_rc5x = true;
> decrease_duration(&ev, RC5X_SPACE);
> - } else {
> - /* RC5 */
> - data->wanted_bits = RC5_NBITS;
> - }
> + } else
> + data->is_rc5x = false;
> data->state = STATE_BIT_START;
> goto again;
>
> @@ -125,7 +123,7 @@ again:
> if (ev.pulse)
> break;
>
> - if (data->wanted_bits == RC5X_NBITS) {
> + if (data->is_rc5x && data->count == RC5X_NBITS) {
> /* RC5X */
> u8 xdata, command, system;
> xdata = (data->bits & 0x0003F) >> 0;
> @@ -135,7 +133,7 @@ again:
> command += (data->bits & 0x01000) ? 0 : 0x40;
> scancode = system << 16 | command << 8 | xdata;
> protocol = RC_TYPE_RC5X;
> - } else {
> + } else if (!data->is_rc5x && data->count == RC5_NBITS) {
> /* RC5 */
> u8 command, system;
> command = (data->bits & 0x0003F) >> 0;
> @@ -144,10 +142,19 @@ again:
> command += (data->bits & 0x01000) ? 0 : 0x40;
> scancode = system << 8 | command;
> protocol = RC_TYPE_RC5;
> - }
> + } else if (!data->is_rc5x && data->count == RC5_SZ_NBITS) {
> + /* RC5 StreamZap */
> + u8 command, system;
> + command = (data->bits & 0x0003F) >> 0;
> + system = (data->bits & 0x02FC0) >> 6;
> + toggle = (data->bits & 0x01000) ? 1 : 0;
> + scancode = system << 6 | command;
> + protocol = RC_TYPE_RC5_SZ;
> + } else
> + break;
>
> if (dev->enabled_protocols & (1 << protocol)) {
> - IR_dprintk(1, "RC5(x) scancode 0x%06x (toggle: %u)\n",
> + IR_dprintk(1, "RC5(x/sz) scancode 0x%06x (toggle: %u)\n",
> scancode, toggle);
> rc_keydown(dev, protocol, scancode, toggle);
> }
> @@ -164,7 +171,7 @@ out:
> }
>
> static struct ir_raw_handler rc5_handler = {
> - .protocols = RC_BIT_RC5 | RC_BIT_RC5X,
> + .protocols = RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ,
> .decode = ir_rc5_decode,
> };
>
> diff --git a/drivers/media/rc/ir-rc5-sz-decoder.c b/drivers/media/rc/ir-rc5-sz-decoder.c
> deleted file mode 100644
> index 7e9e9c5..0000000
> --- a/drivers/media/rc/ir-rc5-sz-decoder.c
> +++ /dev/null
> @@ -1,153 +0,0 @@
> -/* ir-rc5-sz-decoder.c - handle RC5 Streamzap IR Pulse/Space protocol
> - *
> - * Copyright (C) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
> - * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com>
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation version 2 of the License.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> - * GNU General Public License for more details.
> - */
> -
> -/*
> - * This code handles the 15 bit RC5-ish protocol used by the Streamzap
> - * PC Remote.
> - * It considers a carrier of 36 kHz, with a total of 15 bits, where
> - * the first two bits are start bits, and a third one is a filing bit
> - */
> -
> -#include "rc-core-priv.h"
> -
> -#define RC5_SZ_NBITS 15
> -#define RC5_UNIT 888888 /* ns */
> -#define RC5_BIT_START (1 * RC5_UNIT)
> -#define RC5_BIT_END (1 * RC5_UNIT)
> -
> -enum rc5_sz_state {
> - STATE_INACTIVE,
> - STATE_BIT_START,
> - STATE_BIT_END,
> - STATE_FINISHED,
> -};
> -
> -/**
> - * ir_rc5_sz_decode() - Decode one RC-5 Streamzap pulse or space
> - * @dev: the struct rc_dev descriptor of the device
> - * @ev: the struct ir_raw_event descriptor of the pulse/space
> - *
> - * This function returns -EINVAL if the pulse violates the state machine
> - */
> -static int ir_rc5_sz_decode(struct rc_dev *dev, struct ir_raw_event ev)
> -{
> - struct rc5_sz_dec *data = &dev->raw->rc5_sz;
> - u8 toggle, command, system;
> - u32 scancode;
> -
> - if (!(dev->enabled_protocols & RC_BIT_RC5_SZ))
> - return 0;
> -
> - if (!is_timing_event(ev)) {
> - if (ev.reset)
> - data->state = STATE_INACTIVE;
> - return 0;
> - }
> -
> - if (!geq_margin(ev.duration, RC5_UNIT, RC5_UNIT / 2))
> - goto out;
> -
> -again:
> - IR_dprintk(2, "RC5-sz decode started at state %i (%uus %s)\n",
> - data->state, TO_US(ev.duration), TO_STR(ev.pulse));
> -
> - if (!geq_margin(ev.duration, RC5_UNIT, RC5_UNIT / 2))
> - return 0;
> -
> - switch (data->state) {
> -
> - case STATE_INACTIVE:
> - if (!ev.pulse)
> - break;
> -
> - data->state = STATE_BIT_START;
> - data->count = 1;
> - data->wanted_bits = RC5_SZ_NBITS;
> - decrease_duration(&ev, RC5_BIT_START);
> - goto again;
> -
> - case STATE_BIT_START:
> - if (!eq_margin(ev.duration, RC5_BIT_START, RC5_UNIT / 2))
> - break;
> -
> - data->bits <<= 1;
> - if (!ev.pulse)
> - data->bits |= 1;
> - data->count++;
> - data->state = STATE_BIT_END;
> - return 0;
> -
> - case STATE_BIT_END:
> - if (!is_transition(&ev, &dev->raw->prev_ev))
> - break;
> -
> - if (data->count == data->wanted_bits)
> - data->state = STATE_FINISHED;
> - else
> - data->state = STATE_BIT_START;
> -
> - decrease_duration(&ev, RC5_BIT_END);
> - goto again;
> -
> - case STATE_FINISHED:
> - if (ev.pulse)
> - break;
> -
> - /* RC5-sz */
> - command = (data->bits & 0x0003F) >> 0;
> - system = (data->bits & 0x02FC0) >> 6;
> - toggle = (data->bits & 0x01000) ? 1 : 0;
> - scancode = system << 6 | command;
> -
> - IR_dprintk(1, "RC5-sz scancode 0x%04x (toggle: %u)\n",
> - scancode, toggle);
> -
> - rc_keydown(dev, RC_TYPE_RC5_SZ, scancode, toggle);
> - data->state = STATE_INACTIVE;
> - return 0;
> - }
> -
> -out:
> - IR_dprintk(1, "RC5-sz decode failed at state %i (%uus %s)\n",
> - data->state, TO_US(ev.duration), TO_STR(ev.pulse));
> - data->state = STATE_INACTIVE;
> - return -EINVAL;
> -}
> -
> -static struct ir_raw_handler rc5_sz_handler = {
> - .protocols = RC_BIT_RC5_SZ,
> - .decode = ir_rc5_sz_decode,
> -};
> -
> -static int __init ir_rc5_sz_decode_init(void)
> -{
> - ir_raw_handler_register(&rc5_sz_handler);
> -
> - printk(KERN_INFO "IR RC5 (streamzap) protocol handler initialized\n");
> - return 0;
> -}
> -
> -static void __exit ir_rc5_sz_decode_exit(void)
> -{
> - ir_raw_handler_unregister(&rc5_sz_handler);
> -}
> -
> -module_init(ir_rc5_sz_decode_init);
> -module_exit(ir_rc5_sz_decode_exit);
> -
> -MODULE_LICENSE("GPL");
> -MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");
> -MODULE_AUTHOR("Red Hat Inc. (http://www.redhat.com)");
> -MODULE_DESCRIPTION("RC5 (streamzap) IR protocol decoder");
> diff --git a/drivers/media/rc/keymaps/rc-streamzap.c b/drivers/media/rc/keymaps/rc-streamzap.c
> index 3e4d62f..d8d097a 100644
> --- a/drivers/media/rc/keymaps/rc-streamzap.c
> +++ b/drivers/media/rc/keymaps/rc-streamzap.c
> @@ -14,9 +14,7 @@
> static struct rc_map_table streamzap[] = {
> /*
> * The Streamzap remote is almost, but not quite, RC-5, as it has an extra
> - * bit in it, which throws the in-kernel RC-5 decoder for a loop. Currently,
> - * an additional RC-5-sz decoder is being deployed to support it, but it
> - * may be possible to merge it back with the standard RC-5 decoder.
> + * bit in it.
> */
> { RC_TYPE_RC5_SZ, RC_SCANCODE_RC5_SZ(0x28,0xc0), KEY_NUMERIC_0 },
> { RC_TYPE_RC5_SZ, RC_SCANCODE_RC5_SZ(0x28,0xc1), KEY_NUMERIC_1 },
> diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h
> index 729b6a7..bcdf7b5 100644
> --- a/drivers/media/rc/rc-core-priv.h
> +++ b/drivers/media/rc/rc-core-priv.h
> @@ -54,7 +54,7 @@ struct ir_raw_event_ctrl {
> int state;
> u32 bits;
> unsigned count;
> - unsigned wanted_bits;
> + bool is_rc5x;
> } rc5;
> struct rc6_dec {
> int state;
> @@ -77,12 +77,6 @@ struct ir_raw_event_ctrl {
> bool first;
> bool toggle;
> } jvc;
> - struct rc5_sz_dec {
> - int state;
> - u32 bits;
> - unsigned count;
> - unsigned wanted_bits;
> - } rc5_sz;
> struct lirc_codec {
> struct rc_dev *dev;
> struct lirc_driver *drv;
> diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c
> index 48cf47f..eccfbb4 100644
> --- a/drivers/media/rc/streamzap.c
> +++ b/drivers/media/rc/streamzap.c
> @@ -69,13 +69,6 @@ MODULE_DEVICE_TABLE(usb, streamzap_table);
> /* number of samples buffered */
> #define SZ_BUF_LEN 128
>
> -/* from ir-rc5-sz-decoder.c */
> -#ifdef CONFIG_IR_RC5_SZ_DECODER_MODULE
> -#define load_rc5_sz_decode() request_module("ir-rc5-sz-decoder")
> -#else
> -#define load_rc5_sz_decode() {}
> -#endif
> -
> enum StreamzapDecoderState {
> PulseSpace,
> FullPulse,
> @@ -458,9 +451,6 @@ static int __devinit streamzap_probe(struct usb_interface *intf,
> dev_info(sz->dev, "Registered %s on usb%d:%d\n", name,
> usbdev->bus->busnum, usbdev->devnum);
>
> - /* Load the streamzap not-quite-rc5 decoder too */
> - load_rc5_sz_decode();
> -
> return 0;
>
> rc_dev_fail:
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 09/10] rc-core: lirc use unsigned int
2011-04-28 15:13 ` [PATCH 09/10] rc-core: lirc use unsigned int David Härdeman
@ 2011-05-04 15:23 ` Mauro Carvalho Chehab
2011-05-06 9:46 ` David Härdeman
0 siblings, 1 reply; 25+ messages in thread
From: Mauro Carvalho Chehab @ 2011-05-04 15:23 UTC (permalink / raw)
To: David Härdeman; +Cc: linux-media, jarod
Em 28-04-2011 12:13, David Härdeman escreveu:
> Durations can never be negative, so it makes sense to consistently use
> unsigned int for LIRC transmission. Contrary to the initial impression,
> this shouldn't actually change the userspace API.
Patch looked ok to me (except for one small issue - see bellow).
>
> Signed-off-by: David Härdeman <david@hardeman.nu>
> ---
> drivers/media/rc/ene_ir.c | 4 ++--
> drivers/media/rc/ene_ir.h | 2 +-
> drivers/media/rc/ir-lirc-codec.c | 15 +++++++++------
> drivers/media/rc/ite-cir.c | 5 +----
> drivers/media/rc/mceusb.c | 10 ++++------
> drivers/media/rc/nuvoton-cir.c | 12 +++---------
> drivers/media/rc/rc-loopback.c | 13 +++----------
> drivers/media/rc/winbond-cir.c | 6 +-----
> include/media/rc-core.h | 2 +-
> 9 files changed, 25 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
> index 569b07b..2b1d2df 100644
> --- a/drivers/media/rc/ene_ir.c
> +++ b/drivers/media/rc/ene_ir.c
> @@ -953,13 +953,13 @@ static void ene_set_idle(struct rc_dev *rdev, bool idle)
> }
>
> /* outside interface: transmit */
> -static int ene_transmit(struct rc_dev *rdev, int *buf, u32 n)
> +static int ene_transmit(struct rc_dev *rdev, unsigned *buf, unsigned n)
> {
> struct ene_device *dev = rdev->priv;
> unsigned long flags;
>
> dev->tx_buffer = buf;
> - dev->tx_len = n / sizeof(int);
> + dev->tx_len = n;
That hunk seems wrong to me. Or is it a bug fix that you're solving?
> dev->tx_pos = 0;
> dev->tx_reg = 0;
> dev->tx_done = 0;
> diff --git a/drivers/media/rc/ene_ir.h b/drivers/media/rc/ene_ir.h
> index 337a41d..017c209 100644
> --- a/drivers/media/rc/ene_ir.h
> +++ b/drivers/media/rc/ene_ir.h
> @@ -235,7 +235,7 @@ struct ene_device {
> bool tx_sample_pulse; /* current sample is pulse */
>
> /* TX buffer */
> - int *tx_buffer; /* input samples buffer*/
> + unsigned *tx_buffer; /* input samples buffer*/
> int tx_pos; /* position in that bufer */
> int tx_len; /* current len of tx buffer */
> int tx_done; /* done transmitting */
> diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
> index b4119f8..ac54139 100644
> --- a/drivers/media/rc/ir-lirc-codec.c
> +++ b/drivers/media/rc/ir-lirc-codec.c
> @@ -103,19 +103,19 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
> {
> struct lirc_codec *lirc;
> struct rc_dev *dev;
> - int *txbuf; /* buffer with values to transmit */
> - int ret = 0;
> + unsigned int *txbuf; /* buffer with values to transmit */
> + ssize_t ret = 0;
> size_t count;
>
> lirc = lirc_get_pdata(file);
> if (!lirc)
> return -EFAULT;
>
> - if (n % sizeof(int))
> + if (n < sizeof(unsigned) || n % sizeof(unsigned))
> return -EINVAL;
>
> - count = n / sizeof(int);
> - if (count > LIRCBUF_SIZE || count % 2 == 0 || n % sizeof(int) != 0)
> + count = n / sizeof(unsigned);
> + if (count > LIRCBUF_SIZE || count % 2 == 0)
> return -EINVAL;
>
> txbuf = memdup_user(buf, n);
> @@ -129,7 +129,10 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
> }
>
> if (dev->tx_ir)
> - ret = dev->tx_ir(dev, txbuf, (u32)n);
> + ret = dev->tx_ir(dev, txbuf, count);
> +
> + if (ret > 0)
> + ret *= sizeof(unsigned);
>
> out:
> kfree(txbuf);
> diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
> index 3d13fcb..e8f7847 100644
> --- a/drivers/media/rc/ite-cir.c
> +++ b/drivers/media/rc/ite-cir.c
> @@ -381,7 +381,7 @@ static int ite_set_tx_duty_cycle(struct rc_dev *rcdev, u32 duty_cycle)
> /* transmit out IR pulses; what you get here is a batch of alternating
> * pulse/space/pulse/space lengths that we should write out completely through
> * the FIFO, blocking on a full FIFO */
> -static int ite_tx_ir(struct rc_dev *rcdev, int *txbuf, u32 n)
> +static int ite_tx_ir(struct rc_dev *rcdev, unsigned *txbuf, unsigned n)
> {
> unsigned long flags;
> struct ite_dev *dev = rcdev->priv;
> @@ -397,9 +397,6 @@ static int ite_tx_ir(struct rc_dev *rcdev, int *txbuf, u32 n)
> /* clear the array just in case */
> memset(last_sent, 0, ARRAY_SIZE(last_sent));
>
> - /* n comes in bytes; convert to ints */
> - n /= sizeof(int);
> -
> spin_lock_irqsave(&dev->lock, flags);
>
> /* let everybody know we're now transmitting */
> diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
> index c51e7c2..c1cd00d 100644
> --- a/drivers/media/rc/mceusb.c
> +++ b/drivers/media/rc/mceusb.c
> @@ -665,20 +665,18 @@ static void mce_sync_in(struct mceusb_dev *ir, unsigned char *data, int size)
> }
>
> /* Send data out the IR blaster port(s) */
> -static int mceusb_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
> +static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
> {
> struct mceusb_dev *ir = dev->priv;
> int i, ret = 0;
> - int count, cmdcount = 0;
> + int cmdcount = 0;
> unsigned char *cmdbuf; /* MCE command buffer */
> long signal_duration = 0; /* Singnal length in us */
> struct timeval start_time, end_time;
>
> do_gettimeofday(&start_time);
>
> - count = n / sizeof(int);
> -
> - cmdbuf = kzalloc(sizeof(int) * MCE_CMDBUF_SIZE, GFP_KERNEL);
> + cmdbuf = kzalloc(sizeof(unsigned) * MCE_CMDBUF_SIZE, GFP_KERNEL);
> if (!cmdbuf)
> return -ENOMEM;
>
> @@ -747,7 +745,7 @@ static int mceusb_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
>
> out:
> kfree(cmdbuf);
> - return ret ? ret : n;
> + return ret ? ret : count;
> }
>
> /* Sets active IR outputs -- mce devices typically have two */
> diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
> index dba02b5..64fea04 100644
> --- a/drivers/media/rc/nuvoton-cir.c
> +++ b/drivers/media/rc/nuvoton-cir.c
> @@ -512,24 +512,18 @@ static int nvt_set_tx_carrier(struct rc_dev *dev, u32 carrier)
> * number may larger than TXFCONT (0xff). So in interrupt_handler, it has to
> * set TXFCONT as 0xff, until buf_count less than 0xff.
> */
> -static int nvt_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
> +static int nvt_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned n)
> {
> struct nvt_dev *nvt = dev->priv;
> unsigned long flags;
> - size_t cur_count;
> unsigned int i;
> u8 iren;
> int ret;
>
> spin_lock_irqsave(&nvt->tx.lock, flags);
>
> - if (n >= TX_BUF_LEN) {
> - nvt->tx.buf_count = cur_count = TX_BUF_LEN;
> - ret = TX_BUF_LEN;
> - } else {
> - nvt->tx.buf_count = cur_count = n;
> - ret = n;
> - }
> + ret = min((unsigned)(TX_BUF_LEN / sizeof(unsigned)), n);
> + nvt->tx.buf_count = (ret * sizeof(unsigned));
>
> memcpy(nvt->tx.buf, txbuf, nvt->tx.buf_count);
>
> diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
> index 6dee719..fb8ca81 100644
> --- a/drivers/media/rc/rc-loopback.c
> +++ b/drivers/media/rc/rc-loopback.c
> @@ -101,21 +101,14 @@ static int loop_set_rx_carrier_range(struct rc_dev *dev, u32 min, u32 max)
> return 0;
> }
>
> -static int loop_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
> +static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
> {
> struct loopback_dev *lodev = dev->priv;
> u32 rxmask;
> - unsigned count;
> unsigned total_duration = 0;
> unsigned i;
> DEFINE_IR_RAW_EVENT(rawir);
>
> - if (n == 0 || n % sizeof(int)) {
> - dprintk("invalid tx buffer size\n");
> - return -EINVAL;
> - }
> -
> - count = n / sizeof(int);
> for (i = 0; i < count; i++)
> total_duration += abs(txbuf[i]);
>
> @@ -142,7 +135,7 @@ static int loop_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
>
> for (i = 0; i < count; i++) {
> rawir.pulse = i % 2 ? false : true;
> - rawir.duration = abs(txbuf[i]) * 1000;
> + rawir.duration = txbuf[i] * 1000;
> if (rawir.duration)
> ir_raw_event_store_with_filter(dev, &rawir);
> }
> @@ -158,7 +151,7 @@ out:
> /* Lirc expects this function to take as long as the total duration */
> set_current_state(TASK_INTERRUPTIBLE);
> schedule_timeout(usecs_to_jiffies(total_duration));
> - return n;
> + return count;
> }
>
> static void loop_set_idle(struct rc_dev *dev, bool enable)
> diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
> index 48bafa2..b74d0fd 100644
> --- a/drivers/media/rc/winbond-cir.c
> +++ b/drivers/media/rc/winbond-cir.c
> @@ -577,16 +577,12 @@ wbcir_txmask(struct rc_dev *dev, u32 mask)
> }
>
> static int
> -wbcir_tx(struct rc_dev *dev, int *buf, u32 bufsize)
> +wbcir_tx(struct rc_dev *dev, unsigned *buf, unsigned count)
> {
> struct wbcir_data *data = dev->priv;
> - u32 count;
> unsigned i;
> unsigned long flags;
>
> - /* bufsize has been sanity checked by the caller */
> - count = bufsize / sizeof(int);
> -
> /* Not sure if this is possible, but better safe than sorry */
> spin_lock_irqsave(&data->spinlock, flags);
> if (data->txstate != WBCIR_TXSTATE_INACTIVE) {
> diff --git a/include/media/rc-core.h b/include/media/rc-core.h
> index 1e6b6fc..052ce79 100644
> --- a/include/media/rc-core.h
> +++ b/include/media/rc-core.h
> @@ -134,7 +134,7 @@ struct rc_dev {
> int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier);
> int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle);
> int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max);
> - int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n);
> + int (*tx_ir)(struct rc_dev *dev, unsigned *txbuf, unsigned n);
> void (*s_idle)(struct rc_dev *dev, bool enable);
> int (*s_learning_mode)(struct rc_dev *dev, int enable);
> int (*s_carrier_report) (struct rc_dev *dev, int enable);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 09/10] rc-core: lirc use unsigned int
2011-05-04 15:23 ` Mauro Carvalho Chehab
@ 2011-05-06 9:46 ` David Härdeman
2011-06-11 12:16 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 25+ messages in thread
From: David Härdeman @ 2011-05-06 9:46 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media, jarod
On Wed, 04 May 2011 12:23:03 -0300, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> Em 28-04-2011 12:13, David Härdeman escreveu:
>> Durations can never be negative, so it makes sense to consistently use
>> unsigned int for LIRC transmission. Contrary to the initial impression,
>> this shouldn't actually change the userspace API.
>
> Patch looked ok to me (except for one small issue - see bellow).
>
...
>> diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
>> index 569b07b..2b1d2df 100644
>> --- a/drivers/media/rc/ene_ir.c
>> +++ b/drivers/media/rc/ene_ir.c
>> @@ -953,13 +953,13 @@ static void ene_set_idle(struct rc_dev *rdev,
bool
>> idle)
>> }
>>
>> /* outside interface: transmit */
>> -static int ene_transmit(struct rc_dev *rdev, int *buf, u32 n)
>> +static int ene_transmit(struct rc_dev *rdev, unsigned *buf, unsigned
n)
>> {
>> struct ene_device *dev = rdev->priv;
>> unsigned long flags;
>>
>> dev->tx_buffer = buf;
>> - dev->tx_len = n / sizeof(int);
>> + dev->tx_len = n;
>
> That hunk seems wrong to me. Or is it a bug fix that you're solving?
My fault, I didn't mention in the patch description that the third
argument of the tx function is also changed to mean array size rather
than size in number of bytes.
--
David Härdeman
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 07/10] rc-core: use the full 32 bits for NEC scancodes
2011-05-04 15:16 ` Mauro Carvalho Chehab
@ 2011-05-06 9:58 ` David Härdeman
0 siblings, 0 replies; 25+ messages in thread
From: David Härdeman @ 2011-05-06 9:58 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media, jarod
On Wed, 04 May 2011 12:16:17 -0300, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> Em 28-04-2011 12:13, David Härdeman escreveu:
>> Using the full 32 bits for all kinds of NEC scancodes simplifies
rc-core
>> and the nec decoder without any loss of functionality.
>
> This seems to be a good strategy. However, it breaks the existing NEC
> keymap tables (/me is not considering patch 6/10 macros), and changes
> those keytables on userspace. Not sure how to address this.
The in-kernel keymaps is not a problem, they can always be updated in the
same patch. Keytables provided from userspace are a bigger problem.
Perhaps we could check if the set/get ioctl is done with the new
rc-specific
struct (that includes protocol) and assume that the scancode will be in
nec32
if the protocol has been explicitly provided.
This might seem like we're adding a lot of guesswork into rc-core, but I
think
we should/could phase out the use of legacy ioctls over a couple of kernel
versions and the heuristics can then be removed at the same time.
--
David Härdeman
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 00/10] rc-core: my current patchqueue
2011-05-04 15:13 ` Mauro Carvalho Chehab
@ 2011-05-06 10:06 ` David Härdeman
0 siblings, 0 replies; 25+ messages in thread
From: David Härdeman @ 2011-05-06 10:06 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media
On Wed, 04 May 2011 12:13:49 -0300, Mauro Carvalho Chehab
<maurochehab@gmail.com> wrote:
> Em 29-04-2011 05:08, David Härdeman escreveu:
>> diff --git a/drivers/media/rc/keymaps/rc-videomate-s350.c
>> b/drivers/media/rc/keymaps/rc-videomate-s350.c
>> index 26ca260..2f0ec1f 100644
>> --- a/drivers/media/rc/keymaps/rc-videomate-s350.c
>> +++ b/drivers/media/rc/keymaps/rc-videomate-s350.c
>> @@ -13,57 +13,56 @@
>> #include <media/rc-map.h>
>>
>> static struct rc_map_table videomate_s350[] = {
>> - { 0x00, KEY_TV},
...
>> + { RC_TYPE_UNKNOWN, RC_SCANCODE_UNKNOWN(0x00), KEY_TV},
>> };
> However, changes like the above makes the keymaps confusing and breaks
the
> v4l-utils sync scripts without a good reason.
First of all, I've missed that there are v4l-utils sync scripts.
Second of all, I think you can ignore this patch for now. It's actually a
much better idea to keep the rc_map and rc_map_table structs the way they
are (thereby reducing the patch size) and introduce new structs to be used
in rc_dev for maintaining the actual live keytable (and store the
protocol for each scancode in the new struct instead).
That way drivers/media/rc/keymaps/ won't see so much churn.
--
David Härdeman
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 08/10] rc-core: merge rc5 and streamzap decoders
2011-05-04 15:19 ` Mauro Carvalho Chehab
@ 2011-05-06 11:33 ` David Härdeman
0 siblings, 0 replies; 25+ messages in thread
From: David Härdeman @ 2011-05-06 11:33 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media, jarod
On Wed, 04 May 2011 12:19:12 -0300, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> Em 28-04-2011 12:13, David Härdeman escreveu:
>> Now that the protocol is part of the scancode, it is pretty easy to
merge
>> the rc5 and streamzap decoders. An additional advantage is that the
>> decoder
>> is now stricter as it waits for the trailing silence before determining
>> that
>> a command is a valid rc5/streamzap command (which avoids collisions
that
>> I've
>> seen with e.g. Sony protocols).
>
> Makes sense for me.
>
> (FYI, I probably won't be applying any patch after patch 6, due to
> dependency issues).
Feel free to ignore it for now, I'll include it in a refreshed patchset.
--
David Härdeman
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 05/10] rc-core: add separate defines for protocol bitmaps and numbers
2011-05-04 14:56 ` Mauro Carvalho Chehab
@ 2011-05-06 12:23 ` David Härdeman
0 siblings, 0 replies; 25+ messages in thread
From: David Härdeman @ 2011-05-06 12:23 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media, jarod
On Wed, 04 May 2011 11:56:17 -0300, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> Em 28-04-2011 12:13, David Härdeman escreveu:
>> The RC_TYPE_* defines are currently used both where a single protocol
is
>> expected and where a bitmap of protocols is expected. This patch tries
>> to separate the two in preparation for the following patches.
>>
>> Signed-off-by: David Härdeman <david@hardeman.nu>
>
> Most of the patch is just renaming stuff. So, I'm commenting just the
> rc-main.c/rc-map.h changes.
>
>> diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
>> index 5b4422e..5a182b2 100644
>> --- a/drivers/media/rc/rc-main.c
>> +++ b/drivers/media/rc/rc-main.c
>> @@ -102,7 +102,7 @@ static struct rc_map_list empty_map = {
>> .map = {
>> .scan = empty,
>> .size = ARRAY_SIZE(empty),
>> - .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */
>> + .rc_type = RC_BIT_UNKNOWN, /* Legacy IR type */
>> .name = RC_MAP_EMPTY,
>> }
>> };
>> @@ -725,14 +725,17 @@ static struct {
>> u64 type;
>> char *name;
>> } proto_names[] = {
>> - { RC_TYPE_UNKNOWN, "unknown" },
>> - { RC_TYPE_RC5, "rc-5" },
>> - { RC_TYPE_NEC, "nec" },
>> - { RC_TYPE_RC6, "rc-6" },
>> - { RC_TYPE_JVC, "jvc" },
>> - { RC_TYPE_SONY, "sony" },
>> - { RC_TYPE_RC5_SZ, "rc-5-sz" },
>> - { RC_TYPE_LIRC, "lirc" },
>> + { RC_BIT_OTHER, "other" },
>> + { RC_BIT_RC5, "rc-5" },
>> + { RC_BIT_RC5X, "rc-5-x" },
>> + { RC_BIT_RC5_SZ, "rc-5-sz" },
>> + { RC_BIT_RC6, "rc-6" },
>> + { RC_BIT_JVC, "jvc" },
>> + { RC_BIT_SONY12, "sony12" },
>> + { RC_BIT_SONY15, "sony15" },
>> + { RC_BIT_SONY20, "sony20" },
>> + { RC_BIT_NEC, "nec" },
>> + { RC_BIT_LIRC, "lirc" },
>> };
>
> There are some API breakages on the above. We shouln't do it, except
> if strictly required, and, if we'll do it, we need to do it via
> Documentation/feature-removal-schedule.txt.
>
> There are two types of breakages on the above:
> 1) the removal of "unknown" and "sony" types;
We could just keep "unknown" and (optionally) also map "other" to it.
> 2) the behaviour change of "rc-5" (that, currently, means
> both rc-5 and rc-5x.
That's a change but I don't think it'll actually break user-space
since "rc-5" will still be accepted.
> Also, while you've mapped rc5/sony variants, nec variants weren't
mapped.
"nec" needs no mapping with the nec 32-bit scancode change.
> IMO, what we should do on the above is:
> 1) preserve the "unknown";
>
> 2) use "rc-5", "sony", "nec" with the meaning that they will
> enable all variants of those protocols;
>
> 3) add a new set of protocols to indicate subsets, like "sony:20",
> "rc-5:normal", "rc5:x", etc.
I can look into it...
> 4) if you're changing the interface, please submit a patch also
> to v4l-utils, adding a logic there to handle the changes.
I'll look into it when redoing the patches.
>>
>> #define PROTO_NONE "none"
>> diff --git a/include/media/rc-map.h b/include/media/rc-map.h
>> index 9184751..2c68ca6 100644
>> --- a/include/media/rc-map.h
>> +++ b/include/media/rc-map.h
>> @@ -11,19 +11,36 @@
>>
>> #include <linux/input.h>
>>
>> -#define RC_TYPE_UNKNOWN 0
>> -#define RC_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */
>> -#define RC_TYPE_NEC (1 << 1)
>> -#define RC_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */
>> -#define RC_TYPE_JVC (1 << 3) /* JVC protocol */
>> -#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
>> -#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
>> -#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
>> -#define RC_TYPE_OTHER (1u << 31)
>
>> +#define RC_TYPE_UNKNOWN 0 /* Protocol not known */
>> +#define RC_TYPE_OTHER 0 /* Protocol known but proprietary */
>
> This change doesn't make sense: we should either remove other or use
> different bits for different meanings.
I think that it's not necessary. Unknown and other have a
meaningful difference to the programmer but not from a code
point of view. Both mean that whatever scancode we get, we
have to accept as-is and we don't know anything about it.
For e.g. a RC5 scancode we could (though we're not doing it yet)
do sanity-checks on the scancode and set a proper timeout value
based on protocol characteristics. With other and unknown we can't.
That's the reason I merged them - we can't do anything meaningful
with the difference from a code point of view and long term
"unknown" should die (might not happen but...).
> This is somewhat a mess currently, as there
> are, in
> fact, 3 types of "protocols":
> 1) reverse-engineered drivers, where developer didn't care to check
> what was the used protocol. It is there due to legacy IR handlers,
> added before rc-core. The better is to not accept this type anymore
> for new devices;
> 2) Other protocols that don't match at the list of supported protocols.
> Reserved for the cases were the developer took the care to check if
> the protocol is not NEC/RC-5/... and didn't find any protocol that
> matches;
> 3) Standard protocols with broken hardware. In general, keycode tables
> with just 8 bits for RC-5 or NEC, because the hardware uses a cheap
> uC (generally KS007 or similar) that only decodes the last 8 bits of
> the protocol. As the developer didn't have a full IR decoder, he was
> not able to fill the RC/NEC table with the IR address.
>
> The problem with (2) is that it may reflect a temporary state where the
> protocol
> is not yet known. After adding a protocol decoder for it, case (2) turns
> into
> case (1).
>
> So, maybe we can just merge (1) and (2) into the same case: "unknown".
> Maybe we
> should map (3) with a different option, internally (even exporting it as
> "unknown"
> to userspace), as it helps us to identify such cases and fix it later.
I think we should keep the distinction internal.
--
David Härdeman
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 09/10] rc-core: lirc use unsigned int
2011-05-06 9:46 ` David Härdeman
@ 2011-06-11 12:16 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 25+ messages in thread
From: Mauro Carvalho Chehab @ 2011-06-11 12:16 UTC (permalink / raw)
To: David Härdeman; +Cc: linux-media, jarod
Em 06-05-2011 06:46, David Härdeman escreveu:
> On Wed, 04 May 2011 12:23:03 -0300, Mauro Carvalho Chehab
> <mchehab@redhat.com> wrote:
>> Em 28-04-2011 12:13, David Härdeman escreveu:
>>> Durations can never be negative, so it makes sense to consistently use
>>> unsigned int for LIRC transmission. Contrary to the initial impression,
>>> this shouldn't actually change the userspace API.
>>
>> Patch looked ok to me (except for one small issue - see bellow).
>>
> ...
>>> diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
>>> index 569b07b..2b1d2df 100644
>>> --- a/drivers/media/rc/ene_ir.c
>>> +++ b/drivers/media/rc/ene_ir.c
>>> @@ -953,13 +953,13 @@ static void ene_set_idle(struct rc_dev *rdev,
> bool
>>> idle)
>>> }
>>>
>>> /* outside interface: transmit */
>>> -static int ene_transmit(struct rc_dev *rdev, int *buf, u32 n)
>>> +static int ene_transmit(struct rc_dev *rdev, unsigned *buf, unsigned
> n)
>>> {
>>> struct ene_device *dev = rdev->priv;
>>> unsigned long flags;
>>>
>>> dev->tx_buffer = buf;
>>> - dev->tx_len = n / sizeof(int);
>>> + dev->tx_len = n;
>>
>> That hunk seems wrong to me. Or is it a bug fix that you're solving?
>
> My fault, I didn't mention in the patch description that the third
> argument of the tx function is also changed to mean array size rather
> than size in number of bytes.
Sorry for the long delay. Got sidetracked with other things.
Patch applied.
Thanks,
Mauro
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 10/10] rc-core: move timeout and checks to lirc
2011-04-28 15:14 ` [PATCH 10/10] rc-core: move timeout and checks to lirc David Härdeman
@ 2011-09-21 16:40 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 25+ messages in thread
From: Mauro Carvalho Chehab @ 2011-09-21 16:40 UTC (permalink / raw)
To: jarod; +Cc: David Härdeman, linux-media
Em 28-04-2011 12:14, David Härdeman escreveu:
> The lirc TX functionality expects the process which writes (TX) data to
> the lirc dev to sleep until the actual data has been transmitted by the
> hardware.
>
> Since the same timeout calculation is duplicated in more than one driver
> (and would have to be duplicated in even more drivers as they gain TX
> support), it makes sense to move this timeout calculation to the lirc
> layer instead.
>
> At the same time, centralize some of the sanity checks.
This patch[1] were never applied, nor I'm seeing any comments about it
at the ML.
Jarod,
would you care to review it?
Thanks,
Mauro
[1] http://patchwork.linuxtv.org/patch/6468/
>
> Signed-off-by: David Härdeman <david@hardeman.nu>
> ---
> drivers/media/rc/ir-lirc-codec.c | 33 +++++++++++++++++++++++++++++----
> drivers/media/rc/mceusb.c | 18 ------------------
> drivers/media/rc/rc-loopback.c | 12 ------------
> 3 files changed, 29 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
> index ac54139..a58c7fe 100644
> --- a/drivers/media/rc/ir-lirc-codec.c
> +++ b/drivers/media/rc/ir-lirc-codec.c
> @@ -106,6 +106,12 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
> unsigned int *txbuf; /* buffer with values to transmit */
> ssize_t ret = 0;
> size_t count;
> + ktime_t start;
> + s64 towait;
> + unsigned int duration = 0; /* signal duration in us */
> + int i;
> +
> + start = ktime_get();
>
> lirc = lirc_get_pdata(file);
> if (!lirc)
> @@ -128,11 +134,30 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char *buf,
> goto out;
> }
>
> - if (dev->tx_ir)
> - ret = dev->tx_ir(dev, txbuf, count);
> + if (!dev->tx_ir) {
> + ret = -ENOSYS;
> + goto out;
> + }
> +
> + ret = dev->tx_ir(dev, txbuf, (u32)n);
> + if (ret < 0)
> + goto out;
> +
> + for (i = 0; i < ret; i++)
> + duration += txbuf[i];
>
> - if (ret > 0)
> - ret *= sizeof(unsigned);
> + ret *= sizeof(unsigned int);
> +
> + /*
> + * The lircd gap calculation expects the write function to
> + * wait for the actual IR signal to be transmitted before
> + * returning.
> + */
> + towait = ktime_us_delta(ktime_add_us(start, duration), ktime_get());
> + if (towait > 0) {
> + set_current_state(TASK_INTERRUPTIBLE);
> + schedule_timeout(usecs_to_jiffies(towait));
> + }
>
> out:
> kfree(txbuf);
> diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
> index c1cd00d..7b08797 100644
> --- a/drivers/media/rc/mceusb.c
> +++ b/drivers/media/rc/mceusb.c
> @@ -671,10 +671,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
> int i, ret = 0;
> int cmdcount = 0;
> unsigned char *cmdbuf; /* MCE command buffer */
> - long signal_duration = 0; /* Singnal length in us */
> - struct timeval start_time, end_time;
> -
> - do_gettimeofday(&start_time);
>
> cmdbuf = kzalloc(sizeof(unsigned) * MCE_CMDBUF_SIZE, GFP_KERNEL);
> if (!cmdbuf)
> @@ -687,7 +683,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
>
> /* Generate mce packet data */
> for (i = 0; (i < count) && (cmdcount < MCE_CMDBUF_SIZE); i++) {
> - signal_duration += txbuf[i];
> txbuf[i] = txbuf[i] / MCE_TIME_UNIT;
>
> do { /* loop to support long pulses/spaces > 127*50us=6.35ms */
> @@ -730,19 +725,6 @@ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
> /* Transmit the command to the mce device */
> mce_async_out(ir, cmdbuf, cmdcount);
>
> - /*
> - * The lircd gap calculation expects the write function to
> - * wait the time it takes for the ircommand to be sent before
> - * it returns.
> - */
> - do_gettimeofday(&end_time);
> - signal_duration -= (end_time.tv_usec - start_time.tv_usec) +
> - (end_time.tv_sec - start_time.tv_sec) * 1000000;
> -
> - /* delay with the closest number of ticks */
> - set_current_state(TASK_INTERRUPTIBLE);
> - schedule_timeout(usecs_to_jiffies(signal_duration));
> -
> out:
> kfree(cmdbuf);
> return ret ? ret : count;
> diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
> index fb8ca81..5cb7057 100644
> --- a/drivers/media/rc/rc-loopback.c
> +++ b/drivers/media/rc/rc-loopback.c
> @@ -105,18 +105,9 @@ static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
> {
> struct loopback_dev *lodev = dev->priv;
> u32 rxmask;
> - unsigned total_duration = 0;
> unsigned i;
> DEFINE_IR_RAW_EVENT(rawir);
>
> - for (i = 0; i < count; i++)
> - total_duration += abs(txbuf[i]);
> -
> - if (total_duration == 0) {
> - dprintk("invalid tx data, total duration zero\n");
> - return -EINVAL;
> - }
> -
> if (lodev->txcarrier < lodev->rxcarriermin ||
> lodev->txcarrier > lodev->rxcarriermax) {
> dprintk("ignoring tx, carrier out of range\n");
> @@ -148,9 +139,6 @@ static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
> ir_raw_event_handle(dev);
>
> out:
> - /* Lirc expects this function to take as long as the total duration */
> - set_current_state(TASK_INTERRUPTIBLE);
> - schedule_timeout(usecs_to_jiffies(total_duration));
> return count;
> }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2011-09-21 17:33 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28 15:13 [PATCH 00/10] rc-core: my current patchqueue David Härdeman
2011-04-28 15:13 ` [PATCH 01/10] rc-core: int to bool conversion for winbond-cir David Härdeman
2011-04-28 15:13 ` [PATCH 02/10] rc-core: add TX support to the winbond-cir driver David Härdeman
2011-04-28 15:13 ` [PATCH 03/10] rc-core: use ir_raw_event_store_with_filter in winbond-cir David Härdeman
2011-04-28 15:13 ` [PATCH 04/10] rc-core: add trailing silence in rc-loopback tx David Härdeman
2011-04-28 15:13 ` [PATCH 05/10] rc-core: add separate defines for protocol bitmaps and numbers David Härdeman
2011-05-04 14:56 ` Mauro Carvalho Chehab
2011-05-06 12:23 ` David Härdeman
2011-04-28 15:13 ` [PATCH 07/10] rc-core: use the full 32 bits for NEC scancodes David Härdeman
2011-05-04 15:16 ` Mauro Carvalho Chehab
2011-05-06 9:58 ` David Härdeman
2011-04-28 15:13 ` [PATCH 08/10] rc-core: merge rc5 and streamzap decoders David Härdeman
2011-05-04 15:19 ` Mauro Carvalho Chehab
2011-05-06 11:33 ` David Härdeman
2011-04-28 15:13 ` [PATCH 09/10] rc-core: lirc use unsigned int David Härdeman
2011-05-04 15:23 ` Mauro Carvalho Chehab
2011-05-06 9:46 ` David Härdeman
2011-06-11 12:16 ` Mauro Carvalho Chehab
2011-04-28 15:14 ` [PATCH 10/10] rc-core: move timeout and checks to lirc David Härdeman
2011-09-21 16:40 ` Mauro Carvalho Chehab
2011-04-28 20:13 ` [PATCH 00/10] rc-core: my current patchqueue Malcolm Priestley
2011-04-29 8:08 ` David Härdeman
2011-05-04 15:13 ` Mauro Carvalho Chehab
2011-05-06 10:06 ` David Härdeman
2011-05-02 17:58 ` Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).