linux/drivers/media/platform/ti/cal/cal-camerarx.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * TI Camera Access Layer (CAL) - CAMERARX
 *
 * Copyright (c) 2015-2020 Texas Instruments Inc.
 *
 * Authors:
 *	Benoit Parrot <[email protected]>
 *	Laurent Pinchart <[email protected]>
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/slab.h>

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

#include "cal.h"
#include "cal_regs.h"

/* ------------------------------------------------------------------
 *	I/O Register Accessors
 * ------------------------------------------------------------------
 */

static inline u32 camerarx_read(struct cal_camerarx *phy, u32 offset)
{}

static inline void camerarx_write(struct cal_camerarx *phy, u32 offset, u32 val)
{}

/* ------------------------------------------------------------------
 *	CAMERARX Management
 * ------------------------------------------------------------------
 */

static s64 cal_camerarx_get_ext_link_freq(struct cal_camerarx *phy)
{}

static void cal_camerarx_lane_config(struct cal_camerarx *phy)
{}

static void cal_camerarx_enable(struct cal_camerarx *phy)
{}

void cal_camerarx_disable(struct cal_camerarx *phy)
{}

/*
 * TCLK values are OK at their reset values
 */
#define TCLK_TERM
#define TCLK_MISS
#define TCLK_SETTLE

static void cal_camerarx_config(struct cal_camerarx *phy, s64 link_freq)
{}

static void cal_camerarx_power(struct cal_camerarx *phy, bool enable)
{}

static void cal_camerarx_wait_reset(struct cal_camerarx *phy)
{}

static void cal_camerarx_wait_stop_state(struct cal_camerarx *phy)
{}

static void cal_camerarx_enable_irqs(struct cal_camerarx *phy)
{}

static void cal_camerarx_disable_irqs(struct cal_camerarx *phy)
{}

static void cal_camerarx_ppi_enable(struct cal_camerarx *phy)
{}

static void cal_camerarx_ppi_disable(struct cal_camerarx *phy)
{}

static int cal_camerarx_start(struct cal_camerarx *phy)
{}

static void cal_camerarx_stop(struct cal_camerarx *phy)
{}

/*
 *   Errata i913: CSI2 LDO Needs to be disabled when module is powered on
 *
 *   Enabling CSI2 LDO shorts it to core supply. It is crucial the 2 CSI2
 *   LDOs on the device are disabled if CSI-2 module is powered on
 *   (0x4845 B304 | 0x4845 B384 [28:27] = 0x1) or in ULPS (0x4845 B304
 *   | 0x4845 B384 [28:27] = 0x2) mode. Common concerns include: high
 *   current draw on the module supply in active mode.
 *
 *   Errata does not apply when CSI-2 module is powered off
 *   (0x4845 B304 | 0x4845 B384 [28:27] = 0x0).
 *
 * SW Workaround:
 *	Set the following register bits to disable the LDO,
 *	which is essentially CSI2 REG10 bit 6:
 *
 *		Core 0:  0x4845 B828 = 0x0000 0040
 *		Core 1:  0x4845 B928 = 0x0000 0040
 */
void cal_camerarx_i913_errata(struct cal_camerarx *phy)
{}

static int cal_camerarx_regmap_init(struct cal_dev *cal,
				    struct cal_camerarx *phy)
{}

static int cal_camerarx_parse_dt(struct cal_camerarx *phy)
{}

/* ------------------------------------------------------------------
 *	V4L2 Subdev Operations
 * ------------------------------------------------------------------
 */

static inline struct cal_camerarx *to_cal_camerarx(struct v4l2_subdev *sd)
{}

static int cal_camerarx_sd_s_stream(struct v4l2_subdev *sd, int enable)
{}

static int cal_camerarx_sd_enum_mbus_code(struct v4l2_subdev *sd,
					  struct v4l2_subdev_state *state,
					  struct v4l2_subdev_mbus_code_enum *code)
{}

static int cal_camerarx_sd_enum_frame_size(struct v4l2_subdev *sd,
					   struct v4l2_subdev_state *state,
					   struct v4l2_subdev_frame_size_enum *fse)
{}

static int cal_camerarx_sd_set_fmt(struct v4l2_subdev *sd,
				   struct v4l2_subdev_state *state,
				   struct v4l2_subdev_format *format)
{}

static int cal_camerarx_sd_init_state(struct v4l2_subdev *sd,
				      struct v4l2_subdev_state *state)
{}

static int cal_camerarx_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
				       struct v4l2_mbus_frame_desc *fd)
{}

static const struct v4l2_subdev_video_ops cal_camerarx_video_ops =;

static const struct v4l2_subdev_pad_ops cal_camerarx_pad_ops =;

static const struct v4l2_subdev_ops cal_camerarx_subdev_ops =;

static const struct v4l2_subdev_internal_ops cal_camerarx_internal_ops =;

static const struct media_entity_operations cal_camerarx_media_ops =;

/* ------------------------------------------------------------------
 *	Create and Destroy
 * ------------------------------------------------------------------
 */

struct cal_camerarx *cal_camerarx_create(struct cal_dev *cal,
					 unsigned int instance)
{}

void cal_camerarx_destroy(struct cal_camerarx *phy)
{}