linux/drivers/media/platform/qcom/camss/camss-csid.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * camss-csid.h
 *
 * Qualcomm MSM Camera Subsystem - CSID (CSI Decoder) Module
 *
 * Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
 * Copyright (C) 2015-2018 Linaro Ltd.
 */
#ifndef QC_MSM_CAMSS_CSID_H
#define QC_MSM_CAMSS_CSID_H

#include <linux/clk.h>
#include <linux/interrupt.h>
#include <media/media-entity.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-mediabus.h>
#include <media/v4l2-subdev.h>

#define MSM_CSID_PAD_SINK
#define MSM_CSID_PAD_FIRST_SRC
#define MSM_CSID_PADS_NUM

#define MSM_CSID_PAD_SRC

/* CSID hardware can demultiplex up to 4 outputs */
#define MSM_CSID_MAX_SRC_STREAMS

#define DATA_TYPE_EMBEDDED_DATA_8BIT
#define DATA_TYPE_YUV420_8BIT
#define DATA_TYPE_YUV420_10BIT
#define DATA_TYPE_YUV420_8BIT_LEGACY
#define DATA_TYPE_YUV420_8BIT_SHIFTED
#define DATA_TYPE_YUV420_10BIT_SHIFTED
#define DATA_TYPE_YUV422_8BIT
#define DATA_TYPE_YUV422_10BIT
#define DATA_TYPE_RGB444
#define DATA_TYPE_RGB555
#define DATA_TYPE_RGB565
#define DATA_TYPE_RGB666
#define DATA_TYPE_RGB888
#define DATA_TYPE_RAW_24BIT
#define DATA_TYPE_RAW_6BIT
#define DATA_TYPE_RAW_7BIT
#define DATA_TYPE_RAW_8BIT
#define DATA_TYPE_RAW_10BIT
#define DATA_TYPE_RAW_12BIT
#define DATA_TYPE_RAW_14BIT
#define DATA_TYPE_RAW_16BIT
#define DATA_TYPE_RAW_20BIT

#define CSID_RESET_TIMEOUT_MS

enum csid_testgen_mode {};

struct csid_format_info {};

struct csid_formats {};

struct csid_testgen_config {};

struct csid_phy_config {};

struct csid_device;

struct csid_hw_ops {};

struct csid_subdev_resources {};

struct csid_device {};

struct camss_subdev_resources;

/*
 * csid_find_code - Find a format code in an array using array index or format code
 * @codes: Array of format codes
 * @ncodes: Length of @code array
 * @req_format_idx: Request preferred index, as defined by subdevice csid_format.
 *	Set @match_code to 0 if used.
 * @match_code: Request preferred code, set @req_format_idx to 0 if used
 *
 * Return 0 on failure or format code otherwise
 */
u32 csid_find_code(u32 *codes, unsigned int ncode,
		   unsigned int match_format_idx, u32 match_code);

/*
 * csid_get_fmt_entry - Find csid_format_info entry with matching format code
 * @formats: Array of format csid_format_info entries
 * @nformats: Length of @nformats array
 * @code: Desired format code
 *
 * Return formats[0] on failure to find code
 */
const struct csid_format_info *csid_get_fmt_entry(const struct csid_format_info *formats,
						  unsigned int nformats,
						  u32 code);

int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
			 const struct camss_subdev_resources *res, u8 id);

int msm_csid_register_entity(struct csid_device *csid,
			     struct v4l2_device *v4l2_dev);

void msm_csid_unregister_entity(struct csid_device *csid);

void msm_csid_get_csid_id(struct media_entity *entity, u8 *id);

extern const char * const csid_testgen_modes[];

extern const struct csid_formats csid_formats_4_1;
extern const struct csid_formats csid_formats_4_7;
extern const struct csid_formats csid_formats_gen2;

extern const struct csid_hw_ops csid_ops_4_1;
extern const struct csid_hw_ops csid_ops_4_7;
extern const struct csid_hw_ops csid_ops_gen2;

/*
 * csid_is_lite - Check if CSID is CSID lite.
 * @csid: CSID Device
 *
 * Return whether CSID is CSID lite
 */
bool csid_is_lite(struct csid_device *csid);

#endif /* QC_MSM_CAMSS_CSID_H */