linux/drivers/media/pci/ddbridge/ddbridge-mci.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * ddbridge-mci.h: Digital Devices micro code interface
 *
 * Copyright (C) 2017-2018 Digital Devices GmbH
 *                         Marcus Metzler <[email protected]>
 *                         Ralph Metzler <[email protected]>
 */

#ifndef _DDBRIDGE_MCI_H_
#define _DDBRIDGE_MCI_H_

#define MCI_DEMOD_MAX
#define MCI_TUNER_MAX
#define DEMOD_UNUSED

#define MCI_CONTROL
#define MCI_COMMAND
#define MCI_RESULT

#define MCI_COMMAND_SIZE
#define MCI_RESULT_SIZE

#define MCI_CONTROL_START_COMMAND
#define MCI_CONTROL_ENABLE_DONE_INTERRUPT
#define MCI_CONTROL_RESET
#define MCI_CONTROL_READY

#define SX8_TSCONFIG

#define SX8_TSCONFIG_MODE_MASK
#define SX8_TSCONFIG_MODE_OFF
#define SX8_TSCONFIG_MODE_NORMAL
#define SX8_TSCONFIG_MODE_IQ

/*
 * IQMode is only available on MaxSX8 on a single tuner
 *
 * IQ_MODE_SAMPLES
 *       sampling rate is 1550/24 MHz (64.583 MHz)
 *       channel agc is frozen, to allow stitching the FFT results together
 *
 * IQ_MODE_VTM
 *       sampling rate is the supplied symbolrate
 *       channel agc is active
 *
 * in both cases down sampling is done with a RRC Filter (currently fixed to
 * alpha = 0.05) which causes some (ca 5%) aliasing at the edges from
 * outside the spectrum
 */

#define SX8_TSCONFIG_TSHEADER
#define SX8_TSCONFIG_BURST

#define SX8_TSCONFIG_BURSTSIZE_MASK
#define SX8_TSCONFIG_BURSTSIZE_2K
#define SX8_TSCONFIG_BURSTSIZE_4K
#define SX8_TSCONFIG_BURSTSIZE_8K
#define SX8_TSCONFIG_BURSTSIZE_16K

#define SX8_DEMOD_STOPPED
#define SX8_DEMOD_IQ_MODE
#define SX8_DEMOD_WAIT_SIGNAL
#define SX8_DEMOD_WAIT_MATYPE
#define SX8_DEMOD_TIMEOUT
#define SX8_DEMOD_LOCKED

#define MCI_CMD_STOP
#define MCI_CMD_GETSTATUS
#define MCI_CMD_GETSIGNALINFO
#define MCI_CMD_RFPOWER

#define MCI_CMD_SEARCH_DVBS

#define MCI_CMD_GET_IQSYMBOL

#define SX8_CMD_INPUT_ENABLE
#define SX8_CMD_INPUT_DISABLE
#define SX8_CMD_START_IQ
#define SX8_CMD_STOP_IQ
#define SX8_CMD_ENABLE_IQOUTPUT
#define SX8_CMD_DISABLE_IQOUTPUT

#define MCI_STATUS_OK
#define MCI_STATUS_UNSUPPORTED
#define MCI_STATUS_RETRY
#define MCI_STATUS_NOT_READY
#define MCI_STATUS_ERROR

#define MCI_SUCCESS(status)

struct mci_command {};

struct mci_result {};

struct mci_base {};

struct mci {};

struct mci_cfg {};

/* defined in ddbridge-sx8.c */
extern const struct mci_cfg ddb_max_sx8_cfg;

int ddb_mci_cmd(struct mci *state, struct mci_command *command,
		struct mci_result *result);
int ddb_mci_config(struct mci *state, u32 config);

struct dvb_frontend
*ddb_mci_attach(struct ddb_input *input, struct mci_cfg *cfg, int nr,
		int (**fn_set_input)(struct dvb_frontend *fe, int input));

#endif /* _DDBRIDGE_MCI_H_ */