drivers/staging/media/atomisp/include/linux/atomisp_platform.h

Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/include/linux/atomisp_platform.h

File Facts

System
Linux kernel
Corpus path
drivers/staging/media/atomisp/include/linux/atomisp_platform.h
Extension
.h
Size
7011 bytes
Lines
184
Domain
Driver Families
Bucket
drivers/staging
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct intel_v4l2_subdev_table {
	enum atomisp_camera_port port;
	unsigned int lanes;
	struct v4l2_subdev *subdev;
};

/*
 * Sensor of external ISP can send multiple streams with different MIPI data
 * type in the same virtual channel. This information needs to come from the
 * sensor or external ISP.
 */
struct atomisp_isys_config_info {
	u8 input_format;
	u16 width;
	u16 height;
};

struct atomisp_input_stream_info {
	enum atomisp_input_stream_id stream;
	u8 enable;
	/* Sensor driver fills ch_id with the id of the virtual channel. */
	u8 ch_id;
	/*
	 * Tells the number of streams in this virtual channel. If 0, ignore the
	 * rest and the input format will be from mipi_info.
	 */
	u8 isys_configs;
	/*
	 * If isys_configs is greater than 0, sensor needs to configure the
	 * input format differently. Width and height can be 0. If width and
	 * height are not zero, then the corresponding data needs to be set.
	 */
	struct atomisp_isys_config_info isys_info[MAX_STREAMS_PER_CHANNEL];
};

struct camera_sensor_platform_data {
	int (*flisclk_ctrl)(struct v4l2_subdev *subdev, int flag);
	int (*csi_cfg)(struct v4l2_subdev *subdev, int flag);

	/*
	 * New G-Min power and GPIO interface to control individual
	 * lines as implemented on all known camera modules.
	 */
	int (*gpio0_ctrl)(struct v4l2_subdev *subdev, int on);
	int (*gpio1_ctrl)(struct v4l2_subdev *subdev, int on);
	int (*v1p8_ctrl)(struct v4l2_subdev *subdev, int on);
	int (*v2p8_ctrl)(struct v4l2_subdev *subdev, int on);
	int (*v1p2_ctrl)(struct v4l2_subdev *subdev, int on);
};

struct camera_mipi_info {
	enum atomisp_camera_port        port;
	unsigned int                    num_lanes;
	enum atomisp_input_format       input_format;
	enum atomisp_bayer_order        raw_bayer_order;
	enum atomisp_input_format       metadata_format;
	u32                             metadata_width;
	u32                             metadata_height;
	const u32                       *metadata_effective_width;
};

const struct intel_v4l2_subdev_table *atomisp_platform_get_subdevs(void);
int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes,
				    enum atomisp_input_format format,
				    enum atomisp_bayer_order bayer_order);
void atomisp_unregister_subdev(struct v4l2_subdev *subdev);

/* API from old platform_camera.h, new CPUID implementation */
#define __IS_SOC(x) (boot_cpu_data.x86_vfm == x)
#define __IS_SOCS(x, y) (boot_cpu_data.x86_vfm == x || boot_cpu_data.x86_vfm == y)

#define IS_MFLD	__IS_SOC(INTEL_ATOM_SALTWELL_MID)
#define IS_BYT	__IS_SOC(INTEL_ATOM_SILVERMONT)
#define IS_CHT	__IS_SOC(INTEL_ATOM_AIRMONT)
#define IS_MRFD	__IS_SOC(INTEL_ATOM_SILVERMONT_MID)
#define IS_MOFD	__IS_SOC(INTEL_ATOM_SILVERMONT_MID2)

/* Both CHT and MOFD come with ISP2401 */
#define IS_ISP2401 __IS_SOCS(INTEL_ATOM_AIRMONT, \
			     INTEL_ATOM_SILVERMONT_MID2)

#endif /* ATOMISP_PLATFORM_H_ */

Annotation

Implementation Notes