Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2241293ybl; Thu, 15 Aug 2019 08:41:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9HUxE3OadsqWISCz2T+BI45YTEtsvq3Qh0A2kZnePWiXYeiC4KphFiUiRu8mfIaIZduHA X-Received: by 2002:a17:902:1105:: with SMTP id d5mr4968989pla.197.1565883670911; Thu, 15 Aug 2019 08:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565883670; cv=none; d=google.com; s=arc-20160816; b=vm1VPeFxqqIBr7cirJO95emAb1/jFiUsqngGoB4hcN600g6z0YlUfyCD77knPxsL4g GSVi8efK3ps9NhwUhWbiva2Xc/+ts8LsRBNsW8oIYWjXLoaqtkV2+u/mPhp/bWtkHzuk Fchlhsmj0N4ETCoVKeWUFTk1rZspmPlAEBRNs+e0JHtTXsdvJAVXfLcsbOCffKdp2pTj 9DAlApJWY3QzgvUoGUq8YuFSV2PQzmP86jdm1dlIogaBi2d+LbELlGE7S2Qd/OshiGur daL+mHh5nnOazdjYh1wWlpM778dsB3lg4FBJ0pR8wedgxc5VdoYnyhcVOeWlq5MlxzUG 6Shg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=UHkUgTVsY8cz+zOWGK7293CzmWQflIsAm9CwwafsuFM=; b=Yc2eOlpdMP8sZJxLSsrKQ9yWCSDCAJA3A9NQjotvlHkL9+ibTsW90Qkcv7Z5sQGSsl VDQA/ACCyYAu2no3o418FnAPLgsRSixyDbgwpbL3b8MsdLeU1IZuNx+luSwdWxJPxtHM LQJKKVc2mKZHokcP7/gPDbJmU4OnKYdTvLyIabQZ+wEtyzzlfZnWgvT7f8UPKpz6EQ/a g+nkbVVT8QM0dIRW+K53zeQAIsXxyJA9b1+f2/MTNikB4nRTqE9b/Zux3doqaadOP96f 3wjd/jWMWQqPf8dVhkWW9ui4Eb8NJ9IZ4s56JBgDRn2zjMM+6eYN9LEYsSR6t03XROah egJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Opvs2mJy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j19si2303068pfd.53.2019.08.15.08.40.54; Thu, 15 Aug 2019 08:41:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Opvs2mJy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733270AbfHOPAX (ORCPT + 99 others); Thu, 15 Aug 2019 11:00:23 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35417 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733253AbfHOPAV (ORCPT ); Thu, 15 Aug 2019 11:00:21 -0400 Received: by mail-wr1-f65.google.com with SMTP id k2so2499811wrq.2; Thu, 15 Aug 2019 08:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UHkUgTVsY8cz+zOWGK7293CzmWQflIsAm9CwwafsuFM=; b=Opvs2mJyoL5Woi8Q1kUrH5crbP9W28g2uJZsnyGtcDaGtIozv96Neq39NbzV7P5mnE IZ0uLqBpK/IR/IXh27C3AJh3bPn2BUuMCCSxl+Zuxf+vnmDpLaQT4nM+sYWLJ1pN0xog ZbpEBAnDcZ4tXlwWBuQpfXDka/FpnuaIBQ3cY6G9yTU0plIhGNPo6F2F35VNxk0LO15r C8w5sNQ9IDw2kbZJmsEbsZokMSWeBCct81YyDv63A1llegxnvBTkakj8bMRoIPIJROG0 4IUXnVaecfIFXTgARDoj1qM8MwmrFBPX8xZapf5IuHKDsbSHpSGu/c0Gx6L35RSaEIed bLpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UHkUgTVsY8cz+zOWGK7293CzmWQflIsAm9CwwafsuFM=; b=lhChZ2oOi2sj5S7wyb2+Rx2FLuFz/XdFpQF8wGcZXm4eIUB+6lnbl9xsW6NcYOtgwx qM0dpPsbYeVKvrjnBOgQayiwkJKC/5x+9NPgbB/S42/AD+qfJ8pHKliXPrloKIEkis0m IilR+rGpvk3MJFUWP5dfM+VgbeYg/x8QWTse9MlR9fi2aaf5N4XUrNmSiiM218dwagI2 a+FxgpR8MYsBHifLLCW/xQGjUeUcfjg7lf10TRDa66S+422+/rxSViFQsWN1GNjDVn3c cWiiFWzuMZF8xOe5i/Fs1yYGPhNpL7lBm1rt10KjLI6JyHVn/PbFFbZ2LR/dmorPQpv9 cEHw== X-Gm-Message-State: APjAAAVKd9df+HmYevmIeEyd3QmTegLJSy599GmZxKXHM5qCMU5uEfxW DJFgoltSpmOnGYUmUlmmT8lpvvjBTdx3bg== X-Received: by 2002:adf:f641:: with SMTP id x1mr6105400wrp.179.1565881219095; Thu, 15 Aug 2019 08:00:19 -0700 (PDT) Received: from localhost.localdomain ([94.204.252.234]) by smtp.gmail.com with ESMTPSA id e4sm5041054wrh.39.2019.08.15.08.00.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Aug 2019 08:00:18 -0700 (PDT) From: Christian Hewitt To: Mauro Carvalho Chehab , Benjamin Valentin , Sean Young , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Christian Hewitt Subject: [PATCH 6/7] media: rc: add keymap for WeTeK Play 2 remote Date: Thu, 15 Aug 2019 18:59:16 +0400 Message-Id: <1565881157-14644-7-git-send-email-christianshewitt@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565881157-14644-1-git-send-email-christianshewitt@gmail.com> References: <1565881157-14644-1-git-send-email-christianshewitt@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The WeTek Play 2 Android STB ships with an unusual remote where the main up/down/left/right/enter controls are surrounded with an outer ring of additional keys which are listed in clockwise order. Signed-off-by: Christian Hewitt --- drivers/media/rc/keymaps/Makefile | 1 + drivers/media/rc/keymaps/rc-wetek-play2.c | 95 +++++++++++++++++++++++++++++++ include/media/rc-map.h | 1 + 3 files changed, 97 insertions(+) create mode 100644 drivers/media/rc/keymaps/rc-wetek-play2.c diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 6d744ac..d316a99 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -117,6 +117,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-videomate-s350.o \ rc-videomate-tv-pvr.o \ rc-wetek-hub.o \ + rc-wetek-play2.o \ rc-winfast.o \ rc-winfast-usbii-deluxe.o \ rc-su3000.o \ diff --git a/drivers/media/rc/keymaps/rc-wetek-play2.c b/drivers/media/rc/keymaps/rc-wetek-play2.c new file mode 100644 index 0000000..77504f2 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-wetek-play2.c @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0+ +// +// Copyright (C) 2019 Christian Hewitt + +#include +#include + +// +// Keytable for the WeTek Play 2 STB remote control +// + +static struct rc_map_table wetek_play2[] = { + + { 0x5e5f02, KEY_POWER }, + { 0x5e5f46, KEY_SLEEP }, // tv + { 0x5e5f10, KEY_MUTE }, + + { 0x5e5f22, KEY_1 }, + { 0x5e5f23, KEY_2 }, + { 0x5e5f24, KEY_3 }, + + { 0x5e5f25, KEY_4 }, + { 0x5e5f26, KEY_5 }, + { 0x5e5f27, KEY_6 }, + + { 0x5e5f28, KEY_7 }, + { 0x5e5f29, KEY_8 }, + { 0x5e5f30, KEY_9 }, + + { 0x5e5f71, KEY_BACK }, + { 0x5e5f21, KEY_0 }, + { 0x5e5f72, KEY_CAPSLOCK }, + + // outer ring clockwide from top + { 0x5e5f03, KEY_HOME }, + { 0x5e5f61, KEY_BACK }, + { 0x5e5f77, KEY_CONFIG }, // mouse + { 0x5e5f83, KEY_EPG }, + { 0x5e5f84, KEY_SCREEN }, // square + { 0x5e5f48, KEY_MENU }, + + // inner ring + { 0x5e5f50, KEY_UP }, + { 0x5e5f4b, KEY_DOWN }, + { 0x5e5f4c, KEY_LEFT }, + { 0x5e5f4d, KEY_RIGHT }, + { 0x5e5f47, KEY_OK }, + + { 0x5e5f44, KEY_VOLUMEUP }, + { 0x5e5f43, KEY_VOLUMEDOWN }, + { 0x5e5f4f, KEY_FAVORITES }, + { 0x5e5f82, KEY_SUBTITLE }, // txt + { 0x5e5f41, KEY_PAGEUP }, + { 0x5e5f42, KEY_PAGEDOWN }, + + { 0x5e5f73, KEY_RED }, + { 0x5e5f74, KEY_GREEN }, + { 0x5e5f75, KEY_YELLOW }, + { 0x5e5f76, KEY_BLUE }, + + { 0x5e5f67, KEY_PREVIOUSSONG }, + { 0x5e5f79, KEY_REWIND }, + { 0x5e5f80, KEY_FASTFORWARD }, + { 0x5e5f81, KEY_NEXTSONG }, + + { 0x5e5f04, KEY_RECORD }, + { 0x5e5f2c, KEY_PLAYPAUSE }, + { 0x5e5f2b, KEY_STOP }, + +}; + +static struct rc_map_list wetek_play2_map = { + .map = { + .scan = wetek_play2, + .size = ARRAY_SIZE(wetek_play2), + .rc_proto = RC_PROTO_NEC, + .name = RC_MAP_WETEK_PLAY2, + } +}; + +static int __init init_rc_map_wetek_play2(void) +{ + return rc_map_register(&wetek_play2_map); +} + +static void __exit exit_rc_map_wetek_play2(void) +{ + rc_map_unregister(&wetek_play2_map); +} + +module_init(init_rc_map_wetek_play2) +module_exit(exit_rc_map_wetek_play2) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Christian Hewitt