#include <linux/atomic.h>
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/minmax.h>
#include <linux/sprintf.h>
#include <media/media-entity.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-subdev.h>
#include "ipu6-bus.h"
#include "ipu6-isys.h"
#include "ipu6-isys-csi2.h"
#include "ipu6-isys-subdev.h"
#include "ipu6-platform-isys-csi2-reg.h"
static const u32 csi2_supported_codes[] = …;
static const struct ipu6_csi2_error dphy_rx_errors[] = …;
s64 ipu6_isys_csi2_get_link_freq(struct ipu6_isys_csi2 *csi2)
{ … }
static int csi2_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
struct v4l2_event_subscription *sub)
{ … }
static const struct v4l2_subdev_core_ops csi2_sd_core_ops = …;
#define DIV_SHIFT …
#define CSI2_ACCINV …
static u32 calc_timing(s32 a, s32 b, s64 link_freq, s32 accinv)
{ … }
static int
ipu6_isys_csi2_calc_timing(struct ipu6_isys_csi2 *csi2,
struct ipu6_isys_csi2_timing *timing, s32 accinv)
{ … }
void ipu6_isys_register_errors(struct ipu6_isys_csi2 *csi2)
{ … }
void ipu6_isys_csi2_error(struct ipu6_isys_csi2 *csi2)
{ … }
static int ipu6_isys_csi2_set_stream(struct v4l2_subdev *sd,
const struct ipu6_isys_csi2_timing *timing,
unsigned int nlanes, int enable)
{ … }
static int ipu6_isys_csi2_enable_streams(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state,
u32 pad, u64 streams_mask)
{ … }
static int ipu6_isys_csi2_disable_streams(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state,
u32 pad, u64 streams_mask)
{ … }
static int ipu6_isys_csi2_set_sel(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state,
struct v4l2_subdev_selection *sel)
{ … }
static int ipu6_isys_csi2_get_sel(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state,
struct v4l2_subdev_selection *sel)
{ … }
static const struct v4l2_subdev_pad_ops csi2_sd_pad_ops = …;
static const struct v4l2_subdev_ops csi2_sd_ops = …;
static const struct media_entity_operations csi2_entity_ops = …;
void ipu6_isys_csi2_cleanup(struct ipu6_isys_csi2 *csi2)
{ … }
int ipu6_isys_csi2_init(struct ipu6_isys_csi2 *csi2,
struct ipu6_isys *isys,
void __iomem *base, unsigned int index)
{ … }
void ipu6_isys_csi2_sof_event_by_stream(struct ipu6_isys_stream *stream)
{ … }
void ipu6_isys_csi2_eof_event_by_stream(struct ipu6_isys_stream *stream)
{ … }
int ipu6_isys_csi2_get_remote_desc(u32 source_stream,
struct ipu6_isys_csi2 *csi2,
struct media_entity *source_entity,
struct v4l2_mbus_frame_desc_entry *entry)
{ … }