2019-05-27 06:55:21 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2011-08-12 17:09:34 +00:00
|
|
|
/*
|
|
|
|
* omap3isp.h
|
|
|
|
*
|
2015-05-20 07:08:30 +00:00
|
|
|
* TI OMAP3 ISP - Bus Configuration
|
2011-08-12 17:09:34 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2011 Nokia Corporation
|
|
|
|
*
|
|
|
|
* Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
|
|
* Sakari Ailus <sakari.ailus@iki.fi>
|
|
|
|
*/
|
|
|
|
|
2015-05-20 07:08:30 +00:00
|
|
|
#ifndef __OMAP3ISP_H__
|
|
|
|
#define __OMAP3ISP_H__
|
2011-08-12 17:09:34 +00:00
|
|
|
|
|
|
|
enum isp_interface_type {
|
|
|
|
ISP_INTERFACE_PARALLEL,
|
|
|
|
ISP_INTERFACE_CSI2A_PHY2,
|
|
|
|
ISP_INTERFACE_CCP2B_PHY1,
|
|
|
|
ISP_INTERFACE_CCP2B_PHY2,
|
|
|
|
ISP_INTERFACE_CSI2C_PHY1,
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2015-03-25 22:57:30 +00:00
|
|
|
* struct isp_parallel_cfg - Parallel interface configuration
|
2011-08-12 17:09:34 +00:00
|
|
|
* @data_lane_shift: Data lane shifter
|
2015-05-20 07:08:30 +00:00
|
|
|
* 0 - CAMEXT[13:0] -> CAM[13:0]
|
2015-12-29 14:03:19 +00:00
|
|
|
* 2 - CAMEXT[13:2] -> CAM[11:0]
|
|
|
|
* 4 - CAMEXT[13:4] -> CAM[9:0]
|
|
|
|
* 6 - CAMEXT[13:6] -> CAM[7:0]
|
2011-08-12 17:09:34 +00:00
|
|
|
* @clk_pol: Pixel clock polarity
|
2011-11-16 19:59:05 +00:00
|
|
|
* 0 - Sample on rising edge, 1 - Sample on falling edge
|
2011-08-12 17:09:34 +00:00
|
|
|
* @hs_pol: Horizontal synchronization polarity
|
|
|
|
* 0 - Active high, 1 - Active low
|
|
|
|
* @vs_pol: Vertical synchronization polarity
|
|
|
|
* 0 - Active high, 1 - Active low
|
2014-05-19 19:37:38 +00:00
|
|
|
* @fld_pol: Field signal polarity
|
|
|
|
* 0 - Positive, 1 - Negative
|
2011-08-31 13:53:41 +00:00
|
|
|
* @data_pol: Data polarity
|
|
|
|
* 0 - Normal, 1 - One's complement
|
2017-07-18 15:51:35 +00:00
|
|
|
* @bt656: Data contain BT.656 embedded synchronization
|
2011-08-12 17:09:34 +00:00
|
|
|
*/
|
2015-03-25 22:57:30 +00:00
|
|
|
struct isp_parallel_cfg {
|
2015-12-29 14:03:19 +00:00
|
|
|
unsigned int data_lane_shift:3;
|
2011-08-12 17:09:34 +00:00
|
|
|
unsigned int clk_pol:1;
|
|
|
|
unsigned int hs_pol:1;
|
|
|
|
unsigned int vs_pol:1;
|
2014-05-19 19:37:38 +00:00
|
|
|
unsigned int fld_pol:1;
|
2011-08-31 13:53:41 +00:00
|
|
|
unsigned int data_pol:1;
|
2017-07-18 15:51:35 +00:00
|
|
|
unsigned int bt656:1;
|
2011-08-12 17:09:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ISP_CCP2_PHY_DATA_CLOCK = 0,
|
|
|
|
ISP_CCP2_PHY_DATA_STROBE = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ISP_CCP2_MODE_MIPI = 0,
|
|
|
|
ISP_CCP2_MODE_CCP2 = 1,
|
|
|
|
};
|
|
|
|
|
2011-10-10 17:13:26 +00:00
|
|
|
/**
|
|
|
|
* struct isp_csiphy_lane: CCP2/CSI2 lane position and polarity
|
|
|
|
* @pos: position of the lane
|
|
|
|
* @pol: polarity of the lane
|
|
|
|
*/
|
|
|
|
struct isp_csiphy_lane {
|
|
|
|
u8 pos;
|
|
|
|
u8 pol;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define ISP_CSIPHY1_NUM_DATA_LANES 1
|
|
|
|
#define ISP_CSIPHY2_NUM_DATA_LANES 2
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct isp_csiphy_lanes_cfg - CCP2/CSI2 lane configuration
|
|
|
|
* @data: Configuration of one or two data lanes
|
|
|
|
* @clk: Clock lane configuration
|
|
|
|
*/
|
|
|
|
struct isp_csiphy_lanes_cfg {
|
|
|
|
struct isp_csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES];
|
|
|
|
struct isp_csiphy_lane clk;
|
|
|
|
};
|
|
|
|
|
2011-08-12 17:09:34 +00:00
|
|
|
/**
|
2015-03-25 22:57:30 +00:00
|
|
|
* struct isp_ccp2_cfg - CCP2 interface configuration
|
2011-08-12 17:09:34 +00:00
|
|
|
* @strobe_clk_pol: Strobe/clock polarity
|
|
|
|
* 0 - Non Inverted, 1 - Inverted
|
|
|
|
* @crc: Enable the cyclic redundancy check
|
|
|
|
* @ccp2_mode: Enable CCP2 compatibility mode
|
|
|
|
* ISP_CCP2_MODE_MIPI - MIPI-CSI1 mode
|
|
|
|
* ISP_CCP2_MODE_CCP2 - CCP2 mode
|
|
|
|
* @phy_layer: Physical layer selection
|
|
|
|
* ISP_CCP2_PHY_DATA_CLOCK - Data/clock physical layer
|
|
|
|
* ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer
|
|
|
|
* @vpclk_div: Video port output clock control
|
|
|
|
*/
|
2015-03-25 22:57:30 +00:00
|
|
|
struct isp_ccp2_cfg {
|
2011-08-12 17:09:34 +00:00
|
|
|
unsigned int strobe_clk_pol:1;
|
|
|
|
unsigned int crc:1;
|
|
|
|
unsigned int ccp2_mode:1;
|
|
|
|
unsigned int phy_layer:1;
|
|
|
|
unsigned int vpclk_div:2;
|
2017-02-28 11:38:16 +00:00
|
|
|
unsigned int vp_clk_pol:1;
|
2011-10-10 17:13:26 +00:00
|
|
|
struct isp_csiphy_lanes_cfg lanecfg;
|
2011-08-12 17:09:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2015-03-25 22:57:30 +00:00
|
|
|
* struct isp_csi2_cfg - CSI2 interface configuration
|
2011-08-12 17:09:34 +00:00
|
|
|
* @crc: Enable the cyclic redundancy check
|
2017-07-13 16:11:32 +00:00
|
|
|
* @lanecfg: CSI-2 lane configuration
|
|
|
|
* @num_data_lanes: The number of data lanes in use
|
2011-08-12 17:09:34 +00:00
|
|
|
*/
|
2015-03-25 22:57:30 +00:00
|
|
|
struct isp_csi2_cfg {
|
2011-08-12 17:09:34 +00:00
|
|
|
unsigned crc:1;
|
2011-10-10 17:13:26 +00:00
|
|
|
struct isp_csiphy_lanes_cfg lanecfg;
|
2017-07-13 16:11:32 +00:00
|
|
|
u8 num_data_lanes;
|
2011-08-12 17:09:34 +00:00
|
|
|
};
|
|
|
|
|
2015-03-25 22:57:30 +00:00
|
|
|
struct isp_bus_cfg {
|
2011-08-12 17:09:34 +00:00
|
|
|
enum isp_interface_type interface;
|
|
|
|
union {
|
2015-03-25 22:57:30 +00:00
|
|
|
struct isp_parallel_cfg parallel;
|
|
|
|
struct isp_ccp2_cfg ccp2;
|
|
|
|
struct isp_csi2_cfg csi2;
|
2011-08-12 17:09:34 +00:00
|
|
|
} bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
|
|
|
|
};
|
|
|
|
|
2015-05-20 07:08:30 +00:00
|
|
|
#endif /* __OMAP3ISP_H__ */
|