diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-02-07 15:54:20 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-02-07 15:54:20 -0700 |
commit | 61a695184fcc8f225327206b88320279dd8684af (patch) | |
tree | 6cbda2b0e7de94ebad95072d17cc0aa82c9d8ab3 /drivers/media/rc/ir-rc6-decoder.c | |
parent | 9e05c864993c5442227f83ae1694a737d7a102ed (diff) | |
parent | 581e400ff935d34d95811258586128bf11baef15 (diff) |
Merge branch 'master' into test
* master: (1190 commits)
ASoC: stm32: add of dependency for stm32 drivers
ASoC: mt8173-rt5650: fix child-node lookup
ASoC: dapm: fix debugfs read using path->connected
platform/x86: samsung-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro
platform/x86: ideapad-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro
platform/x86: dell-laptop: Re-use DEFINE_SHOW_ATTRIBUTE() macro
seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro
Documentation/sysctl/user.txt: fix typo
MAINTAINERS: update ARM/QUALCOMM SUPPORT patterns
MAINTAINERS: update various PALM patterns
MAINTAINERS: update "ARM/OXNAS platform support" patterns
MAINTAINERS: update Cortina/Gemini patterns
MAINTAINERS: remove ARM/CLKDEV SUPPORT file pattern
MAINTAINERS: remove ANDROID ION pattern
mm: docs: add blank lines to silence sphinx "Unexpected indentation" errors
mm: docs: fix parameter names mismatch
mm: docs: fixup punctuation
pipe: read buffer limits atomically
pipe: simplify round_pipe_size()
pipe: reject F_SETPIPE_SZ with size over UINT_MAX
...
Diffstat (limited to 'drivers/media/rc/ir-rc6-decoder.c')
-rw-r--r-- | drivers/media/rc/ir-rc6-decoder.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c index 5d0d2fe3b7a7..55bb19bbd4e9 100644 --- a/drivers/media/rc/ir-rc6-decoder.c +++ b/drivers/media/rc/ir-rc6-decoder.c @@ -288,13 +288,8 @@ out: static const struct ir_raw_timings_manchester ir_rc6_timings[4] = { { - .leader = RC6_PREFIX_PULSE, - .pulse_space_start = 0, - .clock = RC6_UNIT, - .invert = 1, - .trailer_space = RC6_PREFIX_SPACE, - }, - { + .leader_pulse = RC6_PREFIX_PULSE, + .leader_space = RC6_PREFIX_SPACE, .clock = RC6_UNIT, .invert = 1, }, @@ -329,27 +324,22 @@ static int ir_rc6_encode(enum rc_proto protocol, u32 scancode, struct ir_raw_event *e = events; if (protocol == RC_PROTO_RC6_0) { - /* Modulate the preamble */ - ret = ir_raw_gen_manchester(&e, max, &ir_rc6_timings[0], 0, 0); - if (ret < 0) - return ret; - /* Modulate the header (Start Bit & Mode-0) */ ret = ir_raw_gen_manchester(&e, max - (e - events), - &ir_rc6_timings[1], + &ir_rc6_timings[0], RC6_HEADER_NBITS, (1 << 3)); if (ret < 0) return ret; /* Modulate Trailer Bit */ ret = ir_raw_gen_manchester(&e, max - (e - events), - &ir_rc6_timings[2], 1, 0); + &ir_rc6_timings[1], 1, 0); if (ret < 0) return ret; /* Modulate rest of the data */ ret = ir_raw_gen_manchester(&e, max - (e - events), - &ir_rc6_timings[3], RC6_0_NBITS, + &ir_rc6_timings[2], RC6_0_NBITS, scancode); if (ret < 0) return ret; @@ -372,27 +362,22 @@ static int ir_rc6_encode(enum rc_proto protocol, u32 scancode, return -EINVAL; } - /* Modulate the preamble */ - ret = ir_raw_gen_manchester(&e, max, &ir_rc6_timings[0], 0, 0); - if (ret < 0) - return ret; - /* Modulate the header (Start Bit & Header-version 6 */ ret = ir_raw_gen_manchester(&e, max - (e - events), - &ir_rc6_timings[1], + &ir_rc6_timings[0], RC6_HEADER_NBITS, (1 << 3 | 6)); if (ret < 0) return ret; /* Modulate Trailer Bit */ ret = ir_raw_gen_manchester(&e, max - (e - events), - &ir_rc6_timings[2], 1, 0); + &ir_rc6_timings[1], 1, 0); if (ret < 0) return ret; /* Modulate rest of the data */ ret = ir_raw_gen_manchester(&e, max - (e - events), - &ir_rc6_timings[3], + &ir_rc6_timings[2], bits, scancode); if (ret < 0) @@ -408,6 +393,7 @@ static struct ir_raw_handler rc6_handler = { RC_PROTO_BIT_RC6_MCE, .decode = ir_rc6_decode, .encode = ir_rc6_encode, + .carrier = 36000, }; static int __init ir_rc6_decode_init(void) |