linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cec-follower: create analog channel frequencies
@ 2019-09-16 18:38 Jiunn Chang
  2019-09-17  8:34 ` Hans Verkuil
  2019-09-17  9:13 ` [PATCH v2] " Jiunn Chang
  0 siblings, 2 replies; 6+ messages in thread
From: Jiunn Chang @ 2019-09-16 18:38 UTC (permalink / raw)
  To: linux-media, linux-kernel-mentees; +Cc: hverkuil

This frequency table will allow proper testing of tuner control.  There
are three frequencies per analog broadcast type and broadcast system, so
tuner increment and decrement can be tested.

Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
 utils/cec-follower/cec-tuner.cpp | 77 ++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp
index 5e794d71..e0d58e6c 100644
--- a/utils/cec-follower/cec-tuner.cpp
+++ b/utils/cec-follower/cec-tuner.cpp
@@ -7,6 +7,83 @@
 
 #include "cec-follower.h"
 
+/*
+ * This table contains analog television channel frequencies in KHz.  There are
+ * a total of three frequencies per analog broadcast type and broadcast system.
+ *
+ * CEC 17 and CEC Table 31 of the 1.4 specification lists the available analog
+ * broadcast types and broadcast systems.
+ *
+ * The table is indexed by [ana_bcast_type][bcast_system][i].
+ *
+ */
+static unsigned int analog_freqs_khz[3][9][3] =
+{
+	// cable
+	{
+		// pal-bg
+		{471250, 479250, 487250},
+		// secam-lq
+		{615250, 623250, 631250},
+		// pal-m
+		{501250, 507250, 513250},
+		// ntsc-m
+		{519250, 525250, 531250},
+		// pal-i
+		{45750, 53750, 61750},
+		// secam-dk
+		{759250, 767250, 775250},
+		// secam-bg
+		{495250, 503250, 511250},
+		// secam-l
+		{639250, 647250, 655250},
+		// pal-dk
+		{783250, 791250, 799250}
+	},
+	// satellite
+	{
+		// pal-bg
+		{519250, 527250, 535250},
+		// secam-lq
+		{663250, 671250, 679250},
+		// pal-m
+		{537250, 543250, 549250},
+		// ntsc-m
+		{555250, 561250, 567250},
+		// pal-i
+		{175250, 183250, 191250},
+		// secam-dk
+		{807250, 815250, 823250},
+		// secam-bg
+		{543250, 551250, 559250},
+		// secam-l
+		{687250, 695250, 703250},
+		// pal-dk
+		{831250, 839250, 847250}
+	},
+	// terrestrial
+	{
+		// pal-bg
+		{567250, 575250, 583250},
+		// secam-lq
+		{711250, 719250, 727250},
+		// pal-m
+		{573250, 579250, 585250},
+		// ntsc-m
+		{591250, 597250, 603250},
+		// pal-i
+		{199250, 207250, 215250},
+		// secam-dk
+		{145250, 153250, 161250},
+		// secam-bg
+		{591250, 599250, 607250},
+		// secam-l
+		{735250, 743250, 751250},
+		// pal-dk
+		{169250, 177250, 185250}
+	}
+};
+
 void process_tuner_record_timer_msgs(struct node *node, struct cec_msg &msg, unsigned me)
 {
 	switch (msg.msg[1]) {
-- 
2.23.0


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

end of thread, other threads:[~2019-09-19 17:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16 18:38 [PATCH] cec-follower: create analog channel frequencies Jiunn Chang
2019-09-17  8:34 ` Hans Verkuil
2019-09-17  9:13 ` [PATCH v2] " Jiunn Chang
2019-09-17  9:20   ` Hans Verkuil
2019-09-19  2:53   ` [PATCH v3] " Jiunn Chang
2019-09-19 17:47     ` [PATCH v4] " Jiunn Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).