mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [v5 1/4] media: rc: add keymap for MagicBox M16S remote
       [not found] <20220724231704.132472-1-zhangn1985@qq.com>
@ 2022-07-24 23:17 ` Zhang Ning
  2022-07-26  0:31   ` Zhang Ning
  2022-07-24 23:17 ` [v5 2/4] " Zhang Ning
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Zhang Ning @ 2022-07-24 23:17 UTC (permalink / raw)
  To: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media
  Cc: Zhang Ning

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.

Signed-off-by: Zhang Ning <zhangn1985@qq.com>
---
 Documentation/devicetree/bindings/media/rc.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/rc.yaml b/Documentation/devicetree/bindings/media/rc.yaml
index d4c541c4b164..6491d1bdbac7 100644
--- a/Documentation/devicetree/bindings/media/rc.yaml
+++ b/Documentation/devicetree/bindings/media/rc.yaml
@@ -90,6 +90,7 @@ properties:
       - rc-kworld-plus-tv-analog
       - rc-leadtek-y04g0051
       - rc-lme2510
+      - rc-magicbox
       - rc-manli
       - rc-mecool-kii-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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [v5 2/4] media: rc: add keymap for MagicBox M16S remote
       [not found] <20220724231704.132472-1-zhangn1985@qq.com>
  2022-07-24 23:17 ` [v5 1/4] media: rc: add keymap for MagicBox M16S remote Zhang Ning
@ 2022-07-24 23:17 ` Zhang Ning
  2022-07-26  7:42   ` Sean Young
  2022-07-24 23:17 ` [v5 3/4] dt-bindings: arm: add Magicbox M16S bindings Zhang Ning
  2022-07-24 23:17 ` [v5 4/4] arm64: dts: meson: Add MagicBox M16S support Zhang Ning
  3 siblings, 1 reply; 13+ messages in thread
From: Zhang Ning @ 2022-07-24 23:17 UTC (permalink / raw)
  To: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media
  Cc: Zhang Ning

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.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [v5 3/4] dt-bindings: arm: add Magicbox M16S bindings
       [not found] <20220724231704.132472-1-zhangn1985@qq.com>
  2022-07-24 23:17 ` [v5 1/4] media: rc: add keymap for MagicBox M16S remote Zhang Ning
  2022-07-24 23:17 ` [v5 2/4] " Zhang Ning
@ 2022-07-24 23:17 ` Zhang Ning
  2022-07-25 16:31   ` Krzysztof Kozlowski
  2022-07-24 23:17 ` [v5 4/4] arm64: dts: meson: Add MagicBox M16S support Zhang Ning
  3 siblings, 1 reply; 13+ messages in thread
From: Zhang Ning @ 2022-07-24 23:17 UTC (permalink / raw)
  To: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media
  Cc: Zhang Ning

Add the board binding for Magicbox M16S Tv Box

Signed-off-by: Zhang Ning <zhangn1985@qq.com>
---
 Documentation/devicetree/bindings/arm/amlogic.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/amlogic.yaml b/Documentation/devicetree/bindings/arm/amlogic.yaml
index 61a6cabb375b..3eac16a4de68 100644
--- a/Documentation/devicetree/bindings/arm/amlogic.yaml
+++ b/Documentation/devicetree/bindings/arm/amlogic.yaml
@@ -123,6 +123,7 @@ properties:
               - khadas,vim2
               - kingnovel,r-box-pro
               - libretech,aml-s912-pc
+              - magicbox,m16s
               - minix,neo-u9h
               - nexbox,a1
               - tronsmart,vega-s96
-- 
2.35.1



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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [v5 4/4] arm64: dts: meson: Add MagicBox M16S support
       [not found] <20220724231704.132472-1-zhangn1985@qq.com>
                   ` (2 preceding siblings ...)
  2022-07-24 23:17 ` [v5 3/4] dt-bindings: arm: add Magicbox M16S bindings Zhang Ning
@ 2022-07-24 23:17 ` Zhang Ning
  2022-07-25 16:32   ` Krzysztof Kozlowski
  3 siblings, 1 reply; 13+ messages in thread
From: Zhang Ning @ 2022-07-24 23:17 UTC (permalink / raw)
  To: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media
  Cc: Zhang Ning

MagicBox M16S or MagicBox 3Pro is popular Tv box in China.
with spec:

 - Amlogic S912-H (S912 with dolby and dts)
 - 2G ddr3
 - 16G emmc
 - Marvell sd8897 BT/wifi module
 - 100M ethernet
 - IR reciever
 - 4K HDMI
 - AV out
 - Rest hole
 - 5V2A power input
 - white LED

it's q201_v1 according u-boot log.
and it's almost same as Q201 reference design.

add a simple dts to support this Tv box.

Signed-off-by: Zhang Ning <zhangn1985@qq.com>
---
 arch/arm64/boot/dts/amlogic/Makefile          |  1 +
 .../dts/amlogic/meson-gxm-magicbox-m16s.dts   | 40 +++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts

diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
index 8773211df50e..e0907fb41829 100644
--- a/arch/arm64/boot/dts/amlogic/Makefile
+++ b/arch/arm64/boot/dts/amlogic/Makefile
@@ -44,6 +44,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb
+dtb-$(CONFIG_ARCH_MESON) += meson-gxm-magicbox-m16s.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-mecool-kiii-pro.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-minix-neo-u9h.dtb
 dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
new file mode 100644
index 000000000000..69e72687ac9c
--- /dev/null
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
+ */
+
+/dts-v1/;
+
+#include "meson-gxm.dtsi"
+#include "meson-gx-p23x-q20x.dtsi"
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
+	model = "MagicBox M16S";
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <100>;
+
+		button-power {
+			label = "power";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+&ethmac {
+        phy-mode = "rmii";
+        phy-handle = <&internal_phy>;
+};
+
+&sdio_pwrseq {
+	reset-gpios = <&gpio GPIODV_2 GPIO_ACTIVE_LOW>;
+};
+
+&ir {
+        linux,rc-map-name = "rc-magicbox";
+};
-- 
2.35.1


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 3/4] dt-bindings: arm: add Magicbox M16S bindings
  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
  0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-25 16:31 UTC (permalink / raw)
  To: Zhang Ning, martin.blumenstingl, narmstrong, linux-amlogic,
	robh+dt, krzysztof.kozlowski+dt, sean, devicetree, linux-media

On 25/07/2022 01:17, Zhang Ning wrote:
> Add the board binding for Magicbox M16S Tv Box
> 
> Signed-off-by: Zhang Ning <zhangn1985@qq.com>

Don't forget proper mail titles (PATCH and prefix). git format-patch
solves the first, git log --oneline gives you hint about second. So this
should be:

[PATCH v5 3/4] dt-bindings: arm: amlogic: add Magicbox M16S bindings

> ---
>  Documentation/devicetree/bindings/arm/amlogic.yaml | 1 +


Best regards,
Krzysztof

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 4/4] arm64: dts: meson: Add MagicBox M16S support
  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
  0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-25 16:32 UTC (permalink / raw)
  To: Zhang Ning, martin.blumenstingl, narmstrong, linux-amlogic,
	robh+dt, krzysztof.kozlowski+dt, sean, devicetree, linux-media

On 25/07/2022 01:17, Zhang Ning wrote:
> MagicBox M16S or MagicBox 3Pro is popular Tv box in China.
> with spec:
> 
>  - Amlogic S912-H (S912 with dolby and dts)
>  - 2G ddr3
>  - 16G emmc
>  - Marvell sd8897 BT/wifi module
>  - 100M ethernet
>  - IR reciever
>  - 4K HDMI
>  - AV out
>  - Rest hole
>  - 5V2A power input
>  - white LED
> 
> it's q201_v1 according u-boot log.
> and it's almost same as Q201 reference design.
> 
> add a simple dts to support this Tv box.
> 
> Signed-off-by: Zhang Ning <zhangn1985@qq.com>
> ---
>  arch/arm64/boot/dts/amlogic/Makefile          |  1 +
>  .../dts/amlogic/meson-gxm-magicbox-m16s.dts   | 40 +++++++++++++++++++
>  2 files changed, 41 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> 
> diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
> index 8773211df50e..e0907fb41829 100644
> --- a/arch/arm64/boot/dts/amlogic/Makefile
> +++ b/arch/arm64/boot/dts/amlogic/Makefile
> @@ -44,6 +44,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb
> +dtb-$(CONFIG_ARCH_MESON) += meson-gxm-magicbox-m16s.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-mecool-kiii-pro.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-minix-neo-u9h.dtb
>  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> new file mode 100644
> index 000000000000..69e72687ac9c
> --- /dev/null
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> @@ -0,0 +1,40 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
> + */
> +
> +/dts-v1/;
> +
> +#include "meson-gxm.dtsi"
> +#include "meson-gx-p23x-q20x.dtsi"
> +#include <dt-bindings/input/input.h>
> +
> +/ {
> +	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
> +	model = "MagicBox M16S";
> +
> +	gpio-keys-polled {

Just gpio-keys (or even "keys").

> +		compatible = "gpio-keys-polled";
> +		#address-cells = <1>;
> +		#size-cells = <0>;

Address/size cells are not correct.

> +		poll-interval = <100>;
> +
> +		button-power {
> +			label = "power";
> +			linux,code = <KEY_POWER>;
> +			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +};

Missing blank line.

> +&ethmac {


Best regards,
Krzysztof

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 3/4] dt-bindings: arm: add Magicbox M16S bindings
  2022-07-25 16:31   ` Krzysztof Kozlowski
@ 2022-07-26  0:00     ` Zhang Ning
  0 siblings, 0 replies; 13+ messages in thread
From: Zhang Ning @ 2022-07-26  0:00 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media

On Mon, Jul 25, 2022 at 06:31:08PM +0200, Krzysztof Kozlowski wrote:
> On 25/07/2022 01:17, Zhang Ning wrote:
> > Add the board binding for Magicbox M16S Tv Box
> > 
> > Signed-off-by: Zhang Ning <zhangn1985@qq.com>
> 
> Don't forget proper mail titles (PATCH and prefix). git format-patch
> solves the first, git log --oneline gives you hint about second. So this
> should be:
> 
> [PATCH v5 3/4] dt-bindings: arm: amlogic: add Magicbox M16S bindings

Thank you, I will update it in next version.
> 
> > ---
> >  Documentation/devicetree/bindings/arm/amlogic.yaml | 1 +
> 
> 
> Best regards,
> Krzysztof

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 4/4] arm64: dts: meson: Add MagicBox M16S support
  2022-07-25 16:32   ` Krzysztof Kozlowski
@ 2022-07-26  0:04     ` Zhang Ning
  2022-07-26  6:48       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 13+ messages in thread
From: Zhang Ning @ 2022-07-26  0:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media

On Mon, Jul 25, 2022 at 06:32:17PM +0200, Krzysztof Kozlowski wrote:
> On 25/07/2022 01:17, Zhang Ning wrote:
> > MagicBox M16S or MagicBox 3Pro is popular Tv box in China.
> > with spec:
> > 
> >  - Amlogic S912-H (S912 with dolby and dts)
> >  - 2G ddr3
> >  - 16G emmc
> >  - Marvell sd8897 BT/wifi module
> >  - 100M ethernet
> >  - IR reciever
> >  - 4K HDMI
> >  - AV out
> >  - Rest hole
> >  - 5V2A power input
> >  - white LED
> > 
> > it's q201_v1 according u-boot log.
> > and it's almost same as Q201 reference design.
> > 
> > add a simple dts to support this Tv box.
> > 
> > Signed-off-by: Zhang Ning <zhangn1985@qq.com>
> > ---
> >  arch/arm64/boot/dts/amlogic/Makefile          |  1 +
> >  .../dts/amlogic/meson-gxm-magicbox-m16s.dts   | 40 +++++++++++++++++++
> >  2 files changed, 41 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> > 
> > diff --git a/arch/arm64/boot/dts/amlogic/Makefile b/arch/arm64/boot/dts/amlogic/Makefile
> > index 8773211df50e..e0907fb41829 100644
> > --- a/arch/arm64/boot/dts/amlogic/Makefile
> > +++ b/arch/arm64/boot/dts/amlogic/Makefile
> > @@ -44,6 +44,7 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-libretech-cc.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-nexbox-a95x.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxl-s905x-p212.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-khadas-vim2.dtb
> > +dtb-$(CONFIG_ARCH_MESON) += meson-gxm-magicbox-m16s.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-mecool-kiii-pro.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-minix-neo-u9h.dtb
> >  dtb-$(CONFIG_ARCH_MESON) += meson-gxm-nexbox-a1.dtb
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> > new file mode 100644
> > index 000000000000..69e72687ac9c
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> > @@ -0,0 +1,40 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +/*
> > + * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
> > + */
> > +
> > +/dts-v1/;
> > +
> > +#include "meson-gxm.dtsi"
> > +#include "meson-gx-p23x-q20x.dtsi"
> > +#include <dt-bindings/input/input.h>
> > +
> > +/ {
> > +	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
> > +	model = "MagicBox M16S";
> > +
> > +	gpio-keys-polled {
> 
> Just gpio-keys (or even "keys").
I see all dts for amlogic platform are using gpio-keys-polled, could I
keep current name?
> 
> > +		compatible = "gpio-keys-polled";
> > +		#address-cells = <1>;
> > +		#size-cells = <0>;
> 
> Address/size cells are not correct.
Yes, this has been already pointed out in V3's review, but I forgot to
delete these 2 lines.
thank you review it again.

> 
> > +		poll-interval = <100>;
> > +
> > +		button-power {
> > +			label = "power";
> > +			linux,code = <KEY_POWER>;
> > +			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
> > +		};
> > +	};
> > +};
> 
> Missing blank line.
thank you, will add it in next version.
> 
> > +&ethmac {
> 
> 
> Best regards,
> Krzysztof

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 1/4] media: rc: add keymap for MagicBox M16S remote
  2022-07-24 23:17 ` [v5 1/4] media: rc: add keymap for MagicBox M16S remote Zhang Ning
@ 2022-07-26  0:31   ` Zhang Ning
  0 siblings, 0 replies; 13+ messages in thread
From: Zhang Ning @ 2022-07-26  0:31 UTC (permalink / raw)
  To: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media

I will change the title to:

dt-bindings: media: rc: add keymap for MagicBox M16S remote

next version.

On Mon, Jul 25, 2022 at 07:17:01AM +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.
> 
> Signed-off-by: Zhang Ning <zhangn1985@qq.com>
> ---
>  Documentation/devicetree/bindings/media/rc.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/rc.yaml b/Documentation/devicetree/bindings/media/rc.yaml
> index d4c541c4b164..6491d1bdbac7 100644
> --- a/Documentation/devicetree/bindings/media/rc.yaml
> +++ b/Documentation/devicetree/bindings/media/rc.yaml
> @@ -90,6 +90,7 @@ properties:
>        - rc-kworld-plus-tv-analog
>        - rc-leadtek-y04g0051
>        - rc-lme2510
> +      - rc-magicbox
>        - rc-manli
>        - rc-mecool-kii-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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 4/4] arm64: dts: meson: Add MagicBox M16S support
  2022-07-26  0:04     ` Zhang Ning
@ 2022-07-26  6:48       ` Krzysztof Kozlowski
  2022-07-26  8:51         ` Zhang Ning
  0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-26  6:48 UTC (permalink / raw)
  To: Zhang Ning
  Cc: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media

On 26/07/2022 02:04, Zhang Ning wrote:

>>> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
>>> @@ -0,0 +1,40 @@
>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>> +/*
>>> + * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
>>> + */
>>> +
>>> +/dts-v1/;
>>> +
>>> +#include "meson-gxm.dtsi"
>>> +#include "meson-gx-p23x-q20x.dtsi"
>>> +#include <dt-bindings/input/input.h>
>>> +
>>> +/ {
>>> +	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
>>> +	model = "MagicBox M16S";
>>> +
>>> +	gpio-keys-polled {
>>
>> Just gpio-keys (or even "keys").
> I see all dts for amlogic platform are using gpio-keys-polled, could I
> keep current name?

Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation


Best regards,
Krzysztof

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 2/4] media: rc: add keymap for MagicBox M16S remote
  2022-07-24 23:17 ` [v5 2/4] " Zhang Ning
@ 2022-07-26  7:42   ` Sean Young
  2022-07-26  8:53     ` Zhang Ning
  0 siblings, 1 reply; 13+ messages in thread
From: Sean Young @ 2022-07-26  7:42 UTC (permalink / raw)
  To: Zhang Ning
  Cc: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, devicetree, linux-media

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 4/4] arm64: dts: meson: Add MagicBox M16S support
  2022-07-26  6:48       ` Krzysztof Kozlowski
@ 2022-07-26  8:51         ` Zhang Ning
  0 siblings, 0 replies; 13+ messages in thread
From: Zhang Ning @ 2022-07-26  8:51 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, sean, devicetree, linux-media

On Tue, Jul 26, 2022 at 08:48:45AM +0200, Krzysztof Kozlowski wrote:
> On 26/07/2022 02:04, Zhang Ning wrote:
> 
> >>> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-magicbox-m16s.dts
> >>> @@ -0,0 +1,40 @@
> >>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> >>> +/*
> >>> + * Copyright (c) 2022 Zhang Ning <zhangn1985@qq.com>
> >>> + */
> >>> +
> >>> +/dts-v1/;
> >>> +
> >>> +#include "meson-gxm.dtsi"
> >>> +#include "meson-gx-p23x-q20x.dtsi"
> >>> +#include <dt-bindings/input/input.h>
> >>> +
> >>> +/ {
> >>> +	compatible = "magicbox,m16s", "amlogic,s912", "amlogic,meson-gxm";
> >>> +	model = "MagicBox M16S";
> >>> +
> >>> +	gpio-keys-polled {
> >>
> >> Just gpio-keys (or even "keys").
> > I see all dts for amlogic platform are using gpio-keys-polled, could I
> > keep current name?
> 
> Node names should be generic.
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
thank you let me know this, I will update in next version.
> 
> 
> Best regards,
> Krzysztof

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [v5 2/4] media: rc: add keymap for MagicBox M16S remote
  2022-07-26  7:42   ` Sean Young
@ 2022-07-26  8:53     ` Zhang Ning
  0 siblings, 0 replies; 13+ messages in thread
From: Zhang Ning @ 2022-07-26  8:53 UTC (permalink / raw)
  To: Sean Young
  Cc: martin.blumenstingl, narmstrong, linux-amlogic, robh+dt,
	krzysztof.kozlowski+dt, devicetree, linux-media

On Tue, Jul 26, 2022 at 08:42:48AM +0100, Sean Young wrote:
> 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.

OK, I will also remove it from dt-bindings patch, they have some 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-07-26  8:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220724231704.132472-1-zhangn1985@qq.com>
2022-07-24 23:17 ` [v5 1/4] media: rc: add keymap for MagicBox M16S remote 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
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

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®