}
static inline void cec_msg_request_active_source(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[0] |= 0xf; /* broadcast */
}
static inline void cec_msg_routing_change(struct cec_msg *msg,
- bool reply,
+ int reply,
__u16 orig_phys_addr,
__u16 new_phys_addr)
{
/* One Touch Record Feature */
-static inline void cec_msg_record_off(struct cec_msg *msg, bool reply)
+static inline void cec_msg_record_off(struct cec_msg *msg, int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_RECORD_OFF;
}
static inline void cec_msg_record_on(struct cec_msg *msg,
- bool reply,
+ int reply,
const struct cec_op_record_src *rec_src)
{
switch (rec_src->type) {
}
static inline void cec_msg_record_tv_screen(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_RECORD_TV_SCREEN;
}
static inline void cec_msg_clear_analogue_timer(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 day,
__u8 month,
__u8 start_hr,
}
static inline void cec_msg_clear_digital_timer(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 day,
__u8 month,
__u8 start_hr,
}
static inline void cec_msg_clear_ext_timer(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 day,
__u8 month,
__u8 start_hr,
}
static inline void cec_msg_set_analogue_timer(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 day,
__u8 month,
__u8 start_hr,
}
static inline void cec_msg_set_digital_timer(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 day,
__u8 month,
__u8 start_hr,
}
static inline void cec_msg_set_ext_timer(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 day,
__u8 month,
__u8 start_hr,
}
static inline void cec_msg_get_cec_version(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GET_CEC_VERSION;
}
static inline void cec_msg_give_physical_addr(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GIVE_PHYSICAL_ADDR;
}
static inline void cec_msg_get_menu_language(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GET_MENU_LANGUAGE;
}
static inline void cec_msg_give_features(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GIVE_FEATURES;
}
static inline void cec_msg_give_deck_status(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 status_req)
{
msg->len = 3;
struct cec_op_tuner_device_info {
__u8 rec_flag;
__u8 tuner_display_info;
- bool is_analog;
+ __u8 is_analog;
union {
struct cec_op_digital_service_id digital;
struct {
}
static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 status_req)
{
msg->len = 3;
}
static inline void cec_msg_give_device_vendor_id(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GIVE_DEVICE_VENDOR_ID;
}
static inline void cec_msg_give_osd_name(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GIVE_OSD_NAME;
}
static inline void cec_msg_menu_request(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 menu_req)
{
msg->len = 3;
struct cec_op_ui_command {
__u8 ui_cmd;
- bool has_opt_arg;
+ __u8 has_opt_arg;
union {
struct cec_op_channel_data channel_identifier;
__u8 ui_broadcast_type;
struct cec_op_ui_command *ui_cmd)
{
ui_cmd->ui_cmd = msg->msg[2];
- ui_cmd->has_opt_arg = false;
+ ui_cmd->has_opt_arg = 0;
if (msg->len == 3)
return;
switch (ui_cmd->ui_cmd) {
case 0x6a:
/* The optional operand is one byte for all these ui commands */
ui_cmd->play_mode = msg->msg[3];
- ui_cmd->has_opt_arg = true;
+ ui_cmd->has_opt_arg = 1;
break;
case 0x67:
if (msg->len < 7)
break;
- ui_cmd->has_opt_arg = true;
+ ui_cmd->has_opt_arg = 1;
ui_cmd->channel_identifier.channel_number_fmt = msg->msg[3] >> 2;
ui_cmd->channel_identifier.major = ((msg->msg[3] & 3) << 6) | msg->msg[4];
ui_cmd->channel_identifier.minor = (msg->msg[5] << 8) | msg->msg[6];
}
static inline void cec_msg_give_device_power_status(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GIVE_DEVICE_POWER_STATUS;
}
static inline void cec_msg_give_audio_status(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GIVE_AUDIO_STATUS;
}
static inline void cec_msg_system_audio_mode_request(struct cec_msg *msg,
- bool reply,
+ int reply,
__u16 phys_addr)
{
msg->len = phys_addr == 0xffff ? 2 : 4;
}
static inline void cec_msg_give_system_audio_mode_status(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS;
}
static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg,
- bool reply,
+ int reply,
__u8 num_descriptors,
const __u8 *audio_format_id,
const __u8 *audio_format_code)
}
static inline void cec_msg_initiate_arc(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_INITIATE_ARC;
}
static inline void cec_msg_request_arc_initiation(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_REQUEST_ARC_INITIATION;
}
static inline void cec_msg_terminate_arc(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_TERMINATE_ARC;
}
static inline void cec_msg_request_arc_termination(struct cec_msg *msg,
- bool reply)
+ int reply)
{
msg->len = 2;
msg->msg[1] = CEC_MSG_REQUEST_ARC_TERMINATION;
}
static inline void cec_msg_request_current_latency(struct cec_msg *msg,
- bool reply,
+ int reply,
__u16 phys_addr)
{
msg->len = 4;
#define _CEC_UAPI_H
#include <linux/types.h>
+#include <linux/string.h>
#define CEC_MAX_MSG_SIZE 16
* cec_msg_is_broadcast - return true if this is a broadcast message.
* @msg: the message structure
*/
-static inline bool cec_msg_is_broadcast(const struct cec_msg *msg)
+static inline int cec_msg_is_broadcast(const struct cec_msg *msg)
{
return (msg->msg[0] & 0xf) == 0xf;
}
#define CEC_RX_STATUS_TIMEOUT (1 << 1)
#define CEC_RX_STATUS_FEATURE_ABORT (1 << 2)
-static inline bool cec_msg_status_is_ok(const struct cec_msg *msg)
+static inline int cec_msg_status_is_ok(const struct cec_msg *msg)
{
if (msg->tx_status && !(msg->tx_status & CEC_TX_STATUS_OK))
- return false;
+ return 0;
if (msg->rx_status && !(msg->rx_status & CEC_RX_STATUS_OK))
- return false;
+ return 0;
if (!msg->tx_status && !msg->rx_status)
- return false;
+ return 0;
return !(msg->rx_status & CEC_RX_STATUS_FEATURE_ABORT);
}
#define CEC_LOG_ADDR_MASK_SPECIFIC (1 << CEC_LOG_ADDR_SPECIFIC)
#define CEC_LOG_ADDR_MASK_UNREGISTERED (1 << CEC_LOG_ADDR_UNREGISTERED)
-static inline bool cec_has_tv(__u16 log_addr_mask)
+static inline int cec_has_tv(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_TV;
}
-static inline bool cec_has_record(__u16 log_addr_mask)
+static inline int cec_has_record(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_RECORD;
}
-static inline bool cec_has_tuner(__u16 log_addr_mask)
+static inline int cec_has_tuner(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_TUNER;
}
-static inline bool cec_has_playback(__u16 log_addr_mask)
+static inline int cec_has_playback(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_PLAYBACK;
}
-static inline bool cec_has_audiosystem(__u16 log_addr_mask)
+static inline int cec_has_audiosystem(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_AUDIOSYSTEM;
}
-static inline bool cec_has_backup(__u16 log_addr_mask)
+static inline int cec_has_backup(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_BACKUP;
}
-static inline bool cec_has_specific(__u16 log_addr_mask)
+static inline int cec_has_specific(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_SPECIFIC;
}
-static inline bool cec_is_unregistered(__u16 log_addr_mask)
+static inline int cec_is_unregistered(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_UNREGISTERED;
}
-static inline bool cec_is_unconfigured(__u16 log_addr_mask)
+static inline int cec_is_unconfigured(__u16 log_addr_mask)
{
return log_addr_mask == 0;
}
/* Helper functions to identify the 'special' CEC devices */
-static inline bool cec_is_2nd_tv(const struct cec_log_addrs *las)
+static inline int cec_is_2nd_tv(const struct cec_log_addrs *las)
{
/*
* It is a second TV if the logical address is 14 or 15 and the
las->primary_device_type[0] == CEC_OP_PRIM_DEVTYPE_TV;
}
-static inline bool cec_is_processor(const struct cec_log_addrs *las)
+static inline int cec_is_processor(const struct cec_log_addrs *las)
{
/*
* It is a processor if the logical address is 12-15 and the
las->primary_device_type[0] == CEC_OP_PRIM_DEVTYPE_PROCESSOR;
}
-static inline bool cec_is_switch(const struct cec_log_addrs *las)
+static inline int cec_is_switch(const struct cec_log_addrs *las)
{
/*
* It is a switch if the logical address is 15 and the
!(las->flags & CEC_LOG_ADDRS_FL_CDC_ONLY);
}
-static inline bool cec_is_cdc_only(const struct cec_log_addrs *las)
+static inline int cec_is_cdc_only(const struct cec_log_addrs *las)
{
/*
* It is a CDC-only device if the logical address is 15 and the