All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deborah Brouwer <deborahbrouwer3563@gmail.com>
To: linux-media@vger.kernel.org
Cc: hverkuil@xs4all.nl, jaffe1@gmail.com,
	Deborah Brouwer <deborahbrouwer3563@gmail.com>
Subject: [PATCH v5 1/3] cec-follower: use log_addr_type to get local device type
Date: Thu, 24 Jun 2021 17:13:09 -0700	[thread overview]
Message-ID: <b40d7dbedb87240a2bd58b2a0ab28158c8a7d4c5.1624578960.git.deborahbrouwer3563@gmail.com> (raw)
In-Reply-To: <cover.1624578960.git.deborahbrouwer3563@gmail.com>

A device may use a Backup logical address (aka Reserved in CEC
Version < 2.0) if the logical addresses that the device would normally
used are unavailable. Since a Backup logical address is not unique to any
device type, it cannot be used to determine the device type of the
follower. Instead use the more accurate log_addr_type as returned by
CEC_ADAP_G_LOG_ADDRS to find the device type.

Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com>
---
 utils/cec-follower/cec-follower.h     | 2 +-
 utils/cec-follower/cec-processing.cpp | 7 ++++---
 utils/cec-follower/cec-tuner.cpp      | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/utils/cec-follower/cec-follower.h b/utils/cec-follower/cec-follower.h
index 3fa95417..343ae998 100644
--- a/utils/cec-follower/cec-follower.h
+++ b/utils/cec-follower/cec-follower.h
@@ -222,7 +222,7 @@ void sad_encode(const struct short_audio_desc *sad, __u32 *descriptor);
 
 // cec-tuner.cpp
 void tuner_dev_info_init(struct state *state);
-void process_tuner_record_timer_msgs(struct node *node, struct cec_msg &msg, unsigned me);
+void process_tuner_record_timer_msgs(struct node *node, struct cec_msg &msg, unsigned me, __u8 type);
 
 // CEC processing
 void reply_feature_abort(struct node *node, struct cec_msg *msg,
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index 41bb990c..b1c8f3d9 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -271,7 +271,7 @@ static void update_deck_state(struct node *node, unsigned me, __u8 deck_state_ne
 	}
 }
 
-static void processMsg(struct node *node, struct cec_msg &msg, unsigned me)
+static void processMsg(struct node *node, struct cec_msg &msg, unsigned me, __u8 type)
 {
 	__u8 to = cec_msg_destination(&msg);
 	__u8 from = cec_msg_initiator(&msg);
@@ -672,7 +672,7 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me)
 	case CEC_MSG_SET_TIMER_PROGRAM_TITLE:
 	case CEC_MSG_TIMER_CLEARED_STATUS:
 	case CEC_MSG_TIMER_STATUS:
-		process_tuner_record_timer_msgs(node, msg, me);
+		process_tuner_record_timer_msgs(node, msg, me, type);
 		return;
 
 		/* Dynamic Auto Lipsync */
@@ -1009,6 +1009,7 @@ void testProcessing(struct node *node, bool wallclock)
 	doioctl(node, CEC_S_MODE, &mode);
 	doioctl(node, CEC_ADAP_G_LOG_ADDRS, &laddrs);
 	me = laddrs.log_addr[0];
+	__u8 type = laddrs.log_addr_type[0];
 
 	poll_remote_devs(node, me);
 
@@ -1088,7 +1089,7 @@ void testProcessing(struct node *node, bool wallclock)
 					       msg.sequence, ts2s(msg.rx_ts, wallclock).c_str());
 			}
 			if (node->adap_la_mask)
-				processMsg(node, msg, me);
+				processMsg(node, msg, me, type);
 		}
 
 		__u8 pwr_state = current_power_state(node);
diff --git a/utils/cec-follower/cec-tuner.cpp b/utils/cec-follower/cec-tuner.cpp
index b9c21684..d1718986 100644
--- a/utils/cec-follower/cec-tuner.cpp
+++ b/utils/cec-follower/cec-tuner.cpp
@@ -482,7 +482,7 @@ static bool analog_set_tuner_dev_info(struct node *node, struct cec_msg *msg)
 	return false;
 }
 
-void process_tuner_record_timer_msgs(struct node *node, struct cec_msg &msg, unsigned me)
+void process_tuner_record_timer_msgs(struct node *node, struct cec_msg &msg, unsigned me, __u8 type)
 {
 	bool is_bcast = cec_msg_is_broadcast(&msg);
 
-- 
2.25.1


  reply	other threads:[~2021-06-25  0:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  0:13 [PATCH v5 0/3] cec: One Touch Record tests Deborah Brouwer
2021-06-25  0:13 ` Deborah Brouwer [this message]
2021-06-25  0:13 ` [PATCH v5 2/3] cec: expand " Deborah Brouwer
2021-06-25 12:58   ` Hans Verkuil
2021-06-25  0:13 ` [PATCH v5 3/3] cec: add One Touch Record Standby tests Deborah Brouwer
2021-06-28  9:20   ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b40d7dbedb87240a2bd58b2a0ab28158c8a7d4c5.1624578960.git.deborahbrouwer3563@gmail.com \
    --to=deborahbrouwer3563@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jaffe1@gmail.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.