summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/pxa_camera.c
Commit message (Collapse)AuthorAgeFilesLines
* media: pxa_camera: get rid of kernel_doc warningsMauro Carvalho Chehab2017-11-301-3/+6
| | | | | | | | | | | | | | | Get rid of the following warnings: drivers/media/platform/pxa_camera.c:247: warning: No description found for parameter 'layout' drivers/media/platform/pxa_camera.c:867: warning: No description found for parameter 'buf' drivers/media/platform/pxa_camera.c:867: warning: No description found for parameter 'sg' drivers/media/platform/pxa_camera.c:867: warning: No description found for parameter 'sglen' drivers/media/platform/pxa_camera.c:867: warning: Excess function parameter 'vb' description in 'pxa_init_dma_channel' drivers/media/platform/pxa_camera.c:867: warning: Excess function parameter 'dma' description in 'pxa_init_dma_channel' drivers/media/platform/pxa_camera.c:867: warning: Excess function parameter 'cibr' description in 'pxa_init_dma_channel' drivers/media/platform/pxa_camera.c:1029: warning: No description found for parameter 'last_submitted' drivers/media/platform/pxa_camera.c:1029: warning: No description found for parameter 'last_issued' Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: v4l: async: Move async subdev notifier operations to a separate structureLaurent Pinchart2017-10-311-2/+6
| | | | | | | | | | | | | | | | | The async subdev notifier .bound(), .unbind() and .complete() operations are function pointers stored directly in the v4l2_async_subdev structure. As the structure isn't immutable, this creates a potential security risk as the function pointers are mutable. To fix this, move the function pointers to a new v4l2_async_subdev_operations structure that can be made const in drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: Convert to using %pOF instead of full_nameRob Herring2017-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: Songjun Wu <songjun.wu@microchip.com> Cc: Kukjin Kim <kgene@kernel.org> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Javier Martinez Canillas <javier@osg.samsung.com> Cc: Minghsiu Tsai <minghsiu.tsai@mediatek.com> Cc: Houlong Wei <houlong.wei@mediatek.com> Cc: Andrew-CT Chen <andrew-ct.chen@mediatek.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Hyun Kwon <hyun.kwon@xilinx.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-renesas-soc@vger.kernel.org Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: pxa_camera: constify v4l2_clk_ops structureJulia Lawall2017-08-201-1/+1
| | | | | | | | | | | | This v4l2_clk_ops structure is only passed as the first argument of v4l2_clk_register, which is const, so the v4l2_clk_ops structure can also be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: v4l: use WARN_ON(1) instead of __WARN()Arnd Bergmann2017-08-081-1/+1
| | | | | | | | | | | | | | | | | | | __WARN() cannot be used in portable code, since it is only available on some architectures and configurations: drivers/media/platform/pxa_camera.c: In function 'pxa_mbus_config_compatible': drivers/media/platform/pxa_camera.c:642:3: error: implicit declaration of function '__WARN'; did you mean '__WALL'? [-Werror=implicit-function-declaration] The common way to express an unconditional warning is WARN_ON(1), so let's use that here. Fixes: 97bbdf02d905 ("media: v4l: Add support for CSI-1 and CCP2 busses") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: v4l: Add support for CSI-1 and CCP2 bussesSakari Ailus2017-07-191-0/+3
| | | | | | | | | | CCP2 and CSI-1, are older single data lane serial busses. [mchehab@s-opensource.com: don't use spaces for identation] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: pxa_camera: constify vb2_ops structureGustavo A. R. Silva2017-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. This issue was detected using Coccinelle and the following semantic patch: @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 = { ... }; Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] v4l: Switch from V4L2 OF not V4L2 fwnode APISakari Ailus2017-06-061-5/+6
| | | | | | | | | | | | 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] pxa_camera: Fix a call with an uninitialized device pointerPetr Cvek2017-06-061-2/+2
| | | | | | | | | | | | | | | | | | | In 'commit 295ab497d6357 ("[media] media: platform: pxa_camera: make printk consistent")' a pointer to the device structure in mclk_get_divisor() was changed to pcdev_to_dev(pcdev). The pointer used by pcdev_to_dev() is still uninitialized during the call to mclk_get_divisor() as it happens in v4l2_device_register() at the end of the probe. The dev_warn and dev_dbg caused a line in the log: (NULL device *): Limiting master clock to 26000000 Fix this by using an initialized pointer from the platform_device (as before the old patch). Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Acked-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] pxa_camera: Add (un)subscribe_event ioctlPetr Cvek2017-06-061-0/+4
| | | | | | | | | The v4l2-compliance complains about nonexistent vidioc_subscribe_event and vidioc_unsubscribe_event calls. Add them to fix the complaints. Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: Fix incorrect test in the image size generationPetr Cvek2017-06-061-0/+3
| | | | | | | | | | | | | | | During the transfer from the soc_camera a test in pxa_mbus_image_size() got removed. Without it any PXA_MBUS_LAYOUT_PACKED format causes either the return of a wrong value (PXA_MBUS_PACKING_2X8_PADHI doubles the correct value) or EINVAL (PXA_MBUS_PACKING_NONE and PXA_MBUS_PACKING_EXTEND16). This was observed in an error from the ffmpeg (for some of the YUYV subvariants). This patch re-adds the same test as in soc_camera version. Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: Add remaining Bayer 8 formatsPetr Cvek2017-06-061-10/+30
| | | | | | | | | | | | | This patch adds Bayer 8 GBRG and RGGB support and move GRBG definition close to BGGR (so all Bayer 8 variants are together). No other changes are needed as the driver handles them as RAW data stream. The RGGB variant was tested in a modified OV9640 driver. Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Acked-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 drivers: annotate fall-throughMauro Carvalho Chehab2017-05-191-0/+1
| | | | | | | | | | | | | | | | | | | Avoid warnings like those: drivers/media/pci/ddbridge/ddbridge-core.c: In function 'dvb_input_detach': drivers/media/pci/ddbridge/ddbridge-core.c:787:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (input->fe) { ^ drivers/media/pci/ddbridge/ddbridge-core.c:792:2: note: here case 4: ^~~~ ... On several cases, it is just that gcc 7.1 is not capable of understanding the comment, but on other places, we need an annotation. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: fix module remove codepath for v4l2 clockPetr Cvek2017-05-181-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The conversion from soc_camera omitted a correct handling of the clock gating for a sensor. When the pxa_camera driver module was removed it tried to unregister clk, but this caused a similar warning: WARNING: CPU: 0 PID: 6740 at drivers/media/v4l2-core/v4l2-clk.c:278 v4l2_clk_unregister(): Refusing to unregister ref-counted 0-0030 clock! The clock was at time still refcounted by the sensor driver. Before the removing of the pxa_camera the clock must be dropped by the sensor driver. This should be triggered by v4l2_async_notifier_unregister() call which removes sensor driver module too, calls unbind() function and then tries to probe sensor driver again. Inside unbind() we can safely unregister the v4l2 clock as the sensor driver got removed. The original v4l2_clk_unregister() should be put inside test as the clock can be already unregistered from unbind(). If there was not any bound sensor the clock is still present. The codepath is practically a copy from the old soc_camera. The bug was tested with a pxa_camera+ov9640 combination during the conversion of the ov9640 from the soc_camera. Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Tested-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 missing sensor power onRobert Jarzmik2016-10-241-2/+10
| | | | | | | | | | | During sensors binding, there is a window where the sensor is switched off, while there is a call it to set a new format, which can end up in an access to the sensor, especially an I2C based sensor. Remove this window by activating the sensor. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] platform: don't break long linesMauro Carvalho Chehab2016-10-211-4/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. </script> use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } </script> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: remove duplicated include from pxa_camera.cWei Yongjun2016-09-191-1/+0Star
| | | | | | | | Remove duplicated include. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: fix error return code in pxa_camera_probe()Wei Yongjun2016-09-191-2/+6
| | | | | | | | | | | Fix to return error code -ENODEV from dma_request_slave_channel_compat() error handling case instead of 0, as done elsewhere in this function. Also fix to release resources in v4l2_clk_register() error handling. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: fix spelling mistake: "dequeud" -> "dequeued"Colin Ian King2016-09-191-1/+1
| | | | | | | | trivial fix to spelling mistake in pr_debug message Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: merge soc_mediabus.c into pxa_camera.cHans Verkuil2016-09-121-24/+458
| | | | | | | | | | | | | | | | | | | | | | | Linking soc_mediabus into this driver causes multiple definition linker warnings if soc_camera is also enabled: drivers/media/platform/soc_camera/built-in.o:(___ksymtab+soc_mbus_image_size+0x0): multiple definition of `__ksymtab_soc_mbus_image_size' drivers/media/platform/soc_camera/soc_mediabus.o:(___ksymtab+soc_mbus_image_size+0x0): first defined here >> drivers/media/platform/soc_camera/built-in.o:(___ksymtab+soc_mbus_samples_per_pixel+0x0): multiple definition of `__ksymtab_soc_mbus_samples_per_pixel' drivers/media/platform/soc_camera/soc_mediabus.o:(___ksymtab+soc_mbus_samples_per_pixel+0x0): first defined here drivers/media/platform/soc_camera/built-in.o: In function `soc_mbus_config_compatible': (.text+0x3840): multiple definition of `soc_mbus_config_compatible' drivers/media/platform/soc_camera/soc_mediabus.o:(.text+0x134): first defined here Since we really don't want to have to use any of the soc-camera code this patch copies the relevant code and data structures from soc_mediabus and renames it to pxa_mbus_*. The large table of formats has been culled a bit, removing formats that are not supported by this driver. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: remove an unused structure pointerMauro Carvalho Chehab2016-09-091-3/+0Star
| | | | | | | | | | | As reported by smatch: drivers/media/platform/pxa_camera.c: In function 'pxa_dma_start_channels': drivers/media/platform/pxa_camera.c:457:21: warning: variable 'active' set but not used [-Wunused-but-set-variable] struct pxa_buffer *active; ^~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] pxa_camera: make soc_mbus_xlate_by_fourcc() staticMauro Carvalho Chehab2016-09-091-2/+3
| | | | | | | | | | As warned by smatch: drivers/media/platform/pxa_camera.c:283:39: warning: no previous prototype for 'soc_mbus_xlate_by_fourcc' [-Wmissing-prototypes] const struct soc_camera_format_xlate *soc_mbus_xlate_by_fourcc( ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] media: platform: pxa_camera: fix styleRobert Jarzmik2016-09-091-0/+2
| | | | | | | | | This is a tiny fix for a switch case which quiets 2 checkpatch harmless warnings. The generated code is not affected. 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: move pxa_camera out of soc_cameraRobert Jarzmik2016-09-091-0/+2096
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>