summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/marvell-ccic
Commit message (Collapse)AuthorAgeFilesLines
* [media] V4L: marvell-ccic: (cosmetic) remove redundant variable assignmentGuennadi Liakhovetski2012-05-151-1/+0Star
| | | | | | | | | The "ret = 0" assignment in mcam_vidioc_s_fmt_vid_cap() is redundant, because at that location "ret" is anyway guaranteed to be == 0. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: fix an ARM build errorJonathan Corbet2012-04-261-1/+0Star
| | | | | | | | | | | One of the OLPC changes lost a little in its translation to mainline, leading to build errors on the ARM architecture. Remove the offending line, and all will be well. Reported-by: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Demote the "release" print to debug levelJonathan Corbet2012-03-201-1/+1
| | | | | | | We've spammed enough logfiles at this point. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mmp-camera: Don't power up the sensor on resumeJonathan Corbet2012-03-201-4/+9
| | | | | | | | | | We still need to power up the controller to avoid unsightly self-immolation should something try to access its registers, but the sensor can stay powered down unless the camera was actually operating at suspend time. This gets rid of the camera LED flash on resume, fixing OLPC bug #11644. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Don't signal multiple frame completions in ↵Jonathan Corbet2012-03-201-0/+2
| | | | | | | | | | | | scatter/gather mode There is only one frame known to the DMA engine in scatter/gather mode, but it still tells us that any or all of frames 1-3 are done at each completion interrupt. Avoid the creation of junk frames by being sure to only "complete" one on each interrupt. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: fix the green screen of deathJonathan Corbet2012-03-201-7/+6Star
| | | | | | | | | | | | | | | | I had learned through hard experience that dinking around with the DMA descriptors while the C1_DESC_ENA enable bit was set is a recipe for all kinds of truly malicious behavior on the hardware's part, regardless of whether the DMA engine is actually operating at the time. That notwithstanding, the driver did so dink, resulting in "green frame" captures and the death of the system in random, spectacular ways. Move the tweaking of C1_DESC_ENA to the same function that sets the descriptor so we know that we'll never try to set a descriptor while that bit is set. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Increase the DMA shutdown timeoutJonathan Corbet2012-03-201-1/+9
| | | | | | | | | | Experience shows that, on the Armada platform, it can take as much as 120ms for the DMA engine to actually shut down after it has been told to. So a 40ms timeout is not adequate; use 150ms instead. Also make sure we don't leave the DMA_ACTIVE flag set once things are down. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Remove broken "owner" logicJonathan Corbet2012-03-202-5/+1Star
| | | | | | | | | | | The marvell cam driver retained just enough of the owner-tracking logic from cafe_ccic to be broken; it could, conceivably, cause the driver to release DMA memory while the controller is still active. Simply remove the remaining pieces and ensure that the controller is stopped before we free things. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: ensure that the camera stops when requestedJonathan Corbet2012-03-201-1/+6
| | | | | | | | | The controller stop/restart logic could possibly restart DMA after the driver things things have stopped, with suitably ugly results. Make sure that we only restart the hardware if we're supposed to be streaming. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* Merge branch 'v4l_for_linus' of ↵Linus Torvalds2012-01-152-7/+64
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (655 commits) [media] revert patch: HDIC HD29L2 DMB-TH USB2.0 reference design driver mb86a20s: Add a few more register settings at the init seq mb86a20s: Group registers into the same line [media] [PATCH] don't reset the delivery system on DTV_CLEAR [media] [BUG] it913x-fe fix typo error making SNR levels unstable [media] cx23885: Query the CX25840 during enum_input for status [media] cx25840: Add support for g_input_status [media] rc-videomate-m1f.c Rename to match remote controler name [media] drivers: media: au0828: Fix dependency for VIDEO_AU0828 [media] convert drivers/media/* to use module_platform_driver() [media] drivers: video: cx231xx: Fix dependency for VIDEO_CX231XX_DVB [media] Exynos4 JPEG codec v4l2 driver [media] doc: v4l: selection: choose pixels as units for selection rectangles [media] v4l: s5p-tv: mixer: fix setup of VP scaling [media] v4l: s5p-tv: mixer: add support for selection API [media] v4l: emulate old crop API using extended crop/compose API [media] doc: v4l: add documentation for selection API [media] doc: v4l: add binary images for selection API [media] v4l: add support for selection api [media] hd29l2: fix review findings ...
| * [media] marvell-cam: Make suspend/resume work on MMP2Jonathan Corbet2012-01-062-7/+64
| | | | | | | | | | | | | | | | | | Somehow I didn't ever quite get around to implementing suspend/resume on the MMP2 platform; this patch fixes that little oversight. A bit of core work was necessary to do the right thing in the s/g DMA case. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* | module_param: make bool parameters really bool (drivers & misc)Rusty Russell2012-01-131-3/+3
|/ | | | | | | | | | | | module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* [media] V4L: vb2: prepare to support multi-size buffersGuennadi Liakhovetski2011-11-031-1/+2
| | | | | | | | | In preparation for the forthcoming VIDIOC_CREATE_BUFS ioctl add a "const struct v4l2_format *" argument to the .queue_setup() vb2 operation. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] mmp_camera: add MODULE_ALIASDaniel Drake2011-09-181-0/+1
| | | | | | | | This enables module autoloading. Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] media: vb2: change queue initialization orderMarek Szyprowski2011-09-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the order of operations during stream on call. Now the buffers are first queued to the driver and then the start_streaming method is called. This resolves the most common case when the driver needs to know buffer addresses to enable dma engine and start streaming. Additional parameter to start_streaming method have been added to simplify drivers code. The driver are now obliged to check if the number of queued buffers is high enough to enable hardware streaming. If not - it can return an error. In such case all the buffers that have been pre-queued are invalidated. This patch also updates all videobuf2 clients to work properly with the changed order of operations. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Pawel Osciak <pawel@osciak.com> CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de> CC: Hans Verkuil <hverkuil@xs4all.nl> CC: Tomasz Stanislawski <t.stanislaws@samsung.com> CC: Sylwester Nawrocki <s.nawrocki@samsung.com> CC: Kamil Debski <k.debski@samsung.com> CC: Jonathan Corbet <corbet@lwn.net> CC: Josh Wu <josh.wu@atmel.com> CC: Hans de Goede <hdegoede@redhat.com> CC: Paul Mundt <lethal@linux-sh.org> Tested-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] media: vb2: dma contig allocator: use dma_addr instread of paddrMarek Szyprowski2011-09-061-2/+2
| | | | | | | | | | | | | Use the correct 'dma_addr' name for the buffer address. 'paddr' suggested that this is the physical address in system memory. For most ARM platforms these two are the same, but this is not a generic rule. 'dma_addr' will also point better to dma-mapping api. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Pawel Osciak <pawel@osciak.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] media: vb2: change plane sizes array to unsigned int[]Marek Szyprowski2011-09-061-1/+1
| | | | | | | | | | | | Plane sizes array was declared as unsigned long[], while unsigned int is more than enough for storing size of the video buffer. This patch reduces the size of the array by definiting it as unsigned int[]. Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> CC: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: clean up a couple of unused cam structure fieldsJonathan Corbet2011-07-272-5/+0Star
| | | | | | | Delete a couple of leftover fields whose time has passed. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Allow selection of supported buffer modesJonathan Corbet2011-07-273-59/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Marvell camera core can support all three videobuf2 buffer modes, which is slick, but it also requires that all three modes be built and present, even though only one is likely to be used. This patch allows the supported modes to be selected at configuration time, reducing the footprint of the driver. Prior to this patch, the MMP camera driver looked like this: mmp_camera 19092 0 videobuf2_core 15542 1 mmp_camera videobuf2_dma_sg 3173 1 mmp_camera videobuf2_dma_contig 2188 1 mmp_camera videobuf2_vmalloc 1718 1 mmp_camera videobuf2_memops 2100 3 videobuf2_dma_sg,videobuf2_dma_contig,videobuf2_vmalloc Afterward, instead, with scatter/gather only configured: mmp_camera 16021 0 videobuf2_core 15542 1 mmp_camera videobuf2_dma_sg 3173 1 mmp_camera videobuf2_memops 2100 1 videobuf2_dma_sg The total goes from 43,813 bytes to 36,836. The emphasis has been on simplicity and minimal #ifdef use rather than on squeezing out every possible byte of code. For configuration, the driver simply looks at which videobuf2 modes have been configured in and supports them all; it's simplistic but should be good enough. The cafe driver is set to support vmalloc and dma-contig; mmp supports only dma-sg, since that's the only mode that really makes sense to use. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: power down mmp camera on registration failureJonathan Corbet2011-07-271-1/+1
| | | | | | | If registration does not work, we don't want to leave the sensor powered on. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: remove {min,max}_buffers parametersJonathan Corbet2011-07-271-13/+0Star
| | | | | | | | Somewhere along the way the code stopped actually paying any attention to them, and I doubt anybody has ever made use of them. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: core code reorganizationJonathan Corbet2011-07-271-404/+420
| | | | | | | | | | | This code shows signs of having been mucked with over the last five years or so; things were kind of mixed up. This patch reorders functions into a more rational organization which, with luck, will facilitate making the buffer modes selectable at configuration time. Code movement only: no functional changes here. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: delete struct mcam_sio_bufferJonathan Corbet2011-07-271-11/+0Star
| | | | | | | | This structure got passed over in the videobuf2 conversion; it has no reason to exist now. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: use S/G DMA by defaultJonathan Corbet2011-07-271-1/+1
| | | | | | | | Scatter/gather DMA mode works nicely on this platform and is clearly the best way of doing things. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Working s/g DMAJonathan Corbet2011-07-273-42/+266
| | | | | | | | The core Marvell camera driver can now do scatter/gather DMA on controllers which support that functionality. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: implement contiguous DMA operationJonathan Corbet2011-07-275-54/+205
| | | | | | | | | | The core driver can now operate in either vmalloc or dma-contig modes; obviously the latter is preferable when it is supported. Default is currently vmalloc on all platforms; load the module with buffer_mode=1 for contiguous DMA mode. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Don't spam the logs on frame lossJonathan Corbet2011-07-271-2/+0Star
| | | | | | | | The sequence numbers already give that information if user space cares; this is a frequent occurrence on slower machines, alas. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: no need to initialize the DMA buffersJonathan Corbet2011-07-271-2/+0Star
| | | | | | | | This was an old debugging thing from years ago. It's only done at initialization time, but it's still unnecessary; take it out. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: include file cleanupJonathan Corbet2011-07-271-8/+6Star
| | | | | | | | Put the includes into a slightly more readable ordering and get rid of a few unneeded ones. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: convert to videobuf2Jonathan Corbet2011-07-273-411/+196Star
| | | | | | | | | | | This is a basic, naive conversion to the videobuf2 infrastructure, removing a lot of code in the process. For now, we're using vmalloc, which is suboptimal, but it does match what the cafe driver did before. In the cafe case, it may have to stay that way just because memory is too tight to do direct streaming; mmp-camera will be able to do better. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Basic working MMP camera driverJonathan Corbet2011-07-274-8/+374
| | | | | | | | | Now we have a camera working over the marvell cam controller core. It works like the cafe driver and has all the same limitations, contiguous DMA only being one of them. But it's a start. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Allocate the i2c adapter in the platform driverJonathan Corbet2011-07-273-4/+9
| | | | | | | | | The upcoming mmp-camera driver will need an i2c_adapter structure allocated externally, so change the core adapter to a pointer and require the platform code to fill it in. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Right-shift i2c slave ID's in the cafe driverJonathan Corbet2011-07-272-2/+9
| | | | | | | | This makes the cafe i2c implement consistent with the rest of Linux so that the core can use the same slave ID everywhere. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Move Cafe-specific register definitions to cafe-driver.cJonathan Corbet2011-07-272-55/+64
| | | | | | | Nobody else ever needs to see these, so let's hide them. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Remove the "untested" commentJonathan Corbet2011-07-271-3/+0Star
| | | | | | | This code is, indeed, tested :) Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Pass sensor parameters from the platformJonathan Corbet2011-07-273-20/+10Star
| | | | | | | | | | | | Depending on the controller, the ov7670 sensor may be told to work with a different clock speed or to use the SMBUS protocol. Remove the wired-in code and pass that information from the platform layer. The Cafe driver now just assumes it's running on an OLPC XO 1; I do not believe it has ever run anywhere else. Cc: Daniel Drake <dsd@laptop.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Separate out the Marvell camera coreJonathan Corbet2011-07-276-2433/+2571
| | | | | | | | | | | | There will eventually be multiple users of the core camera controller, so separate it from the bus/platform/i2c stuff. I've tried to do the minimal set of changes to get the driver functioning in this configuration; I did clean up a bunch of old checkpatch gripes in the process. This driver works like the old one did on OLPC XO 1 systems. Cc: Daniel Drake <dsd@laptop.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] marvell-cam: Move cafe-ccic into its own directoryJonathan Corbet2011-07-274-0/+2443
This driver will soon become a family of drivers, so let's give it its own place to live. This move requires putting ov7670.h into include/media, but there are no code changes. Cc: Daniel Drake <dsd@laptop.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>