From patchwork Tue Jul 17 21:33:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 10530767 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 4100860247 for ; Tue, 17 Jul 2018 21:33:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35E98280B0 for ; Tue, 17 Jul 2018 21:33:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29FCA29578; Tue, 17 Jul 2018 21:33:10 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 8D247280B0 for ; Tue, 17 Jul 2018 21:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730598AbeGQWHm (ORCPT ); Tue, 17 Jul 2018 18:07:42 -0400 Received: from gofer.mess.org ([88.97.38.141]:55805 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729754AbeGQWHl (ORCPT ); Tue, 17 Jul 2018 18:07:41 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 10F5C601FD; Tue, 17 Jul 2018 22:33:07 +0100 (BST) From: Sean Young To: linux-media@vger.kernel.org Subject: [PATCH v4l-utils] ir-ctl: make nec32 scancode encoding match kernel Date: Tue, 17 Jul 2018 22:33:04 +0100 Message-Id: <20180717213306.22799-1-sean@mess.org> X-Mailer: git-send-email 2.11.0 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 For the nec32 encoding, the kernel swaps in the "inverted" and normal address and command. This might not be the most logical scheme. Signed-off-by: Sean Young --- utils/common/ir-encode.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/utils/common/ir-encode.c b/utils/common/ir-encode.c index c7e319eb..ccc75032 100644 --- a/utils/common/ir-encode.c +++ b/utils/common/ir-encode.c @@ -64,15 +64,10 @@ static int nec_encode(enum rc_proto proto, unsigned scancode, unsigned *buf) add_byte(~scancode); break; case RC_PROTO_NEC32: - /* - * At the time of writing kernel software nec decoder - * reverses the bit order so it will not match. Hardware - * decoders do not have this issue. - */ - add_byte(scancode >> 24); add_byte(scancode >> 16); - add_byte(scancode >> 8); + add_byte(scancode >> 24); add_byte(scancode); + add_byte(scancode >> 8); break; }