linux/drivers/media/cec/core/cec-pin-priv.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * cec-pin-priv.h - internal cec-pin header
 *
 * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 */

#ifndef LINUX_CEC_PIN_PRIV_H
#define LINUX_CEC_PIN_PRIV_H

#include <linux/types.h>
#include <linux/atomic.h>
#include <media/cec-pin.h>

#define call_pin_op(pin, op, arg...)

#define call_void_pin_op(pin, op, arg...)

enum cec_pin_state {};

/* Error Injection */

/* Error injection modes */
#define CEC_ERROR_INJ_MODE_OFF
#define CEC_ERROR_INJ_MODE_ONCE
#define CEC_ERROR_INJ_MODE_ALWAYS
#define CEC_ERROR_INJ_MODE_TOGGLE
#define CEC_ERROR_INJ_MODE_MASK

/* Receive error injection options */
#define CEC_ERROR_INJ_RX_NACK_OFFSET
#define CEC_ERROR_INJ_RX_LOW_DRIVE_OFFSET
#define CEC_ERROR_INJ_RX_ADD_BYTE_OFFSET
#define CEC_ERROR_INJ_RX_REMOVE_BYTE_OFFSET
#define CEC_ERROR_INJ_RX_ARB_LOST_OFFSET
#define CEC_ERROR_INJ_RX_MASK

/* Transmit error injection options */
#define CEC_ERROR_INJ_TX_NO_EOM_OFFSET
#define CEC_ERROR_INJ_TX_EARLY_EOM_OFFSET
#define CEC_ERROR_INJ_TX_SHORT_BIT_OFFSET
#define CEC_ERROR_INJ_TX_LONG_BIT_OFFSET
#define CEC_ERROR_INJ_TX_CUSTOM_BIT_OFFSET
#define CEC_ERROR_INJ_TX_SHORT_START_OFFSET
#define CEC_ERROR_INJ_TX_LONG_START_OFFSET
#define CEC_ERROR_INJ_TX_CUSTOM_START_OFFSET
#define CEC_ERROR_INJ_TX_LAST_BIT_OFFSET
#define CEC_ERROR_INJ_TX_ADD_BYTES_OFFSET
#define CEC_ERROR_INJ_TX_REMOVE_BYTE_OFFSET
#define CEC_ERROR_INJ_TX_LOW_DRIVE_OFFSET
#define CEC_ERROR_INJ_TX_MASK

#define CEC_ERROR_INJ_RX_LOW_DRIVE_ARG_IDX
#define CEC_ERROR_INJ_RX_ARB_LOST_ARG_IDX

#define CEC_ERROR_INJ_TX_ADD_BYTES_ARG_IDX
#define CEC_ERROR_INJ_TX_SHORT_BIT_ARG_IDX
#define CEC_ERROR_INJ_TX_LONG_BIT_ARG_IDX
#define CEC_ERROR_INJ_TX_CUSTOM_BIT_ARG_IDX
#define CEC_ERROR_INJ_TX_LAST_BIT_ARG_IDX
#define CEC_ERROR_INJ_TX_LOW_DRIVE_ARG_IDX
#define CEC_ERROR_INJ_NUM_ARGS

/* Special CEC op values */
#define CEC_ERROR_INJ_OP_ANY

/* The default for the low/high time of the custom pulse */
#define CEC_TIM_CUSTOM_DEFAULT

#define CEC_NUM_PIN_EVENTS
#define CEC_PIN_EVENT_FL_IS_HIGH
#define CEC_PIN_EVENT_FL_DROPPED

#define CEC_PIN_IRQ_UNCHANGED
#define CEC_PIN_IRQ_DISABLE
#define CEC_PIN_IRQ_ENABLE

struct cec_pin {};

void cec_pin_start_timer(struct cec_pin *pin);

#ifdef CONFIG_CEC_PIN_ERROR_INJ
bool cec_pin_error_inj_parse_line(struct cec_adapter *adap, char *line);
int cec_pin_error_inj_show(struct cec_adapter *adap, struct seq_file *sf);

u16 cec_pin_rx_error_inj(struct cec_pin *pin);
u16 cec_pin_tx_error_inj(struct cec_pin *pin);
#endif

#endif