Skip to contentSkip to conversation

cec-ctl/compliance: new CEC utilities

PATCH In review Hans Verkuil 2 participants 6 messages Aug 18, 2015

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

v2 cover cec-ctl/compliance: new CEC utilities

This patch series adds two new utilities to the v4l-utils git repository
(http://git.linuxtv.org/cgit.cgi/v4l-utils.git/). It assumes that the new CEC framework available in the kernel:

http://www.mail-archive.com/[email protected]/msg90085.html

The first patch adds the new cec headers to the 'sync-with-kernel' target, the second syncs with the kernel and adds the new cec headers to v4l-utils, the third adds the compliance utility and the last adds the cec-ctl utility.

The cec-compliance utility is by no means 100% coverage, in particular the event API and non-blocking ioctls are untested. But it is a starting point, and a complex protocol like CEC really needs a compliance tool.

The cec-ctl utility has almost full CEC message coverage: all generated from the cec headers, so this is easy to keep up to date.

Regards,

Hans

Changes since v1:

- Added CEC message logging/monitoring to cec-ctl.
- Add support to clear the logical addresses.

Hans Verkuil (4):
Makefile.am: copy cec headers with make sync-with-kernel sync-with-kernel
cec-compliance: add new CEC compliance utility
cec-ctl: CEC control utility

 Makefile.am                                   |    4 +
 configure.ac                                  |    2 +
 contrib/freebsd/include/linux/input.h         |   29 +
 contrib/freebsd/include/linux/v4l2-controls.h |    4 +
 include/linux/cec-funcs.h                     | 1771 +++++++++++++++++++++++++
 include/linux/cec.h                           |  781 +++++++++++
 include/linux/v4l2-controls.h                 |    4 +
 utils/Makefile.am                             |    2 +
 utils/cec-compliance/Makefile.am              |    3 +
 utils/cec-compliance/cec-compliance.cpp       |  926 +++++++++++++
 utils/cec-compliance/cec-compliance.h         |   87 ++
 utils/cec-ctl/Makefile.am                     |    8 +
 utils/cec-ctl/cec-ctl.cpp                     | 1296 ++++++++++++++++++
 utils/cec-ctl/msg2ctl.pl                      |  430 ++++++
 utils/keytable/parse.h                        |   18 +
 utils/keytable/rc_keymaps/lme2510             |  132 +-
 utils/keytable/rc_maps.cfg                    |    1 +
 17 files changed, 5432 insertions(+), 66 deletions(-)
 create mode 100644 include/linux/cec-funcs.h
 create mode 100644 include/linux/cec.h
 create mode 100644 utils/cec-compliance/Makefile.am
 create mode 100644 utils/cec-compliance/cec-compliance.cpp
 create mode 100644 utils/cec-compliance/cec-compliance.h
 create mode 100644 utils/cec-ctl/Makefile.am
 create mode 100644 utils/cec-ctl/cec-ctl.cpp
 create mode 100644 utils/cec-ctl/msg2ctl.pl
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/4 Makefile.am: copy cec headers with make sync-with-kernel

Copy the new cec headers.

---
 Makefile.am | 4 ++++
 1 file changed, 4 insertions(+)
Makefile.am +4 -0
index 1a61592..b8c450d 100644
@@ -21,6 +21,8 @@ sync-with-kernel:
 	      ! -f $(KERNEL_DIR)/usr/include/linux/v4l2-common.h -o \
 	      ! -f $(KERNEL_DIR)/usr/include/linux/v4l2-subdev.h -o \
 	      ! -f $(KERNEL_DIR)/usr/include/linux/v4l2-mediabus.h -o \
+	      ! -f $(KERNEL_DIR)/usr/include/linux/cec.h -o \
+	      ! -f $(KERNEL_DIR)/usr/include/linux/cec-funcs.h -o \
 	      ! -f $(KERNEL_DIR)/usr/include/linux/ivtv.h -o \
 	      ! -f $(KERNEL_DIR)/usr/include/linux/dvb/frontend.h -o \
 	      ! -f $(KERNEL_DIR)/usr/include/linux/dvb/dmx.h -o \
@@ -38,6 +40,8 @@ sync-with-kernel:
 	cp -a $(KERNEL_DIR)/usr/include/linux/v4l2-mediabus.h $(top_srcdir)/include/linux
 	cp -a $(KERNEL_DIR)/usr/include/linux/media-bus-format.h $(top_srcdir)/include/linux
 	cp -a $(KERNEL_DIR)/usr/include/linux/media.h $(top_srcdir)/include/linux
+	cp -a $(KERNEL_DIR)/usr/include/linux/cec.h $(top_srcdir)/include/linux
+	cp -a $(KERNEL_DIR)/usr/include/linux/cec-funcs.h $(top_srcdir)/include/linux
 	cp -a $(KERNEL_DIR)/usr/include/linux/ivtv.h $(top_srcdir)/include/linux
 	cp -a $(KERNEL_DIR)/usr/include/linux/dvb/frontend.h $(top_srcdir)/include/linux/dvb
 	cp -a $(KERNEL_DIR)/usr/include/linux/dvb/dmx.h $(top_srcdir)/include/linux/dvb
Signature · 1 line
2.1.4
#2 lore raw

PATCH v2 2/4 sync-with-kernel

In reply to Hans Verkuil
---
 contrib/freebsd/include/linux/input.h         |   29 +
 contrib/freebsd/include/linux/v4l2-controls.h |    4 +
 include/linux/cec-funcs.h                     | 1771 +++++++++++++++++++++++++
 include/linux/cec.h                           |  781 +++++++++++
 include/linux/v4l2-controls.h                 |    4 +
 utils/keytable/parse.h                        |   18 +
 utils/keytable/rc_keymaps/lme2510             |  132 +-
 utils/keytable/rc_maps.cfg                    |    1 +
 8 files changed, 2674 insertions(+), 66 deletions(-)
 create mode 100644 include/linux/cec-funcs.h
 create mode 100644 include/linux/cec.h
contrib/freebsd/include/linux/input.h +29 -0
index 19345e1..1bc7241 100644
@@ -786,6 +786,34 @@ struct input_keymap_entry {
 #define KEY_KBDINPUTASSIST_ACCEPT		0x264
 #define KEY_KBDINPUTASSIST_CANCEL		0x265
 
+#define KEY_RIGHT_UP			0x266
+#define KEY_RIGHT_DOWN			0x267
+#define KEY_LEFT_UP			0x268
+#define KEY_LEFT_DOWN			0x269
+#define KEY_ROOT_MENU			0x26a /* Show Device's Root Menu */
+#define KEY_MEDIA_TOP_MENU		0x26b /* Show Top Menu of the Media (e.g. DVD) */
+#define KEY_NUMERIC_11			0x26c
+#define KEY_NUMERIC_12			0x26d
+/*
+ * Toggle Audio Description: refers to an audio service that helps blind and
+ * visually impaired consumers understand the action in a program. Note: in
+ * some countries this is referred to as "Video Description".
+ */
+#define KEY_AUDIO_DESC			0x26e
+#define KEY_3D_MODE			0x26f
+#define KEY_NEXT_FAVORITE		0x270
+#define KEY_STOP_RECORD			0x271
+#define KEY_PAUSE_RECORD		0x272
+#define KEY_VOD				0x273 /* Video on Demand */
+#define KEY_UNMUTE			0x274
+#define KEY_FASTREVERSE			0x275
+#define KEY_SLOWREVERSE			0x276
+/*
+ * Control a data application associated with the currently viewed channel,
+ * e.g. teletext or data broadcast application (MHEG, MHP, HbbTV, etc.)
+ */
+#define KEY_DATA			0x275
+
 #define BTN_TRIGGER_HAPPY		0x2c0
 #define BTN_TRIGGER_HAPPY1		0x2c0
 #define BTN_TRIGGER_HAPPY2		0x2c1
@@ -1006,6 +1034,7 @@ struct input_keymap_entry {
 #define BUS_GSC			0x1A
 #define BUS_ATARI		0x1B
 #define BUS_SPI			0x1C
+#define BUS_CEC			0x1D
 
 /*
  * MT_TOOL types
contrib/freebsd/include/linux/v4l2-controls.h +4 -0
index 9f6e108..d448c53 100644
@@ -174,6 +174,10 @@ enum v4l2_colorfx {
  * We reserve 16 controls for this driver. */
 #define V4L2_CID_USER_ADV7180_BASE		(V4L2_CID_USER_BASE + 0x1070)
 
+/* The base for the tc358743 driver controls.
+ * We reserve 16 controls for this driver. */
+#define V4L2_CID_USER_TC358743_BASE		(V4L2_CID_USER_BASE + 0x1080)
+
 /* MPEG-class control IDs */
 /* The MPEG controls are applicable to all codec controls
  * and the 'MPEG' part of the define is historical */
include/linux/cec-funcs.h new file +1771 -0

1,771 lines not on this page · raw message

include/linux/cec.h new file +781 -0

781 lines not on this page · raw message

include/linux/v4l2-controls.h +4 -0
index 9f6e108..d448c53 100644
@@ -174,6 +174,10 @@ enum v4l2_colorfx {
  * We reserve 16 controls for this driver. */
 #define V4L2_CID_USER_ADV7180_BASE		(V4L2_CID_USER_BASE + 0x1070)
 
+/* The base for the tc358743 driver controls.
+ * We reserve 16 controls for this driver. */
+#define V4L2_CID_USER_TC358743_BASE		(V4L2_CID_USER_BASE + 0x1080)
+
 /* MPEG-class control IDs */
 /* The MPEG controls are applicable to all codec controls
  * and the 'MPEG' part of the define is historical */
utils/keytable/parse.h +18 -0
index 6ada6e5..67eb1a6 100644
@@ -518,6 +518,24 @@ struct parse_event key_events[] = {
 	{"KEY_KBDINPUTASSIST_NEXTGROUP", 0x263},
 	{"KEY_KBDINPUTASSIST_ACCEPT", 0x264},
 	{"KEY_KBDINPUTASSIST_CANCEL", 0x265},
+	{"KEY_RIGHT_UP", 0x266},
+	{"KEY_RIGHT_DOWN", 0x267},
+	{"KEY_LEFT_UP", 0x268},
+	{"KEY_LEFT_DOWN", 0x269},
+	{"KEY_ROOT_MENU", 0x26a},
+	{"KEY_MEDIA_TOP_MENU", 0x26b},
+	{"KEY_NUMERIC_11", 0x26c},
+	{"KEY_NUMERIC_12", 0x26d},
+	{"KEY_AUDIO_DESC", 0x26e},
+	{"KEY_3D_MODE", 0x26f},
+	{"KEY_NEXT_FAVORITE", 0x270},
+	{"KEY_STOP_RECORD", 0x271},
+	{"KEY_PAUSE_RECORD", 0x272},
+	{"KEY_VOD", 0x273},
+	{"KEY_UNMUTE", 0x274},
+	{"KEY_FASTREVERSE", 0x275},
+	{"KEY_SLOWREVERSE", 0x276},
+	{"KEY_DATA", 0x275},
 	{"BTN_TRIGGER_HAPPY", 0x2c0},
 	{"BTN_TRIGGER_HAPPY1", 0x2c0},
 	{"BTN_TRIGGER_HAPPY2", 0x2c1},
utils/keytable/rc_keymaps/lme2510 +66 -66

133 lines not on this page · raw message

utils/keytable/rc_maps.cfg +1 -0
index e69fd6a..3bd7197 100644
@@ -50,6 +50,7 @@
 *	rc-behold-columbus       behold_columbus
 *	rc-behold                behold
 *	rc-budget-ci-old         budget_ci_old
+*	rc-cec                   cec
 *	rc-cinergy-1400          cinergy_1400
 *	rc-cinergy               cinergy
 *	rc-delock-61959          delock_61959
Signature · 1 line
2.1.4
#3 lore raw

PATCH v2 3/4 cec-compliance: add new CEC compliance utility

In reply to Hans Verkuil

This utility will attempt to test whether the CEC protocol was implemented correctly.

---
 configure.ac                            |   1 +
 utils/Makefile.am                       |   1 +
 utils/cec-compliance/Makefile.am        |   3 +
 utils/cec-compliance/cec-compliance.cpp | 926 ++++++++++++++++++++++++++++++++
 utils/cec-compliance/cec-compliance.h   |  87 +++
 5 files changed, 1018 insertions(+)
 create mode 100644 utils/cec-compliance/Makefile.am
 create mode 100644 utils/cec-compliance/cec-compliance.cpp
 create mode 100644 utils/cec-compliance/cec-compliance.h
configure.ac +1 -0
index d4e312c..12c2eb9 100644
@@ -26,6 +26,7 @@ AC_CONFIG_FILES([Makefile
 	utils/keytable/Makefile
 	utils/media-ctl/Makefile
 	utils/rds/Makefile
+	utils/cec-compliance/Makefile
 	utils/v4l2-compliance/Makefile
 	utils/v4l2-ctl/Makefile
 	utils/v4l2-dbg/Makefile
utils/Makefile.am +1 -0
index 31b2979..c78e97b 100644
@@ -5,6 +5,7 @@ SUBDIRS = \
 	decode_tm6000 \
 	keytable \
 	media-ctl \
+	cec-compliance \
 	v4l2-compliance \
 	v4l2-ctl \
 	v4l2-dbg \
utils/cec-compliance/Makefile.am new file +3 -0
new file mode 100644
index 0000000..da4c0ef
@@ -0,0 +1,3 @@
+bin_PROGRAMS = cec-compliance
+
+cec_compliance_SOURCES = cec-compliance.cpp
utils/cec-compliance/cec-compliance.cpp new file +926 -0

926 lines not on this page · raw message

utils/cec-compliance/cec-compliance.h new file +87 -0

87 lines not on this page · raw message

Signature · 1 line
2.1.4
#4 lore raw

PATCH v2 4/4 cec-ctl: CEC control utility

In reply to Hans Verkuil

Generic CEC utility that can be used to send/receive/monitor CEC messages.

---
 configure.ac              |    1 +
 utils/Makefile.am         |    1 +
 utils/cec-ctl/Makefile.am |    8 +
 utils/cec-ctl/cec-ctl.cpp | 1296 +++++++++++++++++++++++++++++++++++++++++++++
 utils/cec-ctl/msg2ctl.pl  |  430 +++++++++++++++
 5 files changed, 1736 insertions(+)
 create mode 100644 utils/cec-ctl/Makefile.am
 create mode 100644 utils/cec-ctl/cec-ctl.cpp
 create mode 100644 utils/cec-ctl/msg2ctl.pl
configure.ac +1 -0
index 12c2eb9..72d59bd 100644
@@ -27,6 +27,7 @@ AC_CONFIG_FILES([Makefile
 	utils/media-ctl/Makefile
 	utils/rds/Makefile
 	utils/cec-compliance/Makefile
+	utils/cec-ctl/Makefile
 	utils/v4l2-compliance/Makefile
 	utils/v4l2-ctl/Makefile
 	utils/v4l2-dbg/Makefile
utils/Makefile.am +1 -0
index c78e97b..617abf1 100644
@@ -6,6 +6,7 @@ SUBDIRS = \
 	keytable \
 	media-ctl \
 	cec-compliance \
+	cec-ctl \
 	v4l2-compliance \
 	v4l2-ctl \
 	v4l2-dbg \
utils/cec-ctl/Makefile.am new file +8 -0
new file mode 100644
index 0000000..378d7db
@@ -0,0 +1,8 @@
+bin_PROGRAMS = cec-ctl
+
+cec_ctl_SOURCES = cec-ctl.cpp
+
+cec-ctl.cpp: cec-ctl-gen.h
+
+cec-ctl-gen.h: msg2ctl.pl ../../include/linux/cec.h ../../include/linux/cec-funcs.h
+	msg2ctl.pl ../../include/linux/cec.h ../../include/linux/cec-funcs.h >cec-ctl-gen.h
utils/cec-ctl/cec-ctl.cpp new file +1296 -0

1,296 lines not on this page · raw message

utils/cec-ctl/msg2ctl.pl new file +430 -0

430 lines not on this page · raw message

Signature · 1 line
2.1.4
#5 lore raw
In reply to Hans Verkuil

Oops, this cover letter is incomplete, here is the full cover letter:

This patch series adds two new utilities to the v4l-utils git repository
(http://git.linuxtv.org/cgit.cgi/v4l-utils.git/). It assumes that the new CEC framework (v8) is available in the kernel:

http://www.mail-archive.com/[email protected]/msg91285.html

The first patch adds the new cec headers to the 'sync-with-kernel' target, the second syncs with the kernel and adds the new cec headers to v4l-utils, the third adds the compliance utility and the last adds the cec-ctl utility.

The cec-compliance utility is by no means 100% coverage, in particular the event API and non-blocking ioctls are untested. But it is a starting point, and a complex protocol like CEC really needs a compliance tool.

The cec-ctl utility has almost full CEC message coverage: all generated from the cec headers, so this is easy to keep up to date.

Regards,

Hans

Changes since v1:

- cec-ctl: added CEC message logging/monitoring.
- cec-ctl: add support to clear the logical addresses.
- cec-ctl: log events.

Quoted 24 lines · Hans Verkuil

Hans Verkuil (4):
Makefile.am: copy cec headers with make sync-with-kernel sync-with-kernel
cec-compliance: add new CEC compliance utility
cec-ctl: CEC control utility

 Makefile.am                                   |    4 +
 configure.ac                                  |    2 +
 contrib/freebsd/include/linux/input.h         |   29 +
 contrib/freebsd/include/linux/v4l2-controls.h |    4 +
 include/linux/cec-funcs.h                     | 1771 +++++++++++++++++++++++++
 include/linux/cec.h                           |  781 +++++++++++
 include/linux/v4l2-controls.h                 |    4 +
 utils/Makefile.am                             |    2 +
 utils/cec-compliance/Makefile.am              |    3 +
 utils/cec-compliance/cec-compliance.cpp       |  926 +++++++++++++
 utils/cec-compliance/cec-compliance.h         |   87 ++
 utils/cec-ctl/Makefile.am                     |    8 +
 utils/cec-ctl/cec-ctl.cpp                     | 1296 ++++++++++++++++++
 utils/cec-ctl/msg2ctl.pl                      |  430 ++++++
 utils/keytable/parse.h                        |   18 +
 utils/keytable/rc_keymaps/lme2510             |  132 +-
 utils/keytable/rc_maps.cfg                    |    1 +
 17 files changed, 5432 insertions(+), 66 deletions(-)
Quoted 9 lines
 create mode 100644 include/linux/cec-funcs.h
 create mode 100644 include/linux/cec.h
 create mode 100644 utils/cec-compliance/Makefile.am
 create mode 100644 utils/cec-compliance/cec-compliance.cpp
 create mode 100644 utils/cec-compliance/cec-compliance.h
 create mode 100644 utils/cec-ctl/Makefile.am
 create mode 100644 utils/cec-ctl/cec-ctl.cpp
 create mode 100644 utils/cec-ctl/msg2ctl.pl

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel