#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/math64.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 <linux/regmap.h>
#include <linux/videodev2.h>
#include <linux/atmel-isc-media.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-image-sizes.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
#include <media/videobuf2-dma-contig.h>
#include "microchip-isc-regs.h"
#include "microchip-isc.h"
#define ISC_IS_FORMAT_RAW(mbus_code) …
#define ISC_IS_FORMAT_GREY(mbus_code) …
static inline void isc_update_v4l2_ctrls(struct isc_device *isc)
{ … }
static inline void isc_update_awb_ctrls(struct isc_device *isc)
{ … }
static inline void isc_reset_awb_ctrls(struct isc_device *isc)
{ … }
static int isc_queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers, unsigned int *nplanes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static int isc_buffer_prepare(struct vb2_buffer *vb)
{ … }
static void isc_crop_pfe(struct isc_device *isc)
{ … }
static void isc_start_dma(struct isc_device *isc)
{ … }
static void isc_set_pipeline(struct isc_device *isc, u32 pipeline)
{ … }
static int isc_update_profile(struct isc_device *isc)
{ … }
static void isc_set_histogram(struct isc_device *isc, bool enable)
{ … }
static int isc_configure(struct isc_device *isc)
{ … }
static int isc_prepare_streaming(struct vb2_queue *vq)
{ … }
static int isc_start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void isc_unprepare_streaming(struct vb2_queue *vq)
{ … }
static void isc_stop_streaming(struct vb2_queue *vq)
{ … }
static void isc_buffer_queue(struct vb2_buffer *vb)
{ … }
static const struct vb2_ops isc_vb2_ops = …;
static int isc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int isc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int isc_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *fmt)
{ … }
static int isc_try_validate_formats(struct isc_device *isc)
{ … }
static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump)
{ … }
static int isc_try_configure_pipeline(struct isc_device *isc)
{ … }
static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f)
{ … }
static int isc_set_fmt(struct isc_device *isc, struct v4l2_format *f)
{ … }
static int isc_validate(struct isc_device *isc)
{ … }
static int isc_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int isc_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int isc_enum_input(struct file *file, void *priv,
struct v4l2_input *inp)
{ … }
static int isc_g_input(struct file *file, void *priv, unsigned int *i)
{ … }
static int isc_s_input(struct file *file, void *priv, unsigned int i)
{ … }
static int isc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
{ … }
static int isc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
{ … }
static int isc_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize)
{ … }
static const struct v4l2_ioctl_ops isc_ioctl_ops = …;
static int isc_open(struct file *file)
{ … }
static int isc_release(struct file *file)
{ … }
static const struct v4l2_file_operations isc_fops = …;
irqreturn_t microchip_isc_interrupt(int irq, void *dev_id)
{ … }
EXPORT_SYMBOL_GPL(…);
static void isc_hist_count(struct isc_device *isc, u32 *min, u32 *max)
{ … }
static void isc_wb_update(struct isc_ctrls *ctrls)
{ … }
static void isc_awb_work(struct work_struct *w)
{ … }
static int isc_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops isc_ctrl_ops = …;
static int isc_s_awb_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int isc_g_volatile_awb_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops isc_awb_ops = …;
#define ISC_CTRL_OFF(_name, _id, _name_str) …
ISC_CTRL_OFF(isc_r_off_ctrl, ISC_CID_R_OFFSET, "Red Component Offset");
ISC_CTRL_OFF(isc_b_off_ctrl, ISC_CID_B_OFFSET, "Blue Component Offset");
ISC_CTRL_OFF(isc_gr_off_ctrl, ISC_CID_GR_OFFSET, "Green Red Component Offset");
ISC_CTRL_OFF(isc_gb_off_ctrl, ISC_CID_GB_OFFSET, "Green Blue Component Offset");
#define ISC_CTRL_GAIN(_name, _id, _name_str) …
ISC_CTRL_GAIN(isc_r_gain_ctrl, ISC_CID_R_GAIN, "Red Component Gain");
ISC_CTRL_GAIN(isc_b_gain_ctrl, ISC_CID_B_GAIN, "Blue Component Gain");
ISC_CTRL_GAIN(isc_gr_gain_ctrl, ISC_CID_GR_GAIN, "Green Red Component Gain");
ISC_CTRL_GAIN(isc_gb_gain_ctrl, ISC_CID_GB_GAIN, "Green Blue Component Gain");
static int isc_ctrl_init(struct isc_device *isc)
{ … }
static int isc_async_bound(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *subdev,
struct v4l2_async_connection *asd)
{ … }
static void isc_async_unbind(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *subdev,
struct v4l2_async_connection *asd)
{ … }
struct isc_format *isc_find_format_by_code(struct isc_device *isc,
unsigned int code, int *index)
{ … }
EXPORT_SYMBOL_GPL(…);
static int isc_set_default_fmt(struct isc_device *isc)
{ … }
static int isc_async_complete(struct v4l2_async_notifier *notifier)
{ … }
const struct v4l2_async_notifier_operations microchip_isc_async_ops = …;
EXPORT_SYMBOL_GPL(…);
void microchip_isc_subdev_cleanup(struct isc_device *isc)
{ … }
EXPORT_SYMBOL_GPL(…);
int microchip_isc_pipeline_init(struct isc_device *isc)
{ … }
EXPORT_SYMBOL_GPL(…);
static int isc_link_validate(struct media_link *link)
{ … }
static const struct media_entity_operations isc_entity_operations = …;
int isc_mc_init(struct isc_device *isc, u32 ver)
{ … }
EXPORT_SYMBOL_GPL(…);
void isc_mc_cleanup(struct isc_device *isc)
{ … }
EXPORT_SYMBOL_GPL(…);
#define MICROCHIP_ISC_REG_MAX …
const struct regmap_config microchip_isc_regmap_config = …;
EXPORT_SYMBOL_GPL(…);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;