brintos

brintos / linux-shallow public Read only

0
0
Text · 21.3 KiB · ca952fd Raw
691 lines · c
1/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */2/*3 * Rockchip ISP1 Driver - Common definitions4 *5 * Copyright (C) 2019 Collabora, Ltd.6 *7 * Based on Rockchip ISP1 driver by Rockchip Electronics Co., Ltd.8 * Copyright (C) 2017 Rockchip Electronics Co., Ltd.9 */10 11#ifndef _RKISP1_COMMON_H12#define _RKISP1_COMMON_H13 14#include <linux/clk.h>15#include <linux/interrupt.h>16#include <linux/mutex.h>17#include <linux/rkisp1-config.h>18#include <media/media-device.h>19#include <media/media-entity.h>20#include <media/v4l2-ctrls.h>21#include <media/v4l2-device.h>22#include <media/videobuf2-v4l2.h>23 24#include "rkisp1-regs.h"25 26struct dentry;27struct regmap;28 29/*30 * flags on the 'direction' field in struct rkisp1_mbus_info' that indicate31 * on which pad the media bus format is supported32 */33#define RKISP1_ISP_SD_SRC			BIT(0)34#define RKISP1_ISP_SD_SINK			BIT(1)35 36/*37 * Minimum values for the width and height of entities. The maximum values are38 * model-specific and stored in the rkisp1_info structure.39 */40#define RKISP1_ISP_MIN_WIDTH			3241#define RKISP1_ISP_MIN_HEIGHT			3242 43#define RKISP1_RSZ_MP_SRC_MAX_WIDTH		441644#define RKISP1_RSZ_MP_SRC_MAX_HEIGHT		331245#define RKISP1_RSZ_SP_SRC_MAX_WIDTH		192046#define RKISP1_RSZ_SP_SRC_MAX_HEIGHT		192047#define RKISP1_RSZ_SRC_MIN_WIDTH		3248#define RKISP1_RSZ_SRC_MIN_HEIGHT		1649 50/* the default width and height of all the entities */51#define RKISP1_DEFAULT_WIDTH			80052#define RKISP1_DEFAULT_HEIGHT			60053 54#define RKISP1_DRIVER_NAME			"rkisp1"55#define RKISP1_BUS_INFO				"platform:" RKISP1_DRIVER_NAME56 57/* maximum number of clocks */58#define RKISP1_MAX_BUS_CLK			859 60/* a bitmask of the ready stats */61#define RKISP1_STATS_MEAS_MASK			(RKISP1_CIF_ISP_AWB_DONE |	\62						 RKISP1_CIF_ISP_AFM_FIN |	\63						 RKISP1_CIF_ISP_EXP_END |	\64						 RKISP1_CIF_ISP_HIST_MEASURE_RDY)65 66/* IRQ lines */67enum rkisp1_irq_line {68	RKISP1_IRQ_ISP = 0,69	RKISP1_IRQ_MI,70	RKISP1_IRQ_MIPI,71	RKISP1_NUM_IRQS,72};73 74/* enum for the resizer pads */75enum rkisp1_rsz_pad {76	RKISP1_RSZ_PAD_SINK,77	RKISP1_RSZ_PAD_SRC,78	RKISP1_RSZ_PAD_MAX79};80 81/* enum for the csi receiver pads */82enum rkisp1_csi_pad {83	RKISP1_CSI_PAD_SINK,84	RKISP1_CSI_PAD_SRC,85	RKISP1_CSI_PAD_NUM86};87 88/* enum for the capture id */89enum rkisp1_stream_id {90	RKISP1_MAINPATH,91	RKISP1_SELFPATH,92};93 94/* bayer patterns */95enum rkisp1_fmt_raw_pat_type {96	RKISP1_RAW_RGGB = 0,97	RKISP1_RAW_GRBG,98	RKISP1_RAW_GBRG,99	RKISP1_RAW_BGGR,100};101 102/* enum for the isp pads */103enum rkisp1_isp_pad {104	RKISP1_ISP_PAD_SINK_VIDEO,105	RKISP1_ISP_PAD_SINK_PARAMS,106	RKISP1_ISP_PAD_SOURCE_VIDEO,107	RKISP1_ISP_PAD_SOURCE_STATS,108	RKISP1_ISP_PAD_MAX109};110 111/*112 * enum rkisp1_feature - ISP features113 *114 * @RKISP1_FEATURE_MIPI_CSI2: The ISP has an internal MIPI CSI-2 receiver115 * @RKISP1_FEATURE_MAIN_STRIDE: The ISP supports configurable stride on the main path116 * @RKISP1_FEATURE_SELF_PATH: The ISP has a self path117 * @RKISP1_FEATURE_DUAL_CROP: The ISP has the dual crop block at the resizer input118 * @RKISP1_FEATURE_DMA_34BIT: The ISP uses 34-bit DMA addresses119 * @RKISP1_FEATURE_BLS: The ISP has a dedicated BLS block120 * @RKISP1_FEATURE_COMPAND: The ISP has a companding block121 *122 * The ISP features are stored in a bitmask in &rkisp1_info.features and allow123 * the driver to implement support for features present in some ISP versions124 * only.125 */126enum rkisp1_feature {127	RKISP1_FEATURE_MIPI_CSI2 = BIT(0),128	RKISP1_FEATURE_MAIN_STRIDE = BIT(1),129	RKISP1_FEATURE_SELF_PATH = BIT(2),130	RKISP1_FEATURE_DUAL_CROP = BIT(3),131	RKISP1_FEATURE_DMA_34BIT = BIT(4),132	RKISP1_FEATURE_BLS = BIT(5),133	RKISP1_FEATURE_COMPAND = BIT(6),134};135 136#define rkisp1_has_feature(rkisp1, feature) \137	((rkisp1)->info->features & RKISP1_FEATURE_##feature)138 139/*140 * struct rkisp1_info - Model-specific ISP Information141 *142 * @clks: array of ISP clock names143 * @clk_size: number of entries in the @clks array144 * @isrs: array of ISP interrupt descriptors145 * @isr_size: number of entries in the @isrs array146 * @isp_ver: ISP version147 * @features: bitmask of rkisp1_feature features implemented by the ISP148 * @max_width: maximum input frame width149 * @max_height: maximum input frame height150 *151 * This structure contains information about the ISP specific to a particular152 * ISP model, version, or integration in a particular SoC.153 */154struct rkisp1_info {155	const char * const *clks;156	unsigned int clk_size;157	const struct rkisp1_isr_data *isrs;158	unsigned int isr_size;159	enum rkisp1_cif_isp_version isp_ver;160	unsigned int features;161	unsigned int max_width;162	unsigned int max_height;163};164 165/*166 * struct rkisp1_sensor_async - A container for the v4l2_async_subdev to add to the notifier167 *				of the v4l2-async API168 *169 * @asd:		async_subdev variable for the sensor170 * @index:		index of the sensor (counting sensor found in DT)171 * @source_ep:		fwnode for the sensor source endpoint172 * @lanes:		number of lanes173 * @mbus_type:		type of bus (currently only CSI2 is supported)174 * @mbus_flags:		media bus (V4L2_MBUS_*) flags175 * @sd:			a pointer to v4l2_subdev struct of the sensor176 * @pixel_rate_ctrl:	pixel rate of the sensor, used to initialize the phy177 * @port:		port number (0: MIPI, 1: Parallel)178 */179struct rkisp1_sensor_async {180	struct v4l2_async_connection asd;181	unsigned int index;182	struct fwnode_handle *source_ep;183	unsigned int lanes;184	enum v4l2_mbus_type mbus_type;185	unsigned int mbus_flags;186	struct v4l2_subdev *sd;187	struct v4l2_ctrl *pixel_rate_ctrl;188	unsigned int port;189};190 191/*192 * struct rkisp1_csi - CSI receiver subdev193 *194 * @rkisp1: pointer to the rkisp1 device195 * @dphy: a pointer to the phy196 * @is_dphy_errctrl_disabled: if dphy errctrl is disabled (avoid endless interrupt)197 * @sd: v4l2_subdev variable198 * @pads: media pads199 * @source: source in-use, set when starting streaming200 */201struct rkisp1_csi {202	struct rkisp1_device *rkisp1;203	struct phy *dphy;204	bool is_dphy_errctrl_disabled;205	struct v4l2_subdev sd;206	struct media_pad pads[RKISP1_CSI_PAD_NUM];207	struct v4l2_subdev *source;208};209 210/*211 * struct rkisp1_isp - ISP subdev entity212 *213 * @sd:				v4l2_subdev variable214 * @rkisp1:			pointer to rkisp1_device215 * @pads:			media pads216 * @sink_fmt:			input format217 * @frame_sequence:		used to synchronize frame_id between video devices.218 */219struct rkisp1_isp {220	struct v4l2_subdev sd;221	struct rkisp1_device *rkisp1;222	struct media_pad pads[RKISP1_ISP_PAD_MAX];223	const struct rkisp1_mbus_info *sink_fmt;224	__u32 frame_sequence;225};226 227/*228 * struct rkisp1_vdev_node - Container for the video nodes: params, stats, mainpath, selfpath229 *230 * @buf_queue:	queue of buffers231 * @vlock:	lock of the video node232 * @vdev:	video node233 * @pad:	media pad234 */235struct rkisp1_vdev_node {236	struct vb2_queue buf_queue;237	struct mutex vlock; /* ioctl serialization mutex */238	struct video_device vdev;239	struct media_pad pad;240};241 242/*243 * struct rkisp1_buffer - A container for the vb2 buffers used by the video devices:244 *			  stats, mainpath, selfpath245 *246 * @vb:		vb2 buffer247 * @queue:	entry of the buffer in the queue248 * @buff_addr:	dma addresses of each plane, used only by the capture devices: selfpath, mainpath249 */250struct rkisp1_buffer {251	struct vb2_v4l2_buffer vb;252	struct list_head queue;253	dma_addr_t buff_addr[VIDEO_MAX_PLANES];254};255 256/*257 * struct rkisp1_params_buffer - A container for the vb2 buffers used by the258 *				 params video device259 *260 * @vb:		vb2 buffer261 * @queue:	entry of the buffer in the queue262 * @cfg:	scratch buffer used for caching the ISP configuration parameters263 */264struct rkisp1_params_buffer {265	struct vb2_v4l2_buffer vb;266	struct list_head queue;267	void *cfg;268};269 270static inline struct rkisp1_params_buffer *271to_rkisp1_params_buffer(struct vb2_v4l2_buffer *vbuf)272{273	return container_of(vbuf, struct rkisp1_params_buffer, vb);274}275 276/*277 * struct rkisp1_dummy_buffer - A buffer to write the next frame to in case278 *				there are no vb2 buffers available.279 *280 * @vaddr:	return value of call to dma_alloc_attrs.281 * @dma_addr:	dma address of the buffer.282 * @size:	size of the buffer.283 */284struct rkisp1_dummy_buffer {285	void *vaddr;286	dma_addr_t dma_addr;287	u32 size;288};289 290struct rkisp1_device;291 292/*293 * struct rkisp1_capture - ISP capture video device294 *295 * @vnode:	  video node296 * @rkisp1:	  pointer to rkisp1_device297 * @id:		  id of the capture, one of RKISP1_SELFPATH, RKISP1_MAINPATH298 * @ops:	  list of callbacks to configure the capture device.299 * @config:	  a pointer to the list of registers to configure the capture format.300 * @is_streaming: device is streaming301 * @is_stopping:  stop_streaming callback was called and the device is in the process of302 *		  stopping the streaming.303 * @done:	  when stop_streaming callback is called, the device waits for the next irq304 *		  handler to stop the streaming by waiting on the 'done' wait queue.305 *		  If the irq handler is not called, the stream is stopped by the callback306 *		  after timeout.307 * @stride:       the line stride for the first plane, in pixel units308 * @buf.lock:	  lock to protect buf.queue309 * @buf.queue:	  queued buffer list310 * @buf.dummy:	  dummy space to store dropped data311 *312 * rkisp1 uses shadow registers, so it needs two buffers at a time313 * @buf.curr:	  the buffer used for current frame314 * @buf.next:	  the buffer used for next frame315 * @pix.cfg:	  pixel configuration316 * @pix.info:	  a pointer to the v4l2_format_info of the pixel format317 * @pix.fmt:	  buffer format318 */319struct rkisp1_capture {320	struct rkisp1_vdev_node vnode;321	struct rkisp1_device *rkisp1;322	enum rkisp1_stream_id id;323	const struct rkisp1_capture_ops *ops;324	const struct rkisp1_capture_config *config;325	bool is_streaming;326	bool is_stopping;327	wait_queue_head_t done;328	unsigned int stride;329	struct {330		/* protects queue, curr and next */331		spinlock_t lock;332		struct list_head queue;333		struct rkisp1_dummy_buffer dummy;334		struct rkisp1_buffer *curr;335		struct rkisp1_buffer *next;336	} buf;337	struct {338		const struct rkisp1_capture_fmt_cfg *cfg;339		const struct v4l2_format_info *info;340		struct v4l2_pix_format_mplane fmt;341	} pix;342};343 344struct rkisp1_stats;345struct rkisp1_stats_ops {346	void (*get_awb_meas)(struct rkisp1_stats *stats,347			     struct rkisp1_stat_buffer *pbuf);348	void (*get_aec_meas)(struct rkisp1_stats *stats,349			     struct rkisp1_stat_buffer *pbuf);350	void (*get_hst_meas)(struct rkisp1_stats *stats,351			     struct rkisp1_stat_buffer *pbuf);352};353 354/*355 * struct rkisp1_stats - ISP Statistics device356 *357 * @vnode:	  video node358 * @rkisp1:	  pointer to the rkisp1 device359 * @lock:	  locks the buffer list 'stat'360 * @stat:	  queue of rkisp1_buffer361 * @vdev_fmt:	  v4l2_format of the metadata format362 */363struct rkisp1_stats {364	struct rkisp1_vdev_node vnode;365	struct rkisp1_device *rkisp1;366	const struct rkisp1_stats_ops *ops;367 368	spinlock_t lock; /* locks the buffers list 'stats' */369	struct list_head stat;370	struct v4l2_format vdev_fmt;371};372 373struct rkisp1_params;374struct rkisp1_params_ops {375	void (*lsc_matrix_config)(struct rkisp1_params *params,376				  const struct rkisp1_cif_isp_lsc_config *pconfig);377	void (*goc_config)(struct rkisp1_params *params,378			   const struct rkisp1_cif_isp_goc_config *arg);379	void (*awb_meas_config)(struct rkisp1_params *params,380				const struct rkisp1_cif_isp_awb_meas_config *arg);381	void (*awb_meas_enable)(struct rkisp1_params *params,382				const struct rkisp1_cif_isp_awb_meas_config *arg,383				bool en);384	void (*awb_gain_config)(struct rkisp1_params *params,385				const struct rkisp1_cif_isp_awb_gain_config *arg);386	void (*aec_config)(struct rkisp1_params *params,387			   const struct rkisp1_cif_isp_aec_config *arg);388	void (*hst_config)(struct rkisp1_params *params,389			   const struct rkisp1_cif_isp_hst_config *arg);390	void (*hst_enable)(struct rkisp1_params *params,391			   const struct rkisp1_cif_isp_hst_config *arg, bool en);392	void (*afm_config)(struct rkisp1_params *params,393			   const struct rkisp1_cif_isp_afc_config *arg);394};395 396/*397 * struct rkisp1_params - ISP input parameters device398 *399 * @vnode:		video node400 * @rkisp1:		pointer to the rkisp1 device401 * @ops:		pointer to the variant-specific operations402 * @config_lock:	locks the buffer list 'params'403 * @params:		queue of rkisp1_buffer404 * @metafmt		the currently enabled metadata format405 * @quantization:	the quantization configured on the isp's src pad406 * @ycbcr_encoding	the YCbCr encoding407 * @raw_type:		the bayer pattern on the isp video sink pad408 * @enabled_blocks:	bitmask of enabled ISP blocks409 */410struct rkisp1_params {411	struct rkisp1_vdev_node vnode;412	struct rkisp1_device *rkisp1;413	const struct rkisp1_params_ops *ops;414 415	spinlock_t config_lock; /* locks the buffers list 'params' */416	struct list_head params;417 418	const struct v4l2_meta_format *metafmt;419 420	enum v4l2_quantization quantization;421	enum v4l2_ycbcr_encoding ycbcr_encoding;422	enum rkisp1_fmt_raw_pat_type raw_type;423 424	u32 enabled_blocks;425};426 427/*428 * struct rkisp1_resizer - Resizer subdev429 *430 * @sd:	       v4l2_subdev variable431 * @regs_base: base register address offset432 * @id:	       id of the resizer, one of RKISP1_SELFPATH, RKISP1_MAINPATH433 * @rkisp1:    pointer to the rkisp1 device434 * @pads:      media pads435 * @config:    the set of registers to configure the resizer436 */437struct rkisp1_resizer {438	struct v4l2_subdev sd;439	u32 regs_base;440	enum rkisp1_stream_id id;441	struct rkisp1_device *rkisp1;442	struct media_pad pads[RKISP1_RSZ_PAD_MAX];443	const struct rkisp1_rsz_config *config;444};445 446/*447 * struct rkisp1_debug - Values to be exposed on debugfs.448 *			 The parameters are counters of the number of times the449 *			 event occurred since the driver was loaded.450 *451 * @data_loss:			  loss of data occurred within a line, processing failure452 * @outform_size_error:		  size error is generated in outmux submodule453 * @img_stabilization_size_error: size error is generated in image stabilization submodule454 * @inform_size_err:		  size error is generated in inform submodule455 * @mipi_error:			  mipi error occurred456 * @stats_error:		  writing to the 'Interrupt clear register' did not clear457 *				  it in the register 'Masked interrupt status'458 * @stop_timeout:		  upon stream stop, the capture waits 1 second for the isr to stop459 *				  the stream. This param is incremented in case of timeout.460 * @frame_drop:			  a frame was ready but the buffer queue was empty so the frame461 *				  was not sent to userspace462 */463struct rkisp1_debug {464	struct dentry *debugfs_dir;465	unsigned long data_loss;466	unsigned long outform_size_error;467	unsigned long img_stabilization_size_error;468	unsigned long inform_size_error;469	unsigned long irq_delay;470	unsigned long mipi_error;471	unsigned long stats_error;472	unsigned long stop_timeout[2];473	unsigned long frame_drop[2];474	unsigned long complete_frames;475};476 477/*478 * struct rkisp1_device - ISP platform device479 *480 * @base_addr:	   base register address481 * @dev:	   a pointer to the struct device482 * @clk_size:	   number of clocks483 * @clks:	   array of clocks484 * @gasket:	   the gasket - i.MX8MP only485 * @gasket_id:	   the gasket ID (0 or 1) - i.MX8MP only486 * @v4l2_dev:	   v4l2_device variable487 * @media_dev:	   media_device variable488 * @notifier:	   a notifier to register on the v4l2-async API to be notified on the sensor489 * @source:        source subdev in-use, set when starting streaming490 * @csi:	   internal CSI-2 receiver491 * @isp:	   ISP sub-device492 * @resizer_devs:  resizer sub-devices493 * @capture_devs:  capture devices494 * @stats:	   ISP statistics metadata capture device495 * @params:	   ISP parameters metadata output device496 * @pipe:	   media pipeline497 * @stream_lock:   serializes {start/stop}_streaming callbacks between the capture devices.498 * @debug:	   debug params to be exposed on debugfs499 * @info:	   version-specific ISP information500 * @irqs:          IRQ line numbers501 * @irqs_enabled:  the hardware is enabled and can cause interrupts502 */503struct rkisp1_device {504	void __iomem *base_addr;505	struct device *dev;506	unsigned int clk_size;507	struct clk_bulk_data clks[RKISP1_MAX_BUS_CLK];508	struct regmap *gasket;509	unsigned int gasket_id;510	struct v4l2_device v4l2_dev;511	struct media_device media_dev;512	struct v4l2_async_notifier notifier;513	struct v4l2_subdev *source;514	struct rkisp1_csi csi;515	struct rkisp1_isp isp;516	struct rkisp1_resizer resizer_devs[2];517	struct rkisp1_capture capture_devs[2];518	struct rkisp1_stats stats;519	struct rkisp1_params params;520	struct media_pipeline pipe;521	struct mutex stream_lock; /* serialize {start/stop}_streaming cb between capture devices */522	struct rkisp1_debug debug;523	const struct rkisp1_info *info;524	int irqs[RKISP1_NUM_IRQS];525	bool irqs_enabled;526};527 528/*529 * struct rkisp1_mbus_info - ISP media bus info, Translates media bus code to hardware530 *			     format values531 *532 * @mbus_code: media bus code533 * @pixel_enc: pixel encoding534 * @mipi_dt:   mipi data type535 * @yuv_seq:   the order of the Y, Cb, Cr values536 * @bus_width: bus width537 * @bayer_pat: bayer pattern538 * @direction: a bitmask of the flags indicating on which pad the format is supported on539 */540struct rkisp1_mbus_info {541	u32 mbus_code;542	enum v4l2_pixel_encoding pixel_enc;543	u32 mipi_dt;544	u32 yuv_seq;545	u8 bus_width;546	enum rkisp1_fmt_raw_pat_type bayer_pat;547	unsigned int direction;548};549 550static inline void551rkisp1_write(struct rkisp1_device *rkisp1, unsigned int addr, u32 val)552{553	writel(val, rkisp1->base_addr + addr);554}555 556static inline u32 rkisp1_read(struct rkisp1_device *rkisp1, unsigned int addr)557{558	return readl(rkisp1->base_addr + addr);559}560 561/*562 * rkisp1_cap_enum_mbus_codes - A helper function that return the i'th supported mbus code563 *				of the capture entity. This is used to enumerate the supported564 *				mbus codes on the source pad of the resizer.565 *566 * @cap:  the capture entity567 * @code: the mbus code, the function reads the code->index and fills the code->code568 */569int rkisp1_cap_enum_mbus_codes(struct rkisp1_capture *cap,570			       struct v4l2_subdev_mbus_code_enum *code);571 572/*573 * rkisp1_mbus_info_get_by_index - Retrieve the ith supported mbus info574 *575 * @index: index of the mbus info to fetch576 */577const struct rkisp1_mbus_info *rkisp1_mbus_info_get_by_index(unsigned int index);578 579/*580 * rkisp1_path_count - Return the number of paths supported by the device581 *582 * Some devices only have a main path, while other device have both a main path583 * and a self path. This function returns the number of paths that this device584 * has, based on the feature flags. It should be used insted of checking585 * ARRAY_SIZE of capture_devs/resizer_devs.586 */587static inline unsigned int rkisp1_path_count(struct rkisp1_device *rkisp1)588{589	return rkisp1_has_feature(rkisp1, SELF_PATH) ? 2 : 1;590}591 592/*593 * rkisp1_sd_adjust_crop_rect - adjust a rectangle to fit into another rectangle.594 *595 * @crop:   rectangle to adjust.596 * @bounds: rectangle used as bounds.597 */598void rkisp1_sd_adjust_crop_rect(struct v4l2_rect *crop,599				const struct v4l2_rect *bounds);600 601/*602 * rkisp1_sd_adjust_crop - adjust a rectangle to fit into media bus format603 *604 * @crop:   rectangle to adjust.605 * @bounds: media bus format used as bounds.606 */607void rkisp1_sd_adjust_crop(struct v4l2_rect *crop,608			   const struct v4l2_mbus_framefmt *bounds);609 610void rkisp1_bls_swap_regs(enum rkisp1_fmt_raw_pat_type pattern,611			  const u32 input[4], u32 output[4]);612 613/*614 * rkisp1_mbus_info_get_by_code - get the isp info of the media bus code615 *616 * @mbus_code: the media bus code617 */618const struct rkisp1_mbus_info *rkisp1_mbus_info_get_by_code(u32 mbus_code);619 620/*621 * rkisp1_params_pre_configure - Configure the params before stream start622 *623 * @params:	  pointer to rkisp1_params624 * @bayer_pat:	  the bayer pattern on the isp video sink pad625 * @quantization: the quantization configured on the isp's src pad626 * @ycbcr_encoding: the ycbcr_encoding configured on the isp's src pad627 *628 * This function is called by the ISP entity just before the ISP gets started.629 * It applies the initial ISP parameters from the first params buffer, but630 * skips LSC as it needs to be configured after the ISP is started.631 */632void rkisp1_params_pre_configure(struct rkisp1_params *params,633				 enum rkisp1_fmt_raw_pat_type bayer_pat,634				 enum v4l2_quantization quantization,635				 enum v4l2_ycbcr_encoding ycbcr_encoding);636 637/*638 * rkisp1_params_post_configure - Configure the params after stream start639 *640 * @params:	  pointer to rkisp1_params641 *642 * This function is called by the ISP entity just after the ISP gets started.643 * It applies the initial ISP LSC parameters from the first params buffer.644 */645void rkisp1_params_post_configure(struct rkisp1_params *params);646 647/* rkisp1_params_disable - disable all parameters.648 *			   This function is called by the isp entity upon stream start649 *			   when capturing bayer format.650 *651 * @params: pointer to rkisp1_params.652 */653void rkisp1_params_disable(struct rkisp1_params *params);654 655/* irq handlers */656irqreturn_t rkisp1_isp_isr(int irq, void *ctx);657irqreturn_t rkisp1_csi_isr(int irq, void *ctx);658irqreturn_t rkisp1_capture_isr(int irq, void *ctx);659void rkisp1_stats_isr(struct rkisp1_stats *stats, u32 isp_ris);660void rkisp1_params_isr(struct rkisp1_device *rkisp1);661 662/* register/unregisters functions of the entities */663int rkisp1_capture_devs_register(struct rkisp1_device *rkisp1);664void rkisp1_capture_devs_unregister(struct rkisp1_device *rkisp1);665 666int rkisp1_isp_register(struct rkisp1_device *rkisp1);667void rkisp1_isp_unregister(struct rkisp1_device *rkisp1);668 669int rkisp1_resizer_devs_register(struct rkisp1_device *rkisp1);670void rkisp1_resizer_devs_unregister(struct rkisp1_device *rkisp1);671 672int rkisp1_stats_register(struct rkisp1_device *rkisp1);673void rkisp1_stats_unregister(struct rkisp1_device *rkisp1);674 675int rkisp1_params_register(struct rkisp1_device *rkisp1);676void rkisp1_params_unregister(struct rkisp1_device *rkisp1);677 678#if IS_ENABLED(CONFIG_DEBUG_FS)679void rkisp1_debug_init(struct rkisp1_device *rkisp1);680void rkisp1_debug_cleanup(struct rkisp1_device *rkisp1);681#else682static inline void rkisp1_debug_init(struct rkisp1_device *rkisp1)683{684}685static inline void rkisp1_debug_cleanup(struct rkisp1_device *rkisp1)686{687}688#endif689 690#endif /* _RKISP1_COMMON_H */691