Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/linux
File: cec.h
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
[0] Fix | Delete
/*
[1] Fix | Delete
* cec - HDMI Consumer Electronics Control public header
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
#ifndef _CEC_UAPI_H
[7] Fix | Delete
#define _CEC_UAPI_H
[8] Fix | Delete
[9] Fix | Delete
#include <linux/types.h>
[10] Fix | Delete
#include <linux/string.h>
[11] Fix | Delete
[12] Fix | Delete
#define CEC_MAX_MSG_SIZE 16
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* struct cec_msg - CEC message structure.
[16] Fix | Delete
* @tx_ts: Timestamp in nanoseconds using CLOCK_MONOTONIC. Set by the
[17] Fix | Delete
* driver when the message transmission has finished.
[18] Fix | Delete
* @rx_ts: Timestamp in nanoseconds using CLOCK_MONOTONIC. Set by the
[19] Fix | Delete
* driver when the message was received.
[20] Fix | Delete
* @len: Length in bytes of the message.
[21] Fix | Delete
* @timeout: The timeout (in ms) that is used to timeout CEC_RECEIVE.
[22] Fix | Delete
* Set to 0 if you want to wait forever. This timeout can also be
[23] Fix | Delete
* used with CEC_TRANSMIT as the timeout for waiting for a reply.
[24] Fix | Delete
* If 0, then it will use a 1 second timeout instead of waiting
[25] Fix | Delete
* forever as is done with CEC_RECEIVE.
[26] Fix | Delete
* @sequence: The framework assigns a sequence number to messages that are
[27] Fix | Delete
* sent. This can be used to track replies to previously sent
[28] Fix | Delete
* messages.
[29] Fix | Delete
* @flags: Set to 0.
[30] Fix | Delete
* @msg: The message payload.
[31] Fix | Delete
* @reply: This field is ignored with CEC_RECEIVE and is only used by
[32] Fix | Delete
* CEC_TRANSMIT. If non-zero, then wait for a reply with this
[33] Fix | Delete
* opcode. Set to CEC_MSG_FEATURE_ABORT if you want to wait for
[34] Fix | Delete
* a possible ABORT reply. If there was an error when sending the
[35] Fix | Delete
* msg or FeatureAbort was returned, then reply is set to 0.
[36] Fix | Delete
* If reply is non-zero upon return, then len/msg are set to
[37] Fix | Delete
* the received message.
[38] Fix | Delete
* If reply is zero upon return and status has the
[39] Fix | Delete
* CEC_TX_STATUS_FEATURE_ABORT bit set, then len/msg are set to
[40] Fix | Delete
* the received feature abort message.
[41] Fix | Delete
* If reply is zero upon return and status has the
[42] Fix | Delete
* CEC_TX_STATUS_MAX_RETRIES bit set, then no reply was seen at
[43] Fix | Delete
* all. If reply is non-zero for CEC_TRANSMIT and the message is a
[44] Fix | Delete
* broadcast, then -EINVAL is returned.
[45] Fix | Delete
* if reply is non-zero, then timeout is set to 1000 (the required
[46] Fix | Delete
* maximum response time).
[47] Fix | Delete
* @rx_status: The message receive status bits. Set by the driver.
[48] Fix | Delete
* @tx_status: The message transmit status bits. Set by the driver.
[49] Fix | Delete
* @tx_arb_lost_cnt: The number of 'Arbitration Lost' events. Set by the driver.
[50] Fix | Delete
* @tx_nack_cnt: The number of 'Not Acknowledged' events. Set by the driver.
[51] Fix | Delete
* @tx_low_drive_cnt: The number of 'Low Drive Detected' events. Set by the
[52] Fix | Delete
* driver.
[53] Fix | Delete
* @tx_error_cnt: The number of 'Error' events. Set by the driver.
[54] Fix | Delete
*/
[55] Fix | Delete
struct cec_msg {
[56] Fix | Delete
__u64 tx_ts;
[57] Fix | Delete
__u64 rx_ts;
[58] Fix | Delete
__u32 len;
[59] Fix | Delete
__u32 timeout;
[60] Fix | Delete
__u32 sequence;
[61] Fix | Delete
__u32 flags;
[62] Fix | Delete
__u8 msg[CEC_MAX_MSG_SIZE];
[63] Fix | Delete
__u8 reply;
[64] Fix | Delete
__u8 rx_status;
[65] Fix | Delete
__u8 tx_status;
[66] Fix | Delete
__u8 tx_arb_lost_cnt;
[67] Fix | Delete
__u8 tx_nack_cnt;
[68] Fix | Delete
__u8 tx_low_drive_cnt;
[69] Fix | Delete
__u8 tx_error_cnt;
[70] Fix | Delete
};
[71] Fix | Delete
[72] Fix | Delete
/**
[73] Fix | Delete
* cec_msg_initiator - return the initiator's logical address.
[74] Fix | Delete
* @msg: the message structure
[75] Fix | Delete
*/
[76] Fix | Delete
static __inline__ __u8 cec_msg_initiator(const struct cec_msg *msg)
[77] Fix | Delete
{
[78] Fix | Delete
return msg->msg[0] >> 4;
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
/**
[82] Fix | Delete
* cec_msg_destination - return the destination's logical address.
[83] Fix | Delete
* @msg: the message structure
[84] Fix | Delete
*/
[85] Fix | Delete
static __inline__ __u8 cec_msg_destination(const struct cec_msg *msg)
[86] Fix | Delete
{
[87] Fix | Delete
return msg->msg[0] & 0xf;
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
/**
[91] Fix | Delete
* cec_msg_opcode - return the opcode of the message, -1 for poll
[92] Fix | Delete
* @msg: the message structure
[93] Fix | Delete
*/
[94] Fix | Delete
static __inline__ int cec_msg_opcode(const struct cec_msg *msg)
[95] Fix | Delete
{
[96] Fix | Delete
return msg->len > 1 ? msg->msg[1] : -1;
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
/**
[100] Fix | Delete
* cec_msg_is_broadcast - return true if this is a broadcast message.
[101] Fix | Delete
* @msg: the message structure
[102] Fix | Delete
*/
[103] Fix | Delete
static __inline__ int cec_msg_is_broadcast(const struct cec_msg *msg)
[104] Fix | Delete
{
[105] Fix | Delete
return (msg->msg[0] & 0xf) == 0xf;
[106] Fix | Delete
}
[107] Fix | Delete
[108] Fix | Delete
/**
[109] Fix | Delete
* cec_msg_init - initialize the message structure.
[110] Fix | Delete
* @msg: the message structure
[111] Fix | Delete
* @initiator: the logical address of the initiator
[112] Fix | Delete
* @destination:the logical address of the destination (0xf for broadcast)
[113] Fix | Delete
*
[114] Fix | Delete
* The whole structure is zeroed, the len field is set to 1 (i.e. a poll
[115] Fix | Delete
* message) and the initiator and destination are filled in.
[116] Fix | Delete
*/
[117] Fix | Delete
static __inline__ void cec_msg_init(struct cec_msg *msg,
[118] Fix | Delete
__u8 initiator, __u8 destination)
[119] Fix | Delete
{
[120] Fix | Delete
memset(msg, 0, sizeof(*msg));
[121] Fix | Delete
msg->msg[0] = (initiator << 4) | destination;
[122] Fix | Delete
msg->len = 1;
[123] Fix | Delete
}
[124] Fix | Delete
[125] Fix | Delete
/**
[126] Fix | Delete
* cec_msg_set_reply_to - fill in destination/initiator in a reply message.
[127] Fix | Delete
* @msg: the message structure for the reply
[128] Fix | Delete
* @orig: the original message structure
[129] Fix | Delete
*
[130] Fix | Delete
* Set the msg destination to the orig initiator and the msg initiator to the
[131] Fix | Delete
* orig destination. Note that msg and orig may be the same pointer, in which
[132] Fix | Delete
* case the change is done in place.
[133] Fix | Delete
*/
[134] Fix | Delete
static __inline__ void cec_msg_set_reply_to(struct cec_msg *msg,
[135] Fix | Delete
struct cec_msg *orig)
[136] Fix | Delete
{
[137] Fix | Delete
/* The destination becomes the initiator and vice versa */
[138] Fix | Delete
msg->msg[0] = (cec_msg_destination(orig) << 4) |
[139] Fix | Delete
cec_msg_initiator(orig);
[140] Fix | Delete
msg->reply = msg->timeout = 0;
[141] Fix | Delete
}
[142] Fix | Delete
[143] Fix | Delete
/* cec_msg flags field */
[144] Fix | Delete
#define CEC_MSG_FL_REPLY_TO_FOLLOWERS (1 << 0)
[145] Fix | Delete
#define CEC_MSG_FL_RAW (1 << 1)
[146] Fix | Delete
[147] Fix | Delete
/* cec_msg tx/rx_status field */
[148] Fix | Delete
#define CEC_TX_STATUS_OK (1 << 0)
[149] Fix | Delete
#define CEC_TX_STATUS_ARB_LOST (1 << 1)
[150] Fix | Delete
#define CEC_TX_STATUS_NACK (1 << 2)
[151] Fix | Delete
#define CEC_TX_STATUS_LOW_DRIVE (1 << 3)
[152] Fix | Delete
#define CEC_TX_STATUS_ERROR (1 << 4)
[153] Fix | Delete
#define CEC_TX_STATUS_MAX_RETRIES (1 << 5)
[154] Fix | Delete
#define CEC_TX_STATUS_ABORTED (1 << 6)
[155] Fix | Delete
#define CEC_TX_STATUS_TIMEOUT (1 << 7)
[156] Fix | Delete
[157] Fix | Delete
#define CEC_RX_STATUS_OK (1 << 0)
[158] Fix | Delete
#define CEC_RX_STATUS_TIMEOUT (1 << 1)
[159] Fix | Delete
#define CEC_RX_STATUS_FEATURE_ABORT (1 << 2)
[160] Fix | Delete
#define CEC_RX_STATUS_ABORTED (1 << 3)
[161] Fix | Delete
[162] Fix | Delete
static __inline__ int cec_msg_status_is_ok(const struct cec_msg *msg)
[163] Fix | Delete
{
[164] Fix | Delete
if (msg->tx_status && !(msg->tx_status & CEC_TX_STATUS_OK))
[165] Fix | Delete
return 0;
[166] Fix | Delete
if (msg->rx_status && !(msg->rx_status & CEC_RX_STATUS_OK))
[167] Fix | Delete
return 0;
[168] Fix | Delete
if (!msg->tx_status && !msg->rx_status)
[169] Fix | Delete
return 0;
[170] Fix | Delete
return !(msg->rx_status & CEC_RX_STATUS_FEATURE_ABORT);
[171] Fix | Delete
}
[172] Fix | Delete
[173] Fix | Delete
#define CEC_LOG_ADDR_INVALID 0xff
[174] Fix | Delete
#define CEC_PHYS_ADDR_INVALID 0xffff
[175] Fix | Delete
[176] Fix | Delete
/*
[177] Fix | Delete
* The maximum number of logical addresses one device can be assigned to.
[178] Fix | Delete
* The CEC 2.0 spec allows for only 2 logical addresses at the moment. The
[179] Fix | Delete
* Analog Devices CEC hardware supports 3. So let's go wild and go for 4.
[180] Fix | Delete
*/
[181] Fix | Delete
#define CEC_MAX_LOG_ADDRS 4
[182] Fix | Delete
[183] Fix | Delete
/* The logical addresses defined by CEC 2.0 */
[184] Fix | Delete
#define CEC_LOG_ADDR_TV 0
[185] Fix | Delete
#define CEC_LOG_ADDR_RECORD_1 1
[186] Fix | Delete
#define CEC_LOG_ADDR_RECORD_2 2
[187] Fix | Delete
#define CEC_LOG_ADDR_TUNER_1 3
[188] Fix | Delete
#define CEC_LOG_ADDR_PLAYBACK_1 4
[189] Fix | Delete
#define CEC_LOG_ADDR_AUDIOSYSTEM 5
[190] Fix | Delete
#define CEC_LOG_ADDR_TUNER_2 6
[191] Fix | Delete
#define CEC_LOG_ADDR_TUNER_3 7
[192] Fix | Delete
#define CEC_LOG_ADDR_PLAYBACK_2 8
[193] Fix | Delete
#define CEC_LOG_ADDR_RECORD_3 9
[194] Fix | Delete
#define CEC_LOG_ADDR_TUNER_4 10
[195] Fix | Delete
#define CEC_LOG_ADDR_PLAYBACK_3 11
[196] Fix | Delete
#define CEC_LOG_ADDR_BACKUP_1 12
[197] Fix | Delete
#define CEC_LOG_ADDR_BACKUP_2 13
[198] Fix | Delete
#define CEC_LOG_ADDR_SPECIFIC 14
[199] Fix | Delete
#define CEC_LOG_ADDR_UNREGISTERED 15 /* as initiator address */
[200] Fix | Delete
#define CEC_LOG_ADDR_BROADCAST 15 /* as destination address */
[201] Fix | Delete
[202] Fix | Delete
/* The logical address types that the CEC device wants to claim */
[203] Fix | Delete
#define CEC_LOG_ADDR_TYPE_TV 0
[204] Fix | Delete
#define CEC_LOG_ADDR_TYPE_RECORD 1
[205] Fix | Delete
#define CEC_LOG_ADDR_TYPE_TUNER 2
[206] Fix | Delete
#define CEC_LOG_ADDR_TYPE_PLAYBACK 3
[207] Fix | Delete
#define CEC_LOG_ADDR_TYPE_AUDIOSYSTEM 4
[208] Fix | Delete
#define CEC_LOG_ADDR_TYPE_SPECIFIC 5
[209] Fix | Delete
#define CEC_LOG_ADDR_TYPE_UNREGISTERED 6
[210] Fix | Delete
/*
[211] Fix | Delete
* Switches should use UNREGISTERED.
[212] Fix | Delete
* Processors should use SPECIFIC.
[213] Fix | Delete
*/
[214] Fix | Delete
[215] Fix | Delete
#define CEC_LOG_ADDR_MASK_TV (1 << CEC_LOG_ADDR_TV)
[216] Fix | Delete
#define CEC_LOG_ADDR_MASK_RECORD ((1 << CEC_LOG_ADDR_RECORD_1) | \
[217] Fix | Delete
(1 << CEC_LOG_ADDR_RECORD_2) | \
[218] Fix | Delete
(1 << CEC_LOG_ADDR_RECORD_3))
[219] Fix | Delete
#define CEC_LOG_ADDR_MASK_TUNER ((1 << CEC_LOG_ADDR_TUNER_1) | \
[220] Fix | Delete
(1 << CEC_LOG_ADDR_TUNER_2) | \
[221] Fix | Delete
(1 << CEC_LOG_ADDR_TUNER_3) | \
[222] Fix | Delete
(1 << CEC_LOG_ADDR_TUNER_4))
[223] Fix | Delete
#define CEC_LOG_ADDR_MASK_PLAYBACK ((1 << CEC_LOG_ADDR_PLAYBACK_1) | \
[224] Fix | Delete
(1 << CEC_LOG_ADDR_PLAYBACK_2) | \
[225] Fix | Delete
(1 << CEC_LOG_ADDR_PLAYBACK_3))
[226] Fix | Delete
#define CEC_LOG_ADDR_MASK_AUDIOSYSTEM (1 << CEC_LOG_ADDR_AUDIOSYSTEM)
[227] Fix | Delete
#define CEC_LOG_ADDR_MASK_BACKUP ((1 << CEC_LOG_ADDR_BACKUP_1) | \
[228] Fix | Delete
(1 << CEC_LOG_ADDR_BACKUP_2))
[229] Fix | Delete
#define CEC_LOG_ADDR_MASK_SPECIFIC (1 << CEC_LOG_ADDR_SPECIFIC)
[230] Fix | Delete
#define CEC_LOG_ADDR_MASK_UNREGISTERED (1 << CEC_LOG_ADDR_UNREGISTERED)
[231] Fix | Delete
[232] Fix | Delete
static __inline__ int cec_has_tv(__u16 log_addr_mask)
[233] Fix | Delete
{
[234] Fix | Delete
return log_addr_mask & CEC_LOG_ADDR_MASK_TV;
[235] Fix | Delete
}
[236] Fix | Delete
[237] Fix | Delete
static __inline__ int cec_has_record(__u16 log_addr_mask)
[238] Fix | Delete
{
[239] Fix | Delete
return log_addr_mask & CEC_LOG_ADDR_MASK_RECORD;
[240] Fix | Delete
}
[241] Fix | Delete
[242] Fix | Delete
static __inline__ int cec_has_tuner(__u16 log_addr_mask)
[243] Fix | Delete
{
[244] Fix | Delete
return log_addr_mask & CEC_LOG_ADDR_MASK_TUNER;
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
static __inline__ int cec_has_playback(__u16 log_addr_mask)
[248] Fix | Delete
{
[249] Fix | Delete
return log_addr_mask & CEC_LOG_ADDR_MASK_PLAYBACK;
[250] Fix | Delete
}
[251] Fix | Delete
[252] Fix | Delete
static __inline__ int cec_has_audiosystem(__u16 log_addr_mask)
[253] Fix | Delete
{
[254] Fix | Delete
return log_addr_mask & CEC_LOG_ADDR_MASK_AUDIOSYSTEM;
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
static __inline__ int cec_has_backup(__u16 log_addr_mask)
[258] Fix | Delete
{
[259] Fix | Delete
return log_addr_mask & CEC_LOG_ADDR_MASK_BACKUP;
[260] Fix | Delete
}
[261] Fix | Delete
[262] Fix | Delete
static __inline__ int cec_has_specific(__u16 log_addr_mask)
[263] Fix | Delete
{
[264] Fix | Delete
return log_addr_mask & CEC_LOG_ADDR_MASK_SPECIFIC;
[265] Fix | Delete
}
[266] Fix | Delete
[267] Fix | Delete
static __inline__ int cec_is_unregistered(__u16 log_addr_mask)
[268] Fix | Delete
{
[269] Fix | Delete
return log_addr_mask & CEC_LOG_ADDR_MASK_UNREGISTERED;
[270] Fix | Delete
}
[271] Fix | Delete
[272] Fix | Delete
static __inline__ int cec_is_unconfigured(__u16 log_addr_mask)
[273] Fix | Delete
{
[274] Fix | Delete
return log_addr_mask == 0;
[275] Fix | Delete
}
[276] Fix | Delete
[277] Fix | Delete
/*
[278] Fix | Delete
* Use this if there is no vendor ID (CEC_G_VENDOR_ID) or if the vendor ID
[279] Fix | Delete
* should be disabled (CEC_S_VENDOR_ID)
[280] Fix | Delete
*/
[281] Fix | Delete
#define CEC_VENDOR_ID_NONE 0xffffffff
[282] Fix | Delete
[283] Fix | Delete
/* The message handling modes */
[284] Fix | Delete
/* Modes for initiator */
[285] Fix | Delete
#define CEC_MODE_NO_INITIATOR (0x0 << 0)
[286] Fix | Delete
#define CEC_MODE_INITIATOR (0x1 << 0)
[287] Fix | Delete
#define CEC_MODE_EXCL_INITIATOR (0x2 << 0)
[288] Fix | Delete
#define CEC_MODE_INITIATOR_MSK 0x0f
[289] Fix | Delete
[290] Fix | Delete
/* Modes for follower */
[291] Fix | Delete
#define CEC_MODE_NO_FOLLOWER (0x0 << 4)
[292] Fix | Delete
#define CEC_MODE_FOLLOWER (0x1 << 4)
[293] Fix | Delete
#define CEC_MODE_EXCL_FOLLOWER (0x2 << 4)
[294] Fix | Delete
#define CEC_MODE_EXCL_FOLLOWER_PASSTHRU (0x3 << 4)
[295] Fix | Delete
#define CEC_MODE_MONITOR_PIN (0xd << 4)
[296] Fix | Delete
#define CEC_MODE_MONITOR (0xe << 4)
[297] Fix | Delete
#define CEC_MODE_MONITOR_ALL (0xf << 4)
[298] Fix | Delete
#define CEC_MODE_FOLLOWER_MSK 0xf0
[299] Fix | Delete
[300] Fix | Delete
/* Userspace has to configure the physical address */
[301] Fix | Delete
#define CEC_CAP_PHYS_ADDR (1 << 0)
[302] Fix | Delete
/* Userspace has to configure the logical addresses */
[303] Fix | Delete
#define CEC_CAP_LOG_ADDRS (1 << 1)
[304] Fix | Delete
/* Userspace can transmit messages (and thus become follower as well) */
[305] Fix | Delete
#define CEC_CAP_TRANSMIT (1 << 2)
[306] Fix | Delete
/*
[307] Fix | Delete
* Passthrough all messages instead of processing them.
[308] Fix | Delete
*/
[309] Fix | Delete
#define CEC_CAP_PASSTHROUGH (1 << 3)
[310] Fix | Delete
/* Supports remote control */
[311] Fix | Delete
#define CEC_CAP_RC (1 << 4)
[312] Fix | Delete
/* Hardware can monitor all messages, not just directed and broadcast. */
[313] Fix | Delete
#define CEC_CAP_MONITOR_ALL (1 << 5)
[314] Fix | Delete
/* Hardware can use CEC only if the HDMI HPD pin is high. */
[315] Fix | Delete
#define CEC_CAP_NEEDS_HPD (1 << 6)
[316] Fix | Delete
/* Hardware can monitor CEC pin transitions */
[317] Fix | Delete
#define CEC_CAP_MONITOR_PIN (1 << 7)
[318] Fix | Delete
/* CEC_ADAP_G_CONNECTOR_INFO is available */
[319] Fix | Delete
#define CEC_CAP_CONNECTOR_INFO (1 << 8)
[320] Fix | Delete
[321] Fix | Delete
/**
[322] Fix | Delete
* struct cec_caps - CEC capabilities structure.
[323] Fix | Delete
* @driver: name of the CEC device driver.
[324] Fix | Delete
* @name: name of the CEC device. @driver + @name must be unique.
[325] Fix | Delete
* @available_log_addrs: number of available logical addresses.
[326] Fix | Delete
* @capabilities: capabilities of the CEC adapter.
[327] Fix | Delete
* @version: version of the CEC adapter framework.
[328] Fix | Delete
*/
[329] Fix | Delete
struct cec_caps {
[330] Fix | Delete
char driver[32];
[331] Fix | Delete
char name[32];
[332] Fix | Delete
__u32 available_log_addrs;
[333] Fix | Delete
__u32 capabilities;
[334] Fix | Delete
__u32 version;
[335] Fix | Delete
};
[336] Fix | Delete
[337] Fix | Delete
/**
[338] Fix | Delete
* struct cec_log_addrs - CEC logical addresses structure.
[339] Fix | Delete
* @log_addr: the claimed logical addresses. Set by the driver.
[340] Fix | Delete
* @log_addr_mask: current logical address mask. Set by the driver.
[341] Fix | Delete
* @cec_version: the CEC version that the adapter should implement. Set by the
[342] Fix | Delete
* caller.
[343] Fix | Delete
* @num_log_addrs: how many logical addresses should be claimed. Set by the
[344] Fix | Delete
* caller.
[345] Fix | Delete
* @vendor_id: the vendor ID of the device. Set by the caller.
[346] Fix | Delete
* @flags: flags.
[347] Fix | Delete
* @osd_name: the OSD name of the device. Set by the caller.
[348] Fix | Delete
* @primary_device_type: the primary device type for each logical address.
[349] Fix | Delete
* Set by the caller.
[350] Fix | Delete
* @log_addr_type: the logical address types. Set by the caller.
[351] Fix | Delete
* @all_device_types: CEC 2.0: all device types represented by the logical
[352] Fix | Delete
* address. Set by the caller.
[353] Fix | Delete
* @features: CEC 2.0: The logical address features. Set by the caller.
[354] Fix | Delete
*/
[355] Fix | Delete
struct cec_log_addrs {
[356] Fix | Delete
__u8 log_addr[CEC_MAX_LOG_ADDRS];
[357] Fix | Delete
__u16 log_addr_mask;
[358] Fix | Delete
__u8 cec_version;
[359] Fix | Delete
__u8 num_log_addrs;
[360] Fix | Delete
__u32 vendor_id;
[361] Fix | Delete
__u32 flags;
[362] Fix | Delete
char osd_name[15];
[363] Fix | Delete
__u8 primary_device_type[CEC_MAX_LOG_ADDRS];
[364] Fix | Delete
__u8 log_addr_type[CEC_MAX_LOG_ADDRS];
[365] Fix | Delete
[366] Fix | Delete
/* CEC 2.0 */
[367] Fix | Delete
__u8 all_device_types[CEC_MAX_LOG_ADDRS];
[368] Fix | Delete
__u8 features[CEC_MAX_LOG_ADDRS][12];
[369] Fix | Delete
};
[370] Fix | Delete
[371] Fix | Delete
/* Allow a fallback to unregistered */
[372] Fix | Delete
#define CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK (1 << 0)
[373] Fix | Delete
/* Passthrough RC messages to the input subsystem */
[374] Fix | Delete
#define CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU (1 << 1)
[375] Fix | Delete
/* CDC-Only device: supports only CDC messages */
[376] Fix | Delete
#define CEC_LOG_ADDRS_FL_CDC_ONLY (1 << 2)
[377] Fix | Delete
[378] Fix | Delete
/**
[379] Fix | Delete
* struct cec_drm_connector_info - tells which drm connector is
[380] Fix | Delete
* associated with the CEC adapter.
[381] Fix | Delete
* @card_no: drm card number
[382] Fix | Delete
* @connector_id: drm connector ID
[383] Fix | Delete
*/
[384] Fix | Delete
struct cec_drm_connector_info {
[385] Fix | Delete
__u32 card_no;
[386] Fix | Delete
__u32 connector_id;
[387] Fix | Delete
};
[388] Fix | Delete
[389] Fix | Delete
#define CEC_CONNECTOR_TYPE_NO_CONNECTOR 0
[390] Fix | Delete
#define CEC_CONNECTOR_TYPE_DRM 1
[391] Fix | Delete
[392] Fix | Delete
/**
[393] Fix | Delete
* struct cec_connector_info - tells if and which connector is
[394] Fix | Delete
* associated with the CEC adapter.
[395] Fix | Delete
* @type: connector type (if any)
[396] Fix | Delete
* @drm: drm connector info
[397] Fix | Delete
*/
[398] Fix | Delete
struct cec_connector_info {
[399] Fix | Delete
__u32 type;
[400] Fix | Delete
union {
[401] Fix | Delete
struct cec_drm_connector_info drm;
[402] Fix | Delete
__u32 raw[16];
[403] Fix | Delete
};
[404] Fix | Delete
};
[405] Fix | Delete
[406] Fix | Delete
/* Events */
[407] Fix | Delete
[408] Fix | Delete
/* Event that occurs when the adapter state changes */
[409] Fix | Delete
#define CEC_EVENT_STATE_CHANGE 1
[410] Fix | Delete
/*
[411] Fix | Delete
* This event is sent when messages are lost because the application
[412] Fix | Delete
* didn't empty the message queue in time
[413] Fix | Delete
*/
[414] Fix | Delete
#define CEC_EVENT_LOST_MSGS 2
[415] Fix | Delete
#define CEC_EVENT_PIN_CEC_LOW 3
[416] Fix | Delete
#define CEC_EVENT_PIN_CEC_HIGH 4
[417] Fix | Delete
#define CEC_EVENT_PIN_HPD_LOW 5
[418] Fix | Delete
#define CEC_EVENT_PIN_HPD_HIGH 6
[419] Fix | Delete
#define CEC_EVENT_PIN_5V_LOW 7
[420] Fix | Delete
#define CEC_EVENT_PIN_5V_HIGH 8
[421] Fix | Delete
[422] Fix | Delete
#define CEC_EVENT_FL_INITIAL_STATE (1 << 0)
[423] Fix | Delete
#define CEC_EVENT_FL_DROPPED_EVENTS (1 << 1)
[424] Fix | Delete
[425] Fix | Delete
/**
[426] Fix | Delete
* struct cec_event_state_change - used when the CEC adapter changes state.
[427] Fix | Delete
* @phys_addr: the current physical address
[428] Fix | Delete
* @log_addr_mask: the current logical address mask
[429] Fix | Delete
* @have_conn_info: if non-zero, then HDMI connector information is available.
[430] Fix | Delete
* This field is only valid if CEC_CAP_CONNECTOR_INFO is set. If that
[431] Fix | Delete
* capability is set and @have_conn_info is zero, then that indicates
[432] Fix | Delete
* that the HDMI connector device is not instantiated, either because
[433] Fix | Delete
* the HDMI driver is still configuring the device or because the HDMI
[434] Fix | Delete
* device was unbound.
[435] Fix | Delete
*/
[436] Fix | Delete
struct cec_event_state_change {
[437] Fix | Delete
__u16 phys_addr;
[438] Fix | Delete
__u16 log_addr_mask;
[439] Fix | Delete
__u16 have_conn_info;
[440] Fix | Delete
};
[441] Fix | Delete
[442] Fix | Delete
/**
[443] Fix | Delete
* struct cec_event_lost_msgs - tells you how many messages were lost.
[444] Fix | Delete
* @lost_msgs: how many messages were lost.
[445] Fix | Delete
*/
[446] Fix | Delete
struct cec_event_lost_msgs {
[447] Fix | Delete
__u32 lost_msgs;
[448] Fix | Delete
};
[449] Fix | Delete
[450] Fix | Delete
/**
[451] Fix | Delete
* struct cec_event - CEC event structure
[452] Fix | Delete
* @ts: the timestamp of when the event was sent.
[453] Fix | Delete
* @event: the event.
[454] Fix | Delete
* array.
[455] Fix | Delete
* @state_change: the event payload for CEC_EVENT_STATE_CHANGE.
[456] Fix | Delete
* @lost_msgs: the event payload for CEC_EVENT_LOST_MSGS.
[457] Fix | Delete
* @raw: array to pad the union.
[458] Fix | Delete
*/
[459] Fix | Delete
struct cec_event {
[460] Fix | Delete
__u64 ts;
[461] Fix | Delete
__u32 event;
[462] Fix | Delete
__u32 flags;
[463] Fix | Delete
union {
[464] Fix | Delete
struct cec_event_state_change state_change;
[465] Fix | Delete
struct cec_event_lost_msgs lost_msgs;
[466] Fix | Delete
__u32 raw[16];
[467] Fix | Delete
};
[468] Fix | Delete
};
[469] Fix | Delete
[470] Fix | Delete
/* ioctls */
[471] Fix | Delete
[472] Fix | Delete
/* Adapter capabilities */
[473] Fix | Delete
#define CEC_ADAP_G_CAPS _IOWR('a', 0, struct cec_caps)
[474] Fix | Delete
[475] Fix | Delete
/*
[476] Fix | Delete
* phys_addr is either 0 (if this is the CEC root device)
[477] Fix | Delete
* or a valid physical address obtained from the sink's EDID
[478] Fix | Delete
* as read by this CEC device (if this is a source device)
[479] Fix | Delete
* or a physical address obtained and modified from a sink
[480] Fix | Delete
* EDID and used for a sink CEC device.
[481] Fix | Delete
* If nothing is connected, then phys_addr is 0xffff.
[482] Fix | Delete
* See HDMI 1.4b, section 8.7 (Physical Address).
[483] Fix | Delete
*
[484] Fix | Delete
* The CEC_ADAP_S_PHYS_ADDR ioctl may not be available if that is handled
[485] Fix | Delete
* internally.
[486] Fix | Delete
*/
[487] Fix | Delete
#define CEC_ADAP_G_PHYS_ADDR _IOR('a', 1, __u16)
[488] Fix | Delete
#define CEC_ADAP_S_PHYS_ADDR _IOW('a', 2, __u16)
[489] Fix | Delete
[490] Fix | Delete
/*
[491] Fix | Delete
* Configure the CEC adapter. It sets the device type and which
[492] Fix | Delete
* logical types it will try to claim. It will return which
[493] Fix | Delete
* logical addresses it could actually claim.
[494] Fix | Delete
* An error is returned if the adapter is disabled or if there
[495] Fix | Delete
* is no physical address assigned.
[496] Fix | Delete
*/
[497] Fix | Delete
[498] Fix | Delete
#define CEC_ADAP_G_LOG_ADDRS _IOR('a', 3, struct cec_log_addrs)
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function