* [PATCH 1/2] cec: remove unused waitq and phys_addrs fields
@ 2020-06-20 10:16 Hans Verkuil
2020-06-20 10:16 ` [PATCH 2/2] media/cec.h: document cec_adapter fields Hans Verkuil
0 siblings, 1 reply; 2+ messages in thread
From: Hans Verkuil @ 2020-06-20 10:16 UTC (permalink / raw)
To: linux-media; +Cc: Hans Verkuil
The cec_adapter struct contained a waitq field that isn't used
anywhere, so drop this.
It also contained a phys_addrs array to store any reported physical
addresses. However, this was never actually used, so this field is
removed as well. The original idea was to let the core keep track of
this information, but nothing was ever done with this. Should this
be needed in the future then it is easy enough to resurrect this.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
drivers/media/cec/core/cec-adap.c | 4 ----
drivers/media/cec/core/cec-core.c | 1 -
include/media/cec.h | 2 --
3 files changed, 7 deletions(-)
diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c
index 6a04d19a96b2..4efe8014445e 100644
--- a/drivers/media/cec/core/cec-adap.c
+++ b/drivers/media/cec/core/cec-adap.c
@@ -1306,7 +1306,6 @@ static int cec_config_log_addr(struct cec_adapter *adap,
las->log_addr[idx] = log_addr;
las->log_addr_mask |= 1 << log_addr;
- adap->phys_addrs[log_addr] = adap->phys_addr;
return 1;
}
@@ -1324,7 +1323,6 @@ static void cec_adap_unconfigure(struct cec_adapter *adap)
adap->log_addrs.log_addr_mask = 0;
adap->is_configuring = false;
adap->is_configured = false;
- memset(adap->phys_addrs, 0xff, sizeof(adap->phys_addrs));
cec_flush(adap);
wake_up_interruptible(&adap->kthread_waitq);
cec_post_state_event(adap);
@@ -1974,8 +1972,6 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
case CEC_MSG_REPORT_PHYSICAL_ADDR: {
u16 pa = (msg->msg[2] << 8) | msg->msg[3];
- if (!from_unregistered)
- adap->phys_addrs[init_laddr] = pa;
dprintk(1, "reported physical address %x.%x.%x.%x for logical address %d\n",
cec_phys_addr_exp(pa), init_laddr);
break;
diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c
index 0c52e1bb3910..c599cd94dd62 100644
--- a/drivers/media/cec/core/cec-core.c
+++ b/drivers/media/cec/core/cec-core.c
@@ -265,7 +265,6 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
adap->sequence = 0;
adap->ops = ops;
adap->priv = priv;
- memset(adap->phys_addrs, 0xff, sizeof(adap->phys_addrs));
mutex_init(&adap->lock);
INIT_LIST_HEAD(&adap->transmit_queue);
INIT_LIST_HEAD(&adap->wait_queue);
diff --git a/include/media/cec.h b/include/media/cec.h
index 972bc8cd4384..1de44a4fc390 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -162,7 +162,6 @@ struct cec_adapter {
struct task_struct *kthread;
wait_queue_head_t kthread_waitq;
- wait_queue_head_t waitq;
const struct cec_adap_ops *ops;
void *priv;
@@ -197,7 +196,6 @@ struct cec_adapter {
struct dentry *status_file;
struct dentry *error_inj_file;
- u16 phys_addrs[15];
u32 sequence;
char input_phys[32];
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] media/cec.h: document cec_adapter fields
2020-06-20 10:16 [PATCH 1/2] cec: remove unused waitq and phys_addrs fields Hans Verkuil
@ 2020-06-20 10:16 ` Hans Verkuil
0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2020-06-20 10:16 UTC (permalink / raw)
To: linux-media; +Cc: Hans Verkuil
Document this core CEC structure.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
include/media/cec.h | 49 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/include/media/cec.h b/include/media/cec.h
index 1de44a4fc390..32f7c695d7b5 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -144,6 +144,55 @@ struct cec_adap_ops {
*/
#define CEC_MAX_MSG_TX_QUEUE_SZ (18 * 1)
+/**
+ * struct cec_adapter - cec adapter structure
+ * @owner: module owner
+ * @name: name of the CEC adapter
+ * @devnode: device node for the /dev/cecX device
+ * @lock: mutex controlling access to this structure
+ * @rc: remote control device
+ * @transmit_queue: queue of pending transmits
+ * @transmit_queue_sz: number of pending transmits
+ * @wait_queue: queue of transmits waiting for a reply
+ * @transmitting: CEC messages currently being transmitted
+ * @transmit_in_progress: true if a transmit is in progress
+ * @kthread_config: kthread used to configure a CEC adapter
+ * @config_completion: used to signal completion of the config kthread
+ * @kthread: main CEC processing thread
+ * @kthread_waitq: main CEC processing wait_queue
+ * @ops: cec adapter ops
+ * @priv: cec driver's private data
+ * @capabilities: cec adapter capabilities
+ * @available_log_addrs: maximum number of available logical addresses
+ * @phys_addr: the current physical address
+ * @needs_hpd: if true, then the HDMI HotPlug Detect pin must be high
+ * in order to transmit or receive CEC messages. This is usually a HW
+ * limitation.
+ * @is_configuring: the CEC adapter is configuring (i.e. claiming LAs)
+ * @is_configured: the CEC adapter is configured (i.e. has claimed LAs)
+ * @cec_pin_is_high: if true then the CEC pin is high. Only used with the
+ * CEC pin framework.
+ * @last_initiator: the initiator of the last transmitted message.
+ * @monitor_all_cnt: number of filehandles monitoring all msgs
+ * @monitor_pin_cnt: number of filehandles monitoring pin changes
+ * @follower_cnt: number of filehandles in follower mode
+ * @cec_follower: filehandle of the exclusive follower
+ * @cec_initiator: filehandle of the exclusive initiator
+ * @passthrough: if true, then the exclusive follower is in
+ * passthrough mode.
+ * @log_addrs: current logical addresses
+ * @conn_info: current connector info
+ * @tx_timeouts: number of transmit timeouts
+ * @notifier: CEC notifier
+ * @pin: CEC pin status struct
+ * @cec_dir: debugfs cec directory
+ * @status_file: debugfs cec status file
+ * @error_inj_file: debugfs cec error injection file
+ * @sequence: transmit sequence counter
+ * @input_phys: remote control input_phys name
+ *
+ * This structure represents a cec adapter.
+ */
struct cec_adapter {
struct module *owner;
char name[32];
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-20 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-20 10:16 [PATCH 1/2] cec: remove unused waitq and phys_addrs fields Hans Verkuil
2020-06-20 10:16 ` [PATCH 2/2] media/cec.h: document cec_adapter fields Hans Verkuil
Unnamed repository; edit this file 'description' to name the repository.
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://archive.lwn.net:8080/linux-media/0 linux-media/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 linux-media linux-media/ http://archive.lwn.net:8080/linux-media \
linux-media@vger.kernel.org lwn-linux-media@archive.lwn.net
public-inbox-index linux-media
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://archive.lwn.net/lwn.kernel.linux-media
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git