The project is relatively tight. Within three weeks, a camera with an external ISP and mipi data communication and 8 million pixels will be switched from no driver to the customer's full needs.
Build the platform, build the environment, compile the kernel, and burn the code on the first day.
I have been building a virtual machine on the server under the window for development, but I really don't like the Linux system environment. Every time I get to the project, I want to build the environment, and my heart is a bit out of it, the process is quite tangled. It seems that we still need to have a Linux real machine to play with in the future.
Write the General camera driver framework on the 2 th, and configure gpio, I2C, mipi, voltage, clock, and so on.
Fae is rarely used for hardware manuals, but does not support Linux and Android drivers. Because it is an external ISP chip of camera sensor, the cup will happen. The entire system is like this. On the Qualcomm platform development board, you can write your own driver to control the ISP chip. the ISP chip is encapsulated with the camera sensor, and the ISP controls the sensor, which is essentially the sensor write register.
I started to write the driver. The nice thing to say is that I was standing on the shoulders of giants and learning from other drivers. The ugly thing was to draw pictures from the gourd tree. I changed kconfig and makefile anyway. This driver framework was even available.
For driver development, the main work in the early stage should be to configure the gpio port and chip power-on sequence.
Each specific platform has its own kernel API encapsulation implementation for operating gpio, voltage, and clock. You can use these Apis as long as you can understand them. After configuration, you must correctly set the chip power-on sequence in the driver initialization function to ensure that the chip hardware works properly.
Write the I2C communication encapsulation function on the third day to debug I2C communication between the CPU and ISP
For some mature solutions, if the above work is successful, the driver will be almost done .. It is a pity that this ISP chip does not bring me enough technical support while improving the camera performance by 8 million. It can only be said that it is also an ISP and fails to be an ISP, come on with all the solutions. The first hurdle of the long journey is I2C.
Two points must be noted for I2C communication,
1) if the 9th-bit ack bit of SDA is low, the response is returned from the device.
2) slave address
The chip Manual does not have a uniform way of writing the address from the device. Some give 8-bit addresses and some give 7-bit addresses, which are easy to confuse at the beginning. If the address is an 8-bit address, the 8th-bit address indicates write-0 or read-1, and the actual I2C chip address is a 7-bit address. In the Linux source code, the baseboard information of struct i2c_board_info should be filled in with a 7-bit I2C address. In addition, the I2C chip address can be viewed through $ ls/sys/bus/I2C/devices/in the development board shell environment. For example,
Static struct i2c_board_info msm_camera_boardinfo [] _ initdata = {
{
I2c_board_info ("ov8820", 0x78> 1 ),
},
4-day Fae onsite support
When Fae came over, I confirmed one thing. There was no ready-made driver, and I was completely dead. Later, we found a rule that as long as Fae came to the site, it would mean nothing could be done .. It is better for a few people to study together. However, they leave at least an important piece of information in this line-ISP chip command sequence, which relies on the implementation of all functions of camera.
5-day pass I2C
I2C commissioning has a milestone. It not only marks the normal opening of hardware performance, but also lays a solid foundation for the splendid camera world ..
Some time is stuck in I2C communication, and 0xf0 is successfully enabled for the ISP chip 0x3c, but all other commands fail to be sent.
Analysis Phenomenon, I2C bus can communicate, the problem can only be on the ISP chip, so, look up the circuit diagram, copy the guy up to the circuit board on the electricity and clock again ..
The result shows that the voltage of one auto-focus motor is only 1.7 V, which does not meet the requirement. The gpio in the driver is not increased, and the chip cannot be enabled normally.
Write a preview driver on the 6th to measure the mipi data
Based on the ISP command sequence in the sunflower collection, you can enter the relevant code in the Linux driver and the android Qualcomm abstraction layer to implement the preview function. However, unfortunately, the two previews are just incomplete. When you enable the preview program, use the oscilloscope to measure the image data on the mipi bus to obtain the ideal mipi waveform, indicating that the preview function of the underlying driver is OK. The problem lies in the camif vfe of the Qualcomm platform, so I read Qualcomm's technical materials and learned how to add some vfe configurations.
Configure vfe on the 7th to light up and preview
The success of previewing is epoch-making. It not only marks the formation of the camera module in the entire android system architecture, but also lays a solid foundation for later functions such as photo taking, video recording, and image effects. The appearance of previewing means that I no longer need to answer questions that only focus on surface phenomena, such as "Camera Bright". From that moment on, I seem to have stood on another level, there is a feeling of Dreaming back to the Chinese and Tang Dynasties ..
8-day robust code, photo writing function, focus Function
So far, the entire camera module has been fully connected from the upper-layer application to the underlying driver. Next, you can see how God kills God and how Buddha kills Buddha ..
Write white balance, color effect, scene mode, ISO, shockproof, flashlight, and other functions on the 9th
This year, coders cannot afford to hurt! Fill in the ISP instruction sequence in the sunflower collection.
Log on to the server on December 10 and submit the code.