From patchwork Fri Dec 2 17:20:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 9458921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17D9260756 for ; Fri, 2 Dec 2016 17:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F361F28590 for ; Fri, 2 Dec 2016 17:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2FBB28597; Fri, 2 Dec 2016 17:20:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E9F828590 for ; Fri, 2 Dec 2016 17:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbcLBRUX (ORCPT ); Fri, 2 Dec 2016 12:20:23 -0500 Received: from gofer.mess.org ([80.229.237.210]:34609 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbcLBRUW (ORCPT ); Fri, 2 Dec 2016 12:20:22 -0500 Received: by gofer.mess.org (Postfix, from userid 1000) id 5687E60461; Fri, 2 Dec 2016 17:20:21 +0000 (GMT) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH v4l-utils 2/6] ir-ctl: fix rc5x encoding Date: Fri, 2 Dec 2016 17:20:17 +0000 Message-Id: <1480699221-9267-2-git-send-email-sean@mess.org> X-Mailer: git-send-email 2.1.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 6th command bit was missing. Signed-off-by: Sean Young --- utils/ir-ctl/ir-encode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/ir-ctl/ir-encode.c b/utils/ir-ctl/ir-encode.c index 1bf0ac6..704ce95 100644 --- a/utils/ir-ctl/ir-encode.c +++ b/utils/ir-ctl/ir-encode.c @@ -261,7 +261,7 @@ static int rc5_encode(enum rc_proto proto, unsigned scancode, unsigned *buf) add_bits(scancode, 6); break; case RC_PROTO_RC5X: - add_bits(!!(scancode & 0x4000), 1); + add_bits(!(scancode & 0x4000), 1); add_bits(0, 1); add_bits(scancode >> 16, 5); advance_space(NS_TO_US(rc5_unit * 4)); @@ -350,7 +350,7 @@ static const struct { int (*encode)(enum rc_proto proto, unsigned scancode, unsigned *buf); } encoders[RC_PROTO_COUNT] = { [RC_PROTO_RC5] = { "rc5", 0x1f3f, 24, 36000, rc5_encode }, - [RC_PROTO_RC5X] = { "rc5x", 0x1f3f3f, 40, 36000, rc5_encode }, + [RC_PROTO_RC5X] = { "rc5x", 0x1f7f3f, 40, 36000, rc5_encode }, [RC_PROTO_RC5_SZ] = { "rc5_sz", 0x2fff, 26, 36000, rc5_encode }, [RC_PROTO_SONY12] = { "sony12", 0x1f007f, 25, 40000, sony_encode }, [RC_PROTO_SONY15] = { "sony15", 0xff007f, 31, 40000, sony_encode },