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

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

#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/videodev2.h>

#include <media/media-device.h>
#include <media/v4l2-async.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/videobuf2-core.h>
#include <media/videobuf2-dma-contig.h>

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

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

int cal_video_nr =;
module_param_named(video_nr, cal_video_nr, uint, 0644);
MODULE_PARM_DESC();

unsigned int cal_debug;
module_param_named(debug, cal_debug, uint, 0644);
MODULE_PARM_DESC();

#ifdef CONFIG_VIDEO_TI_CAL_MC
#define CAL_MC_API_DEFAULT
#else
#define CAL_MC_API_DEFAULT
#endif

bool cal_mc_api =;
module_param_named(mc_api, cal_mc_api, bool, 0444);
MODULE_PARM_DESC();

/* ------------------------------------------------------------------
 *	Format Handling
 * ------------------------------------------------------------------
 */

const struct cal_format_info cal_formats[] =;

const unsigned int cal_num_formats =;

const struct cal_format_info *cal_format_by_fourcc(u32 fourcc)
{}

const struct cal_format_info *cal_format_by_code(u32 code)
{}

/* ------------------------------------------------------------------
 *	Platform Data
 * ------------------------------------------------------------------
 */

static const struct cal_camerarx_data dra72x_cal_camerarx[] =;

static const struct cal_data dra72x_cal_data =;

static const struct cal_data dra72x_es1_cal_data =;

static const struct cal_camerarx_data dra76x_cal_csi_phy[] =;

static const struct cal_data dra76x_cal_data =;

static const struct cal_camerarx_data am654_cal_csi_phy[] =;

static const struct cal_data am654_cal_data =;

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

void cal_quickdump_regs(struct cal_dev *cal)
{}

/* ------------------------------------------------------------------
 *	Context Management
 * ------------------------------------------------------------------
 */

#define CAL_MAX_PIX_PROC

static int cal_reserve_pix_proc(struct cal_dev *cal)
{}

static void cal_release_pix_proc(struct cal_dev *cal, unsigned int pix_proc_num)
{}

static void cal_ctx_csi2_config(struct cal_ctx *ctx)
{}

static void cal_ctx_pix_proc_config(struct cal_ctx *ctx)
{}

static void cal_ctx_wr_dma_config(struct cal_ctx *ctx)
{}

void cal_ctx_set_dma_addr(struct cal_ctx *ctx, dma_addr_t addr)
{}

static void cal_ctx_wr_dma_enable(struct cal_ctx *ctx)
{}

static void cal_ctx_wr_dma_disable(struct cal_ctx *ctx)
{}

static bool cal_ctx_wr_dma_stopped(struct cal_ctx *ctx)
{}

static int
cal_get_remote_frame_desc_entry(struct cal_ctx *ctx,
				struct v4l2_mbus_frame_desc_entry *entry)
{}

int cal_ctx_prepare(struct cal_ctx *ctx)
{}

void cal_ctx_unprepare(struct cal_ctx *ctx)
{}

void cal_ctx_start(struct cal_ctx *ctx)
{}

void cal_ctx_stop(struct cal_ctx *ctx)
{}

/* ------------------------------------------------------------------
 *	IRQ Handling
 * ------------------------------------------------------------------
 */

/*
 * Track a sequence number for each virtual channel, which is shared by
 * all contexts using the same virtual channel. This is done using the
 * CSI-2 frame number as a base.
 */
static void cal_update_seq_number(struct cal_ctx *ctx)
{}

static inline void cal_irq_wdma_start(struct cal_ctx *ctx)
{}

static inline void cal_irq_wdma_end(struct cal_ctx *ctx)
{}

static void cal_irq_handle_wdma(struct cal_ctx *ctx, bool start, bool end)
{}

static irqreturn_t cal_irq(int irq_cal, void *data)
{}

/* ------------------------------------------------------------------
 *	Asynchronous V4L2 subdev binding
 * ------------------------------------------------------------------
 */

struct cal_v4l2_async_subdev {};

static inline struct cal_v4l2_async_subdev *
to_cal_asd(struct v4l2_async_connection *asd)
{}

static int cal_async_notifier_bound(struct v4l2_async_notifier *notifier,
				    struct v4l2_subdev *subdev,
				    struct v4l2_async_connection *asd)
{}

static int cal_async_notifier_complete(struct v4l2_async_notifier *notifier)
{}

static const struct v4l2_async_notifier_operations cal_async_notifier_ops =;

static int cal_async_notifier_register(struct cal_dev *cal)
{}

static void cal_async_notifier_unregister(struct cal_dev *cal)
{}

/* ------------------------------------------------------------------
 *	Media and V4L2 device handling
 * ------------------------------------------------------------------
 */

/*
 * Register user-facing devices. To be called at the end of the probe function
 * when all resources are initialized and ready.
 */
static int cal_media_register(struct cal_dev *cal)
{}

/*
 * Unregister the user-facing devices, but don't free memory yet. To be called
 * at the beginning of the remove function, to disallow access from userspace.
 */
static void cal_media_unregister(struct cal_dev *cal)
{}

/*
 * Initialize the in-kernel objects. To be called at the beginning of the probe
 * function, before the V4L2 device is used by the driver.
 */
static int cal_media_init(struct cal_dev *cal)
{}

/*
 * Cleanup the in-kernel objects, freeing memory. To be called at the very end
 * of the remove sequence, when nothing (including userspace) can access the
 * objects anymore.
 */
static void cal_media_cleanup(struct cal_dev *cal)
{}

/* ------------------------------------------------------------------
 *	Initialization and module stuff
 * ------------------------------------------------------------------
 */

static struct cal_ctx *cal_ctx_create(struct cal_dev *cal, int inst)
{}

static void cal_ctx_destroy(struct cal_ctx *ctx)
{}

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

/* Get hardware revision and info. */

#define CAL_HL_HWINFO_VALUE

static void cal_get_hwinfo(struct cal_dev *cal)
{}

static int cal_init_camerarx_regmap(struct cal_dev *cal)
{}

static int cal_probe(struct platform_device *pdev)
{}

static void cal_remove(struct platform_device *pdev)
{}

static int cal_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops cal_pm_ops =;

static struct platform_driver cal_pdrv =;

module_platform_driver();