* [PATCH v3 1/4] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
2016-06-28 19:17 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
@ 2016-06-28 19:17 ` Martin Blumenstingl
2016-07-01 1:34 ` Rob Herring
2016-06-28 19:18 ` [PATCH v3 2/4] media: rc: meson-ir: Add support for newer versions of the IR decoder Martin Blumenstingl
` (5 subsequent siblings)
6 siblings, 1 reply; 34+ messages in thread
From: Martin Blumenstingl @ 2016-06-28 19:17 UTC (permalink / raw)
To: linux-amlogic, linux-media
Cc: robh+dt, mark.rutland, carlo, khilman, mchehab, devicetree,
narmstrong, Martin Blumenstingl
From: Neil Armstrong <narmstrong@baylibre.com>
New bindings are needed as the register layout on the newer platforms
is slightly different compared to Meson6b.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
Documentation/devicetree/bindings/media/meson-ir.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/media/meson-ir.txt b/Documentation/devicetree/bindings/media/meson-ir.txt
index 407848e..e7e3f3c 100644
--- a/Documentation/devicetree/bindings/media/meson-ir.txt
+++ b/Documentation/devicetree/bindings/media/meson-ir.txt
@@ -1,7 +1,10 @@
* Amlogic Meson IR remote control receiver
Required properties:
- - compatible : should be "amlogic,meson6-ir"
+ - compatible : depending on the platform this should be one of:
+ - "amlogic,meson6-ir"
+ - "amlogic,meson8b-ir"
+ - "amlogic,meson-gxbb-ir"
- reg : physical base address and length of the device registers
- interrupts : a single specifier for the interrupt from the device
--
2.9.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH v3 1/4] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
2016-06-28 19:17 ` [PATCH v3 1/4] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings Martin Blumenstingl
@ 2016-07-01 1:34 ` Rob Herring
0 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2016-07-01 1:34 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-amlogic, linux-media, mark.rutland, carlo, khilman,
mchehab, devicetree, narmstrong
On Tue, Jun 28, 2016 at 09:17:59PM +0200, Martin Blumenstingl wrote:
> From: Neil Armstrong <narmstrong@baylibre.com>
>
> New bindings are needed as the register layout on the newer platforms
> is slightly different compared to Meson6b.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> Documentation/devicetree/bindings/media/meson-ir.txt | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH v3 2/4] media: rc: meson-ir: Add support for newer versions of the IR decoder
2016-06-28 19:17 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
2016-06-28 19:17 ` [PATCH v3 1/4] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings Martin Blumenstingl
@ 2016-06-28 19:18 ` Martin Blumenstingl
2016-06-28 19:18 ` [PATCH v3 3/4] ARM64: meson-gxbb: Add Infrared Remote Controller decoder Martin Blumenstingl
` (4 subsequent siblings)
6 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-06-28 19:18 UTC (permalink / raw)
To: linux-amlogic, linux-media
Cc: robh+dt, mark.rutland, carlo, khilman, mchehab, devicetree,
narmstrong, Martin Blumenstingl
From: Neil Armstrong <narmstrong@baylibre.com>
Newer SoCs (Meson 8b and GXBB) are using REG2 (offset 0x20) instead of
REG1 to configure the decoder mode. This makes it necessary to
introduce new bindings so the driver knows which register has to be
used.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
drivers/media/rc/meson-ir.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
index fcc3b82..003fff0 100644
--- a/drivers/media/rc/meson-ir.c
+++ b/drivers/media/rc/meson-ir.c
@@ -24,6 +24,7 @@
#define DRIVER_NAME "meson-ir"
+/* valid on all Meson platforms */
#define IR_DEC_LDR_ACTIVE 0x00
#define IR_DEC_LDR_IDLE 0x04
#define IR_DEC_LDR_REPEAT 0x08
@@ -32,12 +33,21 @@
#define IR_DEC_FRAME 0x14
#define IR_DEC_STATUS 0x18
#define IR_DEC_REG1 0x1c
+/* only available on Meson 8b and newer */
+#define IR_DEC_REG2 0x20
#define REG0_RATE_MASK (BIT(11) - 1)
-#define REG1_MODE_MASK (BIT(7) | BIT(8))
-#define REG1_MODE_NEC (0 << 7)
-#define REG1_MODE_GENERAL (2 << 7)
+#define DECODE_MODE_NEC 0x0
+#define DECODE_MODE_RAW 0x2
+
+/* Meson 6b uses REG1 to configure the mode */
+#define REG1_MODE_MASK GENMASK(8, 7)
+#define REG1_MODE_SHIFT 7
+
+/* Meson 8b / GXBB use REG2 to configure the mode */
+#define REG2_MODE_MASK GENMASK(3, 0)
+#define REG2_MODE_SHIFT 0
#define REG1_TIME_IV_SHIFT 16
#define REG1_TIME_IV_MASK ((BIT(13) - 1) << REG1_TIME_IV_SHIFT)
@@ -158,8 +168,15 @@ static int meson_ir_probe(struct platform_device *pdev)
/* Reset the decoder */
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, REG1_RESET);
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, 0);
- /* Set general operation mode */
- meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK, REG1_MODE_GENERAL);
+
+ /* Set general operation mode (= raw/software decoding) */
+ if (of_device_is_compatible(node, "amlogic,meson6-ir"))
+ meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK,
+ DECODE_MODE_RAW << REG1_MODE_SHIFT);
+ else
+ meson_ir_set_mask(ir, IR_DEC_REG2, REG2_MODE_MASK,
+ DECODE_MODE_RAW << REG2_MODE_SHIFT);
+
/* Set rate */
meson_ir_set_mask(ir, IR_DEC_REG0, REG0_RATE_MASK, MESON_TRATE - 1);
/* IRQ on rising and falling edges */
@@ -197,6 +214,8 @@ static int meson_ir_remove(struct platform_device *pdev)
static const struct of_device_id meson_ir_match[] = {
{ .compatible = "amlogic,meson6-ir" },
+ { .compatible = "amlogic,meson8b-ir" },
+ { .compatible = "amlogic,meson-gxbb-ir" },
{ },
};
--
2.9.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v3 3/4] ARM64: meson-gxbb: Add Infrared Remote Controller decoder
2016-06-28 19:17 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
2016-06-28 19:17 ` [PATCH v3 1/4] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings Martin Blumenstingl
2016-06-28 19:18 ` [PATCH v3 2/4] media: rc: meson-ir: Add support for newer versions of the IR decoder Martin Blumenstingl
@ 2016-06-28 19:18 ` Martin Blumenstingl
2016-06-28 19:18 ` [PATCH v3 4/4] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards Martin Blumenstingl
` (3 subsequent siblings)
6 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-06-28 19:18 UTC (permalink / raw)
To: linux-amlogic, linux-media
Cc: robh+dt, mark.rutland, carlo, khilman, mchehab, devicetree,
narmstrong, Martin Blumenstingl
From: Neil Armstrong <narmstrong@baylibre.com>
This adds the Infrared Remote Controller node so boards with an IR
remote can simply enable it.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 6c23965..fa88f80 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -213,6 +213,13 @@
clocks = <&xtal>;
status = "disabled";
};
+
+ ir: ir@580 {
+ compatible = "amlogic,meson-gxbb-ir";
+ reg = <0x0 0x00580 0x0 0x40>;
+ interrupts = <GIC_SPI 196 IRQ_TYPE_EDGE_RISING>;
+ status = "disabled";
+ };
};
periphs: periphs@c8834000 {
--
2.9.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v3 4/4] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards
2016-06-28 19:17 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
` (2 preceding siblings ...)
2016-06-28 19:18 ` [PATCH v3 3/4] ARM64: meson-gxbb: Add Infrared Remote Controller decoder Martin Blumenstingl
@ 2016-06-28 19:18 ` Martin Blumenstingl
2016-08-08 5:54 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Kevin Hilman
` (2 subsequent siblings)
6 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-06-28 19:18 UTC (permalink / raw)
To: linux-amlogic, linux-media
Cc: robh+dt, mark.rutland, carlo, khilman, mchehab, devicetree,
narmstrong, Martin Blumenstingl
Enable the Infrared Remote Controller on boards which have an Infrared
receiver.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 4 ++++
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 4 ++++
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index b06bf8a..9a451ce 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -120,3 +120,7 @@
vmmc-supply = <&mmc_iv>;
voltage-ranges = <1800 3300>;
};
+
+&ir {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
index 5dfd849..2650bb7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
@@ -102,3 +102,7 @@
voltage-ranges = <1800 3300>;
vmmc-supply = <&mmc_iv>;
};
+
+&ir {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
index 54bb7c7..934deb9 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -60,3 +60,7 @@
pinctrl-names = "default";
};
+
+&ir {
+ status = "okay";
+};
--
2.9.0
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver
2016-06-28 19:17 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
` (3 preceding siblings ...)
2016-06-28 19:18 ` [PATCH v3 4/4] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards Martin Blumenstingl
@ 2016-08-08 5:54 ` Kevin Hilman
2016-08-19 21:55 ` [PATCH v4 0/6] " Martin Blumenstingl
2016-08-20 9:53 ` Martin Blumenstingl
6 siblings, 0 replies; 34+ messages in thread
From: Kevin Hilman @ 2016-08-08 5:54 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-amlogic, linux-media, Rob Herring, Mark Rutland,
Carlo Caione, mchehab, devicetree, Neil Armstrong
Hi Martin,
On Tue, Jun 28, 2016 at 12:17 PM, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
> Newer Amlogic platforms (Meson 8b and GXBB) use a slightly different
> register layout for their Infrared Remoete Controller. The decoder mode
> is now configured in another register. Without the changes to the
> meson-ir driver we are simply getting incorrect "durations" reported
> from the hardware (because the hardware is not in time measurement aka
> software decode mode).
>
> This problem was also noticed by some people trying to use this on an
> ODROID-C1 and ODROID-C2 - the workaround there (probably because the
> datasheets were not publicy available yet at that time) was to switch
> to ir_raw_event_store_edge (which leaves it up to the kernel to measure
> the duration of a pulse). See [0] and [1] for the corresponding
> patches.
I tried this on meson-gxbb-p200 and I'm not seeing any button press
events with evtest or ir-keytable when using the Amlogic remote that
came with the board. Below is the register dump you requested on IRC:
[ 1.068347] Registered IR keymap rc-empty
[ 1.072422] input: meson-ir as
/devices/platform/soc/c8100000.aobus/c8100580.ir/rc/rc0/input0
[ 1.080814] rc rc0: meson-ir as
/devices/platform/soc/c8100000.aobus/c8100580.ir/rc/rc0
[ 1.088839] input: MCE IR Keyboard/Mouse (meson-ir) as
/devices/virtual/input/input1
[ 1.096519] rc rc0: lirc_dev: driver ir-lirc-codec (meson-ir)
registered at minor = 0
[ 1.104119] meson-ir c8100580.ir: receiver initialized
[ 1.109172] IR: reg 0x00 = 0x01d801ac
[ 1.112795] IR: reg 0x04 = 0x00f800ca
[ 1.116416] IR: reg 0x08 = 0x007a0066
[ 1.120037] IR: reg 0x0c = 0x0044002c
[ 1.123660] IR: reg 0x10 = 0x70fa0009
[ 1.127278] IR: reg 0x14 = 0x00000000
[ 1.130907] IR: reg 0x18 = 0x08915c00
[ 1.134527] IR: reg 0x1c = 0x00009f44
[ 1.138152] IR: reg 0x20 = 0x00000002
Kevin
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH v4 0/6] Add Meson 8b / GXBB support to the IR driver
2016-06-28 19:17 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
` (4 preceding siblings ...)
2016-08-08 5:54 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Kevin Hilman
@ 2016-08-19 21:55 ` Martin Blumenstingl
2016-08-19 21:55 ` [PATCH v4 1/6] pinctrl: amlogic: gxbb: add the IR remote pin Martin Blumenstingl
` (4 more replies)
2016-08-20 9:53 ` Martin Blumenstingl
6 siblings, 5 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-19 21:55 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
khilman, carlo
Cc: mark.rutland, Martin Blumenstingl, catalin.marinas,
linus.walleij, will.deacon, robh+dt, mchehab, linux-arm-kernel
Newer Amlogic platforms (Meson 8b and GXBB) use a slightly different
register layout for their Infrared Remoete Controller. The decoder mode
is now configured in another register. Without the changes to the
meson-ir driver we are simply getting incorrect "durations" reported
from the hardware (because the hardware is not in time measurement aka
software decode mode).
This problem was also noticed by some people trying to use this on an
ODROID-C1 and ODROID-C2 - the workaround there (probably because the
datasheets were not publicy available yet at that time) was to switch
to ir_raw_event_store_edge (which leaves it up to the kernel to measure
the duration of a pulse). See [0] and [1] for the corresponding
patches.
Changes in v4:
- added support for pinctrl configuration which makes it possible to
use the IR decoder when doing a cold-boot. Without these pinctrl
changes the IR decoder was only working when booting into stock
Android, then rebooting and booting the mainline kernel (with the
other patches from this series). Thanks to Kevin Hilman for spotting
this issue.
- rebased dts changes to Kevin's v4.8/integ branch
As discussed on IRC (thanks Neil):
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
[0] https://github.com/erdoukki/linux-amlogic-1/commit/969b2e2242fb14a13cb651f9a1cf771b599c958b
[1] http://forum.odroid.com/viewtopic.php?f=135&t=20504
Martin Blumenstingl (3):
pinctrl: amlogic: gxbb: add the IR remote pin
ARM64: dts: amlogic: add the pin for the IR remote
ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards
Neil Armstrong (3):
dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
media: rc: meson-ir: Add support for newer versions of the IR decoder
ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder
.../devicetree/bindings/media/meson-ir.txt | 5 +++-
.../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 6 +++++
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 6 +++++
.../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 6 +++++
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 14 +++++++++++
drivers/media/rc/meson-ir.c | 29 ++++++++++++++++++----
drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 8 ++++++
7 files changed, 68 insertions(+), 6 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH v4 1/6] pinctrl: amlogic: gxbb: add the IR remote pin
2016-08-19 21:55 ` [PATCH v4 0/6] " Martin Blumenstingl
@ 2016-08-19 21:55 ` Martin Blumenstingl
2016-08-19 22:23 ` Kevin Hilman
[not found] ` <20160819215547.20063-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
` (3 subsequent siblings)
4 siblings, 1 reply; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-19 21:55 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
khilman, carlo
Cc: mark.rutland, Martin Blumenstingl, catalin.marinas,
linus.walleij, will.deacon, robh+dt, mchehab, linux-arm-kernel
This adds the IR remote receiver to the AO domain devices.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
index cb4d6ad..8fffb31 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
@@ -225,6 +225,8 @@ static const unsigned int i2c_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
static const unsigned int i2c_slave_sck_ao_pins[] = {PIN(GPIOAO_4, 0) };
static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
+static const unsigned int ir_in_ao_pins[] = {PIN(GPIOAO_7, 0) };
+
static struct meson_pmx_group meson_gxbb_periphs_groups[] = {
GPIO_GROUP(GPIOZ_0, EE_OFF),
GPIO_GROUP(GPIOZ_1, EE_OFF),
@@ -432,6 +434,7 @@ static struct meson_pmx_group meson_gxbb_aobus_groups[] = {
GROUP(i2c_sda_ao, 0, 5),
GROUP(i2c_slave_sck_ao, 0, 2),
GROUP(i2c_slave_sda_ao, 0, 1),
+ GROUP(ir_in_ao, 0, 0),
};
static const char * const gpio_periphs_groups[] = {
@@ -521,6 +524,10 @@ static const char * const i2c_slave_ao_groups[] = {
"i2c_slave_sdk_ao", "i2c_slave_sda_ao",
};
+static const char * const ir_in_ao_groups[] = {
+ "ir_in_ao",
+};
+
static struct meson_pmx_func meson_gxbb_periphs_functions[] = {
FUNCTION(gpio_periphs),
FUNCTION(emmc),
@@ -537,6 +544,7 @@ static struct meson_pmx_func meson_gxbb_aobus_functions[] = {
FUNCTION(uart_ao_b),
FUNCTION(i2c_ao),
FUNCTION(i2c_slave_ao),
+ FUNCTION(ir_in_ao),
};
static struct meson_bank meson_gxbb_periphs_banks[] = {
--
2.9.3
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH v4 1/6] pinctrl: amlogic: gxbb: add the IR remote pin
2016-08-19 21:55 ` [PATCH v4 1/6] pinctrl: amlogic: gxbb: add the IR remote pin Martin Blumenstingl
@ 2016-08-19 22:23 ` Kevin Hilman
0 siblings, 0 replies; 34+ messages in thread
From: Kevin Hilman @ 2016-08-19 22:23 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
carlo, linux-arm-kernel, linus.walleij, mchehab, will.deacon,
catalin.marinas, mark.rutland, robh+dt
Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:
> This adds the IR remote receiver to the AO domain devices.
nit Re: Subject: should specify IR remote *input* pin.
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> index cb4d6ad..8fffb31 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
> @@ -225,6 +225,8 @@ static const unsigned int i2c_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
> static const unsigned int i2c_slave_sck_ao_pins[] = {PIN(GPIOAO_4, 0) };
> static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
>
> +static const unsigned int ir_in_ao_pins[] = {PIN(GPIOAO_7, 0) };
> +
I'm trying to keep the names here so they match the datasheet, which
calls this remote_input_ao. Please update throughout the patch.
Otherwise looks good to me. Feel free to add
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
and Linus W can queue it up.
Thanks,
Kevin
^ permalink raw reply [flat|nested] 34+ messages in thread
[parent not found: <20160819215547.20063-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>]
* [PATCH v4 2/6] ARM64: dts: amlogic: add the pin for the IR remote
[not found] ` <20160819215547.20063-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
@ 2016-08-19 21:55 ` Martin Blumenstingl
2016-08-19 21:55 ` [PATCH v4 3/6] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings Martin Blumenstingl
2016-08-19 21:55 ` [PATCH v4 6/6] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards Martin Blumenstingl
2 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-19 21:55 UTC (permalink / raw)
To: linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
narmstrong-rdvid1DuHRBWk0Htik3J/w,
khilman-rdvid1DuHRBWk0Htik3J/w, carlo-KA+7E9HrN00dnm+yROfE0A
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
mchehab-DgEjT+Ai2ygdnm+yROfE0A, will.deacon-5wv7dgnIgG8,
catalin.marinas-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, Martin Blumenstingl
Signed-off-by: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
---
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 4f42316..72df302 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -210,6 +210,13 @@
function = "uart_ao";
};
};
+
+ ir_in_ao_pins: ir_in_ao {
+ mux {
+ groups = "ir_in_ao";
+ function = "ir_in_ao";
+ };
+ };
};
uart_AO: serial@4c0 {
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v4 3/6] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
[not found] ` <20160819215547.20063-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-19 21:55 ` [PATCH v4 2/6] ARM64: dts: amlogic: add the pin for the IR remote Martin Blumenstingl
@ 2016-08-19 21:55 ` Martin Blumenstingl
2016-08-19 21:55 ` [PATCH v4 6/6] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards Martin Blumenstingl
2 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-19 21:55 UTC (permalink / raw)
To: linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
narmstrong-rdvid1DuHRBWk0Htik3J/w,
khilman-rdvid1DuHRBWk0Htik3J/w, carlo-KA+7E9HrN00dnm+yROfE0A
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
mchehab-DgEjT+Ai2ygdnm+yROfE0A, will.deacon-5wv7dgnIgG8,
catalin.marinas-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, Martin Blumenstingl
From: Neil Armstrong <narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
New bindings are needed as the register layout on the newer platforms
is slightly different compared to Meson6b.
Signed-off-by: Neil Armstrong <narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
Documentation/devicetree/bindings/media/meson-ir.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/media/meson-ir.txt b/Documentation/devicetree/bindings/media/meson-ir.txt
index 407848e..e7e3f3c 100644
--- a/Documentation/devicetree/bindings/media/meson-ir.txt
+++ b/Documentation/devicetree/bindings/media/meson-ir.txt
@@ -1,7 +1,10 @@
* Amlogic Meson IR remote control receiver
Required properties:
- - compatible : should be "amlogic,meson6-ir"
+ - compatible : depending on the platform this should be one of:
+ - "amlogic,meson6-ir"
+ - "amlogic,meson8b-ir"
+ - "amlogic,meson-gxbb-ir"
- reg : physical base address and length of the device registers
- interrupts : a single specifier for the interrupt from the device
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v4 6/6] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards
[not found] ` <20160819215547.20063-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-19 21:55 ` [PATCH v4 2/6] ARM64: dts: amlogic: add the pin for the IR remote Martin Blumenstingl
2016-08-19 21:55 ` [PATCH v4 3/6] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings Martin Blumenstingl
@ 2016-08-19 21:55 ` Martin Blumenstingl
2 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-19 21:55 UTC (permalink / raw)
To: linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
narmstrong-rdvid1DuHRBWk0Htik3J/w,
khilman-rdvid1DuHRBWk0Htik3J/w, carlo-KA+7E9HrN00dnm+yROfE0A
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
mchehab-DgEjT+Ai2ygdnm+yROfE0A, will.deacon-5wv7dgnIgG8,
catalin.marinas-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, Martin Blumenstingl
Enable the Infrared Remote Controller on boards which have an Infrared
receiver.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
---
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 6 ++++++
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 6 ++++++
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 6 ++++++
3 files changed, 18 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index cba3ea1..9900b87 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -161,3 +161,9 @@
vmmc-supply = <&vcc3v3>;
vmmcq-sumpply = <&vcc1v8>;
};
+
+&ir {
+ status = "okay";
+ pinctrl-0 = <&ir_in_ao_pins>;
+ pinctrl-names = "default";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
index e118754..dc007fe 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
@@ -143,3 +143,9 @@
vmmc-supply = <&vcc_3v3>;
vmmcq-sumpply = <&vddio_boot>;
};
+
+&ir {
+ status = "okay";
+ pinctrl-0 = <&ir_in_ao_pins>;
+ pinctrl-names = "default";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
index 54bb7c7..45cd3ae 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -60,3 +60,9 @@
pinctrl-names = "default";
};
+
+&ir {
+ status = "okay";
+ pinctrl-0 = <&ir_in_ao_pins>;
+ pinctrl-names = "default";
+};
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v4 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder
2016-08-19 21:55 ` [PATCH v4 0/6] " Martin Blumenstingl
2016-08-19 21:55 ` [PATCH v4 1/6] pinctrl: amlogic: gxbb: add the IR remote pin Martin Blumenstingl
[not found] ` <20160819215547.20063-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
@ 2016-08-19 21:55 ` Martin Blumenstingl
2016-08-19 22:28 ` Kevin Hilman
2016-08-19 21:55 ` [PATCH v4 5/6] ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
4 siblings, 1 reply; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-19 21:55 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
khilman, carlo
Cc: linux-arm-kernel, linus.walleij, mchehab, will.deacon,
catalin.marinas, mark.rutland, robh+dt, Martin Blumenstingl
From: Neil Armstrong <narmstrong@baylibre.com>
Newer SoCs (Meson 8b and GXBB) are using REG2 (offset 0x20) instead of
REG1 to configure the decoder mode. This makes it necessary to
introduce new bindings so the driver knows which register has to be
used.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
drivers/media/rc/meson-ir.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
index fcc3b82..003fff0 100644
--- a/drivers/media/rc/meson-ir.c
+++ b/drivers/media/rc/meson-ir.c
@@ -24,6 +24,7 @@
#define DRIVER_NAME "meson-ir"
+/* valid on all Meson platforms */
#define IR_DEC_LDR_ACTIVE 0x00
#define IR_DEC_LDR_IDLE 0x04
#define IR_DEC_LDR_REPEAT 0x08
@@ -32,12 +33,21 @@
#define IR_DEC_FRAME 0x14
#define IR_DEC_STATUS 0x18
#define IR_DEC_REG1 0x1c
+/* only available on Meson 8b and newer */
+#define IR_DEC_REG2 0x20
#define REG0_RATE_MASK (BIT(11) - 1)
-#define REG1_MODE_MASK (BIT(7) | BIT(8))
-#define REG1_MODE_NEC (0 << 7)
-#define REG1_MODE_GENERAL (2 << 7)
+#define DECODE_MODE_NEC 0x0
+#define DECODE_MODE_RAW 0x2
+
+/* Meson 6b uses REG1 to configure the mode */
+#define REG1_MODE_MASK GENMASK(8, 7)
+#define REG1_MODE_SHIFT 7
+
+/* Meson 8b / GXBB use REG2 to configure the mode */
+#define REG2_MODE_MASK GENMASK(3, 0)
+#define REG2_MODE_SHIFT 0
#define REG1_TIME_IV_SHIFT 16
#define REG1_TIME_IV_MASK ((BIT(13) - 1) << REG1_TIME_IV_SHIFT)
@@ -158,8 +168,15 @@ static int meson_ir_probe(struct platform_device *pdev)
/* Reset the decoder */
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, REG1_RESET);
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, 0);
- /* Set general operation mode */
- meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK, REG1_MODE_GENERAL);
+
+ /* Set general operation mode (= raw/software decoding) */
+ if (of_device_is_compatible(node, "amlogic,meson6-ir"))
+ meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK,
+ DECODE_MODE_RAW << REG1_MODE_SHIFT);
+ else
+ meson_ir_set_mask(ir, IR_DEC_REG2, REG2_MODE_MASK,
+ DECODE_MODE_RAW << REG2_MODE_SHIFT);
+
/* Set rate */
meson_ir_set_mask(ir, IR_DEC_REG0, REG0_RATE_MASK, MESON_TRATE - 1);
/* IRQ on rising and falling edges */
@@ -197,6 +214,8 @@ static int meson_ir_remove(struct platform_device *pdev)
static const struct of_device_id meson_ir_match[] = {
{ .compatible = "amlogic,meson6-ir" },
+ { .compatible = "amlogic,meson8b-ir" },
+ { .compatible = "amlogic,meson-gxbb-ir" },
{ },
};
--
2.9.3
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH v4 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder
2016-08-19 21:55 ` [PATCH v4 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder Martin Blumenstingl
@ 2016-08-19 22:28 ` Kevin Hilman
2016-08-25 12:41 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 34+ messages in thread
From: Kevin Hilman @ 2016-08-19 22:28 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
carlo, linux-arm-kernel, linus.walleij, mchehab, will.deacon,
catalin.marinas, mark.rutland, robh+dt
Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:
> From: Neil Armstrong <narmstrong@baylibre.com>
>
> Newer SoCs (Meson 8b and GXBB) are using REG2 (offset 0x20) instead of
> REG1 to configure the decoder mode. This makes it necessary to
> introduce new bindings so the driver knows which register has to be
> used.
>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Mauro, are you the one to pick up new media/rc drivers? Or if you
prefer, with your ack, I'll take this along with the DT and submit via
arm-soc.
Thanks,
Kevin
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH v4 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder
2016-08-19 22:28 ` Kevin Hilman
@ 2016-08-25 12:41 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 34+ messages in thread
From: Mauro Carvalho Chehab @ 2016-08-25 12:41 UTC (permalink / raw)
To: Kevin Hilman
Cc: Martin Blumenstingl, Mauro Carvalho Chehab, linux-media,
linux-gpio, linux-amlogic, devicetree, narmstrong, carlo,
linux-arm-kernel, linus.walleij, will.deacon, catalin.marinas,
mark.rutland, robh+dt
Em Fri, 19 Aug 2016 15:28:22 -0700
Kevin Hilman <khilman@baylibre.com> escreveu:
> Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:
>
> > From: Neil Armstrong <narmstrong@baylibre.com>
> >
> > Newer SoCs (Meson 8b and GXBB) are using REG2 (offset 0x20) instead of
> > REG1 to configure the decoder mode. This makes it necessary to
> > introduce new bindings so the driver knows which register has to be
> > used.
> >
> > Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>
> Acked-by: Kevin Hilman <khilman@baylibre.com>
>
> Mauro, are you the one to pick up new media/rc drivers? Or if you
> prefer, with your ack, I'll take this along with the DT and submit via
> arm-soc.
I generally pick new media rc drivers, but in the specific case of this
patchset, it is just adding a few extra lines to existing drivers, and
most of the work are actually at the ARM tree.
So, feel free to merge via arm-soc with my ack:
Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
>
> Thanks,
>
> Kevin
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks,
Mauro
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH v4 5/6] ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder
2016-08-19 21:55 ` [PATCH v4 0/6] " Martin Blumenstingl
` (2 preceding siblings ...)
2016-08-19 21:55 ` [PATCH v4 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder Martin Blumenstingl
@ 2016-08-19 21:55 ` Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
4 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-19 21:55 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
khilman, carlo
Cc: linux-arm-kernel, linus.walleij, mchehab, will.deacon,
catalin.marinas, mark.rutland, robh+dt, Martin Blumenstingl
From: Neil Armstrong <narmstrong@baylibre.com>
This adds the Infrared Remote Controller node so boards with an IR
remote can simply enable it.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 72df302..7070719 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -226,6 +226,13 @@
clocks = <&xtal>;
status = "disabled";
};
+
+ ir: ir@580 {
+ compatible = "amlogic,meson-gxbb-ir";
+ reg = <0x0 0x00580 0x0 0x40>;
+ interrupts = <GIC_SPI 196 IRQ_TYPE_EDGE_RISING>;
+ status = "disabled";
+ };
};
periphs: periphs@c8834000 {
--
2.9.3
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver
2016-08-19 21:55 ` [PATCH v4 0/6] " Martin Blumenstingl
` (3 preceding siblings ...)
2016-08-19 21:55 ` [PATCH v4 5/6] ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder Martin Blumenstingl
@ 2016-08-20 9:54 ` Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 1/6] pinctrl: amlogic: gxbb: add the IR remote input pin Martin Blumenstingl
` (4 more replies)
4 siblings, 5 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-20 9:54 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
linus.walleij, khilman, carlo
Cc: mark.rutland, Martin Blumenstingl, catalin.marinas, will.deacon,
b.galvani, robh+dt, mchehab, linux-arm-kernel
Newer Amlogic platforms (Meson 8b and GXBB) use a slightly different
register layout for their Infrared Remoete Controller. The decoder mode
is now configured in another register. Without the changes to the
meson-ir driver we are simply getting incorrect "durations" reported
from the hardware (because the hardware is not in time measurement aka
software decode mode).
This problem was also noticed by some people trying to use this on an
ODROID-C1 and ODROID-C2 - the workaround there (probably because the
datasheets were not publicy available yet at that time) was to switch
to ir_raw_event_store_edge (which leaves it up to the kernel to measure
the duration of a pulse). See [0] and [1] for the corresponding
patches.
Changes in v5:
- changed pin function and group names to remote_input_ao so they match
with the datasheet
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
[0] https://github.com/erdoukki/linux-amlogic-1/commit/969b2e2242fb14a13cb651f9a1cf771b599c958b
[1] http://forum.odroid.com/viewtopic.php?f=135&t=20504
Martin Blumenstingl (3):
pinctrl: amlogic: gxbb: add the IR remote input pin
ARM64: dts: amlogic: add the input pin for the IR remote
ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards
Neil Armstrong (3):
dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
media: rc: meson-ir: Add support for newer versions of the IR decoder
ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder
.../devicetree/bindings/media/meson-ir.txt | 5 +++-
.../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 6 +++++
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 6 +++++
.../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 6 +++++
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 14 +++++++++++
drivers/media/rc/meson-ir.c | 29 ++++++++++++++++++----
drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 8 ++++++
7 files changed, 68 insertions(+), 6 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH v5 1/6] pinctrl: amlogic: gxbb: add the IR remote input pin
2016-08-20 9:54 ` [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
@ 2016-08-20 9:54 ` Martin Blumenstingl
[not found] ` <20160820095424.636-2-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-20 9:54 ` [PATCH v5 3/6] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings Martin Blumenstingl
` (3 subsequent siblings)
4 siblings, 1 reply; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-20 9:54 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
linus.walleij, khilman, carlo
Cc: mark.rutland, Martin Blumenstingl, catalin.marinas, will.deacon,
b.galvani, robh+dt, mchehab, linux-arm-kernel
This adds the IR remote receiver to the AO domain devices.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
---
drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
index cb4d6ad..ff900d1 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
@@ -225,6 +225,8 @@ static const unsigned int i2c_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
static const unsigned int i2c_slave_sck_ao_pins[] = {PIN(GPIOAO_4, 0) };
static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
+static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) };
+
static struct meson_pmx_group meson_gxbb_periphs_groups[] = {
GPIO_GROUP(GPIOZ_0, EE_OFF),
GPIO_GROUP(GPIOZ_1, EE_OFF),
@@ -432,6 +434,7 @@ static struct meson_pmx_group meson_gxbb_aobus_groups[] = {
GROUP(i2c_sda_ao, 0, 5),
GROUP(i2c_slave_sck_ao, 0, 2),
GROUP(i2c_slave_sda_ao, 0, 1),
+ GROUP(remote_input_ao, 0, 0),
};
static const char * const gpio_periphs_groups[] = {
@@ -521,6 +524,10 @@ static const char * const i2c_slave_ao_groups[] = {
"i2c_slave_sdk_ao", "i2c_slave_sda_ao",
};
+static const char * const remote_input_ao_groups[] = {
+ "remote_input_ao",
+};
+
static struct meson_pmx_func meson_gxbb_periphs_functions[] = {
FUNCTION(gpio_periphs),
FUNCTION(emmc),
@@ -537,6 +544,7 @@ static struct meson_pmx_func meson_gxbb_aobus_functions[] = {
FUNCTION(uart_ao_b),
FUNCTION(i2c_ao),
FUNCTION(i2c_slave_ao),
+ FUNCTION(remote_input_ao),
};
static struct meson_bank meson_gxbb_periphs_banks[] = {
--
2.9.3
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v5 3/6] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
2016-08-20 9:54 ` [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 1/6] pinctrl: amlogic: gxbb: add the IR remote input pin Martin Blumenstingl
@ 2016-08-20 9:54 ` Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder Martin Blumenstingl
` (2 subsequent siblings)
4 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-20 9:54 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
linus.walleij, khilman, carlo
Cc: mark.rutland, Martin Blumenstingl, catalin.marinas, will.deacon,
b.galvani, robh+dt, mchehab, linux-arm-kernel
From: Neil Armstrong <narmstrong@baylibre.com>
New bindings are needed as the register layout on the newer platforms
is slightly different compared to Meson6b.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/media/meson-ir.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/media/meson-ir.txt b/Documentation/devicetree/bindings/media/meson-ir.txt
index 407848e..e7e3f3c 100644
--- a/Documentation/devicetree/bindings/media/meson-ir.txt
+++ b/Documentation/devicetree/bindings/media/meson-ir.txt
@@ -1,7 +1,10 @@
* Amlogic Meson IR remote control receiver
Required properties:
- - compatible : should be "amlogic,meson6-ir"
+ - compatible : depending on the platform this should be one of:
+ - "amlogic,meson6-ir"
+ - "amlogic,meson8b-ir"
+ - "amlogic,meson-gxbb-ir"
- reg : physical base address and length of the device registers
- interrupts : a single specifier for the interrupt from the device
--
2.9.3
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v5 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder
2016-08-20 9:54 ` [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 1/6] pinctrl: amlogic: gxbb: add the IR remote input pin Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 3/6] dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings Martin Blumenstingl
@ 2016-08-20 9:54 ` Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 5/6] ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder Martin Blumenstingl
[not found] ` <20160820095424.636-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
4 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-20 9:54 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
linus.walleij, khilman, carlo
Cc: linux-arm-kernel, mchehab, will.deacon, catalin.marinas,
mark.rutland, robh+dt, b.galvani, Martin Blumenstingl
From: Neil Armstrong <narmstrong@baylibre.com>
Newer SoCs (Meson 8b and GXBB) are using REG2 (offset 0x20) instead of
REG1 to configure the decoder mode. This makes it necessary to
introduce new bindings so the driver knows which register has to be
used.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Kevin Hilman <khilman@baylibre.com>
---
drivers/media/rc/meson-ir.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
index fcc3b82..003fff0 100644
--- a/drivers/media/rc/meson-ir.c
+++ b/drivers/media/rc/meson-ir.c
@@ -24,6 +24,7 @@
#define DRIVER_NAME "meson-ir"
+/* valid on all Meson platforms */
#define IR_DEC_LDR_ACTIVE 0x00
#define IR_DEC_LDR_IDLE 0x04
#define IR_DEC_LDR_REPEAT 0x08
@@ -32,12 +33,21 @@
#define IR_DEC_FRAME 0x14
#define IR_DEC_STATUS 0x18
#define IR_DEC_REG1 0x1c
+/* only available on Meson 8b and newer */
+#define IR_DEC_REG2 0x20
#define REG0_RATE_MASK (BIT(11) - 1)
-#define REG1_MODE_MASK (BIT(7) | BIT(8))
-#define REG1_MODE_NEC (0 << 7)
-#define REG1_MODE_GENERAL (2 << 7)
+#define DECODE_MODE_NEC 0x0
+#define DECODE_MODE_RAW 0x2
+
+/* Meson 6b uses REG1 to configure the mode */
+#define REG1_MODE_MASK GENMASK(8, 7)
+#define REG1_MODE_SHIFT 7
+
+/* Meson 8b / GXBB use REG2 to configure the mode */
+#define REG2_MODE_MASK GENMASK(3, 0)
+#define REG2_MODE_SHIFT 0
#define REG1_TIME_IV_SHIFT 16
#define REG1_TIME_IV_MASK ((BIT(13) - 1) << REG1_TIME_IV_SHIFT)
@@ -158,8 +168,15 @@ static int meson_ir_probe(struct platform_device *pdev)
/* Reset the decoder */
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, REG1_RESET);
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_RESET, 0);
- /* Set general operation mode */
- meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK, REG1_MODE_GENERAL);
+
+ /* Set general operation mode (= raw/software decoding) */
+ if (of_device_is_compatible(node, "amlogic,meson6-ir"))
+ meson_ir_set_mask(ir, IR_DEC_REG1, REG1_MODE_MASK,
+ DECODE_MODE_RAW << REG1_MODE_SHIFT);
+ else
+ meson_ir_set_mask(ir, IR_DEC_REG2, REG2_MODE_MASK,
+ DECODE_MODE_RAW << REG2_MODE_SHIFT);
+
/* Set rate */
meson_ir_set_mask(ir, IR_DEC_REG0, REG0_RATE_MASK, MESON_TRATE - 1);
/* IRQ on rising and falling edges */
@@ -197,6 +214,8 @@ static int meson_ir_remove(struct platform_device *pdev)
static const struct of_device_id meson_ir_match[] = {
{ .compatible = "amlogic,meson6-ir" },
+ { .compatible = "amlogic,meson8b-ir" },
+ { .compatible = "amlogic,meson-gxbb-ir" },
{ },
};
--
2.9.3
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v5 5/6] ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder
2016-08-20 9:54 ` [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
` (2 preceding siblings ...)
2016-08-20 9:54 ` [PATCH v5 4/6] media: rc: meson-ir: Add support for newer versions of the IR decoder Martin Blumenstingl
@ 2016-08-20 9:54 ` Martin Blumenstingl
[not found] ` <20160820095424.636-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
4 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-20 9:54 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
linus.walleij, khilman, carlo
Cc: linux-arm-kernel, mchehab, will.deacon, catalin.marinas,
mark.rutland, robh+dt, b.galvani, Martin Blumenstingl
From: Neil Armstrong <narmstrong@baylibre.com>
This adds the Infrared Remote Controller node so boards with an IR
remote can simply enable it.
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 96f4574..1cdc059 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -226,6 +226,13 @@
clocks = <&xtal>;
status = "disabled";
};
+
+ ir: ir@580 {
+ compatible = "amlogic,meson-gxbb-ir";
+ reg = <0x0 0x00580 0x0 0x40>;
+ interrupts = <GIC_SPI 196 IRQ_TYPE_EDGE_RISING>;
+ status = "disabled";
+ };
};
periphs: periphs@c8834000 {
--
2.9.3
^ permalink raw reply related [flat|nested] 34+ messages in thread
[parent not found: <20160820095424.636-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>]
* [PATCH v5 2/6] ARM64: dts: amlogic: add the input pin for the IR remote
[not found] ` <20160820095424.636-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
@ 2016-08-20 9:54 ` Martin Blumenstingl
[not found] ` <20160820095424.636-3-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-20 9:54 ` [PATCH v5 6/6] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards Martin Blumenstingl
2016-08-29 19:28 ` [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver Kevin Hilman
2 siblings, 1 reply; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-20 9:54 UTC (permalink / raw)
To: linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
narmstrong-rdvid1DuHRBWk0Htik3J/w,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
khilman-rdvid1DuHRBWk0Htik3J/w, carlo-KA+7E9HrN00dnm+yROfE0A
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
mchehab-DgEjT+Ai2ygdnm+yROfE0A, will.deacon-5wv7dgnIgG8,
catalin.marinas-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, b.galvani-Re5JQEeQqe8AvxtiuMwx3w,
Martin Blumenstingl
Signed-off-by: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
---
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 4f42316..96f4574 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -210,6 +210,13 @@
function = "uart_ao";
};
};
+
+ remote_input_ao_pins: remote_input_ao {
+ mux {
+ groups = "remote_input_ao";
+ function = "remote_input_ao";
+ };
+ };
};
uart_AO: serial@4c0 {
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH v5 6/6] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards
[not found] ` <20160820095424.636-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-20 9:54 ` [PATCH v5 2/6] ARM64: dts: amlogic: add the input pin for the IR remote Martin Blumenstingl
@ 2016-08-20 9:54 ` Martin Blumenstingl
2016-08-29 19:28 ` [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver Kevin Hilman
2 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-20 9:54 UTC (permalink / raw)
To: linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
narmstrong-rdvid1DuHRBWk0Htik3J/w,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
khilman-rdvid1DuHRBWk0Htik3J/w, carlo-KA+7E9HrN00dnm+yROfE0A
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
mchehab-DgEjT+Ai2ygdnm+yROfE0A, will.deacon-5wv7dgnIgG8,
catalin.marinas-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, b.galvani-Re5JQEeQqe8AvxtiuMwx3w,
Martin Blumenstingl
Enable the Infrared Remote Controller on boards which have an Infrared
receiver.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
---
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 6 ++++++
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 6 ++++++
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 6 ++++++
3 files changed, 18 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
index cba3ea1..d4823f4 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
@@ -161,3 +161,9 @@
vmmc-supply = <&vcc3v3>;
vmmcq-sumpply = <&vcc1v8>;
};
+
+&ir {
+ status = "okay";
+ pinctrl-0 = <&remote_input_ao_pins>;
+ pinctrl-names = "default";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
index e118754..4538e5a 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi
@@ -143,3 +143,9 @@
vmmc-supply = <&vcc_3v3>;
vmmcq-sumpply = <&vddio_boot>;
};
+
+&ir {
+ status = "okay";
+ pinctrl-0 = <&remote_input_ao_pins>;
+ pinctrl-names = "default";
+};
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
index 54bb7c7..560770e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -60,3 +60,9 @@
pinctrl-names = "default";
};
+
+&ir {
+ status = "okay";
+ pinctrl-0 = <&remote_input_ao_pins>;
+ pinctrl-names = "default";
+};
--
2.9.3
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver
[not found] ` <20160820095424.636-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-20 9:54 ` [PATCH v5 2/6] ARM64: dts: amlogic: add the input pin for the IR remote Martin Blumenstingl
2016-08-20 9:54 ` [PATCH v5 6/6] ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards Martin Blumenstingl
@ 2016-08-29 19:28 ` Kevin Hilman
2 siblings, 0 replies; 34+ messages in thread
From: Kevin Hilman @ 2016-08-29 19:28 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA,
narmstrong-rdvid1DuHRBWk0Htik3J/w,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
carlo-KA+7E9HrN00dnm+yROfE0A,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
mchehab-DgEjT+Ai2ygdnm+yROfE0A, will.deacon-5wv7dgnIgG8,
catalin.marinas-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, b.galvani-Re5JQEeQqe8AvxtiuMwx3w
Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> writes:
> Newer Amlogic platforms (Meson 8b and GXBB) use a slightly different
> register layout for their Infrared Remoete Controller. The decoder mode
> is now configured in another register. Without the changes to the
> meson-ir driver we are simply getting incorrect "durations" reported
> from the hardware (because the hardware is not in time measurement aka
> software decode mode).
>
> This problem was also noticed by some people trying to use this on an
> ODROID-C1 and ODROID-C2 - the workaround there (probably because the
> datasheets were not publicy available yet at that time) was to switch
> to ir_raw_event_store_edge (which leaves it up to the kernel to measure
> the duration of a pulse). See [0] and [1] for the corresponding
> patches.
>
> Changes in v5:
> - changed pin function and group names to remote_input_ao so they match
> with the datasheet
>
> Tested-by: Neil Armstrong <narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
Thanks for the respin. I'll take the driver and DT/bindings through the
arm-soc tree and Linus has taken the pinctrl patch.
Kevin
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH v5 0/6] Add Meson 8b / GXBB support to the IR driver
2016-06-28 19:17 ` [PATCH v3 0/4] Add Meson 8b / GXBB support to the IR driver Martin Blumenstingl
` (5 preceding siblings ...)
2016-08-19 21:55 ` [PATCH v4 0/6] " Martin Blumenstingl
@ 2016-08-20 9:53 ` Martin Blumenstingl
6 siblings, 0 replies; 34+ messages in thread
From: Martin Blumenstingl @ 2016-08-20 9:53 UTC (permalink / raw)
To: linux-media, linux-gpio, linux-amlogic, devicetree, narmstrong,
linus.walleij, khilman, carlo
Cc: mark.rutland, Martin Blumenstingl, catalin.marinas, will.deacon,
b.galvani, robh+dt, mchehab, linux-arm-kernel
Newer Amlogic platforms (Meson 8b and GXBB) use a slightly different
register layout for their Infrared Remoete Controller. The decoder mode
is now configured in another register. Without the changes to the
meson-ir driver we are simply getting incorrect "durations" reported
from the hardware (because the hardware is not in time measurement aka
software decode mode).
This problem was also noticed by some people trying to use this on an
ODROID-C1 and ODROID-C2 - the workaround there (probably because the
datasheets were not publicy available yet at that time) was to switch
to ir_raw_event_store_edge (which leaves it up to the kernel to measure
the duration of a pulse). See [0] and [1] for the corresponding
patches.
Changes in v5:
- changed pin function and group names to remote_input_ao so they match
with the datasheet
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
[0] https://github.com/erdoukki/linux-amlogic-1/commit/969b2e2242fb14a13cb651f9a1cf771b599c958b
[1] http://forum.odroid.com/viewtopic.php?f=135&t=20504
Martin Blumenstingl (3):
pinctrl: amlogic: gxbb: add the IR remote input pin
ARM64: dts: amlogic: add the input pin for the IR remote
ARM64: dts: meson-gxbb: Enable the the IR decoder on supported boards
Neil Armstrong (3):
dt-bindings: media: meson-ir: Add Meson8b and GXBB compatible strings
media: rc: meson-ir: Add support for newer versions of the IR decoder
ARM64: dts: meson-gxbb: Add Infrared Remote Controller decoder
.../devicetree/bindings/media/meson-ir.txt | 5 +++-
.../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 6 +++++
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 6 +++++
.../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 6 +++++
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 14 +++++++++++
drivers/media/rc/meson-ir.c | 29 ++++++++++++++++++----
drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 8 ++++++
7 files changed, 68 insertions(+), 6 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 34+ messages in thread