summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/soc_camera/atmel-isi.c
AgeCommit message (Collapse)AuthorFilesLines
2013-12-18[media] v4l: atmel-isi: Should clear bits before set the hardware registerJosh Wu1-0/+3
In the ISI driver it reads the config register to get original value, then set the correct FRATE_DIV and YCC_SWAP_MODE directly. This will cause some bits overlap. So we need to clear these bits first, then set correct value. This patch fix it. Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-18[media] v4l: atmel-isi: Fix color component orderingLaurent Pinchart1-4/+4
The ISI_CFG2.YCC_SWAP field controls color component ordering. The datasheet lists the following orderings for the memory formats. YCC_SWAP Byte 0 Byte 1 Byte 2 Byte 3 00: Default Cb(i) Y(i) Cr(i) Y(i+1) 01: Mode1 Cr(i) Y(i) Cb(i) Y(i+1) 10: Mode2 Y(i) Cb(i) Y(i+1) Cr(i) 11: Mode3 Y(i) Cr(i) Y(i+1) Cb(i) This is based on a sensor format set to CbYCrY (UYVY). The driver hardcodes the output memory format to YUYV, configure the ordering accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-18[media] v4l: atmel-isi: Make the MCK clock optionalLaurent Pinchart1-15/+21
ISI_MCK is the sensor master clock. It should be handled by the sensor driver directly, as the ISI has no use for that clock. Make the clock optional here while platforms transition to the correct model. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-18[media] v4l: atmel-isi: Reset the ISI when starting the streamLaurent Pinchart1-10/+10
The queue setup operation isn't the right place to reset the ISI. Move the reset call to the start streaming operation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-18[media] v4l: atmel-isi: Defer clock (un)preparation to enable/disable timeLaurent Pinchart1-27/+8
The PCLK and MCK clocks are prepared and unprepared at probe and remove time. Clock (un)preparation isn't needed before enabling/disabling the clocks, and the enable/disable operation happen in non-atomic context. We can thus defer (un)preparation to enable/disable time. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-18[media] v4l: atmel-isi: Use devm_* managed allocatorsLaurent Pinchart1-37/+19
This simplifies error and cleanup code paths. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-18[media] v4l: atmel-isi: remove SOF wait in start_streaming()Josh Wu1-46/+1
when a userspace applications calls the VIDIOC_STREAMON ioctl. The V4L2 core calls the soc_camera_streamon function, which is responsible for starting the video stream. It does so by first starting the atmel-isi host by a call to the vb2_streamon function, and then starting the sensor by a call to the video.s_stream sensor subdev operation. That means we wait for a SOF in start_streaming() before call sensor's s_stream(). It is possible no VSYNC interrupt arrive as the sensor hasn't been started yet. To avoid such case, this patch remove the code to wait for the VSYNC interrupt. And such code is not necessary. Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-06-21[media] atmel-isi: move interface activation and deactivation to clock callbacksGuennadi Liakhovetski1-9/+19
When adding and removing a client, the atmel-isi camera host driver only activates and deactivates its camera interface respectively, which doesn't include any client-specific actions. Move this functionality into .clock_start() and .clock_stop() callbacks. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-06-21[media] soc-camera: move common code to soc_camera.cGuennadi Liakhovetski1-9/+1
All soc-camera host drivers include a pointer to an soc-camera device in their host private struct to check, that only one client is connected. Move this common code to soc_camera.c. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04[media] atmel-isi: Update error check for unsigned variablesTushar Behera1-1/+1
Checking '< 0' for unsigned variables always returns false. For error codes, use IS_ERR_VALUE() instead. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-04[media] drivers: media: use module_platform_driver_probe()Fabio Porcedda1-12/+1
This patch converts the drivers to use the module_platform_driver_probe() macro which makes the code smaller and a bit simpler. Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> [g.liakhovetski@gmx.de: also remove redundant .probe initialisation] Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05[media] vb2: Add support for non monotonic timestampsKamil Debski1-0/+1
Not all drivers use monotonic timestamps. This patch adds a way to set the timestamp type per every queue. In addition, set proper timestamp type in drivers that I am sure that use either MONOTONIC or COPY timestamps. Other drivers will correctly report UNKNOWN timestamp type instead of assuming that all drivers use monotonic timestamps. Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-24Merge branch 'v4l_for_linus' into staging/for_v3.9Mauro Carvalho Chehab1-3/+3
* v4l_for_linus: (464 commits) [media] uvcvideo: Set error_idx properly for S_EXT_CTRLS failures [media] uvcvideo: Cleanup leftovers of partial revert [media] uvcvideo: Return -EACCES when trying to set a read-only control Linux 3.8-rc3 mm: reinstante dropped pmd_trans_splitting() check cred: Remove tgcred pointer from struct cred drm/ttm: fix fence locking in ttm_buffer_object_transfer ARM: clps711x: Fix bad merge of clockevents setup ARM: highbank: save and restore L2 cache and GIC on suspend ARM: highbank: add a power request clear ARM: highbank: fix secondary boot and hotplug ARM: highbank: fix typos with hignbank in power request functions ARM: dts: fix highbank cpu mpidr values ARM: dts: add device_type prop to cpu nodes on Calxeda platforms drm/prime: drop reference on imported dma-buf come from gem xen/netfront: improve truesize tracking ARM: mx5: Fix MX53 flexcan2 clock ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array sctp: fix Kconfig bug in default cookie hmac selection EDAC: Cleanup device deregistering path ... Conflicts: drivers/media/pci/dm1105/dm1105.c drivers/media/platform/soc_camera/mx2_camera.c
2013-01-05[media] soc-camera: remove struct soc_camera_device::video_lockGuennadi Liakhovetski1-2/+2
Currently soc-camera has a per-device node lock, used for video operations and a per-host lock for code paths, modifying host's pipeline. Manipulating the two locks increases complexity and doesn't bring any advantages. This patch removes the per-device lock and uses the per-host lock for all operations. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-03Drivers: media: remove __dev* attributes.Greg Kroah-Hartman1-3/+3
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-12-21[media] v4l: Convert drivers to use monotonic timestampsSakari Ailus1-1/+1
Convert drivers using wall clock time (CLOCK_REALTIME) to timestamp from the monotonic timer (CLOCK_MONOTONIC). Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-21[media] move soc_camera to its own directoryMauro Carvalho Chehab1-0/+1099
That helps to better organize the soc_camera items. While here, cleanup Makefiles, removing uneeded include dirs. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>