mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Zhang Ning <zhangn1985@qq.com>
Cc: martin.blumenstingl@googlemail.com, narmstrong@baylibre.com,
	linux-amlogic@lists.infradead.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org,
	linux-media@vger.kernel.org
Subject: Re: [v5 2/4] media: rc: add keymap for MagicBox M16S remote
Date: Tue, 26 Jul 2022 08:42:48 +0100	[thread overview]
Message-ID: <Yt+a+N1BJ+AZqPRt@gofer.mess.org> (raw)
In-Reply-To: <tencent_5AC39B81CB85E258763BA8CD8774E9045806@qq.com>

On Mon, Jul 25, 2022 at 07:17:02AM +0800, Zhang Ning wrote:
> MagicBox M16S Tv box shipped with a simple NEC remote.
> it has a key labeled "M", used as Magic key in vendor OS.
> This has mapped to KEY_MUTE.

Please put this commit in the source code next to the key definition.
This doesn't belong in the commit message.

Thanks
Sean

> 
> Signed-off-by: Zhang Ning <zhangn1985@qq.com>
> ---
>  drivers/media/rc/keymaps/Makefile      |  1 +
>  drivers/media/rc/keymaps/rc-magicbox.c | 53 ++++++++++++++++++++++++++
>  include/media/rc-map.h                 |  1 +
>  3 files changed, 55 insertions(+)
>  create mode 100644 drivers/media/rc/keymaps/rc-magicbox.c
> 
> diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
> index f513ff5caf4e..02c1c2150f03 100644
> --- a/drivers/media/rc/keymaps/Makefile
> +++ b/drivers/media/rc/keymaps/Makefile
> @@ -71,6 +71,7 @@ obj-$(CONFIG_RC_MAP) += \
>  			rc-kworld-plus-tv-analog.o \
>  			rc-leadtek-y04g0051.o \
>  			rc-lme2510.o \
> +			rc-magicbox.o \
>  			rc-manli.o \
>  			rc-mecool-kiii-pro.o \
>  			rc-mecool-kii-pro.o \
> diff --git a/drivers/media/rc/keymaps/rc-magicbox.c b/drivers/media/rc/keymaps/rc-magicbox.c
> new file mode 100644
> index 000000000000..b4fc1856a9e7
> --- /dev/null
> +++ b/drivers/media/rc/keymaps/rc-magicbox.c
> @@ -0,0 +1,53 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +//
> +// Copyright (C) 2022 Zhang Ning <zhangn1985@qq.com>
> +
> +/*
> + * Keytable for the MagicBox M16S remote control
> + */
> +
> +#include <media/rc-map.h>
> +#include <linux/module.h>
> +
> +static struct rc_map_table magicbox[] = {
> +	{ 0x9f57, KEY_POWER },
> +	{ 0x9f8a, KEY_MUTE }, // M
> +
> +	{ 0x9f43, KEY_UP },
> +	{ 0x9f0a, KEY_DOWN },
> +	{ 0x9f06, KEY_LEFT },
> +	{ 0x9f0e, KEY_RIGHT },
> +	{ 0x9f02, KEY_OK },
> +
> +	{ 0x9f47, KEY_HOME },
> +	{ 0x9f4f, KEY_BACK },
> +	{ 0x9f16, KEY_MENU },
> +
> +	{ 0x9fff, KEY_VOLUMEDOWN },
> +	{ 0x9f5d, KEY_VOLUMEUP },
> +};
> +
> +static struct rc_map_list magicbox_map = {
> +	.map = {
> +		.scan     = magicbox,
> +		.size     = ARRAY_SIZE(magicbox),
> +		.rc_proto = RC_PROTO_NEC,
> +		.name     = RC_MAP_MAGICBOX,
> +	}
> +};
> +
> +static int __init init_rc_map_magicbox(void)
> +{
> +	return rc_map_register(&magicbox_map);
> +}
> +
> +static void __exit exit_rc_map_magicbox(void)
> +{
> +	rc_map_unregister(&magicbox_map);
> +}
> +
> +module_init(init_rc_map_magicbox)
> +module_exit(exit_rc_map_magicbox)
> +
> +MODULE_LICENSE("GPL");
> +MODULE_AUTHOR("Zhang Ning <zhangn1985@qq.com>");
> diff --git a/include/media/rc-map.h b/include/media/rc-map.h
> index 793b54342dff..656217b8e91b 100644
> --- a/include/media/rc-map.h
> +++ b/include/media/rc-map.h
> @@ -277,6 +277,7 @@ struct rc_map *rc_map_get(const char *name);
>  #define RC_MAP_KWORLD_PLUS_TV_ANALOG     "rc-kworld-plus-tv-analog"
>  #define RC_MAP_LEADTEK_Y04G0051          "rc-leadtek-y04g0051"
>  #define RC_MAP_LME2510                   "rc-lme2510"
> +#define RC_MAP_MAGICBOX                  "rc-magicbox"
>  #define RC_MAP_MANLI                     "rc-manli"
>  #define RC_MAP_MECOOL_KII_PRO            "rc-mecool-kii-pro"
>  #define RC_MAP_MECOOL_KIII_PRO           "rc-mecool-kiii-pro"
> -- 
> 2.35.1

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2022-07-26  7:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220724231704.132472-1-zhangn1985@qq.com>
2022-07-24 23:17 ` [v5 1/4] " Zhang Ning
2022-07-26  0:31   ` Zhang Ning
2022-07-24 23:17 ` [v5 2/4] " Zhang Ning
2022-07-26  7:42   ` Sean Young [this message]
2022-07-26  8:53     ` Zhang Ning
2022-07-24 23:17 ` [v5 3/4] dt-bindings: arm: add Magicbox M16S bindings Zhang Ning
2022-07-25 16:31   ` Krzysztof Kozlowski
2022-07-26  0:00     ` Zhang Ning
2022-07-24 23:17 ` [v5 4/4] arm64: dts: meson: Add MagicBox M16S support Zhang Ning
2022-07-25 16:32   ` Krzysztof Kozlowski
2022-07-26  0:04     ` Zhang Ning
2022-07-26  6:48       ` Krzysztof Kozlowski
2022-07-26  8:51         ` Zhang Ning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yt+a+N1BJ+AZqPRt@gofer.mess.org \
    --to=sean@mess.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=zhangn1985@qq.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®