linux/drivers/media/platform/cadence/cdns-csi2tx.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Driver for Cadence MIPI-CSI2 TX Controller
 *
 * Copyright (C) 2017-2019 Cadence Design Systems Inc.
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

#include <media/mipi-csi2.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>

#define CSI2TX_DEVICE_CONFIG_REG
#define CSI2TX_DEVICE_CONFIG_STREAMS_MASK
#define CSI2TX_DEVICE_CONFIG_HAS_DPHY
#define CSI2TX_DEVICE_CONFIG_LANES_MASK

#define CSI2TX_CONFIG_REG
#define CSI2TX_CONFIG_CFG_REQ
#define CSI2TX_CONFIG_SRST_REQ

#define CSI2TX_DPHY_CFG_REG
#define CSI2TX_DPHY_CFG_CLK_RESET
#define CSI2TX_DPHY_CFG_LANE_RESET(n)
#define CSI2TX_DPHY_CFG_MODE_MASK
#define CSI2TX_DPHY_CFG_MODE_LPDT
#define CSI2TX_DPHY_CFG_MODE_HS
#define CSI2TX_DPHY_CFG_MODE_ULPS
#define CSI2TX_DPHY_CFG_CLK_ENABLE
#define CSI2TX_DPHY_CFG_LANE_ENABLE(n)

#define CSI2TX_DPHY_CLK_WAKEUP_REG
#define CSI2TX_DPHY_CLK_WAKEUP_ULPS_CYCLES(n)

#define CSI2TX_DT_CFG_REG(n)
#define CSI2TX_DT_CFG_DT(n)

#define CSI2TX_DT_FORMAT_REG(n)
#define CSI2TX_DT_FORMAT_BYTES_PER_LINE(n)
#define CSI2TX_DT_FORMAT_MAX_LINE_NUM(n)

#define CSI2TX_STREAM_IF_CFG_REG(n)
#define CSI2TX_STREAM_IF_CFG_FILL_LEVEL(n)

/* CSI2TX V2 Registers */
#define CSI2TX_V2_DPHY_CFG_REG
#define CSI2TX_V2_DPHY_CFG_RESET
#define CSI2TX_V2_DPHY_CFG_CLOCK_MODE
#define CSI2TX_V2_DPHY_CFG_MODE_MASK
#define CSI2TX_V2_DPHY_CFG_MODE_LPDT
#define CSI2TX_V2_DPHY_CFG_MODE_HS
#define CSI2TX_V2_DPHY_CFG_MODE_ULPS
#define CSI2TX_V2_DPHY_CFG_CLK_ENABLE
#define CSI2TX_V2_DPHY_CFG_LANE_ENABLE(n)

#define CSI2TX_LANES_MAX
#define CSI2TX_STREAMS_MAX

enum csi2tx_pads {};

struct csi2tx_fmt {};

struct csi2tx_priv;

/* CSI2TX Variant Operations */
struct csi2tx_vops {};

struct csi2tx_priv {};

static const struct csi2tx_fmt csi2tx_formats[] =;

static const struct v4l2_mbus_framefmt fmt_default =;

static inline
struct csi2tx_priv *v4l2_subdev_to_csi2tx(struct v4l2_subdev *subdev)
{}

static const struct csi2tx_fmt *csi2tx_get_fmt_from_mbus(u32 mbus)
{}

static int csi2tx_enum_mbus_code(struct v4l2_subdev *subdev,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_mbus_code_enum *code)
{}

static struct v4l2_mbus_framefmt *
__csi2tx_get_pad_format(struct v4l2_subdev *subdev,
			struct v4l2_subdev_state *sd_state,
			struct v4l2_subdev_format *fmt)
{}

static int csi2tx_get_pad_format(struct v4l2_subdev *subdev,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_format *fmt)
{}

static int csi2tx_set_pad_format(struct v4l2_subdev *subdev,
				 struct v4l2_subdev_state *sd_state,
				 struct v4l2_subdev_format *fmt)
{}

static const struct v4l2_subdev_pad_ops csi2tx_pad_ops =;

/* Set Wake Up value in the D-PHY */
static void csi2tx_dphy_set_wakeup(struct csi2tx_priv *csi2tx)
{}

/*
 * Finishes the D-PHY initialization
 * reg dphy cfg value to be used
 */
static void csi2tx_dphy_init_finish(struct csi2tx_priv *csi2tx, u32 reg)
{}

/* Configures D-PHY in CSIv1.3 */
static void csi2tx_dphy_setup(struct csi2tx_priv *csi2tx)
{}

/* Configures D-PHY in CSIv2 */
static void csi2tx_v2_dphy_setup(struct csi2tx_priv *csi2tx)
{}

static void csi2tx_reset(struct csi2tx_priv *csi2tx)
{}

static int csi2tx_start(struct csi2tx_priv *csi2tx)
{}

static void csi2tx_stop(struct csi2tx_priv *csi2tx)
{}

static int csi2tx_s_stream(struct v4l2_subdev *subdev, int enable)
{}

static const struct v4l2_subdev_video_ops csi2tx_video_ops =;

static const struct v4l2_subdev_ops csi2tx_subdev_ops =;

static int csi2tx_get_resources(struct csi2tx_priv *csi2tx,
				struct platform_device *pdev)
{}

static int csi2tx_check_lanes(struct csi2tx_priv *csi2tx)
{}

static const struct csi2tx_vops csi2tx_vops =;

static const struct csi2tx_vops csi2tx_v2_vops =;

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

static int csi2tx_probe(struct platform_device *pdev)
{}

static void csi2tx_remove(struct platform_device *pdev)
{}

static struct platform_driver csi2tx_driver =;
module_platform_driver();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();