#include <linux/clk.h>
#include <linux/clk/tegra.h>
#include <linux/device.h>
#include <linux/host1x.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <media/v4l2-fwnode.h>
#include "csi.h"
#include "video.h"
#define MHZ …
static inline struct tegra_csi *
host1x_client_to_csi(struct host1x_client *client)
{ … }
static inline struct tegra_csi_channel *to_csi_chan(struct v4l2_subdev *subdev)
{ … }
static const struct v4l2_mbus_framefmt tegra_csi_tpg_fmts[] = …;
static const struct v4l2_frmsize_discrete tegra_csi_tpg_sizes[] = …;
static int csi_enum_bus_code(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int csi_get_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int csi_get_frmrate_table_index(struct tegra_csi *csi, u32 code,
u32 width, u32 height)
{ … }
static void csi_chan_update_blank_intervals(struct tegra_csi_channel *csi_chan,
u32 code, u32 width, u32 height)
{ … }
static int csi_enum_framesizes(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
{ … }
static int csi_enum_frameintervals(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie)
{ … }
static int csi_set_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int tegra_csi_get_frame_interval(struct v4l2_subdev *subdev,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval *vfi)
{ … }
static unsigned int csi_get_pixel_rate(struct tegra_csi_channel *csi_chan)
{ … }
void tegra_csi_calc_settle_time(struct tegra_csi_channel *csi_chan,
u8 csi_port_num,
u8 *clk_settle_time,
u8 *ths_settle_time)
{ … }
static int tegra_csi_enable_stream(struct v4l2_subdev *subdev)
{ … }
static int tegra_csi_disable_stream(struct v4l2_subdev *subdev)
{ … }
static int tegra_csi_s_stream(struct v4l2_subdev *subdev, int enable)
{ … }
static const struct v4l2_subdev_video_ops tegra_csi_video_ops = …;
static const struct v4l2_subdev_pad_ops tegra_csi_pad_ops = …;
static const struct v4l2_subdev_ops tegra_csi_ops = …;
static int tegra_csi_channel_alloc(struct tegra_csi *csi,
struct device_node *node,
unsigned int port_num, unsigned int lanes,
unsigned int num_pads)
{ … }
static int tegra_csi_tpg_channels_alloc(struct tegra_csi *csi)
{ … }
static int tegra_csi_channels_alloc(struct tegra_csi *csi)
{ … }
static int tegra_csi_channel_init(struct tegra_csi_channel *chan)
{ … }
void tegra_csi_error_recover(struct v4l2_subdev *sd)
{ … }
static int tegra_csi_channels_init(struct tegra_csi *csi)
{ … }
static void tegra_csi_channels_cleanup(struct tegra_csi *csi)
{ … }
static int __maybe_unused csi_runtime_suspend(struct device *dev)
{ … }
static int __maybe_unused csi_runtime_resume(struct device *dev)
{ … }
static int tegra_csi_init(struct host1x_client *client)
{ … }
static int tegra_csi_exit(struct host1x_client *client)
{ … }
static const struct host1x_client_ops csi_client_ops = …;
static int tegra_csi_probe(struct platform_device *pdev)
{ … }
static void tegra_csi_remove(struct platform_device *pdev)
{ … }
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
extern const struct tegra_csi_soc tegra210_csi_soc;
#endif
static const struct of_device_id tegra_csi_of_id_table[] = …;
MODULE_DEVICE_TABLE(of, tegra_csi_of_id_table);
static const struct dev_pm_ops tegra_csi_pm_ops = …;
struct platform_driver tegra_csi_driver = …;