ARM: sunxi: Add support for consumer infrared devices
Subsystems (4)
v10 cover ARM: sunxi: Add support for consumer infrared devices
This patch introduces Consumer IR(CIR) support for sunxi boards.
This is based on Alexsey Shestacov's work based on the original driver supplied by Allwinner.
---
Changes since version 1:
- Fix timer memory leaks
- Fix race condition when driver unloads while interrupt handler is active
- Support Cubieboard 2(need testing)
Changes since version 2:
- More reliable keydown events
- Documentation fixes
- Rename registers accurding to A20 user manual
- Remove some includes, order includes alphabetically
- Use BIT macro
- Typo fixes
Changes since version 3:
- Split the patch on smaller parts
- More documentation fixes
- Add clock-names in DT
- Use devm_clk_get function to get the clocks
- Removed gpios property from ir's DT
- Changed compatible from allwinner,sunxi-ir to allwinner,sun7i-a20-ir in DT
- Use spin_lock_irq instead spin_lock_irqsave in interrupt handler
- Add myself in the copyright ;)
- Coding style and indentation fixes
Changes since version 4:
- Try to fix indentation errors by sending patches with git send-mail
Changes since version 5:
- More indentation fixes
- Make patches pass checkpatch with --strict option
- Replaced magic numbers with defines(patch by Priit Laes)
- Fixed oops on loading(patch by Hans de Goede)
Changes since version 6:
- Removed constants from code
- Better errrors handling on loading
- Renamed sunxi-ir.c to sunxi-cir.c
- Changed description of second commit
- Order entries in dts and dtsi by register address
- Code style fixes
Changes since version 7:
- Removed a couple of blank lines in code
- Delay interrupts init until we are ready to handle them
- Increased the reported duration of each pulse by one
- Refactored defines
Changes since version 8:
- Split the DT patch to three
- Code style fixes
Changes since version 9:
- Rebase patches on 3.16-rc1
Alexander Bersenev (5):
ARM: sunxi: Add documentation for sunxi consumer infrared devices [media] rc: add sunxi-ir driver
ARM: sunxi: Add pins for IR controller on A20 to dtsi
ARM: sunxi: Add IR controllers on A20 to dtsi
ARM: sunxi: Enable IR controller on cubieboard 2 and cubietruck in
dts
.../devicetree/bindings/media/sunxi-ir.txt | 23 ++ arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 6 + arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 6 + arch/arm/boot/dts/sun7i-a20.dtsi | 32 ++ drivers/media/rc/Kconfig | 10 + drivers/media/rc/Makefile | 1 + drivers/media/rc/sunxi-cir.c | 318 ++++++++++++++++++++ 7 files changed, 396 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/sunxi-ir.txt create mode 100644 drivers/media/rc/sunxi-cir.c
PATCH v10 1/5 ARM: sunxi: Add documentation for sunxi consumer infrared devices
This patch adds documentation for Device-Tree bindings for sunxi IR controller.
--- .../devicetree/bindings/media/sunxi-ir.txt | 23 ++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/sunxi-ir.txt
Documentation/devicetree/bindings/media/sunxi-ir.txt new file +23 -0
@@ -0,0 +1,23 @@ +Device-Tree bindings for SUNXI IR controller found in sunXi SoC family + +Required properties: +- compatible : should be "allwinner,sun7i-a20-ir"; +- clocks : list of clock specifiers, corresponding to + entries in clock-names property; +- clock-names : should contain "apb" and "ir" entries; +- interrupts : should contain IR IRQ number; +- reg : should contain IO map address for IR. + +Optional properties: +- linux,rc-map-name : Remote control map name. + +Example: + +ir0: ir at 01c21800 { + compatible = "allwinner,sun7i-a20-ir"; + clocks = <&apb0_gates 6>, <&ir0_clk>; + clock-names = "apb", "ir"; + interrupts = <0 5 1>; + reg = <0x01C21800 0x40>; + linux,rc-map-name = "rc-rc6-mce"; +};
Signature · 1 line
1.7.1
PATCH v10 2/5 rc: add sunxi-ir driver
In reply to Alexander BersenevThis patch adds driver for sunxi IR controller.
It is based on Alexsey Shestacov's work based on the original driver supplied by Allwinner.
--- drivers/media/rc/Kconfig | 10 ++ drivers/media/rc/Makefile | 1 + drivers/media/rc/sunxi-cir.c | 318 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 329 insertions(+), 0 deletions(-) create mode 100644 drivers/media/rc/sunxi-cir.c
drivers/media/rc/Kconfig +10 -0
@@ -343,4 +343,14 @@ config RC_ST If you're not sure, select N here. +config IR_SUNXI + tristate "SUNXI IR remote control" + depends on RC_CORE + depends on ARCH_SUNXI + ---help--- + Say Y if you want to use sunXi internal IR Controller + + To compile this driver as a module, choose M here: the module will + be called sunxi-ir. + endif #RC_DEVICES
drivers/media/rc/Makefile +1 -0
@@ -32,4 +32,5 @@ obj-$(CONFIG_IR_GPIO_CIR) += gpio-ir-recv.o obj-$(CONFIG_IR_IGUANA) += iguanair.o obj-$(CONFIG_IR_TTUSBIR) += ttusbir.o obj-$(CONFIG_RC_ST) += st_rc.o +obj-$(CONFIG_IR_SUNXI) += sunxi-cir.o obj-$(CONFIG_IR_IMG) += img-ir/
drivers/media/rc/sunxi-cir.c new file +318 -0
318 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH v10 3/5 ARM: sunxi: Add pins for IR controller on A20 to dtsi
In reply to Alexander BersenevThis patch adds pins for two IR controllers on A20
--- arch/arm/boot/dts/sun7i-a20.dtsi | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)
arch/arm/boot/dts/sun7i-a20.dtsi +14 -0
@@ -738,6 +738,20 @@ allwinner,drive = <2>; allwinner,pull = <0>; }; + + ir0_pins_a: ir0 at 0 { + allwinner,pins = "PB3","PB4"; + allwinner,function = "ir0"; + allwinner,drive = <0>; + allwinner,pull = <0>; + }; + + ir1_pins_a: ir1 at 0 { + allwinner,pins = "PB22","PB23"; + allwinner,function = "ir1"; + allwinner,drive = <0>; + allwinner,pull = <0>; + }; }; timer at 01c20c00 {
Signature · 1 line
1.7.1
PATCH v10 4/5 ARM: sunxi: Add IR controllers on A20 to dtsi
In reply to Alexander BersenevThis patch adds records for two IR controllers on A20
--- arch/arm/boot/dts/sun7i-a20.dtsi | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/boot/dts/sun7i-a20.dtsi +18 -0
@@ -785,6 +785,24 @@ status = "disabled"; }; + ir0: ir at 01c21800 { + compatible = "allwinner,sun7i-a20-ir"; + clocks = <&apb0_gates 6>, <&ir0_clk>; + clock-names = "apb", "ir"; + interrupts = <0 5 4>; + reg = <0x01c21800 0x40>; + status = "disabled"; + }; + + ir1: ir at 01c21c00 { + compatible = "allwinner,sun7i-a20-ir"; + clocks = <&apb0_gates 7>, <&ir1_clk>; + clock-names = "apb", "ir"; + interrupts = <0 6 4>; + reg = <0x01c21c00 0x40>; + status = "disabled"; + }; + sid: eeprom at 01c23800 { compatible = "allwinner,sun7i-a20-sid"; reg = <0x01c23800 0x200>;
Signature · 1 line
1.7.1
Maxime Ripard
AppliedRe: [PATCH v10 4/5] ARM: sunxi: Add IR controllers on A20 to dtsi
Quoted 4 lines · Alexander Bersenev
This patch adds records for two IR controllers on A20
Signed-off-by Alexander Bersenev <[email protected]>Signed-off-by Alexsey Shestacov <[email protected]>
Applied, thanks.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140623/f6c3fd2c/attachment.sig>
Re: [PATCH v10 4/5] ARM: sunxi: Add IR controllers on A20 to dtsi
Thanks,
Should I send applied patches in the further versions of this patch set?
Best,
Alexander Bersenev
понедельник, 23 июня 2014 г., 19:10:45 UTC+6 пользователь Maxime Ripard написал:
Quoted 16 lines · Alexander Bersenev
Quoted 4 lines
This patch adds records for two IR controllers on A20
Signed-off-by Alexander Bersenev <b...-d8LqKIyZzER6k2ZkT/[email protected] <javascript:>>Signed-off-by Alexsey Shestacov <[email protected] <javascript:>>Applied, thanks.
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Signature · 3 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
Re: [linux-sunxi] Re: [PATCH v10 4/5] ARM: sunxi: Add IR controllers on A20 to dtsi
Quoted 3 lines · ????????? ????????
Thanks,
Should I send applied patches in the further versions of this patch set?
No, you don't have to.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140623/2f658f2e/attachment.sig>
PATCH v10 5/5 ARM: sunxi: Enable IR controller on cubieboard 2 and cubietruck in dts
In reply to Alexander BersenevThis patch enables two IR devices in dts:
- One IR device physically found on Cubieboard 2
- One IR device physically found on Cubietruck
--- arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 6 ++++++ arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 6 ++++++ 2 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +6 -0
@@ -66,6 +66,12 @@ }; }; + ir0: ir at 01c21800 { + pinctrl-names = "default"; + pinctrl-0 = <&ir0_pins_a>; + status = "okay"; + }; + uart0: serial at 01c28000 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>;
arch/arm/boot/dts/sun7i-a20-cubietruck.dts +6 -0
@@ -100,6 +100,12 @@ status = "okay"; }; + ir0: ir at 01c21800 { + pinctrl-names = "default"; + pinctrl-0 = <&ir0_pins_a>; + status = "okay"; + }; + uart0: serial at 01c28000 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>;
Signature · 1 line
1.7.1