#include <linux/bitfield.h>
#include <linux/dmaengine.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <media/mipi-csi2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mc.h>
#include <media/videobuf2-dma-contig.h>
#define TI_CSI2RX_MODULE_NAME …
#define SHIM_CNTL …
#define SHIM_CNTL_PIX_RST …
#define SHIM_DMACNTX …
#define SHIM_DMACNTX_EN …
#define SHIM_DMACNTX_YUV422 …
#define SHIM_DMACNTX_SIZE …
#define SHIM_DMACNTX_FMT …
#define SHIM_DMACNTX_YUV422_MODE_11 …
#define SHIM_DMACNTX_SIZE_8 …
#define SHIM_DMACNTX_SIZE_16 …
#define SHIM_DMACNTX_SIZE_32 …
#define SHIM_PSI_CFG0 …
#define SHIM_PSI_CFG0_SRC_TAG …
#define SHIM_PSI_CFG0_DST_TAG …
#define PSIL_WORD_SIZE_BYTES …
#define MAX_WIDTH_BYTES …
#define MAX_HEIGHT_LINES …
#define DRAIN_TIMEOUT_MS …
#define DRAIN_BUFFER_SIZE …
struct ti_csi2rx_fmt { … };
struct ti_csi2rx_buffer { … };
enum ti_csi2rx_dma_state { … };
struct ti_csi2rx_dma { … };
struct ti_csi2rx_dev { … };
static const struct ti_csi2rx_fmt ti_csi2rx_formats[] = …;
static int ti_csi2rx_start_dma(struct ti_csi2rx_dev *csi,
struct ti_csi2rx_buffer *buf);
static const struct ti_csi2rx_fmt *find_format_by_fourcc(u32 pixelformat)
{ … }
static const struct ti_csi2rx_fmt *find_format_by_code(u32 code)
{ … }
static void ti_csi2rx_fill_fmt(const struct ti_csi2rx_fmt *csi_fmt,
struct v4l2_format *v4l2_fmt)
{ … }
static int ti_csi2rx_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int ti_csi2rx_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int ti_csi2rx_g_fmt_vid_cap(struct file *file, void *prov,
struct v4l2_format *f)
{ … }
static int ti_csi2rx_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int ti_csi2rx_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int ti_csi2rx_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize)
{ … }
static const struct v4l2_ioctl_ops csi_ioctl_ops = …;
static const struct v4l2_file_operations csi_fops = …;
static int csi_async_notifier_bound(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *subdev,
struct v4l2_async_connection *asc)
{ … }
static int csi_async_notifier_complete(struct v4l2_async_notifier *notifier)
{ … }
static const struct v4l2_async_notifier_operations csi_async_notifier_ops = …;
static int ti_csi2rx_notifier_register(struct ti_csi2rx_dev *csi)
{ … }
static void ti_csi2rx_setup_shim(struct ti_csi2rx_dev *csi)
{ … }
static void ti_csi2rx_drain_callback(void *param)
{ … }
static int ti_csi2rx_drain_dma(struct ti_csi2rx_dev *csi)
{ … }
static void ti_csi2rx_dma_callback(void *param)
{ … }
static int ti_csi2rx_start_dma(struct ti_csi2rx_dev *csi,
struct ti_csi2rx_buffer *buf)
{ … }
static void ti_csi2rx_stop_dma(struct ti_csi2rx_dev *csi)
{ … }
static void ti_csi2rx_cleanup_buffers(struct ti_csi2rx_dev *csi,
enum vb2_buffer_state state)
{ … }
static int ti_csi2rx_queue_setup(struct vb2_queue *q, unsigned int *nbuffers,
unsigned int *nplanes, unsigned int sizes[],
struct device *alloc_devs[])
{ … }
static int ti_csi2rx_buffer_prepare(struct vb2_buffer *vb)
{ … }
static void ti_csi2rx_buffer_queue(struct vb2_buffer *vb)
{ … }
static int ti_csi2rx_start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void ti_csi2rx_stop_streaming(struct vb2_queue *vq)
{ … }
static const struct vb2_ops csi_vb2_qops = …;
static int ti_csi2rx_init_vb2q(struct ti_csi2rx_dev *csi)
{ … }
static int ti_csi2rx_link_validate(struct media_link *link)
{ … }
static const struct media_entity_operations ti_csi2rx_video_entity_ops = …;
static int ti_csi2rx_init_dma(struct ti_csi2rx_dev *csi)
{ … }
static int ti_csi2rx_v4l2_init(struct ti_csi2rx_dev *csi)
{ … }
static void ti_csi2rx_cleanup_dma(struct ti_csi2rx_dev *csi)
{ … }
static void ti_csi2rx_cleanup_v4l2(struct ti_csi2rx_dev *csi)
{ … }
static void ti_csi2rx_cleanup_subdev(struct ti_csi2rx_dev *csi)
{ … }
static void ti_csi2rx_cleanup_vb2q(struct ti_csi2rx_dev *csi)
{ … }
static int ti_csi2rx_probe(struct platform_device *pdev)
{ … }
static void ti_csi2rx_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id ti_csi2rx_of_match[] = …;
MODULE_DEVICE_TABLE(of, ti_csi2rx_of_match);
static struct platform_driver ti_csi2rx_pdrv = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;