summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/soc_camera
Commit message (Collapse)AuthorAgeFilesLines
* [media] v4l: Switch from V4L2 OF not V4L2 fwnode APISakari Ailus2017-06-061-3/+4
| | | | | | | | | | | | Switch users of the v4l2_of_ APIs to the more generic v4l2_fwnode_ APIs. Async OF matching is replaced by fwnode matching and OF matching support is removed. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Benoit Parrot <bparrot@ti.com> # i2c/ov2569.c, am437x/am437x-vpfe.c and ti-vpe/cal.c Tested-by: Hans Verkuil <hans.verkuil@cisco.com> # Atmel sama5d3 board + ov2640 sensor Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] soc_camera: annotate a switch fall throughMauro Carvalho Chehab2017-05-191-0/+1
| | | | | | | | Clearly, hsync and vsinc bool vars are part of the return logic on the second case of the switch. Annotate that, in order to shut up gcc warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atmel-isi: move out of soc_camera to atmelHans Verkuil2017-04-104-1517/+0Star
| | | | | | | | | Move this out of the soc_camera directory into the atmel directory where it belongs. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] atmel-isi: remove dependency of the soc-camera frameworkHans Verkuil2017-04-102-498/+698
| | | | | | | | | This patch converts the atmel-isi driver from a soc-camera driver to a driver that is stand-alone. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] soc-camera: fix rectangle adjustment in croppingKoji Matsuoka2017-03-231-5/+6
| | | | | | | | | | | | | | | update_subrect() adjusts the sub-rectangle to be inside a base area. It checks width and height to not exceed those of the area, then it checks the low border (left or top) to lie within the area, then the high border (right or bottom) to lie there too. This latter check has a bug, which is fixed by this patch. Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> [g.liakhovetski@gmx.de: dropped supposedly wrong hunks] Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] sh_mobile_ceu_camera: use module_platform_driverGeliang Tang2017-03-231-12/+1Star
| | | | | | | | Use module_platform_driver() helper to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l: soc-camera: Remove videobuf1 supportLaurent Pinchart2017-03-222-85/+19Star
| | | | | | | | | | | All remaining soc-camera drivers use videobuf2, drop support for videobuf1. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: also drop 'select VIDEOBUF_GEN' from Kconfig] Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: soc_camera_platform : constify v4l2_subdev_* structuresBhumika Goyal2017-01-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v4l2_subdev_{core/video}_ops structures are stored in the fields of the v4l2_subdev_ops structure which are of type const. Also, v4l2_subdev_ops structure is passed to a function having its argument of type const. As these structures are never modified, so declare them as const. Done using Coccinelle:(One of the scripts) @r1 disable optional_qualifier @ identifier i; position p; @@ static struct v4l2_subdev_core_ops i@p = {...}; @ok1@ identifier r1.i; position p; struct v4l2_subdev_ops obj; @@ obj.core=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct v4l2_subdev_core_ops i; File size before: text data bss dec hex filename 858 576 0 1434 59a soc_camera/soc_camera_platform.o File size after: text data bss dec hex filename 1234 192 0 1426 592 soc_camera/soc_camera_platform.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] soc-camera/rcar-vin: remove obsolete driverHans Verkuil2016-09-193-1979/+0Star
| | | | | | | | | | | | | | This driver has been replaced by the non-soc-camera rcar-vin driver. The soc-camera framework is being deprecated, so drop this older rcar-vin driver in favor of the newer version that does not rely on this deprecated framework. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] platform: constify vb2_ops structuresJulia Lawall2016-09-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for vb2_ops structures that are only stored in the ops field of a vb2_queue structure. That field is declared const, so vb2_ops structures that have this property can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p = { ... }; @ok@ identifier r.i; struct vb2_queue e; position p; @@ e.ops = &i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct vb2_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct vb2_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com> Reviewed-by: Jacek Anaszewski <j.anaszewski@samsung.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> [hans.verkuil@cisco.com: dropped soc_camera/rcar_vin.c patch because that driver will be removed] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: move pxa_camera out of soc_cameraRobert Jarzmik2016-09-093-2105/+0Star
| | | | | | | | | | As the conversion to a v4l2 standalone device is finished, move pxa_camera one directory up and finish severing any dependency to soc_camera. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: change stop_streaming semanticsRobert Jarzmik2016-09-091-3/+12
| | | | | | | | | | | | | | Instead of the legacy behavior where it was required to wait for all video buffers to be finished by the hardware, use a cancel like strategy : as soon as the stop_streaming() call is done, abort all DMA transfers, report the already buffers as failed and return. This makes stop_streaming() more a "cancel capture" than a "wait for end of capture" semantic. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: add debug register accessRobert Jarzmik2016-09-091-0/+32
| | | | | | | | Add pxa_camera registers access through advanced video debugging. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: make a standalone v4l2 deviceRobert Jarzmik2016-09-092-239/+516
| | | | | | | | | | | | | | | | | | | | | | This patch removes the soc_camera API dependency from pxa_camera. In the current status : - all previously captures are working the same on pxa270 - the s_crop() call was removed, judged not working (see what happens soc_camera_s_crop() when get_crop() == NULL) - if the pixel clock is provided by then sensor, ie. not MCLK, the dual stage change is not handled yet. => there is no in-tree user of this, so I'll let it that way - the MCLK is not yet finished, it's as in the legacy way, ie. activated at video device opening and closed at video device closing. In a subsequence patch pxa_camera_mclk_ops should be used, and platform data MCLK ignored. It will be the sensor's duty to request the clock and enable it, which will end in pxa_camera_mclk_ops. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: remove set_selectionRobert Jarzmik2016-09-091-83/+0Star
| | | | | | | | | | This is to be seen as a regression as the set_selection (former set_crop) function is removed. This is a temporary situation in the v4l2 porting, and will have to be added later. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: add buffer sequencingRobert Jarzmik2016-09-091-0/+5
| | | | | | | | Add sequence numbers to completed buffers. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: make printk consistentRobert Jarzmik2016-09-091-27/+43
| | | | | | | | | | | | Make all print consistent by always using : - dev_xxx(pcdev_to_dev(pcdev), ....) This prepares the soc_camera adherence removal by making these call rely on only pcdev, and not the soc_camera icd structure. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: introduce sensor_callRobert Jarzmik2016-09-091-12/+15
| | | | | | | | | | Introduce sensor_call(), which will be used for all sensor invocations. This is a preparation move to v4l2 device conversion, ie. soc_camera adherence removal. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: trivial move of functionsRobert Jarzmik2016-09-091-232/+241
| | | | | | | | | | | | | | Move the functions in the file to be regrouped into meaningful blocks : 1. pxa camera core handling functions, manipulating the herdware 2. videobuf2 functions, dealing with video buffers 3. video ioctl (vidioc) related functions 4. driver probing, removal, suspend and resume This patch doesn't modify a single line of code. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: convert to vb2Robert Jarzmik2016-09-092-314/+269Star
| | | | | | | | | | | | | | | Convert pxa_camera from videobuf to videobuf2. As the soc_camera was already compatible with videobuf2, the port is quite straightforward. The special case of this code in which the vb2 to prepare is "too big" in terms of size for the new capture format, the pxa_camera will fail. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l2: remove g/s_crop from video opsHans Verkuil2016-08-247-206/+157Star
| | | | | | | | | | | | | | Replace all calls to g/s_crop by calls to the get/set_selection pad ops. Remove the old g/s_crop video ops since they are now no longer used. The cropcap video op is now only used to pass pixelaspect information, and is only needed if the pixelaspect is not 1:1. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] soc-camera/sh_mobile_csi2: remove unused driverHans Verkuil2016-08-244-627/+10Star
| | | | | | | | | | The sh_mobile_csi2 isn't used anymore (was it ever?), so remove it. Especially since the soc-camera framework is being deprecated. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vb2: replace void *alloc_ctxs by struct device *alloc_devsHans Verkuil2016-07-083-3/+3
| | | | | | | | | | | | | | | | Make this a proper typed array. Drop the old allocate context code since that is no longer used. Note that the memops functions now get a struct device pointer instead of the struct device ** that was there initially (actually a void pointer to a struct containing only a struct device pointer). This code is now a lot cleaner. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media/.../soc-camera: convert drivers to use the new vb2_queue dev fieldHans Verkuil2016-07-083-36/+4Star
| | | | | | | | | | Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Ludovic Desroches <ludovic.desroches@atmel.com> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] rcar-vin: add Renesas R-Car VIN driverNiklas Söderlund2016-06-162-3/+3
| | | | | | | | | | A V4L2 driver for Renesas R-Car VIN driver that do not depend on soc_camera. The driver is heavily based on its predecessor and aims to replace it. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] soc_camera: rcar_vin: add R-Car Gen 2 and 3 fallback compatibility ↵Yoshihiro Kaneko2016-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | strings Add fallback compatibility string for R-Car Gen 1 and 2. In the case of Renesas R-Car hardware we know that there are generations of SoCs, e.g. Gen 2 and 3. But beyond that it's unclear what the relationship between IP blocks might be. For example, I believe that r8a7790 is older than r8a7791 but that doesn't imply that the latter is a descendant of the former or vice versa. We can, however, by examining the documentation and behaviour of the hardware at run-time observe that the current driver implementation appears to be compatible with the IP blocks on SoCs within a given generation. For the above reasons and convenience when enabling new SoCs a per-generation fallback compatibility string scheme being adopted for drivers for Renesas SoCs. Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] sh_mobile_ceu_camera: Remove dependency on SUPERHSimon Horman2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A dependency on ARCH_SHMOBILE seems to be the best option for sh_mobile_ceu_camera: * For Super H based SoCs: sh_mobile_ceu is used on SH_AP325RXA, SH_ECOVEC, SH_KFR2R09, SH_MIGOR, and SH_7724_SOLUTION_ENGINE which depend on CPU_SUBTYPE_SH7722, CPU_SUBTYPE_SH7723, or CPU_SUBTYPE_SH7724 which all select ARCH_SHMOBILE. * For ARM Based SoCs: Since the removal of legacy (non-multiplatform) support this driver has not been used by any Renesas ARM based SoCs. The Renesas ARM based SoCs currently select ARCH_SHMOBILE, however, it is planned that this will no longer be the case. This is part of an ongoing process to migrate from ARCH_SHMOBILE to ARCH_RENESAS the motivation for which being that RENESAS seems to be a more appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs. Thanks to Geert Uytterhoeven for analysis and portions of the change log text. Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rcar_vin: Use ARCH_RENESASSimon Horman2016-04-131-1/+1
| | | | | | | | | | | | | Make use of ARCH_RENESAS in place of ARCH_SHMOBILE. This is part of an ongoing process to migrate from ARCH_SHMOBILE to ARCH_RENESAS the motivation for which being that RENESAS seems to be a more appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] soc_camera/mx3_camera.c: move to staging in preparation, for removalHans Verkuil2016-03-033-1274/+0Star
| | | | | | | | | | | | | This driver is deprecated: it should become a stand-alone driver instead of using the soc-camera framework. Unless someone is willing to take this on (unlikely with such ancient hardware) it is going to be removed from the kernel soon. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] soc_camera/mx2_camera.c: move to staging in preparation, for removalHans Verkuil2016-03-033-1646/+0Star
| | | | | | | | | | | | | This driver is deprecated: it should become a stand-alone driver instead of using the soc-camera framework. Unless someone is willing to take this on (unlikely with such ancient hardware) it is going to be removed from the kernel soon. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] soc_camera/omap1: move to staging in preparation for removalHans Verkuil2016-03-033-1749/+0Star
| | | | | | | | | | | | | | This driver is deprecated: it needs to be converted to vb2 and it should become a stand-alone driver instead of using the soc-camera framework. Unless someone is willing to take this on (unlikely with such ancient hardware) it is going to be removed from the kernel soon. Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] atmel-isi: Fix bad usage of IS_ERR_VALUEGuenter Roeck2016-03-031-2/+2
| | | | | | | | | | | | | | | | | | | | IS_ERR_VALUE() assumes that its parameter is an unsigned long. It can not be used to check if an unsigned int reflects an error. Doing so can result in the following build warning. drivers/media/platform/soc_camera/atmel-isi.c: In function "atmel_isi_probe": include/linux/err.h:21:38: warning: comparison is always false due to limited range of data type drivers/media/platform/soc_camera/atmel-isi.c:1089:6: note: in expansion of macro "IS_ERR_VALUE" If that warning is seen, the return value from platform_get_irq() is not checked for errors. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] pxa_camera: conversion to dmaengineRobert Jarzmik2016-03-032-229/+174Star
| | | | | | | | | | | | | | | Convert pxa_camera to dmaengine. This removes all DMA registers manipulation in favor of the more generic dmaengine API. The functional level should be the same as before. The biggest change is in the sg_split() function, which splits a videobuf-dma into several scatterlists for 3 planes captures (Y, U, V). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> [g.liakhovetski@gmx.de: fix a function prototype, use bool, struct init] Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] pxa_camera: trivial move of dma irq functionsRobert Jarzmik2016-03-031-18/+24
| | | | | | | | | | | This moves the dma irq handling functions up in the source file, so that they are available before DMA preparation functions. It prepares the conversion to DMA engine, where the descriptors are populated with these functions as callbacks. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] pxa_camera: move interrupt to taskletRobert Jarzmik2016-03-031-15/+29
| | | | | | | | | | | In preparation for dmaengine conversion, move the camera interrupt handling into a tasklet. This won't change the global flow, as this interrupt is only used to detect the end of frame and activate DMA fifos handling. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] pxa_camera: fix the buffer free pathRobert Jarzmik2016-03-031-11/+5Star
| | | | | | | | | | Fix the error path where the video buffer wasn't allocated nor mapped. In this case, in the driver free path don't try to unmap memory which was not mapped in the first place. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] mx3_camera: use %pad format string for dma_ddr_tArnd Bergmann2016-03-031-6/+6
| | | | | | | | | | | | | | | | | | | The mx3_camera driver prints DMA addresses using the "%x" format string, which is wrong when using a 64-bit dma_addr_t definition: media/platform/soc_camera/mx3_camera.c: In function 'mx3_cam_dma_done': media/platform/soc_camera/mx3_camera.c:149:125: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=] media/platform/soc_camera/mx3_camera.c: In function 'mx3_videobuf_queue': media/platform/soc_camera/mx3_camera.c:317:119: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=] media/platform/soc_camera/mx3_camera.c: In function 'mx3_videobuf_release': media/platform/soc_camera/mx3_camera.c:346:119: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=] This changes the code to use the special %pad format string, which always does the right thing. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] soc_camera: rcar_vin: Add ARGB8888 caputre format supportKoji Matsuoka2016-03-031-10/+29
| | | | | | | | | This patch adds ARGB8888 capture format support for R-Car Gen3. Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* Merge tag 'v4.5-rc3' into patchworkMauro Carvalho Chehab2016-02-092-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux 4.5-rc3 * tag 'v4.5-rc3': (644 commits) Linux 4.5-rc3 epoll: restrict EPOLLEXCLUSIVE to POLLIN and POLLOUT radix-tree: fix oops after radix_tree_iter_retry MAINTAINERS: trim the file triggers for ABI/API dax: dirty inode only if required thp: make deferred_split_scan() work again mm: replace vma_lock_anon_vma with anon_vma_lock_read/write ocfs2/dlm: clear refmap bit of recovery lock while doing local recovery cleanup um: asm/page.h: remove the pte_high member from struct pte_t mm, hugetlb: don't require CMA for runtime gigantic pages mm/hugetlb: fix gigantic page initialization/allocation mm: downgrade VM_BUG in isolate_lru_page() to warning mempolicy: do not try to queue pages from !vma_migratable() mm, vmstat: fix wrong WQ sleep when memory reclaim doesn't make any progress vmstat: make vmstat_update deferrable mm, vmstat: make quiet_vmstat lighter mm/Kconfig: correct description of DEFERRED_STRUCT_PAGE_INIT memblock: don't mark memblock_phys_mem_size() as __init dump_stack: avoid potential deadlocks mm: validate_mm browse_rb SMP race condition ...
| * [media] atmel-isi: fix debug message which only show the first formatJosh Wu2016-01-251-1/+1
| | | | | | | | | | | | | | | | Correct the debug output message to show correct format. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
| * [media] soc_camera: cleanup control device on async_unbindWolfram Sang2016-01-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I got the following WARN on a simple unbind/bind cycle: root@Lager:/sys/bus/i2c/drivers/adv7180# echo 6-0020 > unbind root@Lager:/sys/bus/i2c/drivers/adv7180# echo 6-0020 > bind [ 31.097652] adv7180 6-0020: chip found @ 0x20 (e6520000.i2c) [ 31.123744] ------------[ cut here ]------------ [ 31.128413] WARNING: CPU: 3 PID: 873 at drivers/media/platform/soc_camera/soc_camera.c:1463 soc_camera_async_bound+0x40/0xa0() [ 31.139896] CPU: 3 PID: 873 Comm: sh Not tainted 4.4.0-rc3-00062-ge8ae2c0b6bca2a #172 [ 31.147815] Hardware name: Generic R8A7790 (Flattened Device Tree) [ 31.154056] Backtrace: [ 31.156575] [<c0014bc0>] (dump_backtrace) from [<c0014d80>] (show_stack+0x20/0x24) [ 31.164233] r6:c05c5b33 r5:00000009 r4:00000000 r3:00404100 [ 31.170017] [<c0014d60>] (show_stack) from [<c01e2344>] (dump_stack+0x78/0x94) [ 31.177344] [<c01e22cc>] (dump_stack) from [<c0029e7c>] (warn_slowpath_common+0x98/0xc4) [ 31.185518] r4:00000000 r3:00000000 [ 31.189172] [<c0029de4>] (warn_slowpath_common) from [<c0029fa0>] (warn_slowpath_null+0x2c/0x34) [ 31.198043] r8:eb38df28 r7:eb38c5d0 r6:eb38de80 r5:e6962810 r4:eb38de80 [ 31.204898] [<c0029f74>] (warn_slowpath_null) from [<c0356348>] (soc_camera_async_bound+0x40/0xa0) [ 31.213955] [<c0356308>] (soc_camera_async_bound) from [<c03499a0>] (v4l2_async_test_notify+0x9c/0x108) [ 31.223430] r5:eb38c5ec r4:eb38de80 [ 31.227084] [<c0349904>] (v4l2_async_test_notify) from [<c0349dd8>] (v4l2_async_register_subdev+0x88/0xd0) [ 31.236822] r7:c07115c8 r6:c071160c r5:eb38c5ec r4:eb38de80 [ 31.242622] [<c0349d50>] (v4l2_async_register_subdev) from [<c0337040>] (adv7180_probe+0x2c8/0x3a4) [ 31.251753] r8:00000000 r7:00000001 r6:eb38de80 r5:ea973400 r4:eb38de10 r3:00000000 [ 31.259660] [<c0336d78>] (adv7180_probe) from [<c032dd80>] (i2c_device_probe+0x1a0/0x1e4) This gets fixed by clearing the control device pointer on async_unbind. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | [media] soc_camera: rcar_vin: Add R-Car Gen3 supportYoshihiko Mori2016-01-251-0/+2
| | | | | | | | | | | | | | | | | | Add chip identification for R-Car Gen3. Signed-off-by: Yoshihiko Mori <yoshihiko.mori.nx@renesas.com> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* | [media] sh_mobile_ceu_camera: use soc_camera_from_vb2qGeliang Tang2016-01-251-9/+5Star
|/ | | | | | | | Use soc_camera_from_vb2q() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: videobuf2: Move timestamp to vb2_bufferJunghak Sung2015-12-185-5/+5
| | | | | | | | | | | | | | Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer for common use, and change its type to u64 in order to handling y2038 problem. This patch also includes all device drivers' changes related to this restructuring. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vb2: drop v4l2_format argument from queue_setupHans Verkuil2015-12-185-102/+21Star
| | | | | | | | | | | | | | | | | | | | | The queue_setup callback has a void pointer that is just for V4L2 and is the pointer to the v4l2_format struct that was passed to VIDIOC_CREATE_BUFS. The idea was that drivers would use the information from that struct to buffers suitable for the requested format. After the vb2 split series this pointer is now a void pointer, which is ugly, and the reality is that all existing drivers will effectively just look at the sizeimage field of v4l2_format. To make this more generic the queue_setup callback is changed: the void pointer is dropped, instead if the *num_planes argument is 0, then use the current format size, if it is non-zero, then it contains the number of requested planes and the sizes array contains the requested sizes. If either is unsupported, then return -EINVAL, otherwise use the requested size(s). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] rcar_vin: Remove obsolete platform data supportGeert Uytterhoeven2015-11-191-46/+29Star
| | | | | | | | | | Since commit 3d7608e4c169af03 ("ARM: shmobile: bockw: remove legacy board file and config"), Renesas R-Car SoCs are only supported in generic DT-only ARM multi-platform builds. The driver doesn't need to use platform data anymore, hence remove platform data configuration. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] move media platform data to linux/platform_data/mediaMauro Carvalho Chehab2015-11-194-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that media has its own subdirectory inside platform_data, let's move the headers that are already there to such subdir. After moving those files, the references were adjusted using this script: MAIN_DIR="linux/platform_data/" PREV_DIR="linux/platform_data/" DIRS="media/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Suggested-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] atmel-isi: support RGB565 output when sensor output YUV formatsJosh Wu2015-11-171-6/+19
| | | | | | | | | | This patch enable Atmel ISI preview path to convert the YUV to RGB format. Signed-off-by: Josh Wu <josh.wu@atmel.com> [g.liakhovetski@gmx.de: removed superfluous parentheses] Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] atmel-isi: setup YCC_SWAP correctly when using preview pathJosh Wu2015-11-171-0/+14
| | | | | | | | | | | The preview path only can convert UYVY format to RGB data. To make preview path work correctly, we need to set up YCC_SWAP according to sensor output and convert them to UYVY. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] atmel-isi: add code to setup correct resolution for preview pathJosh Wu2015-11-172-1/+21
| | | | | | | | | | | | Not like codec path, preview path can do downsampling, so we should setup a extra preview width, height for it. This patch add preview resolution setup without down sampling. So currently preview path will output same size as sensor output size. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>