高通camera驱动 camx相关内容 (二)

camx

编译环境中的driver文件的相关位置

  • sensor driver XML files : chi-cdk/vendor/sensor/default/<sensor_name>/<sensor_name)_sensor.xml.
  • Module configuration files : chi-cdk/vendor/module/<module_name>_module.xml.
  • Kernel dts files : kernel/msm-4.9/arch/arm64/boot/dts/qcom/<target_name>-camera-sensor-<platform>.dtsi.
  • Submodule driver XML files : chi-cdk/vendor/sensor/default/<sub-module_name>/< sub-module _name_sub-module>.xml. For example, chi-cdk/vendor/sensor/default/actuator/<actuator_name>_actuator.xml.
  • The driver binary in the device vendor makefile to be included in the build is at vendor/qcom/proprietary/common/config/device-vendor.mk. For example, MM_CAMERA +=com.qti.sensormodule.<sensor_name>.bin.

Sensor information nodes (sensor 信息节点)

slaveInfo: XML文件中的slaveInfo节点保存驱动程序在 probe sensor 时使用的信息,包括I2C地址 I2C频率 sensor寄存器地址 sensor寄存器值 上下电时序等,注意需要完全按照厂商提供的sensor spec填写

                                                                  Sensor slave information node

节点描述
slaveInfoContains the sensor slave information and power settings.
sensorNameName of the sensor.
Example: imx230
slaveAddress8 bit or 10 bit slave address
Example: 32
For 0x20 slave address, the field value is 32.
regAddrType Register address/data size in bytes.
Example:
  • 1 = Byte address
  • 2 = Word address
  • 3 = 3 byte address
  • 4 = Address type max
regDataType

Register address/data size in bytes.
Example:

  • 1 = Byte data
  • 2 = Word data
  • 3 = Double word data
  • 4 = Data type max
sensorIdRegAddrRegister address for sensor ID.
Example: 22
sensorIdSensor ID.
Example: 560
sensorIDMask Mask for sensor ID. Sensor ID may only be a few bits.
Example: 4294967295
i2cFrequencyModeI2C Frequency mode of slave.
Example: FAST
Supported modes are:
  • STANDARD (100 kHz)
  • FAST (400 kHz)
  • FAST_PLUS (1 MHz)
  • CUSTOM (custom frequency in DTSI)
powerUpSequenceContains the power-up configuration sequence required to control the
power to the device while turning it on.
Example:
<powerUpSequence>
<powerSetting>
<configType>RESET</configType>
<configValue>0</configValue>
<delayMs>0</delayMs>
</powerSetting>
</ powerUpSequence>
powerSettingContains power configuration type, value, and delay.
configTypePower configuration type.
Example: MCLK
Supported types are:
  • MCLK
  • VANA
  • VDIG
  • VIO
  • VAF
  • RESET
  • STANDBY
configValue Power configuration type.
Example: 24000000
delayMsDelay in milliseconds.
Example: 1
powerDownSequenceContains the power-down configuration sequence that is required to control the power to the device while closing it.
Example:
<powerDownSequence>
<powerSetting>
<configType>RESET</configType>
<configValue>0</configValue>
<delayMs>0</delayMs>
</powerSetting>
</ powerDownSequence>

refAddrInfo : register information节点包含用于设置gain, frame length lines, and test pattern generation等各种传感器功能的配置寄存器地址。

节点描述
regAddrInfoContains the information about the register addresses for various sensor settings.
xOutputControls the program width.
Example: 844
If the register address is 0x34C then the value of this field is 844
yOutputControls the program height.
Example: 846
frameLengthLinesPrograms the frame length lines.
Example: 832
lineLengthPixelClockPrograms the line length pixel clock.
Example: 834
globalGainAddr Program the gain channel.
Example: 516
digitalGainRedAddrPrograms digital gain for the red channel.
This address is optional but is required if supported by sensor.
Example: 528
digitalGainGreenRedAddrPrograms digital gain for the green-red channel.
This address is optional but is required if supported by sensor.
Example: 526
digitalGainBlueAddr Register address to program digital gain for the blue channel. This address is optional but is required if supported by sensor.
Example: 530
digitalGainGreenBlueAddr Programs digital gain for the green-blue channel. The address is optional but is required when supported by sensor.
Example: 532
testPatternRAddrPrograms manual test pattern value for the red channel.
Example: 1538
testPatternGRAddrPrograms manual test pattern value for the red channel.
Example: 1540
testPatternBAddrPrograms manual test pattern value for the red channel.
Example: 1542
testPatternGBAddrPrograms manual test pattern value for the red channel.
Example: 1544

resolutionInfo: The resolution information node 包含有关分辨率设置和配置的信息。

节点描述
resolutionInfoThis node holds the configuration and settings for all the resolutions.
resolutionData Holds the configuration data for one resolution.
The number of sensor supported resolutions is equal to the number of resolutionData nodes.
NOTE: First node of the resolutionData should always point to the full resolution configuration of the sensor.
colorFilterArrangementColor filter arrangement of the sensor.
Example: BAYER_RGGB
Supported filter arrangements are:
  • BAYER_BGGR
  • BAYER_GBRG
  • BAYER_GRBG
  • BAYER_RGGB
  • BAYER_Y
  • YUV_UYVY
  • YUV_YUYV
streamInfoInformation related to the stream configuration.
Example:
<streamInfo>
<streamConfiguration>
<vc range="[0,3]">0</vc>
<dt>43</dt>
<frameDimension>
<xStart>0</xStart>
<yStart>0</yStart>
<width>4608</width>
<height>2592</height>
</frameDimension>
<bitWidth>10</bitWidth>
<type>IMAGE</type>
</streamConfiguration>
</streamInfo>
streamConfigurationInformation related to the stream data.
vcVirtual channel of the data
Example: 2
Each unique combination of virtual channel (VC) and DT should map
to a unique channel identifier (CID) value. Possible CID values for a
given VC are:
  • 0 – 0, 1, 2, 3
  • 1 – 4, 5, 6, 7
  • 2 – 8, 9, 10, 11
  • 3 – 12, 13, 14, 15
Valid values for VC are: 0, 1, 2, and 3
dtDT of the stream.
Example: 43
Default value is 0x2B (10 bit RAW)
frameDimensionFrame dimension contains x and y start coordinates, and the total width and height of the image.
xStart X coordinate of start of image.
yStartY coordinate of start of image.
widthWidth of the image.
heightHeight of the image
bitWidth Bit width of the data.
type

Stream type
Example: IMAGE
Supported stream types are:

  • BLOB
  • IMAGE
  • PDAF
  • HDR
  • META
lineLengthPixelClockLine length pixel clock of frame.
Typically, this value is the active width + blanking width.
frameLengthLines Frame length lines of frame.
Typically, this value is the active height + blanking height.
minHorizontalBlankingMinimum horizontal blanking interval in pixels.
minVerticalBlankingMinimum horizontal blanking interval in lines
outputPixelClockRepresents how much data comes out of the camera over MIPI lanes to set the VFE clock.
op_pixel_clk = (Total data rate from sensor)/(Bits per pixel)
For example, if the MIPI DDR clock value (speed of the clock lane of the MIPI camera sensor) is 300 MHz and the sensor transmits on four lanes, each lane has a 600 MHz data rate. Thus, the total data rate is 2400 MHz.
For 10 bits per pixel bayer data, the op_pixel_clk value is 2400/10 = 240 MHz. The values are filled in accordance with the sensor specifications.
The values are calculated based on the register settings configured for the camera sensor.
horizontalBinningHorizontal binning value.
verticalBinningVertical binning value.
framerateMaximum frame rate
laneCountThe number of data lanes on which the sensor outputs data for a given mode of operation. The maximum data lane capability (given in the datasheet) of the sensor along with the sensor register settings configured in the driver determines the value
settleTimeNs

Settle time in nanoseconds.
The value is configured, based on the output characteristics of the
sensor, to ensure that the PHY transmitter of the sensor does not
have sync issues with the PHY receiver of MSM chipsets.
For 28 nm and smaller MSM parts, use the following formula to calculate the settle count:
settle_CNT=(T(HS_SETTLE)_AVG)/T(TIMER_CLK)
where,
T(HS_SETTLE)_avg = (T(HS_SETTLE)_min +
T(HS_SETTLE)_max ) / 2
as indicated by sensor datasheet.
TIMER_CLK refers to the operating frequency of PHY interface to which the camera sensor is connected (for example, CAMSS_PHY0_CSI0PHYTIMER_CLK for PHY0). This value is set in the kernel/arch/arm/boot/dts/msm/msmXXXX-camera.dtsi file,
where XXXX refers to the MSM chipset is used.

 

T(TIMER_CLK) is the duration of a clock cycle when the operating frequency is equal to TIMER_CLK, and is represented in nano second units. For example, T(TIMER_CLK) for TIMER_CLK 200
MHz is (1 × (10^9))/(200 × (10^6)) = 5 ns.

 

If the calculated value does not work as expected, try alternating the lower values between T(HS_SETTLE)_avg/T(TIMER_CLK) and T(HS_SETTLE)_min/T(TIMER_CLK) are tried.
See https://mipi.org/specifications/d-phy for more details on
T(HS_SETTLE)

is3PhaseFlag to know if the sensor is a three-phase sensor (C-PHY) or one-phase sensor (D-PHY).
resSettingsSequence of register settings to configure the device with this resolution.
NOTE: Do not add stream on settings for the sensor in the
initialization settings, as this enables the sensor streaming before real software stream on and may cause PHY to miss LP sequence.
Example:
<resSettings>
<regSetting>
<registerAddr>0x114</registerAddr>
<registerData>0x3</registerData>
<regAddrType range="[1,4]">2</regAddrType>
<regDataType range="[1,4]">1</regDataType>
<operation>WRITE</operation>
<delayUs>0x0</delayUs>
</regSetting>
<resSettings>
regSettingThis node holds one register configuration and forms a unit of large-resolution register settings sequence.
registerAddrRegister address that is accessed.
registerDataIf the operation is WRITE, registerData is the data value to be written into the specified register address.
If the operation is READ, registerData is the number of bytes to be read from the specified register address.
regAddrTypeType of register address.
regAddrTypeType of register address.
regDataTypeType of register data.
operationType of operation
Supported values:
  • WRITE
  • READ
  • POLL
delayUsDelay in microseconds. If not explicitly specified, the delay is zero.
cropInfoCrop information of the frame.
Example:
<cropInfo>
<left>0</left>
<right>0</right>
<top>0</top>
<bottom>0</bottom>
</cropInfo>
leftLeft crop pixel information.
rightRight crop pixel information.
top Top crop pixel information.
bottom Bottom crop pixel information.
capabilityList of features/capabilities supported by the sensor.
Supported features are:
HFR
iHDR
INSENSOR_HDR
PDAF
QUADRA_CFA
RAW_HDR
ZIGZAG_HDR

exposureControlInfo: The exposure control information node 包含曝光细节,如  maximum gain, maximum line count, and conversion formulas for gain manipulation.

节点描述
exposureControlInfo This node holds the information about the exposure details such as maximum gain, maximum line count, and conversion formulas for gain manipulation.
Example:
<exposureControlInfo>
<maxAnalogGain>8</maxAnalogGain>
<maxDigitalGain>2</maxDigitalGain>
<verticalOffset>20</verticalOffset>
<maxLineCount>65515</maxLineCount>
<realToRegGain>512-(512/realGain)</realToRegGain>
<regToRealGain>512/(512-regGain)</regToRealGain>
</exposureControlInfo>
maxAnalogGainMaximum analog gain supported by the sensor.
maxDigitalGain Maximum digital gain supported by the sensor.
verticalOffsetMinimum offset to be maintained between the line count and frame length lines.
maxLineCountMaximum line count supported by the sensor.
realToRegGain Real gain to register the gain equation.
The equation must contain realGain in the equation.
regToRealGainRegister gain to real gain equation.
The equation must contain regGain in the equation.

streamOnSettings: Register settings to start streaming.

节点描述
streamOffSettings Sequence of register settings to configure the device to stop streaming.
Configure the following settings to match this guideline and take the clock and data lanes to LP11.
Example:
<streamOffSettings>
<regSetting>
<registerAddr>0x0100</registerAddr>
<registerData>0x0</registerData>
<regAddrType range="[1,4]">2</regAddrType>
<regDataType range="[1,4]">1</regDataType>
<operation>WRITE</operation>
<delayUs>0</delayUs>
</regSetting>
</streamOffSettings>
regSetting Register setting configuration.
Contains: Register address, register data, register address type, register DT, operation, and delay in micro seconds
streamOffSettingsSequence of register settings to configure the device to stop streaming.
Configure the following settings to match this guideline and take the clock and data lanes to LP11.
Example:
<streamOffSettings>
<regSetting>
<registerAddr>0x0100</registerAddr>
<registerData>0x0</registerData>
<regAddrType range="[1,4]">2</regAddrType>
<regDataType range="[1,4]">1</regDataType>
<operation>WRITE</operation>
<delayUs>0</delayUs>
</regSetting>
</streamOffSettings>
regSettingRegister setting configuration.
Contains: Register address, register data, register address type, register DT, operation, and delay in micro seconds

groupHoldOnSettings: Register settings to configure the device in group hold settings.

节点描述
groupHoldOnSettingsSequence of register settings to configure the device in group hold settings.
Example:
<groupHoldOnSettings>
<regSetting>
<registerAddr>0x0104</registerAddr>
<registerData>0x1</registerData>
<regAddrType range="[1,4]">2</regAddrType>
<regDataType range="[1,4]">1</regDataType>
<operation>WRITE</operation>
<delayUs>0</delayUs>
</regSetting>
</groupHoldOnSettings>
regSettingRegister setting configuration.
Contains: Register address, register data, register address type,
register data type, operation, and delay in micro seconds.
groupHoldOffSettingsSequence of register settings to configure the device to stop group hold settings.
Example:
<groupHoldOffSettings>
<regSetting>
<registerAddr>0x0104</registerAddr>
<registerData>0x0</registerData>
<regAddrType range="[1,4]">2</regAddrType>
<regDataType range="[1,4]">1</regDataType>
<operation>WRITE</operation>
<delayUs>0</delayUs>
</regSetting>
</groupHoldOffSettings>
regSettingRegister setting configuration.
Contains: Register address, register data, register address type, register data type, operation, and delay in micro seconds.

initSettings: Sequence of register settings to initialize the sensor.

节点描述
initSettingsSequence of register settings to initialize the sensor.
NOTE: Do not add stream on settings for the sensor in the
initialization settings, as this enables the sensor streaming before real software stream on and may cause PHY to miss LP sequence.
Example:
<initSettings>
<regSetting>
<registerAddr>0x136</registerAddr>
<registerData>0x18</registerData>
<regAddrType range="[1,4]">2</regAddrType>
<regDataType range="[1,4]">1</regDataType>
<operation>WRITE</operation>
<delayUs>0</delayUs>
</regSetting>
</initSettings>
regSettingRegister setting configuration.
Contains: Register address, register data, register address type, register data type, operation, and delay in micro seconds.

testPatternInfo: This node contains the information about the test pattern generation register settings.

节点描述
testPatternInfoContains the information about the test pattern generation register settings.
Example:
<testPatternInfo>
<testPatternData>
<mode>OFF</mode>
<settings>
<regSetting>
<registerAddr>0x136</registerAddr>
<registerData>0x18</registerData>
<regAddrType range="[1,4]">2</regAddrType>
<regDataType range="[1,4]">1</regDataType>
<operation>WRITE</operation>
<delayUs>0</delayUs>
</regSetting>
</settings>
</testPatternData>
</testPatternInfo>
testPatternDataThis node holds the register and mode settings of a particular test pattern.
ModeSupported modes are: 
OFF 
SOLID_COLOR 
COLOR_BARS 
COLOR_BARS_FADE_TO_GRAY 
PN9
CUSTOM1
settingsSequence of register settings to configure the test pattern on the sensor.
regSettingRegister setting configuration.
Contains: Register address, register data, register address type, register data type, operation, and delay in micro seconds.

colorLevelInfo: The color level information node provides details about the various channels in complete dark light.

节点描述
colorLevelInfoColor level information.
The default currents in various channels in complete dark light.
Example:
<colorLevelInfo>
<whiteLevel>1023</whiteLevel>
<rPedestal>64</rPedestal>
<grPedestal>64</grPedestal>
<bPedestal>64</bPedestal>
<gbPedestal>64</gbPedestal>
</colorLevelInfo>
whiteLevelWhite level value.
rPedestalPedestal value for the red channel.
grPedestalPedestal value for the green-red channel.
bPedestalPedestal value for the blue channel.
gbPedestalPedestal value for the green-blue channel.
opticalBlackRegionInfoInformation about black regions.
Multiple black regions are provided, if applicable.
Example:
<opticalBlackRegionInfo>
<dimension>
<xStart>0</xStart>
<yStart>0</yStart>
<width>4608</width>
<height>2592</height>
</dimension>
</opticalBlackRegionInfo>
dimensionFrame dimension: Contains xStart, yStart, width, and height
xStartX start coordinate of the region.
yStartY start coordinate of the region.
widthWidth of the region.
heightHeight of the region.
pixelArrayInfo Information about the pixel array.
Active dimension and dummy pixels width are provided.
activeDimensionWidth and height of the frame or subframe.
Example:
<activeDimension>
<xStart>0</xStart>
<yStart>0</yStart>
<width>4608</width>
<height>2592</height>
</activeDimension>
xStartStart of the X output in the frame.
yStartStart of the Y output in the frame.
widthTotal width of the frame in pixels.
heightTotal height of the frame in pixels.
dummyInfoDummy pixels surrounding the active pixel array.
Example:
<dummyInfo>
<left>0</left>
<right>0</right>
<top>0</top>
<bottom>0</b
leftStarting coordinate of the left dummy pixel.
rightStarting coordinate of the right dummy pixel.
topStarting coordinate of the top dummy pixel.
bottomStarting coordinate of the bottom dummy pixel.
appDelayInfoDelay information.
linecountNumber of frames required to apply the line count.
gainNumber of frames required to apply the gain.
maxPipelineMaximum pipeline delay in number of frames.
frameSkipNumber of initial bad frames to skip.
sensorProperty Sensor property information.
Example:
<sensorProperty>
<pixelSize>0</pixelSize>
<cropFactor>0</cropFactor>
<sensingMethod>ONE_CHIP_COLOR_AREA</sensingMethod>
</sensorProperty>
pixelSizePixel size in micro meters.
cropFactorCrop factor.
sensingMethodSensing method of sensor.
Supported sensing methods:
UNDEFINED
ONE_CHIP_COLOR_AREA TWO_CHIP_COLOR_AREA
THREE_CHIP_COLOR_AREA
COLOR_SEQUENCE_AREA
TRILINEAR
COLOR_SEQUENCE_LINEAR

 

  • 6
    点赞
  • 54
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值