linux/drivers/media/cec/platform/sti/stih-cec.c

// SPDX-License-Identifier: GPL-2.0
/*
 * STIH4xx CEC driver
 * Copyright (C) STMicroelectronics SA 2016
 *
 */
#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>

#include <media/cec.h>
#include <media/cec-notifier.h>

#define CEC_NAME

/* CEC registers  */
#define CEC_CLK_DIV
#define CEC_CTRL
#define CEC_IRQ_CTRL
#define CEC_STATUS
#define CEC_EXT_STATUS
#define CEC_TX_CTRL
#define CEC_FREE_TIME_THRESH
#define CEC_BIT_TOUT_THRESH
#define CEC_BIT_PULSE_THRESH
#define CEC_DATA
#define CEC_TX_ARRAY_CTRL
#define CEC_CTRL2
#define CEC_TX_ERROR_STS
#define CEC_ADDR_TABLE
#define CEC_DATA_ARRAY_CTRL
#define CEC_DATA_ARRAY_STATUS
#define CEC_TX_DATA_BASE
#define CEC_TX_DATA_TOP
#define CEC_TX_DATA_SIZE
#define CEC_RX_DATA_BASE
#define CEC_RX_DATA_TOP
#define CEC_RX_DATA_SIZE

/* CEC_CTRL2 */
#define CEC_LINE_INACTIVE_EN
#define CEC_AUTO_BUS_ERR_EN
#define CEC_STOP_ON_ARB_ERR_EN
#define CEC_TX_REQ_WAIT_EN

/* CEC_DATA_ARRAY_CTRL */
#define CEC_TX_ARRAY_EN
#define CEC_RX_ARRAY_EN
#define CEC_TX_ARRAY_RESET
#define CEC_RX_ARRAY_RESET
#define CEC_TX_N_OF_BYTES_IRQ_EN
#define CEC_TX_STOP_ON_NACK

/* CEC_TX_ARRAY_CTRL */
#define CEC_TX_N_OF_BYTES
#define CEC_TX_START
#define CEC_TX_AUTO_SOM_EN
#define CEC_TX_AUTO_EOM_EN

/* CEC_IRQ_CTRL */
#define CEC_TX_DONE_IRQ_EN
#define CEC_ERROR_IRQ_EN
#define CEC_RX_DONE_IRQ_EN
#define CEC_RX_SOM_IRQ_EN
#define CEC_RX_EOM_IRQ_EN
#define CEC_FREE_TIME_IRQ_EN
#define CEC_PIN_STS_IRQ_EN

/* CEC_CTRL */
#define CEC_IN_FILTER_EN
#define CEC_PWR_SAVE_EN
#define CEC_EN
#define CEC_ACK_CTRL
#define CEC_RX_RESET_EN
#define CEC_IGNORE_RX_ERROR

/* CEC_STATUS */
#define CEC_TX_DONE_STS
#define CEC_TX_ACK_GET_STS
#define CEC_ERROR_STS
#define CEC_RX_DONE_STS
#define CEC_RX_SOM_STS
#define CEC_RX_EOM_STS
#define CEC_FREE_TIME_IRQ_STS
#define CEC_PIN_STS
#define CEC_SBIT_TOUT_STS
#define CEC_DBIT_TOUT_STS
#define CEC_LPULSE_ERROR_STS
#define CEC_HPULSE_ERROR_STS
#define CEC_TX_ERROR
#define CEC_TX_ARB_ERROR
#define CEC_RX_ERROR_MIN
#define CEC_RX_ERROR_MAX

/* Signal free time in bit periods (2.4ms) */
#define CEC_PRESENT_INIT_SFT
#define CEC_NEW_INIT_SFT
#define CEC_RETRANSMIT_SFT

/* Constants for CEC_BIT_TOUT_THRESH register */
#define CEC_SBIT_TOUT_47MS
#define CEC_SBIT_TOUT_48MS
#define CEC_SBIT_TOUT_50MS
#define CEC_DBIT_TOUT_27MS
#define CEC_DBIT_TOUT_28MS
#define CEC_DBIT_TOUT_29MS

/* Constants for CEC_BIT_PULSE_THRESH register */
#define CEC_BIT_LPULSE_03MS
#define CEC_BIT_HPULSE_03MS

/* Constants for CEC_DATA_ARRAY_STATUS register */
#define CEC_RX_N_OF_BYTES
#define CEC_TX_N_OF_BYTES_SENT
#define CEC_RX_OVERRUN

struct stih_cec {};

static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
{}

static int stih_cec_adap_log_addr(struct cec_adapter *adap, u8 logical_addr)
{}

static int stih_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
				  u32 signal_free_time, struct cec_msg *msg)
{}

static void stih_tx_done(struct stih_cec *cec, u32 status)
{}

static void stih_rx_done(struct stih_cec *cec, u32 status)
{}

static irqreturn_t stih_cec_irq_handler_thread(int irq, void *priv)
{}

static irqreturn_t stih_cec_irq_handler(int irq, void *priv)
{}

static const struct cec_adap_ops sti_cec_adap_ops =;

static int stih_cec_probe(struct platform_device *pdev)
{}

static void stih_cec_remove(struct platform_device *pdev)
{}

static const struct of_device_id stih_cec_match[] =;
MODULE_DEVICE_TABLE(of, stih_cec_match);

static struct platform_driver stih_cec_pdrv =;

module_platform_driver();

MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_DESCRIPTION();