The project is relatively tight, within 3 weeks to bring an external ISP,MIPI data communication, 8 million megapixel camera from no drive to achieve all customer needs.
1st platform, build the environment, compile the kernel, burn code.
I have been in the window to set up a virtual machine login server engaged in the development of the Linux system environment is not love, often a project has just begun to take the environment, the heart is always a little repulsive, the process is more tangled, it seems to be a Linux real machine to play.
2nd write the camera driver approximate frame, configure Gpio,i2c,mipi, voltage, clock, etc.
Few can touch the FAE only to the hardware manual, no Linux and Android drivers. Because it is the camera sensor external ISP chip, the cup has happened. The whole system is like this, Qualcomm Platform Development Board, its own write driver to control the ISP chip, ISP chip and camera sensor package together, ISP control sensor, the essence is the sensor write register.
began to write the driver, said the good thing is standing on the shoulders of the Giants for reference to other drivers, said the nasty is divert, anyway, change the kconfig, Makefile, the driving framework is considered to have.
For driver development, the main task of the early stage is to configure the Gpio port and the chip power sequencing.
Each particular platform will have its own set of kernel API packages implemented on GPIO, voltage, and clock, as long as it can be used to understand the API. After configuration, in the driver initialization function, properly set the chip power-up sequence, to ensure that the chip hardware can work properly.
3rd Write the encapsulation function of the I²C communication and debug the I²C communication between the CPU and the ISP
For some mature programs, the above work is done smoothly, the driver is almost. Unfortunately, this ISP chip in upgrading 8 million camera performance at the same time, and did not bring me enough technical support, can only say, become also ISP, fail also ISP, solution all come to it. Long March the first hurdle is i²c.
I²C communication itself should pay attention to two points,
1) The SDA 9th ACK bit is low when the description is responding from the device.
2) Slave Address
Chip Manual on this from the device address does not have a unified wording, some give 8 address, some give 7 address, initially easy to confuse. If the given is a 8-bit address, then the 8th bit refers to Write-0 or Read-1, the actual i²c chip address is 7 bits. The Linux source code i2c_board_info the Board base information should be filled out 7-bit i²c address, in addition, the I²C chip address can be viewed through the Development Board shell Environment $ ls/sys/bus/i2c/devices/. To give an example,
static struct I2c_board_info msm_camera_boardinfo[] __initdata = {
{
I2c_board_info ("ov8820", 0x78 >> 1),
},
4th FAE Onsite Support
Fae came over, confirmed one thing, no off-the-shelf drive, I completely gave up. Later also found a rule, as long as the fae to the scene that means nothing can be done. It is better for a few people to gather their thoughts than to study them in a quiet mind. But they left at least one important piece of information.-ISP chip instruction sequence, the implementation of all camera functions depends on it.
5th Transfer I²c
I²c's tune-up has a milestone meaning, it not only marks the normal hardware performance, but also later bright gorgeous camera world laid a solid foundation.
There is a time card in the I²c communication, to the ISP chip 0x3c write on Chip command 0xf0 success, but then send all other commands failed.
Analysis of the phenomenon, I²c bus has been able to communicate, the problem can only be on the ISP chip, so, check the circuit diagram, copy the guy up the circuit board on the electricity and clock all over again.
It was found that one way from the automatic to the autofocus motor voltage only 1.7V, did not meet the requirements, the driver did not pull its gpio high, resulting in the chip can not normally open the work.
6th Write preview Drive, measure MIPI data
The preview function can be achieved by filling in the relevant code in the Linux driver and the Android high-pass abstraction layer according to the ISP instruction sequence in the Sunflower Treasure Book. Unfortunately, the preview will not come out by the two. When the preview program is opened, the oscilloscope is used to mipi the image data on the bus, the ideal MIPI waveform can be obtained, the preview function of the bottom drive is OK, the problem lies in the camif Vfe of the Qualcomm platform, and then, through the technical data of Qualcomm, learn to add some configuration of Vfe.
7th Configure VFE, light preview
The success of the preview has epoch-making significance, it not only marks the camera module in the entire Android system architecture of the molding, more later photo, video, image effects and other functions laid a solid foundation. The appearance of the preview means that I do not have to answer those similar to the "camera light does not" such as only focus on the surface phenomenon of the problem, from that moment, I seem to stand on another height, a dream back to Han Tang feeling.
8th robust code, write camera function, focus function
At this point, the entire camera module from the upper application to the bottom of the drive has been all open, then you can see God kill God, see Buddha Kill Buddha.
9th write white balance, color effects, scene mode, ISO, shockproof, Flash and other functions
These days, the farmer can't afford to hurt me! Just press the ISP command sequence on the Sunflower Treasure book to fill it in.
10th Login Server Commit Code
Please hold the camera-android Qualcomm platform debug camera driver full record