Skip to content

Commit

Permalink
[media] rc5x: document that this is the 20 bit variant
Browse files Browse the repository at this point in the history
There are many variants of extended rc5. This implements the 20 bit
version.

Signed-off-by: Sean Young <[email protected]>
Cc: David Härdeman <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
seanyoung authored and mchehab committed Jan 30, 2017
1 parent fd844d9 commit 0fcd3f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions drivers/media/rc/ir-rc5-decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (data->is_rc5x && data->count == RC5X_NBITS) {
/* RC5X */
u8 xdata, command, system;
if (!(dev->enabled_protocols & RC_BIT_RC5X)) {
if (!(dev->enabled_protocols & RC_BIT_RC5X_20)) {
data->state = STATE_INACTIVE;
return 0;
}
Expand All @@ -134,7 +134,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
toggle = (data->bits & 0x20000) ? 1 : 0;
command += (data->bits & 0x40000) ? 0 : 0x40;
scancode = system << 16 | command << 8 | xdata;
protocol = RC_TYPE_RC5X;
protocol = RC_TYPE_RC5X_20;

} else if (!data->is_rc5x && data->count == RC5_NBITS) {
/* RC5 */
Expand Down Expand Up @@ -182,7 +182,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
}

static struct ir_raw_handler rc5_handler = {
.protocols = RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ,
.protocols = RC_BIT_RC5 | RC_BIT_RC5X_20 | RC_BIT_RC5_SZ,
.decode = ir_rc5_decode,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/rc/rc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ static const struct {
{ RC_BIT_OTHER, "other", NULL },
{ RC_BIT_UNKNOWN, "unknown", NULL },
{ RC_BIT_RC5 |
RC_BIT_RC5X, "rc-5", "ir-rc5-decoder" },
RC_BIT_RC5X_20, "rc-5", "ir-rc5-decoder" },
{ RC_BIT_NEC |
RC_BIT_NECX |
RC_BIT_NEC32, "nec", "ir-nec-decoder" },
Expand Down
8 changes: 4 additions & 4 deletions include/media/rc-map.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @RC_TYPE_UNKNOWN: Protocol not known
* @RC_TYPE_OTHER: Protocol known but proprietary
* @RC_TYPE_RC5: Philips RC5 protocol
* @RC_TYPE_RC5X: Philips RC5x protocol
* @RC_TYPE_RC5X_20: Philips RC5x 20 bit protocol
* @RC_TYPE_RC5_SZ: StreamZap variant of RC5
* @RC_TYPE_JVC: JVC protocol
* @RC_TYPE_SONY12: Sony 12 bit protocol
Expand All @@ -41,7 +41,7 @@ enum rc_type {
RC_TYPE_UNKNOWN = 0,
RC_TYPE_OTHER = 1,
RC_TYPE_RC5 = 2,
RC_TYPE_RC5X = 3,
RC_TYPE_RC5X_20 = 3,
RC_TYPE_RC5_SZ = 4,
RC_TYPE_JVC = 5,
RC_TYPE_SONY12 = 6,
Expand All @@ -66,7 +66,7 @@ enum rc_type {
#define RC_BIT_UNKNOWN (1ULL << RC_TYPE_UNKNOWN)
#define RC_BIT_OTHER (1ULL << RC_TYPE_OTHER)
#define RC_BIT_RC5 (1ULL << RC_TYPE_RC5)
#define RC_BIT_RC5X (1ULL << RC_TYPE_RC5X)
#define RC_BIT_RC5X_20 (1ULL << RC_TYPE_RC5X_20)
#define RC_BIT_RC5_SZ (1ULL << RC_TYPE_RC5_SZ)
#define RC_BIT_JVC (1ULL << RC_TYPE_JVC)
#define RC_BIT_SONY12 (1ULL << RC_TYPE_SONY12)
Expand All @@ -87,7 +87,7 @@ enum rc_type {
#define RC_BIT_CEC (1ULL << RC_TYPE_CEC)

#define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | \
RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \
RC_BIT_RC5 | RC_BIT_RC5X_20 | RC_BIT_RC5_SZ | \
RC_BIT_JVC | \
RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \
RC_BIT_NEC | RC_BIT_NECX | RC_BIT_NEC32 | \
Expand Down

0 comments on commit 0fcd3f0

Please sign in to comment.