From 27390f90d76fcce1cc59eb64b080e43237079163 Mon Sep 17 00:00:00 2001 From: Tao Jing Date: Fri, 18 Nov 2011 18:03:34 +0800 Subject: [PATCH] atomisp: porting driver make necessary changes fit for new 3.0 kernel known issue: 1: SSE3 is not enabled in kernel, so use memcpy instead. will change back once enabled. 2: tpg does not have mbus interface but obselete set_fmt... interface which is not supported in new 3.0 kernel. So currently tpg is not enabled. Will add it later. Change-Id: I2c8f12ba27ae2e0aae7e98a66cd807e5920725a4 Signed-off-by: Tao Jing Reviewed-on: http://android.intel.com:8080/24501 Reviewed-by: Gross, Mark Tested-by: Gross, Mark Reviewed-on: http://android.intel.com:8080/24688 --- drivers/media/video/atomisp/Makefile | 2 +- drivers/media/video/atomisp/atomisp_cmd.c | 87 +++++++++------------------- drivers/media/video/atomisp/atomisp_csi2.c | 12 ++-- drivers/media/video/atomisp/atomisp_file.c | 11 +--- drivers/media/video/atomisp/atomisp_fops.c | 10 ++-- drivers/media/video/atomisp/atomisp_ioctl.c | 24 ++++---- drivers/media/video/atomisp/atomisp_subdev.c | 22 +++---- drivers/media/video/atomisp/atomisp_tpg.c | 11 +--- drivers/media/video/atomisp/atomisp_v4l2.c | 13 +++-- 9 files changed, 76 insertions(+), 116 deletions(-) diff --git a/drivers/media/video/atomisp/Makefile b/drivers/media/video/atomisp/Makefile index cd276ba..943900b 100644 --- a/drivers/media/video/atomisp/Makefile +++ b/drivers/media/video/atomisp/Makefile @@ -40,7 +40,7 @@ DEFINES := -DHRT_HW -DHRT_ISP_CSS_CUSTOM_HOST -DHRT_USE_VIR_ADDRS -DHRT_KERNEL DEFINES += -DUSE_DYNAMIC_BIN DEFINES += -DISP_POWER_GATING DEFINES += -DUSE_INTERRUPTS -DEFINES += -DUSE_SSSE3 +#DEFINES += -DUSE_SSSE3 DEFINES += -DPUNIT_CAMERA_BUSY EXTRA_CFLAGS := $(INCLUDES) $(DEFINES) -fno-common diff --git a/drivers/media/video/atomisp/atomisp_cmd.c b/drivers/media/video/atomisp/atomisp_cmd.c index 6b10bb5..a309c16 100644 --- a/drivers/media/video/atomisp/atomisp_cmd.c +++ b/drivers/media/video/atomisp/atomisp_cmd.c @@ -377,11 +377,11 @@ static int atomisp_buffer_dequeue(struct atomisp_device *isp, return -EINVAL; vmem = (*vb_capture)->priv; - if (vmem->vmalloc == NULL) + if (vmem->vaddr == NULL) return -EINVAL; - /*frame structure is stored in videobuf->priv->vmalloc*/ - isp->regular_output_frame = vmem->vmalloc; + /*frame structure is stored in videobuf->priv->vaddr*/ + isp->regular_output_frame = vmem->vaddr; } if (atomisp_is_viewfinder_support(isp) && !(*vb_preview)) { @@ -391,7 +391,7 @@ static int atomisp_buffer_dequeue(struct atomisp_device *isp, return -EINVAL; vmem = (*vb_preview)->priv; - isp->vf_frame = vmem->vmalloc; + isp->vf_frame = vmem->vaddr; } return 0; } @@ -2452,7 +2452,8 @@ int atomisp_try_fmt(struct video_device *vdev, struct v4l2_format *f, fmt = (struct atomisp_format_bridge *)&atomisp_output_fmts[0]; } - + /* fixing me! seems tpg does not support mbus interface */ +#if 0 /*set TPG format*/ if (isp->inputs[isp->input_curr].type == TEST_PATTERN) { ret = v4l2_subdev_call(isp->inputs[isp->input_curr].camera, @@ -2461,24 +2462,19 @@ int atomisp_try_fmt(struct video_device *vdev, struct v4l2_format *f, in_height = f->fmt.pix.height; goto done; } - +#else + if (isp->inputs[isp->input_curr].type == TEST_PATTERN) + return -EINVAL; +#endif snr_mbus_fmt.code = fmt->mbus_code; snr_mbus_fmt.height = out_height; snr_mbus_fmt.width = out_width; ret = v4l2_subdev_call(isp->inputs[isp->input_curr].camera, video, try_mbus_fmt, &snr_mbus_fmt); - if (ret) { - /*In case camera sensor driver don't support try_mbus_fmt*/ - v4l2_err(&atomisp_dev, - "failed to try_mbus_fmt for sensor\n"); - ret = v4l2_subdev_call(isp->inputs[isp->input_curr].camera, - video, try_fmt, f); - if (ret) - return ret; - in_width = f->fmt.pix.width; - in_height = f->fmt.pix.height; - } else { + if (ret) + return ret; + else { in_width = snr_mbus_fmt.width; in_height = snr_mbus_fmt.height; fmt = get_atomisp_format_bridge_from_mbus(snr_mbus_fmt.code); @@ -2858,49 +2854,22 @@ static int atomisp_set_fmt_to_snr(struct atomisp_device *isp, if (format == NULL) return -EINVAL; - if (!isp->sw_contex.file_input) { - v4l2_fill_mbus_format(&snr_mbus_fmt, &f->fmt.pix, - format->mbus_code); - snr_mbus_fmt.height += padding_h + dvs_env_h; - snr_mbus_fmt.width += padding_w + dvs_env_w; - - ret = v4l2_subdev_call( - isp->inputs[isp->input_curr].camera, - video, s_mbus_fmt, &snr_mbus_fmt); - if (ret) { - v4l2_err(&atomisp_dev, - "call s_mbus_fmt for sensor failed\n"); - - snr_fmt = *f; - snr_fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - snr_fmt.fmt.pix.height += padding_h + dvs_env_h; - snr_fmt.fmt.pix.width += padding_w + dvs_env_w; - - /* - * In case the camera driver - * not support mbus function - */ - ret = v4l2_subdev_call( - isp->inputs[isp->input_curr].camera, - video, s_fmt, &snr_fmt); - if (ret) { - v4l2_err(&atomisp_dev, - "call s_fmt for sensor failed\n"); - return ret; - } - isp->input_format->out.width = - snr_fmt.fmt.pix.width; - isp->input_format->out.height = - snr_fmt.fmt.pix.height; - isp->input_format->out.pixelformat = - snr_fmt.fmt.pix.pixelformat; - } else { - isp->input_format->out.width = snr_mbus_fmt.width; - isp->input_format->out.height = snr_mbus_fmt.height; - isp->input_format->out.pixelformat = - snr_mbus_fmt.code; - } + if (!isp->sw_contex.file_input) { + v4l2_fill_mbus_format(&snr_mbus_fmt, &f->fmt.pix, + format->mbus_code); + snr_mbus_fmt.height += padding_h + dvs_env_h; + snr_mbus_fmt.width += padding_w + dvs_env_w; + + ret = v4l2_subdev_call( + isp->inputs[isp->input_curr].camera, + video, s_mbus_fmt, &snr_mbus_fmt); + if (ret) + return ret; + isp->input_format->out.width = snr_mbus_fmt.width; + isp->input_format->out.height = snr_mbus_fmt.height; + isp->input_format->out.pixelformat = + snr_mbus_fmt.code; v4l2_info(&atomisp_dev, "sensor output resolution %dx%d\n", isp->input_format->out.width, diff --git a/drivers/media/video/atomisp/atomisp_csi2.c b/drivers/media/video/atomisp/atomisp_csi2.c index f7af2e0..a497fe8 100644 --- a/drivers/media/video/atomisp/atomisp_csi2.c +++ b/drivers/media/video/atomisp/atomisp_csi2.c @@ -303,12 +303,12 @@ static int csi2_link_setup(struct media_entity *entity, u32 result = local->index | media_entity_type(remote->entity); switch (result) { - case CSI2_PAD_SOURCE | MEDIA_ENTITY_TYPE_DEVNODE: + case CSI2_PAD_SOURCE | MEDIA_ENT_T_DEVNODE: /* not supported yet */ return -EINVAL; - case CSI2_PAD_SOURCE | MEDIA_ENTITY_TYPE_V4L2_SUBDEV: - if (flags & MEDIA_LINK_FLAG_ENABLED) { + case CSI2_PAD_SOURCE | MEDIA_ENT_T_V4L2_SUBDEV: + if (flags & MEDIA_LNK_FL_ENABLED) { if (csi2->output & ~CSI2_OUTPUT_ISP_SUBDEV) return -EBUSY; csi2->output |= CSI2_OUTPUT_ISP_SUBDEV; @@ -351,11 +351,11 @@ static int mipi_csi2_init_entities(struct atomisp_mipi_csi2_device *csi2, v4l2_set_subdevdata(sd, csi2); sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; - pads[CSI2_PAD_SOURCE].flags = MEDIA_PAD_FLAG_OUTPUT; - pads[CSI2_PAD_SINK].flags = MEDIA_PAD_FLAG_INPUT; + pads[CSI2_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE; + pads[CSI2_PAD_SINK].flags = MEDIA_PAD_FL_SINK; me->ops = &csi2_media_ops; - me->type = MEDIA_ENTITY_TYPE_V4L2_SUBDEV; + me->type = MEDIA_ENT_T_V4L2_SUBDEV; ret = media_entity_init(me, CSI2_PADS_NUM, pads, 0); if (ret < 0) return ret; diff --git a/drivers/media/video/atomisp/atomisp_file.c b/drivers/media/video/atomisp/atomisp_file.c index 41d9ead..f34026f 100644 --- a/drivers/media/video/atomisp/atomisp_file.c +++ b/drivers/media/video/atomisp/atomisp_file.c @@ -266,10 +266,6 @@ static int file_input_enum_frame_ival(struct v4l2_subdev *sd, static const struct v4l2_subdev_video_ops file_input_video_ops = { .s_stream = file_input_s_stream, - .enum_fmt = file_input_enum_fmt, - .try_fmt = file_input_try_fmt, - .g_fmt = file_input_g_fmt, - .s_fmt = file_input_s_fmt, .g_parm = file_input_g_parm, .s_parm = file_input_s_parm, .enum_framesizes = file_input_enum_framesizes, @@ -283,7 +279,6 @@ static const struct v4l2_subdev_video_ops file_input_video_ops = { static const struct v4l2_subdev_core_ops file_input_core_ops = { .g_chip_ident = file_input_g_chip_ident, .log_status = file_input_log_status, - .s_config = file_input_s_config, .queryctrl = file_input_queryctrl, .g_ctrl = file_input_g_ctrl, .s_ctrl = file_input_s_ctrl, @@ -303,7 +298,7 @@ static const struct v4l2_subdev_ops file_input_ops = { }; static const struct media_entity_operations file_input_entity_ops = { - .set_power = v4l2_subdev_set_power, +/* .set_power = v4l2_subdev_set_power, */ }; void @@ -351,8 +346,8 @@ int atomisp_file_input_init(struct atomisp_device *isp) file_input_info->raw_bayer_order = sh_css_bayer_order_bggr; v4l2_set_subdev_hostdata(sd, (void *)file_input_info); - pads[0].flags = MEDIA_PAD_FLAG_INPUT; - me->type = MEDIA_ENTITY_TYPE_V4L2_SUBDEV; + pads[0].flags = MEDIA_PAD_FL_SINK; + me->type = MEDIA_ENT_T_V4L2_SUBDEV; ret = media_entity_init(me, 1, pads, 0); if (ret < 0) diff --git a/drivers/media/video/atomisp/atomisp_fops.c b/drivers/media/video/atomisp/atomisp_fops.c index 28ef74c..4c71265 100644 --- a/drivers/media/video/atomisp/atomisp_fops.c +++ b/drivers/media/video/atomisp/atomisp_fops.c @@ -182,7 +182,8 @@ static int atomisp_init_pipe(struct atomisp_video_pipe *pipe) V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, sizeof(struct atomisp_buffer), - pipe); + pipe, + NULL); /* ext_lock: NULL */ videobuf_queue_vmalloc_init(&pipe->outq, &videobuf_qops_output, NULL, @@ -190,7 +191,8 @@ static int atomisp_init_pipe(struct atomisp_video_pipe *pipe) V4L2_BUF_TYPE_VIDEO_OUTPUT, V4L2_FIELD_NONE, sizeof(struct atomisp_buffer), - pipe); + pipe, + NULL); /* ext_lock: NULL */ /* init locks */ spin_lock_init(&pipe->irq_lock); @@ -542,8 +544,6 @@ int atomisp_videobuf_mmap_mapper(struct videobuf_queue *q, } buf->map = map; - map->start = vma->vm_start; - map->end = vma->vm_end; map->q = q; buf->baddr = vma->vm_start; @@ -551,7 +551,7 @@ int atomisp_videobuf_mmap_mapper(struct videobuf_queue *q, if (buf && buf->memory == V4L2_MEMORY_MMAP && buf->boff == offset) { vm_mem = buf->priv; - ret = frame_mmap(vm_mem->vmalloc, vma); + ret = frame_mmap(vm_mem->vaddr, vma); vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; break; } diff --git a/drivers/media/video/atomisp/atomisp_ioctl.c b/drivers/media/video/atomisp/atomisp_ioctl.c index d4798f9..acf8d93 100644 --- a/drivers/media/video/atomisp/atomisp_ioctl.c +++ b/drivers/media/video/atomisp/atomisp_ioctl.c @@ -590,9 +590,9 @@ static void atomisp_videobuf_free(struct videobuf_queue *q) continue; vm_mem = q->bufs[i]->priv; - if (vm_mem && vm_mem->vmalloc) { - sh_css_frame_free(vm_mem->vmalloc); - vm_mem->vmalloc = NULL; + if (vm_mem && vm_mem->vaddr) { + sh_css_frame_free(vm_mem->vaddr); + vm_mem->vaddr = NULL; } kfree(q->bufs[i]); q->bufs[i] = NULL; @@ -684,7 +684,7 @@ int atomisp_reqbufs(struct file *file, void *fh, if (sh_css_frame_allocate_from_info(&frame, &vf_info)) goto error; vm_mem = pipe->capq.bufs[i]->priv; - vm_mem->vmalloc = frame; + vm_mem->vaddr = frame; } else /* @@ -695,7 +695,7 @@ int atomisp_reqbufs(struct file *file, void *fh, if (sh_css_frame_allocate_from_info(&frame, &out_info)) goto error; vm_mem = pipe->capq.bufs[i]->priv; - vm_mem->vmalloc = frame; + vm_mem->vaddr = frame; } return ret; @@ -703,7 +703,7 @@ int atomisp_reqbufs(struct file *file, void *fh, error: while (i--) { vm_mem = pipe->capq.bufs[i]->priv; - sh_css_frame_free(vm_mem->vmalloc); + sh_css_frame_free(vm_mem->vaddr); } if (isp->vf_frame) @@ -813,7 +813,7 @@ static int atomisp_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf) return 0; } - if ((vb->baddr == userptr) && (vm_mem->vmalloc)) + if ((vb->baddr == userptr) && (vm_mem->vaddr)) goto done; switch (isp->sw_contex.run_mode) { @@ -853,15 +853,15 @@ static int atomisp_qbuf(struct file *file, void *fh, struct v4l2_buffer *buf) return PTR_ERR(handle); } - if (vm_mem->vmalloc) { + if (vm_mem->vaddr) { mutex_lock(&pipe->capq.vb_lock); - sh_css_frame_free(vm_mem->vmalloc); - vm_mem->vmalloc = NULL; + sh_css_frame_free(vm_mem->vaddr); + vm_mem->vaddr = NULL; vb->state = VIDEOBUF_NEEDS_INIT; mutex_unlock(&pipe->capq.vb_lock); } - vm_mem->vmalloc = handle; + vm_mem->vaddr = handle; buf->flags &= ~V4L2_BUF_FLAG_MAPPED; buf->flags |= V4L2_BUF_FLAG_QUEUED; @@ -1472,7 +1472,7 @@ static int atomisp_s_parm_file(struct file *file, void *fh, /* set default atomisp ioctl value */ static long atomisp_vidioc_default(struct file *file, void *fh, - int cmd, void *arg) + bool valid_prio, int cmd, void *arg) { struct video_device *vdev = video_devdata(file); struct atomisp_device *isp = video_get_drvdata(vdev); diff --git a/drivers/media/video/atomisp/atomisp_subdev.c b/drivers/media/video/atomisp/atomisp_subdev.c index c41fb46..0103ad8 100644 --- a/drivers/media/video/atomisp/atomisp_subdev.c +++ b/drivers/media/video/atomisp/atomisp_subdev.c @@ -480,9 +480,9 @@ static int isp_subdev_link_setup(struct media_entity *entity, struct atomisp_device *isp = isp_sd->isp; switch (local->index | media_entity_type(remote->entity)) { - case ATOMISP_SUBDEV_PAD_SINK | MEDIA_ENTITY_TYPE_V4L2_SUBDEV: + case ATOMISP_SUBDEV_PAD_SINK | MEDIA_ENT_T_V4L2_SUBDEV: /* Read from the sensor CSI2-4p or CSI2-1p. */ - if (!(flags & MEDIA_LINK_FLAG_ENABLED)) { + if (!(flags & MEDIA_LNK_FL_ENABLED)) { isp_sd->input = ATOMISP_SUBDEV_INPUT_NONE; break; } @@ -499,9 +499,9 @@ static int isp_subdev_link_setup(struct media_entity *entity, break; - case ATOMISP_SUBDEV_PAD_SINK | MEDIA_ENTITY_TYPE_DEVNODE: + case ATOMISP_SUBDEV_PAD_SINK | MEDIA_ENT_T_DEVNODE: /* read from memory */ - if (flags & MEDIA_LINK_FLAG_ENABLED) { + if (flags & MEDIA_LNK_FL_ENABLED) { if (isp_sd->input == ATOMISP_SUBDEV_INPUT_CSI2_4P || isp_sd->input == ATOMISP_SUBDEV_INPUT_CSI2_1P) return -EBUSY; @@ -512,11 +512,11 @@ static int isp_subdev_link_setup(struct media_entity *entity, } break; - case ATOMISP_SUBDEV_PAD_SOURCE_VF | MEDIA_ENTITY_TYPE_DEVNODE: + case ATOMISP_SUBDEV_PAD_SOURCE_VF | MEDIA_ENT_T_DEVNODE: /* always write to memory */ break; - case ATOMISP_SUBDEV_PAD_SOURCE_MO | MEDIA_ENTITY_TYPE_DEVNODE: + case ATOMISP_SUBDEV_PAD_SOURCE_MO | MEDIA_ENT_T_DEVNODE: /* always write to memory */ break; @@ -530,7 +530,7 @@ static int isp_subdev_link_setup(struct media_entity *entity, /* media operations */ static const struct media_entity_operations isp_subdev_media_ops = { .link_setup = isp_subdev_link_setup, - .set_power = v4l2_subdev_set_power, +/* .set_power = v4l2_subdev_set_power, */ }; /* @@ -554,9 +554,9 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *isp_subdev) sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS | V4L2_SUBDEV_FL_HAS_DEVNODE; sd->nevents = 16; /* TBD */ - pads[ATOMISP_SUBDEV_PAD_SINK].flags = MEDIA_PAD_FLAG_INPUT; - pads[ATOMISP_SUBDEV_PAD_SOURCE_VF].flags = MEDIA_PAD_FLAG_OUTPUT; - pads[ATOMISP_SUBDEV_PAD_SOURCE_MO].flags = MEDIA_PAD_FLAG_OUTPUT; + pads[ATOMISP_SUBDEV_PAD_SINK].flags = MEDIA_PAD_FL_SINK; + pads[ATOMISP_SUBDEV_PAD_SOURCE_VF].flags = MEDIA_PAD_FL_SOURCE; + pads[ATOMISP_SUBDEV_PAD_SOURCE_MO].flags = MEDIA_PAD_FL_SOURCE; isp_subdev->formats[ATOMISP_SUBDEV_PAD_SINK].code = V4L2_MBUS_FMT_SBGGR10_1X10; @@ -566,7 +566,7 @@ static int isp_subdev_init_entities(struct atomisp_sub_device *isp_subdev) V4L2_MBUS_FMT_SBGGR10_1X10; me->ops = &isp_subdev_media_ops; - me->type = MEDIA_ENTITY_TYPE_V4L2_SUBDEV; + me->type = MEDIA_ENT_T_V4L2_SUBDEV; ret = media_entity_init(me, ATOMISP_SUBDEV_PADS_NUM, pads, 0); if (ret < 0) return ret; diff --git a/drivers/media/video/atomisp/atomisp_tpg.c b/drivers/media/video/atomisp/atomisp_tpg.c index 7d98c82..130a8e5 100644 --- a/drivers/media/video/atomisp/atomisp_tpg.c +++ b/drivers/media/video/atomisp/atomisp_tpg.c @@ -188,10 +188,6 @@ static int tpg_enum_frame_ival(struct v4l2_subdev *sd, static const struct v4l2_subdev_video_ops tpg_video_ops = { .s_stream = tpg_s_stream, - .enum_fmt = tpg_enum_fmt, - .try_fmt = tpg_try_fmt, - .g_fmt = tpg_g_fmt, - .s_fmt = tpg_s_fmt, .g_parm = tpg_g_parm, .s_parm = tpg_s_parm, .enum_framesizes = tpg_enum_framesizes, @@ -205,7 +201,6 @@ static const struct v4l2_subdev_video_ops tpg_video_ops = { static const struct v4l2_subdev_core_ops tpg_core_ops = { .g_chip_ident = tpg_g_chip_ident, .log_status = tpg_log_status, - .s_config = tpg_s_config, .queryctrl = tpg_queryctrl, .g_ctrl = tpg_g_ctrl, .s_ctrl = tpg_s_ctrl, @@ -225,7 +220,7 @@ static const struct v4l2_subdev_ops tpg_ops = { }; static const struct media_entity_operations tpg_entity_ops = { - .set_power = v4l2_subdev_set_power, +/* .set_power = v4l2_subdev_set_power, */ }; void atomisp_tpg_unregister_entities(struct atomisp_tpg_device *tpg) @@ -268,8 +263,8 @@ int atomisp_tpg_init(struct atomisp_device *isp) strcpy(sd->name, "tpg_subdev"); v4l2_set_subdevdata(sd, tpg); - pads[0].flags = MEDIA_PAD_FLAG_INPUT; - me->type = MEDIA_ENTITY_TYPE_V4L2_SUBDEV; + pads[0].flags = MEDIA_PAD_FL_SINK; + me->type = MEDIA_ENT_T_V4L2_SUBDEV; ret = media_entity_init(me, 1, pads, 0); if (ret < 0) diff --git a/drivers/media/video/atomisp/atomisp_v4l2.c b/drivers/media/video/atomisp/atomisp_v4l2.c index 44c9742..68b5ae4 100644 --- a/drivers/media/video/atomisp/atomisp_v4l2.c +++ b/drivers/media/video/atomisp/atomisp_v4l2.c @@ -232,13 +232,13 @@ int atomisp_video_init(struct atomisp_video_pipe *video, const char *name) switch (video->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: direction = "output"; - video->pad.flags = MEDIA_PAD_FLAG_INPUT; + video->pad.flags = MEDIA_PAD_FL_SINK; video->vdev.fops = &atomisp_fops; video->vdev.ioctl_ops = &atomisp_ioctl_ops; break; case V4L2_BUF_TYPE_VIDEO_OUTPUT: direction = "input"; - video->pad.flags = MEDIA_PAD_FLAG_OUTPUT; + video->pad.flags = MEDIA_PAD_FL_SOURCE; video->vdev.fops = &atomisp_file_fops; video->vdev.ioctl_ops = &atomisp_file_ioctl_ops; break; @@ -411,7 +411,7 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) adapter->name, board_info->type); subdev = v4l2_i2c_new_subdev_board(&isp->v4l2_dev, adapter, - board_info, NULL, 1); + board_info, NULL); if (subdev == NULL) { v4l2_info(&atomisp_dev, @@ -844,8 +844,9 @@ static int __devinit atomisp_pci_probe(struct pci_dev *dev, atomisp_msi_irq_init(isp, dev); #ifdef CONFIG_PM - pm_runtime_set_active(&dev->dev); - pm_runtime_enable(&dev->dev); +/* pm_runtime_set_active(&dev->dev); + pm_runtime_enable(&dev->dev); */ + pm_runtime_put_noidle(&dev->dev); pm_runtime_put_sync(&dev->dev); #endif isp->sw_contex.probed = true; @@ -948,7 +949,7 @@ static void __exit atomisp_exit(void) pci_unregister_driver(&atomisp_pci_driver); } -late_initcall_async(atomisp_init); +module_init(atomisp_init); module_exit(atomisp_exit); MODULE_AUTHOR("Wen Wang "); -- 2.7.4