Skip to contentSkip to conversation

Introduce hix5hd2 IR transmitter driver

PATCH Superseded Zhangfei Gao 2 participants 6 messages Aug 31, 2014 – Sep 1, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v4 cover Introduce hix5hd2 IR transmitter driver

v4:
Change sequence and some comments from Sean and Varka

v3:
Got info from Mauro, 3.17 disable all protocol by default, specific protocol can be selected via ir-keytable and /sys/class/rc/rc0/protocols

Got suggestion from Sean, add rdev specific info, like timeout, resoluton. Add optional property "linux,rc-map-name", if kernel keymap is used otherwise user space keymap will be used.

v2:
Rebase to 3.17-rc1, solve two issues:
a) rc_set_allowed_protocols is deprecated
b) rc-ir-raw.c add empty change_protocol, which block using all protocol For example, when rdev->map_name = RC_MAP_LIRC, ir-nec-decoder can not be used.

Guoxiong Yan (2):
rc: Add DT bindings for hix5hd2
rc: Introduce hix5hd2 IR transmitter driver

Zhangfei Gao (1):
ARM: dts: hix5hd2: add ir node

 .../devicetree/bindings/media/hix5hd2-ir.txt       |   25 ++
 arch/arm/boot/dts/hisi-x5hd2.dtsi                  |   10 +-
 drivers/media/rc/Kconfig                           |   11 +
 drivers/media/rc/Makefile                          |    1 +
 drivers/media/rc/ir-hix5hd2.c                      |  343 ++++++++++++++++++++
 5 files changed, 389 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/media/hix5hd2-ir.txt
 create mode 100644 drivers/media/rc/ir-hix5hd2.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v4 1/2 rc: Add DT bindings for hix5hd2

From: Guoxiong Yan <[email protected]>

---
 .../devicetree/bindings/media/hix5hd2-ir.txt       |   25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/hix5hd2-ir.txt
Documentation/devicetree/bindings/media/hix5hd2-ir.txt new file +25 -0
new file mode 100644
index 0000000..fb5e760
@@ -0,0 +1,25 @@
+Device-Tree bindings for hix5hd2 ir IP
+
+Required properties:
+	- compatible: Should contain "hisilicon,hix5hd2-ir".
+	- reg: Base physical address of the controller and length of memory
+	  mapped region.
+	- interrupts: interrupt-specifier for the sole interrupt generated by
+	  the device. The interrupt specifier format depends on the interrupt
+	  controller parent.
+	- clocks: clock phandle and specifier pair.
+	- hisilicon,power-syscon: phandle of syscon used to control power.
+
+Optional properties:
+	- linux,rc-map-name : Remote control map name.
+
+Example node:
+
+	ir: ir at f8001000 {
+		compatible = "hisilicon,hix5hd2-ir";
+		reg = <0xf8001000 0x1000>;
+		interrupts = <0 47 4>;
+		clocks = <&clock HIX5HD2_FIXED_24M>;
+		hisilicon,power-syscon = <&sysctrl>;
+		linux,rc-map-name = "rc-tivo";
+	};
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v4 1/2 rc: Add DT bindings for hix5hd2

Quoted 17 lines · Zhangfei Gao

From: Guoxiong Yan <[email protected]>

---
  .../devicetree/bindings/media/hix5hd2-ir.txt       |   25 ++++++++++++++++++++
  1 file changed, 25 insertions(+)

create mode 100644 Documentation/devicetree/bindings/media/hix5hd2-ir.txt

Documentation/devicetree/bindings/media/hix5hd2-ir.txt new file +2 -0
new file mode 100644
index 0000000..fb5e760
@@ -0,0 +1,25 @@
+Device-Tree bindings for hix5hd2 ir IP
+

Documentation/devicetree/bindings/media/hix5hd2-ir.txt line 12

Quoted 10 lines
Documentation/devicetree/bindings/media/hix5hd2-ir.txt new file +10 -0
+Required properties:
+	- compatible: Should contain "hisilicon,hix5hd2-ir".
+	- reg: Base physical address of the controller and length of memory
+	  mapped region.
+	- interrupts: interrupt-specifier for the sole interrupt generated by
+	  the device. The interrupt specifier format depends on the interrupt
+	  controller parent.
+	- clocks: clock phandle and specifier pair.
+	- hisilicon,power-syscon: phandle of syscon used to control power.
+

No need of tab space before -compatible.... Give tab spaces after properties...

ex:

Required properties:
- compatible : Should contain "hisilicon,hix5hd2-ir".
- reg : Base physical address of the controller and length of memory
mapped region.

...

Its not standard, but in my view it is understandable. Now every one following this one.

Thanks..

Quoted 13 lines
Documentation/devicetree/bindings/media/hix5hd2-ir.txt new file +13 -0
+Optional properties:
+	- linux,rc-map-name : Remote control map name.
+
+Example node:
+
+	ir: ir at f8001000 {
+		compatible = "hisilicon,hix5hd2-ir";
+		reg = <0xf8001000 0x1000>;
+		interrupts = <0 47 4>;
+		clocks = <&clock HIX5HD2_FIXED_24M>;
+		hisilicon,power-syscon = <&sysctrl>;
+		linux,rc-map-name = "rc-tivo";
+	};
Signature · 2 lines
Regards,
Varka Bhadram.
author
#3 lore raw

PATCH v4 1/2 rc: Add DT bindings for hix5hd2

Quoted 45 lines · Varka Bhadram
Quoted 28 lines · Zhangfei Gao

From: Guoxiong Yan <[email protected]>

---
  .../devicetree/bindings/media/hix5hd2-ir.txt       |   25
++++++++++++++++++++
  1 file changed, 25 insertions(+)

create mode 100644
Documentation/devicetree/bindings/media/hix5hd2-ir.txt

Documentation/devicetree/bindings/media/hix5hd2-ir.txt new file +7 -0
new file mode 100644
index 0000000..fb5e760
@@ -0,0 +1,25 @@
+Device-Tree bindings for hix5hd2 ir IP
+
+Required properties:
+    - compatible: Should contain "hisilicon,hix5hd2-ir".
+    - reg: Base physical address of the controller and length of memory
+      mapped region.
+    - interrupts: interrupt-specifier for the sole interrupt

generated by
+ the device. The interrupt specifier format depends on the
interrupt

Documentation/devicetree/bindings/media/hix5hd2-ir.txt line 12

Quoted 4 lines
Documentation/devicetree/bindings/media/hix5hd2-ir.txt new file +4 -0
+      controller parent.
+    - clocks: clock phandle and specifier pair.
+    - hisilicon,power-syscon: phandle of syscon used to control power.
+

No need of tab space before -compatible.... Give tab spaces after properties...

ex:

Required properties:
- compatible : Should contain "hisilicon,hix5hd2-ir".
- reg : Base physical address of the controller and length of
memory
mapped region.

Quoted 5 lines

...

Its not standard, but in my view it is understandable. Now every one following this
one.

Really, I still prefer the original one.
Have checked several bindings under media, so add tab ahead like st-rc.txt, gpio-ir-receiver.txt

Thanks

#4 lore raw

PATCH v4 2/2 rc: Introduce hix5hd2 IR transmitter driver

In reply to Zhangfei Gao

From: Guoxiong Yan <[email protected]>

IR transmitter driver for Hisilicon hix5hd2 soc

By default all protocols are disabled.
For example nec decoder can be enabled by either
1. ir-keytable -p nec
2. echo nec > /sys/class/rc/rc0/protocols
See see Documentation/ABI/testing/sysfs-class-rc

---
 drivers/media/rc/Kconfig      |   10 ++
 drivers/media/rc/Makefile     |    1 +
 drivers/media/rc/ir-hix5hd2.c |  343 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 354 insertions(+)
 create mode 100644 drivers/media/rc/ir-hix5hd2.c
drivers/media/rc/Kconfig +10 -0
index 5e626af..01e5f7a 100644
@@ -164,6 +164,16 @@ config IR_ENE
 	   To compile this driver as a module, choose M here: the
 	   module will be called ene_ir.
 
+config IR_HIX5HD2
+	tristate "Hisilicon hix5hd2 IR remote control"
+	depends on RC_CORE
+	help
+	 Say Y here if you want to use hisilicon hix5hd2 remote control.
+	 To compile this driver as a module, choose M here: the module will be
+	 called ir-hix5hd2.
+
+	 If you're not sure, select N here
+
 config IR_IMON
 	tristate "SoundGraph iMON Receiver and Display"
 	depends on USB_ARCH_HAS_HCD
drivers/media/rc/Makefile +1 -0
index 9f9843a1..0989f94 100644
@@ -17,6 +17,7 @@ obj-$(CONFIG_IR_XMP_DECODER) += ir-xmp-decoder.o
 
 # stand-alone IR receivers/transmitters
 obj-$(CONFIG_RC_ATI_REMOTE) += ati_remote.o
+obj-$(CONFIG_IR_HIX5HD2) += ir-hix5hd2.o
 obj-$(CONFIG_IR_IMON) += imon.o
 obj-$(CONFIG_IR_ITE_CIR) += ite-cir.o
 obj-$(CONFIG_IR_MCEUSB) += mceusb.o
drivers/media/rc/ir-hix5hd2.c new file +343 -0

343 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v4 3/3 ARM: dts: hix5hd2: add ir node

In reply to Zhangfei Gao
---
 arch/arm/boot/dts/hisi-x5hd2.dtsi |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/arm/boot/dts/hisi-x5hd2.dtsi +9 -1
index 7b1cb53..1d7cd04 100644
@@ -391,7 +391,7 @@
 		};
 
 		sysctrl: system-controller at 00000000 {
-			compatible = "hisilicon,sysctrl";
+			compatible = "hisilicon,sysctrl", "syscon";
 			reg = <0x00000000 0x1000>;
 			reboot-offset = <0x4>;
 		};
@@ -476,5 +476,13 @@
                         interrupts = <0 70 4>;
                         clocks = <&clock HIX5HD2_SATA_CLK>;
 		};
+
+		ir: ir at 001000 {
+			compatible = "hisilicon,hix5hd2-ir";
+			reg = <0x001000 0x1000>;
+			interrupts = <0 47 4>;
+			clocks = <&clock HIX5HD2_FIXED_24M>;
+			hisilicon,power-syscon = <&sysctrl>;
+		};
 	};
 };
Signature · 1 line
1.7.9.5