==================================== 触摸屏驱动相关 ==================================== |
魅族现在的规模还小,自然要先靠这些大厂提供成品了。 |
等魅族有实力的时候,就应该要自己设计研发触摸屏才行了。 |
说句实在话,M9 的触摸屏还是略逊 IP 的。 也就是 SYNAPTICS的 触摸屏技术还是输给了 iPhone |
|
|
kernel/include/linux/i2c.h:429: static inline int i2c_add_driver(struct i2c_driver *driver) |
kernel/drivers/input/Makefile:22: obj-$(CONFIG_INPUT_TOUCHSCREEN) += touchscreen/ |
kernel/drivers/input/touchscreen/Makefile |
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI) += synaptics_i2c_rmi.o |
kernel/drivers/i2c/busses/i2c-msm.c:726: ret = request_irq(dev->irq, msm_i2c_interrupt, |
kernel/drivers/input/touchscreen/synaptics_i2c_rmi.c:539: return i2c_add_driver(&synaptics_ts_driver); |
|
|
内核配置: |
Symbol: TOUCHSCREEN_SYNAPTICS_I2C_RMI [=y] |
Prompt: Synaptics i2c touchscreen |
Defined at drivers/input/touchscreen/Kconfig:298 |
Depends on: !S390 [=S390] && INPUT [=y] && INPUT_TOUCHSCREEN [=y] && I2C [=y] |
Location: |
-> Device Drivers |
-> Input device support |
-> Generic input layer (needed for keyboard, mouse, ...) (INPUT [=y]) |
-> Touchscreens (INPUT_TOUCHSCREEN [=y]) |
|
|
|
|
kernel/drivers/mmc/host/msm_sdcc.c:1495: ret = request_irq(irqres->start, msmsdcc_irq, IRQF_SHARED, |
kernel/drivers/mmc/host/msm_sdcc.c:1500: ret = request_irq(irqres->start, msmsdcc_pio_irq, IRQF_SHARED, |
kernel/drivers/mmc/host/msm_sdcc.c:1506: ret = request_irq(plat->sdiowakeup_irq, |
kernel/drivers/mmc/host/msm_sdcc.c:1534: ret = request_irq(plat->status_irq, |
kernel/drivers/staging/dream/smd/smd.c:1077: r = request_irq(INT_A9_M2A_5, smsm_irq_handler, |
kernel/drivers/staging/dream/camera/msm_vfe8x_proc.c:1969: rc = request_irq(ctrl->vfeirq, vfe_parse_irq, |
kernel/drivers/spi/spi_qsd.c:362:static inline int msm_spi_request_irq(struct msm_spi *dd, |
kernel/drivers/spi/spi_qsd.c:367: rc = request_irq(dd->irq_in, msm_spi_input_irq, IRQF_TRIGGER_RISING, |
kernel/drivers/spi/spi_qsd.c:371: rc = request_irq(dd->irq_out, msm_spi_output_irq, IRQF_TRIGGER_RISING, |
kernel/drivers/char/msm_rotator.c:1105: rc = request_irq(msm_rotator_dev->irq, msm_rotator_isr, |
kernel/drivers/i2c/busses/i2c-msm.c:726: ret = request_irq(dev->irq, msm_i2c_interrupt, |
kernel/drivers/video/msm/mdp.c:847: ret = request_irq(INT_MDP, mdp4_isr, IRQF_DISABLED, "MDP", 0); |
kernel/drivers/video/msm/mddi_client_nt35399.c:169: ret = request_irq(irq, nt35399_vsync_interrupt, IRQF_TRIGGER_RISING, |
kernel/drivers/video/msm/mddi_client_toshiba.c:200: ret = request_irq(irq, toshiba_vsync_interrupt, IRQF_TRIGGER_RISING, |
kernel/drivers/video/msm/lcdc_st15.c:305: rc = request_irq(dd->pd->irq, |
kernel/drivers/video/msm/mddihosti.c:1555: if (request_irq |
kernel/drivers/input/touchscreen/msm_touch.c:252: result = request_irq(ts->irq, ts_interrupt, IRQF_TRIGGER_RISING, |
kernel/drivers/input/touchscreen/msm_ts.c:390: err = request_irq(ts->sample_irq, msm_ts_irq, |
kernel/drivers/input/touchscreen/msm_ts.c:398: err = request_irq(ts->pen_up_irq, msm_ts_irq, |
kernel/drivers/input/mouse/msm_gpio_mouse.c:577:ret = request_irq(mouse_irq, mouse_irq_handler, IRQF_TRIGGER_FALLING , dd->input_dev->name, dd); |
kernel/drivers/serial/msm_serial.c:565: ret = request_irq(port->irq, msm_irq, IRQF_TRIGGER_HIGH, |
kernel/drivers/serial/msm_serial.c:607: ret = request_irq(msm_port->wakeup.irq, msm_rx_irq, |
kernel/drivers/usb/function/msm_hsusb.c:3293: ret = request_irq(irq, usb_interrupt, IRQF_SHARED, pdev->name, ui); |
kernel/drivers/usb/function/msm_otg.c:306: ret = request_irq(xceiv->irq, msm_otg_irq, IRQF_SHARED, |
kernel/drivers/usb/gadget/msm72k_udc.c:1378: ret = request_irq(otg->irq, usb_interrupt, |
kernel/drivers/usb/gadget/msm72k_udc.c:1539: ret = request_irq(otg->irq, usb_interrupt, |
kernel/drivers/usb/otg/msm72k_otg.c:939: ret = request_irq(dev->irq, msm_otg_irq, IRQF_SHARED, |
kernel/drivers/usb/otg/msm72k_otg.c:965: ret = request_irq(vbus_on_irq, pmic_vbus_on_irq, |
kernel/arch/arm/mach-msm/smd.c:1391: r = request_irq(INT_A9_M2A_0, smd_modem_irq_handler, |
kernel/arch/arm/mach-msm/smd.c:1400: r = request_irq(INT_A9_M2A_5, smsm_irq_handler, |
kernel/arch/arm/mach-msm/smd.c:1412: r = request_irq(INT_ADSP_A11, smd_dsp_irq_handler, |
kernel/arch/arm/mach-msm/smd.c:1421: r = request_irq(INT_ADSP_A11, smsm_irq_handler, |
kernel/arch/arm/mach-msm/board-mahimahi-microp.c:2086: ret = request_irq(client->irq, |
kernel/arch/arm/mach-msm/htc_headset.c:1133: ret = request_irq(hi->irq, detect_irq_handler, |
kernel/arch/arm/mach-msm/htc_headset.c:1140: ret = request_irq(hi->irq_btn, button_irq_handler, |
kernel/arch/arm/mach-msm/qdsp5/adsp.c:1127: rc = request_irq(INT_ADSP, adsp_irq_handler, IRQF_TRIGGER_RISING, |
kernel/arch/arm/mach-msm/smmu_driver.c:239: ret = request_irq(irq, smmu_secure_irpt_handler, |
kernel/arch/arm/mach-msm/hw3d.c:395: ret = request_irq(INT_GRAPHICS, hw3d_irq_handler, |
kernel/arch/arm/mach-msm/qdsp5v2/adsp.c:965: rc = request_irq(INT_ADSP, adsp_irq_handler, |
|
|
|
===================================== 摄像头驱动相关 ==================================== |
高通库: /system/lib/liboemcamera.so |
此库调用内核驱动,与内核交换的文件: |
|
vendor/qcom/proprietary/mm-camera/common/camera.h:8: #define MSM_CAMERA_CONTROL "/dev/msm_camera/control0" |
vendor/qcom/proprietary/mm-camera/apps/appslib/camaf_ctrl.c:32: fd = open(MSM_CAMERA_CONTROL, O_RDWR); |
vendor/qcom/proprietary/mm-camera/apps/appslib/Android.mk LOCAL_MODULE:= liboemcamera |
|
高通库:/system/lib/libcamera.so |
./vendor/qcom/android-open/libcamera2/QualcommCameraHardware.cpp 使用库 liboemcamera.so libmmcamera = ::dlopen("liboemcamera.so", RTLD_NOW); |
./vendor/qcom/android-open/libcamera2/Android.mk |
LOCAL_SHARED_LIBRARIES+= liboemcamera |
LOCAL_MODULE:= libcamera |
|
android库 /system/lib/libcameraservice.so |
./frameworks/base/camera/libcameraservice/Android.mk |
LOCAL_SHARED_LIBRARIES += libcamera |
LOCAL_MODULE:= libcameraservice |
|
android库 /system/lib/libsystem_server.so |
./frameworks/base/cmds/system_server/library/Android.mk |
LOCAL_SHARED_LIBRARIES := \ |
libandroid_runtime \ |
libsurfaceflinger \ |
libaudioflinger \ |
libcameraservice \ |
libmediaplayerservice \ |
libutils \ |
libbinder \ |
libcutils |
LOCAL_MODULE:= libsystem_server |
|
开机启动camera服务: |
CameraService::instantiate(); |
./frameworks/base/cmds/system_server/library/system_init.cpp |
extern "C" status_t system_init() |
{ |
LOGI("Entered system_init()"); |
。。。。。。 |
// Start the camera service |
CameraService::instantiate(); |
。。。。。。 |
} |
|
out/target/product/msm7627_ffa/system/bin/system_server |
frameworks/base/cmds/system_server/system_main.cpp:60: |
frameworks/base/services/jni/com_android_server_SystemServer.cpp |
static void android_server_SystemServer_init1(JNIEnv* env, jobject clazz) |
{ |
system_init(); |
} |
|
|
kernel/drivers/media/video/msm/ov5650.c:1215: rc = i2c_add_driver(&ov5650_i2c_driver); |
Symbol: OV5650 [=n] |
Prompt: Sensor ov5650 (Bayer5M) |
Defined at drivers/media/video/msm/Kconfig:16 |
Depends on: MEDIA_SUPPORT [=y] && VIDEO_CAPTURE_DRIVERS [=y] && VIDEO_V4L2 [=y] && MSM_CAMERA [=n] && !ARCH_MSM8X60 [=ARCH_MSM8X60] |
Location: |
-> Device Drivers |
-> Multimedia support (MEDIA_SUPPORT [=y]) |
-> Video capture adapters (VIDEO_CAPTURE_DRIVERS [=y]) |
|
|
CONFIG_MSM_CAMERA=y |
CONFIG_MSM_CAMERA_AF_FOXCONN=y |
CONFIG_MSM_CAMERA_FLASH=y |
CONFIG_MT9T013=y |
CONFIG_MT9D112=y |
CONFIG_OV5650=y |
CONFIG_MT9P012=y |
|
kernel/drivers/media/video/msm/ov5650.c |
kernel/drivers/media/video/msm/mt9d112.c |
kernel/drivers/media/video/msm/mt9t013.c |
|
|
|
// take a picture - image is returned in callback |
status_t CameraService::Client::takePicture() |
return mHardware->takePicture(); |
vendor/qcom/android-open/libcamera2/QualcommCameraHardware.cpp |
status_t QualcommCameraHardware::takePicture() |
mSnapshotThreadRunning = !pthread_create(&mSnapshotThread,&attr,snapshot_thread,NULL); |
vendor/qcom/android-open/libcamera2/QualcommCameraHardware.cpp |
void *snapshot_thread(void *user) |
obj->runSnapshotThread(user); |
void *libhandle = ::dlopen("liboemcamera.so", RTLD_NOW); |
if(mSnapshotFormat == PICTURE_FORMAT_JPEG){ |
if (native_start_snapshot(mCameraControlFd)) |
receiveRawPicture(); |
else |
LOGE("main: native_start_snapshot failed!"); |
} else if(mSnapshotFormat == PICTURE_FORMAT_RAW){ |
if(native_start_raw_snapshot(mCameraControlFd)){ |
receiveRawSnapshot(); |
} else { |
LOGE("main: native_start_raw_snapshot failed!"); |
} |
} |
|
vendor/qcom/android-open/libcamera2/QualcommCameraHardware.cpp |
void *opencamerafd(void *data) { |
camerafd = open(MSM_CAMERA_CONTROL, O_RDWR); |
return NULL; |
} |
vendor/qcom/proprietary/mm-camera/common/camera.h:8: |
#define MSM_CAMERA_CONTROL "/dev/msm_camera/control0" |
bool QualcommCameraHardware::startCamera() |
mCameraControlFd = camerafd; |
|
vendor/qcom/android-open/libcamera2/QualcommCameraHardware.cpp |
static bool native_start_snapshot(int camfd) |
{ |
。。。。。。 |
ctrlCmd.timeout_ms = 5000; |
ctrlCmd.type = CAMERA_START_SNAPSHOT; |
ctrlCmd.length = 0; |
ctrlCmd.resp_fd = camfd; // FIXME: this will be put in by the kernel |
if(ioctl(camfd, MSM_CAM_IOCTL_CTRL_COMMAND, &ctrlCmd) < 0) |
。。。。。。 |
} |
vendor/qcom/proprietary/mm-camera/common/camera.h |
此处的 ioctl 执行的是驱动: |
kernel/drivers/media/video/msm/msm_camera.c |
static const struct file_operations msm_fops_control = { |
.owner = THIS_MODULE, |
.open = msm_open_control, |
.unlocked_ioctl = msm_ioctl_control, |
.release = msm_release_control, |
}; |
中的函数: |
static long msm_ioctl_control(struct file *filep, unsigned int cmd,unsigned long arg) |
38》43》1》15》2》37》9》11》6》61》65》27》6》21》12》8》14》50》26》55》38》1》40》1》39 |
|
typedef enum { |
CAMERA_SET_PARM_DISPLAY_INFO, /* 0 */ |
CAMERA_SET_PARM_DIMENSION, /* 1 */ |
CAMERA_SET_PARM_ZOOM, /* 2 */ |
CAMERA_SET_PARM_CONTRAST, /* 6 */ |
CAMERA_SET_PARM_EXPOSURE_COMPENSATION, /* 8 */ |
CAMERA_SET_PARM_SHARPNESS, /* 9 */ |
CAMERA_SET_PARM_HUE, /* 10 */ |
CAMERA_SET_PARM_SATURATION, /* 11 */ |
CAMERA_SET_PARM_EXPOSURE, /* 12 */ |
CAMERA_SET_PARM_AUTO_FOCUS, |
CAMERA_SET_PARM_WB, /* 14 */ |
CAMERA_SET_PARM_EFFECT, /* 15 */ |
CAMERA_SET_PARM_PREVIEW_MODE, /* 20 */ |
CAMERA_SET_PARM_ISO, /* 26 */ |
CAMERA_SET_PARM_BESTSHOT_MODE, /* 27 */ |
CAMERA_SET_PARM_AF_MODE, /* 30 */ |
CAMERA_SET_PARM_ROLLOFF, /* 37 */ |
CAMERA_STOP_PREVIEW, /* 38 */ |
CAMERA_START_PREVIEW, /* 39 */ |
CAMERA_START_SNAPSHOT, /* 40 */ |
CAMERA_EXIT, /* 43 */ |
CAMERA_SET_PARM_LED_MODE, /* 50 */ |
CAMERA_PREPARE_SNAPSHOT, /* 55 */ |
CAMERA_SET_FPS_MODE, |
CAMERA_START_VIDEO, |
CAMERA_STOP_RECORDING, /* 60 */ |
CAMERA_SET_PARM_AEC_ROI, /* 61 */ |
CAMERA_SET_CAF, |
CAMERA_SET_PARM_BL_DETECTION_ENABLE, |
CAMERA_SET_PARM_SNOW_DETECTION_ENABLE, |
CAMERA_SET_PARM_AF_ROI, /* 65 */ |
CAMERA_CTRL_PARM_MAX |
} cam_ctrl_type; |
#define OV5650_PIDH_REG 0x300A |
#define OV5650_PIDL_REG 0x300B |
读取摄像头型号: |
/* 3. Read sensor Model ID: */ |
if (ov5650_i2c_read(OV5650_PIDH_REG, &chipidh,1) < 0) |
goto init_probe_fail; |
if (ov5650_i2c_read(OV5650_PIDL_REG, &chipidl,1) < 0) |
goto init_probe_fail; |
printk("kov5650 model_id = 0x%x 0x%x\n", chipidh, chipidl); |
|
|
|
static const struct file_operations msm_fops_config = { |
.owner = THIS_MODULE, |
.open = msm_open, |
.unlocked_ioctl = msm_ioctl_config, |
.release = msm_release_config, |
}; |
static const struct file_operations msm_fops_control = { |
.owner = THIS_MODULE, |
.open = msm_open_control, |
.unlocked_ioctl = msm_ioctl_control, |
.release = msm_release_control, |
}; |
|
static long msm_ioctl_control(struct file *filep, unsigned int cmd,unsigned long arg) |
void __user *argp = (void __user *)arg; |
struct msm_control_device *ctrl_pmsm = filep->private_data; |
struct msm_device *pmsm = ctrl_pmsm->pmsm; |
如果 cmd 等于 MSM_CAM_IOCTL_GET_SENSOR_INFO: |
那么: rc = msm_get_sensor_info(pmsm->sync, argp); |
|
static long msm_ioctl_config(struct file *filep, unsigned int cmd,unsigned long arg) |
void __user *argp = (void __user *)arg; |
struct msm_device *pmsm = filep->private_data; |
switch (cmd) { |
case MSM_CAM_IOCTL_GET_SENSOR_INFO: |
rc = msm_get_sensor_info(pmsm->sync, argp); |
break; |
|