Re: [PATCH v2 16/30] v4l: subdev: Add [GS]_ROUTING subdev ioctls and operations

2019-02-21 Thread Sakari Ailus
-off-by: Michal Simek > > > > - Add sink and source streams for multiplexed links > > - Copy the argument back in case of an error. This is needed to let the > > caller know the number of routes. > > > > Signed-off-by: Sakari Ailus > > Reviewed

Re: [PATCH yavta 0/3] Fixes for compound control support

2019-02-20 Thread Sakari Ailus
t numerical control type for unsupported types > Fix control array parsing > > yavta.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > Oh my. Aren't you planning to send v2 that would address the comments? That said, the changes seem fine to me. -- Sakari Ailus

Re: [PATCH yavta 0/7] Compound controls and controls reset support

2019-02-20 Thread Sakari Ailus
602 +++- > 1 file changed, 464 insertions(+), 138 deletions(-) > After ruminating the review comments which may lead to changes in the patches, please add: Acked-by: Sakari Ailus -- Sakari Ailus

Re: [PATCH yavta 6/7] Support setting control from values stored in a file

2019-02-20 Thread Sakari Ailus
o)); > + close(fd); > + return -EINVAL; > + } > + > + close(fd); > + return 0; > + } > + > if (*val++ != '{') > return -EINVAL; > -- Regards, Sakari Ailus

Re: [PATCH yavta 4/7] Implement compound control set support

2019-02-20 Thread Sakari Ailus
unsigned int i; > + char *endptr; > + __u32 value; > + > + for ( ; isspace(*val); ++val) { }; > + if (*val++ != '{') > + return -EINVAL; > + > + for (i = 0; i < query->elems; ++i) { > + for ( ; isspace(*val); ++val) { }; Why braces? Just wondering. :-) You could use any number of semicolons, too. There's more below. -- Sakari Ailus

Re: [PATCH yavta 3/7] Implement compound control get support

2019-02-20 Thread Sakari Ailus
Hi Laurent, On Wed, Feb 20, 2019 at 04:55:06PM +0200, Laurent Pinchart wrote: > Hi Sakari, > > On Wed, Feb 20, 2019 at 04:06:43PM +0200, Sakari Ailus wrote: > > On Wed, Feb 20, 2019 at 02:51:19PM +0200, Laurent Pinchart wrote: > > > Signed-off-by: Laurent Pinchart > &

Re: [PATCH yavta 1/7] yavta: Refactor video_list_controls()

2019-02-20 Thread Sakari Ailus
Hi Laurent, On Wed, Feb 20, 2019 at 04:07:53PM +0200, Laurent Pinchart wrote: > Hi Sakari, > > On Wed, Feb 20, 2019 at 03:21:57PM +0200, Sakari Ailus wrote: > > On Wed, Feb 20, 2019 at 02:51:17PM +0200, Laurent Pinchart wrote: > > > Separate iteration over controls fr

Re: [PATCH yavta 3/7] Implement compound control get support

2019-02-20 Thread Sakari Ailus
control 0x%08x current %s.\n", query->id, current); > + query->step, query->default_value); > + if (query->nr_of_dims) { > + for (i = 0; i < query->nr_of_dims; ++i) > + printf("[%u]", query->dims[i]); > + printf(" "); > + } > + } else { > + printf("control 0x%08x ", query->id); > + } > > - if (query->type == V4L2_CTRL_TYPE_STRING) > - free(ctrl.string); > + if (query->type == V4L2_CTRL_TYPE_BUTTON) { > + /* Button controls have no current value. */ > + printf("\n"); > + return 1; > + } > + > + printf("current "); > + > + ret = get_control(dev, query, &ctrl); > + if (ret < 0) { > + printf("n/a\n"); > + printf("unable to get control 0x%8.8x: %s (%d).\n", > + query->id, strerror(errno), errno); > + } else { > + video_print_control_value(query, &ctrl); > + printf("\n"); > + } > + > + if (query->flags & V4L2_CTRL_FLAG_HAS_PAYLOAD) > + free(ctrl.ptr); > > if (!full) > return 1; -- Regards, Sakari Ailus

Re: [RFCv2 PATCH] videodev2.h: introduce VIDIOC_DQ_EXT_EVENT

2019-02-20 Thread Sakari Ailus
of the struct is at the moment 120 bytes. The allocation done by the kernel is always 128 bytes anyway, and the ext control event above is just 12 bytes short of the maximum. I'd therefore add two more reserved fields. That's fine tuning though. The structs look very nice to me

Re: [PATCH yavta 1/7] yavta: Refactor video_list_controls()

2019-02-20 Thread Sakari Ailus
id = ret; > - nctrls++; > - } > - > - if (nctrls) > - printf("%u control%s found.\n", nctrls, nctrls > 1 ? "s" : ""); > + if (ret) > + printf("%u control%s found.\n", ret, ret > 1 ? "s" : ""); > else > printf("No control found.\n"); > } > @@ -2184,8 +2210,13 @@ int main(int argc, char *argv[]) > if (do_log_status) > video_log_status(&dev); > > - if (do_get_control) > - video_print_control(&dev, ctrl_name, false); > + if (do_get_control) { > + struct v4l2_queryctrl query; > + > + ret = query_control(&dev, ctrl_name, &query); > + if (ret == 0) > + video_print_control(&dev, &query, false); > + } > > if (do_set_control) > set_control(&dev, ctrl_name, ctrl_value); -- Cheers, Sakari Ailus

[PATCH 0/5] Fix most ImgU driver compiler / checker warnings

2019-02-20 Thread Sakari Ailus
the maximum size. I guess it wouldn't benefit anyone to split those memsets into two... Sakari Ailus (5): staging: imgu: Switch to __aligned() from __attribute__((aligned())) staging: imgu: Fix struct ipu3_uapi_awb_fr_config_s alignment staging: imgu: Remove redundant checks staging:

[PATCH 4/5] staging: imgu: Address compiler / checker warnings in MMU code

2019-02-20 Thread Sakari Ailus
Address C compiler, sparse and smatch warnings and little style issues in the IMGU MMU code. Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-mmu.c | 39 +++ 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/ipu3

[PATCH 5/5] Revert "media: ipu3: shut up warnings produced with W=1"

2019-02-20 Thread Sakari Ailus
This reverts commit 0bdfc56c13c0ffe003f28395fcde2cd9b5ea0622. The original patch suppressed compiler and checker warnings and those warnings have been addressed. Do not attempt to suppress these warnings anymore. Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/Makefile | 6

[PATCH 3/5] staging: imgu: Remove redundant checks

2019-02-20 Thread Sakari Ailus
Remove redundant checks for less than zero on unsigned variables. Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-css-fw.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/ipu3/ipu3-css-fw.c b/drivers/staging/media/ipu3/ipu3-css

[PATCH 1/5] staging: imgu: Switch to __aligned() from __attribute__((aligned()))

2019-02-20 Thread Sakari Ailus
__aligned() is preferred. The patch has been generated using the following command in the drivers/staging/media/ipu3 directory: $ git grep -l 'aligned(32)' | \ xargs perl -i -pe \ 's/__attribute__\s*\(\(\s*aligned\s*\(([0-9]+)\s*\)\s*\)\)/__aligned($1)/g;' S

[PATCH 2/5] staging: imgu: Fix struct ipu3_uapi_awb_fr_config_s alignment

2019-02-20 Thread Sakari Ailus
from the struct. Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/include/intel-ipu3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/ipu3/include/intel-ipu3.h b/drivers/staging/media/ipu3/include/intel-ipu3.h index cbb62643172be..4cdb4c79

Re: [PATCH 2/2] ipu3-mmu: fix some kernel-doc macros

2019-02-19 Thread Sakari Ailus
On Tue, Feb 19, 2019 at 09:00:30AM -0500, Mauro Carvalho Chehab wrote: > Some kernel-doc markups are wrong. fix them. > > Signed-off-by: Mauro Carvalho Chehab Acked-by: Sakari Ailus -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 1/2] media: ipu3: shut up warnings produced with W=1

2019-02-19 Thread Sakari Ailus
g, type-limits) > +ccflags-y += $(call cc-disable-warning, unused-const-variable) I'm preparing patches to address these. Could you wait a little bit more, please? Thanks. -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 04/14] media: i2c: fix several typos

2019-02-18 Thread Sakari Ailus
On Mon, Feb 18, 2019 at 02:28:58PM -0500, Mauro Carvalho Chehab wrote: > Use codespell to fix lots of typos over frontends. > > Manually verified to avoid false-positives. > > Signed-off-by: Mauro Carvalho Chehab Acked-by: Sakari Ailus -- Sakari Ailus

Re: [PATCH 3/3] media: tc358746: update MAINTAINERS file

2019-02-18 Thread Sakari Ailus
he DT bindings, in the same patch. I'd expect a new driver to be listed as "Maintained". "Odd Fixes" suggests no-one is particularly looking after it, and it's not nice if a new driver starts off like that. :-I -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH] media: v4l: ioctl: Sanitize num_planes before using it

2019-02-18 Thread Sakari Ailus
the num_planes check and instead clamp it to a sane value, > so we still make sure we don't overflow the planes array by accident. > > Fixes: 9048b2e15b11c5 ("media: v4l: ioctl: Validate num_planes before using > it") > Signed-off-by: Ezequiel Garcia Reviewed-by: Sakari Ailus -- Sakari Ailus

Re: [PATCH 2/3] media: tc358746: add Toshiba TC358746 Parallel to CSI-2 bridge driver

2019-02-18 Thread Sakari Ailus
Hi Marco, On Tue, Dec 18, 2018 at 03:12:39PM +0100, Marco Felsch wrote: > Adding support for the TC358746 bridge. The Bridge can receive images on > the parallel input port and send it to the host using the CSI-TX unit. > Furthermore the Bridge can receive images from the host using the CSI-RX > u

Re: [PATCH 1/3] media: dt-bindings: add bindings for Toshiba TC358746

2019-02-18 Thread Sakari Ailus
remote-endpoint = <µn_parallel_out>; > + }; > + }; > + > + port@1 { > + reg = <1>; > + > + tc358746_mipi2_out: endpoint { > + remote-endpoint = <&mipi_csi2_in>; > + data-lanes = <1 2>; > + clock-lanes = <0>; > + clock-noncontinuous; > + link-frequencies = /bits/ 64 <21600>; > + }; > + }; > + }; > +}; -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

[GIT PULL for 5.1] Ov7740 fix

2019-02-18 Thread Sakari Ailus
ov7740 fix Akinobu Mita (1): media: ov7740: fix runtime pm initialization drivers/media/i2c/ov7740.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- Sakari Ailus

Re: IPU3 smatch/sparse warnings

2019-02-16 Thread Sakari Ailus
other ipu3 warnings all seem trivial to fix. > > I'm trying to get the build to run without sparse/smatch warnings, so > getting this fixed will be very useful. I'll try to get this done early next week. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[GIT PULL for 5.1] sun6 A64 CSI support and address an imgu TODO item

2019-02-14 Thread Sakari Ailus
ivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 11 ++ 5 files changed, 171 insertions(+), 109 deletions(-) -- Sakari Ailus

[PATCH 1/1] soc_camera: Rename files for mt9t031 and imx074

2019-02-09 Thread Sakari Ailus
Rename files (as well as modules) of the mt9t031 and imx074 SoC camera drivers to align with the rest of them, i.e. adding the "soc_" prefix. Signed-off-by: Sakari Ailus --- This goes on top of my previous SoC camera patches. drivers/staging/media/soc_camera/Makefile

[PATCH 1/1] soc_camera: Rename files for mt9t031 and imx074

2019-02-09 Thread Sakari Ailus
Rename files (as well as modules) of the mt9t031 and imx074 SoC camera drivers to align with the rest of them, i.e. adding the "soc_" prefix. Signed-off-by: Sakari Ailus --- This goes on top of my previous SoC camera patches. drivers/staging/media/soc_camera/Makefile

Re: [RFC PATCH V0 3/7] [media] dt-bindings: mt8183: Added DIP-SMEM dt-bindings

2019-02-09 Thread Sakari Ailus
xt for the detail. > + > +Example: > + isp_smem: isp_smem { > + compatible = "mediatek,isp_smem"; > + mediatek,larb = <&larb5>; > + iommus = <&iommu M4U_PORT_CAM_IMGI>; > + }; -- Kind regards, Sakari Ailus

Re: [RFC PATCH V0 1/7] [media] dt-bindings: mt8183: Add binding for DIP shared memory

2019-02-09 Thread Sakari Ailus
#size-cells = <2>; > + ranges; > + reserve-memory-isp_smem { > + compatible = "mediatek,reserve-memory-dip_smem"; > + size = <0 0x140>; > + alignment = <0 0x1000>; > + alloc-ranges = <0 0x4000 0 0x5000>; > + }; > + }; -- Kind regards, Sakari Ailus

[PATCH 1/1] soc_camera: Remove Kconfig leftovers from mt9m111 driver

2019-02-09 Thread Sakari Ailus
The mt9m111 SoC camera driver has been removed, remove its Kconfig leftovers as well. Reported-by: Akinobu Mita Signed-off-by: Sakari Ailus --- This goes on top of my set moving the SoC camera to staging. drivers/staging/media/soc_camera/Kconfig | 10 -- 1 file changed, 10 deletions

Re: [PATCH 2/4] media: mt9m111: add VIDEO_V4L2_SUBDEV_API dependency

2019-02-09 Thread Sakari Ailus
his build error can be fixed by removing SOC_CAMERA_MT9M111 from > drivers/media/i2c/soc_camera/Kconfig. Ah, thanks, I was wondering what this could have been about. :-) I'll send a patch. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 3/5] media: sunxi: Add A10 CSI driver

2019-02-08 Thread Sakari Ailus
Hi Maxime, On Wed, Feb 06, 2019 at 10:16:05PM +0100, Maxime Ripard wrote: > Hi Sakari, > > Thanks for your review, I have a few questions though, and the rest > will be addressed in the next version. > > On Tue, Jan 29, 2019 at 02:39:49PM +0200, Sakari Ailus wrote:

[GIT PULL for 5.1] Move SoC camera to staging, mark as BROKEN

2019-02-08 Thread Sakari Ailus
) no SoC camera Sakari Ailus (6): soc_camera: Remove the mt9m001 SoC camera sensor driver soc_camera: Remove the rj45n1 SoC camera sensor driver soc_camera: Move to the staging tree soc_camera: Move the

[GIT PULL for 5.1] Sensor and imgu driver patches

2019-02-08 Thread Sakari Ailus
media/ipu3/ipu3.h| 18 +- 19 files changed, 881 insertions(+), 825 deletions(-) -- Sakari Ailus

Re: [PATCH] v4l2-subdev.h: v4l2_subdev_call: use temp __sd variable

2019-02-08 Thread Sakari Ailus
d. > > This also avoids any potential side-effects of evaluating sd. > > Signed-off-by: Hans Verkuil Nice one! Acked-by: Sakari Ailus I wonder if this addresses some of the sparse issues related to using a macro to come up with sd? > --- > diff --git a/include/media/v4l2

Re: [PATCH 0/4] Move SoC camera to staging, depend on BROKEN

2019-02-08 Thread Sakari Ailus
On Fri, Feb 08, 2019 at 10:41:43AM +0200, Sakari Ailus wrote: > Hi all, > > This series moves the SoC camera framework and the remaining drivers under > the staging tree and makes them depend on BROKEN. > > The files could be later removed. > > Sakari Ailus (4): >

[PATCH 4/4] soc_camera: Depend on BROKEN

2019-02-08 Thread Sakari Ailus
without having to go to see development history in git. Signed-off-by: Sakari Ailus --- drivers/staging/media/soc_camera/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/soc_camera/Kconfig b/drivers/staging/media/soc_camera/Kconfig index

[PATCH 3/4] soc_camera: Move the mt9t031 under soc_camera directory

2019-02-08 Thread Sakari Ailus
Move the mt9t031 driver to the soc_camera directory in the media staging tree. Signed-off-by: Sakari Ailus --- drivers/staging/media/Kconfig | 2 -- drivers/staging/media/Makefile | 1 - drivers/staging/media/soc_camera/Kconfig

[PATCH 1/4] soc_camera: Move to the staging tree

2019-02-08 Thread Sakari Ailus
The SoC camera framework has no functional drivers left, something that has not changed for years. Move the leftovers to the staging tree. Signed-off-by: Sakari Ailus --- drivers/media/i2c/Kconfig | 8 drivers/media/i2c/Makefile

[PATCH 0/4] Move SoC camera to staging, depend on BROKEN

2019-02-08 Thread Sakari Ailus
Hi all, This series moves the SoC camera framework and the remaining drivers under the staging tree and makes them depend on BROKEN. The files could be later removed. Sakari Ailus (4): soc_camera: Move to the staging tree soc_camera: Move the imx074 under soc_camera directory soc_camera

[PATCH 2/4] soc_camera: Move the imx074 under soc_camera directory

2019-02-08 Thread Sakari Ailus
Move the imx074 driver to the soc_camera directory in the media staging tree. Signed-off-by: Sakari Ailus --- drivers/staging/media/Kconfig | 2 -- drivers/staging/media/Makefile| 1 - drivers/staging/media/imx074/Kconfig | 5

Re: [PATCH] lib/scatterlist: Provide a DMA page iterator

2019-02-07 Thread Sakari Ailus
works as expected with all sglists. A new > iterator type is introduced to provide compile-time safety against wrongly > mixing accessors and iterators. > > Signed-off-by: Jason Gunthorpe Acked-by: Sakari Ailus (ipu3-cio2) -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 7/6] omap4iss: fix sparse warning

2019-02-07 Thread Sakari Ailus
xpression (4 0) > drivers/staging/media/omap4iss/iss.c:141:15: warning: unknown expression (4 0) > > Signed-off-by: Hans Verkuil > --- > Same fix as for omap3isp. I discovered that staging drivers weren't built by > the > daily build, so I never noticed these warnings.

Re: [PATCH 5/6] omap3isp: fix sparse warning

2019-02-07 Thread Sakari Ailus
On Thu, Feb 07, 2019 at 10:13:37AM +0100, Hans Verkuil wrote: > drivers/media/platform/omap3isp/ispvideo.c:1013:15: warning: unknown > expression (4 0) > > Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 6/6] pxa_camera: fix smatch warning

2019-02-07 Thread Sakari Ailus
ata is provided, > and if neither is provided just return with -ENODEV. > > Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 00/13] media: mt9m001: switch soc_mt9m001 to a standard subdev sensor driver

2019-02-06 Thread Sakari Ailus
On Tue, Feb 05, 2019 at 10:39:56PM +0900, Akinobu Mita wrote: > 2019年2月4日(月) 18:06 Sakari Ailus : > > > > Hi Mita-san, > > > > On Tue, Jan 08, 2019 at 11:51:37PM +0900, Akinobu Mita wrote: > > > This patchset converts soc_camera mt9m001 driver to a

Re: [PATCH 6/6] media: ov5640: Consolidate JPEG compression mode setting

2019-02-05 Thread Sakari Ailus
On Tue, Feb 05, 2019 at 09:50:47PM +0800, Chen-Yu Tsai wrote: > On Tue, Feb 5, 2019 at 4:55 PM Sakari Ailus > wrote: > > > > Hi Chen-Yu, > > > > On Fri, Jan 18, 2019 at 04:52:06PM +0800, Chen-Yu Tsai wrote: > > > The register value lists for all the supporte

Re: [PATCH v12 00/13] media: staging/imx7: add i.MX7 media driver

2019-02-05 Thread Sakari Ailus
ce unregister before ctrl_handler_free > - GPL => GPL v2 > - Fix squash of CSI patches, issue on v11 > - add Acked-by: Sakari Ailus 10--13 > - mipi_s_stream check for ret < 0 and call pm_runtime_put_noidle > - use __maybe_unused in pm functions > - Extra space before labels For patches 1, 2 and 4: Acked-by: Sakari Ailus Thanks! -- Sakari Ailus sakari.ai...@linux.intel.com

Re: compile error at sun6i_video

2019-02-05 Thread Sakari Ailus
ruct media_pad *pad); > ~~^~~ Do you have the patches Niklas's v4l2/mux (or my vc) branch in your tree? They change a few things on the way and drivers need to be converted. Drivers that have been added since the patches were written do need to be converted as well, and I suppose the sun6i_video driver is one of them. Cc Niklas. -- Kind regards, Sakari Ailus

Re: [PATCH] media: vb2: Fix compilation warning

2019-02-05 Thread Sakari Ailus
ers/media/common/videobuf2/videobuf2-core.c > @@ -1769,7 +1769,6 @@ EXPORT_SYMBOL_GPL(vb2_wait_for_all_buffers); > static void __vb2_dqbuf(struct vb2_buffer *vb) > { > struct vb2_queue *q = vb->vb2_queue; > - unsigned int i; > > /* nothing to do if the buffer is already dequeued */ > if (vb->state == VB2_BUF_STATE_DEQUEUED) -- Sakari Ailus

Re: [PATCH 6/6] media: ov5640: Consolidate JPEG compression mode setting

2019-02-05 Thread Sakari Ailus
> *sensor, > { > int ret; > > + /* > + * compression mode 3 timing > + * > + * Data is transmitted with programmable width (VFIFO_HSIZE). > + * No padding done. Last line may have less data. Varying > + * number of lines per frame, depending on amount of data. > + */ > + ret = ov5640_mod_reg(sensor, OV5640_REG_JPEG_MODE_SELECT, 0x7, 0x3); > + if (ret < 0) > + return ret; > + > ret = ov5640_write_reg16(sensor, OV5640_REG_VFIFO_HSIZE, mode->hact); > if (ret < 0) > return ret; -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[GIT PULL for 5.1] Ipu3 patches

2019-02-04 Thread Sakari Ailus
| 11 +-- 5 files changed, 20 insertions(+), 22 deletions(-) -- Sakari Ailus

[PATCH 1/2] soc_camera: Remove the mt9m001 SoC camera sensor driver

2019-02-04 Thread Sakari Ailus
There is a V4L2 sub-device sensor driver for the mt9m001. Remove the SoC camera one. Signed-off-by: Sakari Ailus --- drivers/media/i2c/soc_camera/Kconfig | 7 - drivers/media/i2c/soc_camera/Makefile | 1 - drivers/media/i2c/soc_camera/soc_mt9m001.c | 757

[PATCH 0/2] Remove more SoC camera sensor drivers

2019-02-04 Thread Sakari Ailus
Hi folks, This set removes two additional SoC camera sensor drivers that have corresponding V4L2 sub-device drivers. Sakari Ailus (2): soc_camera: Remove the mt9m001 SoC camera sensor driver soc_camera: Remove the rj45n1 SoC camera sensor driver drivers/media/i2c/soc_camera/Kconfig

[PATCH 2/2] soc_camera: Remove the rj45n1 SoC camera sensor driver

2019-02-04 Thread Sakari Ailus
There is a V4L2 sub-device sensor driver for the rj45n1. Remove the SoC camera one. Signed-off-by: Sakari Ailus --- drivers/media/i2c/soc_camera/Kconfig |6 - drivers/media/i2c/soc_camera/Makefile |1 - drivers/media/i2c/soc_camera/soc_rj54n1cb0c.c | 1415

Re: [PATCH v2 00/13] media: mt9m001: switch soc_mt9m001 to a standard subdev sensor driver

2019-02-04 Thread Sakari Ailus
a MAINTAINERS entry for it. The same applies to the mt9m111 driver. Could you provide the MAINTAINERS entries for the two drivers, please? Thanks. -- Kind regards, Sakari Ailus

Re: [PATCH][next] media: staging: intel-ipu3: fix unsigned comparison with < 0

2019-02-04 Thread Sakari Ailus
r); > > + if (ret < 0) { > > dev_err(css->dev, "failed to find suitable binary\n"); > > return -EINVAL; > > } > > + css->pipes[pipe].bindex = ret; > > > > dev_dbg(css->dev, "Binary index %d for pipe %d found.", > > css->pipes[pipe].bindex, pipe); > > > -- Sakari Ailus sakari.ai...@linux.intel.com

[v4l-utils PATCH v4 1/1] v4l2-ctl: Add support for META_OUTPUT buffer type

2019-02-02 Thread Sakari Ailus
Add support for META_OUTPUT buffer type to v4l2-ctl. Signed-off-by: Sakari Ailus --- Hi Hans, others, Here's v4 with the required changed committed. utils/v4l2-ctl/v4l2-ctl-meta.cpp | 92 ++-- utils/v4l2-ctl/v4l2-ctl.cpp | 7 +++ utils/v4l2-ctl

Re: [v4l-utils PATCH v3 1/1] v4l2-ctl: Add support for META_OUTPUT buffer type

2019-02-02 Thread Sakari Ailus
On Sat, Feb 02, 2019 at 10:38:58AM +0100, Hans Verkuil wrote: > On 02/01/2019 02:51 PM, Sakari Ailus wrote: > > Add support for META_OUTPUT buffer type to v4l2-ctl. > > > > Signed-off-by: Sakari Ailus > > --- > > Hi Hans, others, > > > > I'

[v4l-utils PATCH v3 1/1] v4l2-ctl: Add support for META_OUTPUT buffer type

2019-02-01 Thread Sakari Ailus
Add support for META_OUTPUT buffer type to v4l2-ctl. Signed-off-by: Sakari Ailus --- Hi Hans, others, I've reworked the patch to match with the way SDR is implemented: the options for setting the format work independently of the node type. I like this better than the previous one; the

Re: [GIT FIXES FOR v5.0] v4l2-ioctl: Clear only per-plane reserved fields

2019-02-01 Thread Sakari Ailus
On Sat, Jan 12, 2019 at 10:17:47AM +0100, Hans Verkuil wrote: > On 1/11/19 10:10 PM, Sakari Ailus wrote: > > Hi Hans, > > > > On Fri, Jan 11, 2019 at 09:31:25AM +0100, Hans Verkuil wrote: > >> Three fixes for a bug introduced in 5.0. > >> > >&g

Re: [PATCH 3/3] Staging: media: ipu3: fixed max charecter style issue

2019-02-01 Thread Sakari Ailus
->queue[b->queue].bufs); > @@ -2071,7 +2078,8 @@ struct ipu3_css_buffer *ipu3_css_buf_dequeue(struct > ipu3_css *css) > return ERR_PTR(-EIO); > } > > - dev_dbg(css->dev, "buffer 0x%8x done from pipe %d\n", daddr, > pipe); > + dev_dbg(css->dev, "buffer 0x%8x done from pipe %d\n", > + daddr, pipe); > b->pipe = pipe; > b->state = IPU3_CSS_BUFFER_DONE; > list_del(&b->list); > @@ -2203,7 +2211,8 @@ int ipu3_css_set_parameters(struct ipu3_css *css, > unsigned int pipe, > /* get acc_old */ > map = ipu3_css_pool_last(&css_pipe->pool.acc, 1); > /* user acc */ > - r = ipu3_css_cfg_acc(css, pipe, use, acc, map->vaddr, > + r = ipu3_css_cfg_acc > + (css, pipe, use, acc, map->vaddr, > set_params ? &set_params->acc_param : NULL); > if (r < 0) > goto fail; > @@ -2239,7 +2248,8 @@ int ipu3_css_set_parameters(struct ipu3_css *css, > unsigned int pipe, > ipu3_css_pool_get(&css_pipe->pool.gdc); > map = ipu3_css_pool_last(&css_pipe->pool.gdc, 0); > gdc = map->vaddr; > - ipu3_css_cfg_gdc_table(map->vaddr, > + ipu3_css_cfg_gdc_table > + (map->vaddr, > css_pipe->aux_frames[a].bytesperline / > css_pipe->aux_frames[a].bytesperpixel, > css_pipe->aux_frames[a].height, > @@ -2334,12 +2344,12 @@ int ipu3_css_set_parameters(struct ipu3_css *css, > unsigned int pipe, > if (obgrid) > ipu3_css_pool_put(&css_pipe->pool.obgrid); > if (vmem0) > - ipu3_css_pool_put( > - &css_pipe->pool.binary_params_p > + ipu3_css_pool_put > + (&css_pipe->pool.binary_params_p > [IMGU_ABI_MEM_ISP_VMEM0]); > if (dmem0) > - ipu3_css_pool_put( > - &css_pipe->pool.binary_params_p > + ipu3_css_pool_put > + (&css_pipe->pool.binary_params_p > [IMGU_ABI_MEM_ISP_DMEM0]); > > fail_no_put: -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 0/8] Preparing for Y2038 support

2019-02-01 Thread Sakari Ailus
structures. It also ensures consistent > behavior for all media drivers. Acked-by: Sakari Ailus -- Sakari Ailus

Re: [PATCH v2 2/2] media: ipu3-imgu: Remove dead code for NULL check

2019-02-01 Thread Sakari Ailus
hat from him off-list? If he hasn't given one, please send v3 without that tag. Thanks. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH] media: staging/intel-ipu3: Implement lock for stream on/off operations

2019-01-31 Thread Sakari Ailus
Hi Raj, On Wed, Jan 30, 2019 at 05:17:15PM +, Mani, Rajmohan wrote: > Hi Sakari, > > > -Original Message- > > From: Sakari Ailus [mailto:sakari.ai...@linux.intel.com] > > Sent: Wednesday, January 30, 2019 12:59 AM > > To: Mani, Rajmohan > > Cc

Re: [PATCH v2 1/1] uvc: Avoid NULL pointer dereference at the end of streaming

2019-01-30 Thread Sakari Ailus
s: > 5d0fd3c806b9 ("[media] uvcvideo: Disable hardware timestamps by default") > > > How should we proceed with this patch? IMO 5d0fd3c806b9 should be applied as well. It's effectively a bugfix as well (but which also, for most users, covered the problem fixed

Re: [PATCH v11 05/13] media: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7

2019-01-30 Thread Sakari Ailus
events, mipi_csis_events, sizeof(state->events)); > + > + mipi_csis_debugfs_init(state); > + pm_runtime_enable(dev); > + if (!pm_runtime_enabled(dev)) { > + ret = mipi_csis_pm_resume(dev, true); > + if (ret < 0) > + goto unregister_all; > + } > + > + dev_info(&pdev->dev, "lanes: %d, hs_settle: %d, wclk: %d, freq: %u\n", > + state->bus.num_data_lanes, state->hs_settle, > + state->wrap_clk ? 1 : 0, state->clk_frequency); > + > + return 0; > + > +unregister_all: > + mipi_csis_debugfs_exit(state); > + media_entity_cleanup(&state->mipi_sd.entity); > +unregister_subdev: > + v4l2_async_unregister_subdev(&state->mipi_sd); > +disable_clock: > + mipi_csis_clk_disable(state); > + mutex_destroy(&state->lock); > + > + return ret; > +} > + > +static int mipi_csis_pm_suspend(struct device *dev, bool runtime) > +{ > + struct platform_device *pdev = to_platform_device(dev); > + struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev); > + struct csi_state *state = mipi_sd_to_csis_state(mipi_sd); > + int ret = 0; > + > + mutex_lock(&state->lock); > + if (state->flags & ST_POWERED) { > + mipi_csis_stop_stream(state); > + ret = regulator_disable(state->mipi_phy_regulator); > + if (ret) > + goto unlock; > + mipi_csis_clk_disable(state); > + state->flags &= ~ST_POWERED; > + if (!runtime) > + state->flags |= ST_SUSPENDED; > + } > + > + unlock: Extra space here. > + mutex_unlock(&state->lock); > + > + return ret ? -EAGAIN : 0; > +} > + > +static int mipi_csis_pm_resume(struct device *dev, bool runtime) > +{ > + struct platform_device *pdev = to_platform_device(dev); > + struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev); > + struct csi_state *state = mipi_sd_to_csis_state(mipi_sd); > + int ret = 0; > + > + mutex_lock(&state->lock); > + if (!runtime && !(state->flags & ST_SUSPENDED)) > + goto unlock; > + > + if (!(state->flags & ST_POWERED)) { > + ret = regulator_enable(state->mipi_phy_regulator); > + if (ret) > + goto unlock; > + > + state->flags |= ST_POWERED; > + mipi_csis_clk_enable(state); > + } > + if (state->flags & ST_STREAMING) > + mipi_csis_start_stream(state); > + > + state->flags &= ~ST_SUSPENDED; > + > + unlock: Ditto. > + mutex_unlock(&state->lock); > + > + return ret ? -EAGAIN : 0; > +} > + > +static int mipi_csis_suspend(struct device *dev) > +{ > + return mipi_csis_pm_suspend(dev, false); > +} > + > +static int mipi_csis_resume(struct device *dev) > +{ > + return mipi_csis_pm_resume(dev, false); > +} > + > +static int mipi_csis_runtime_suspend(struct device *dev) > +{ > + return mipi_csis_pm_suspend(dev, true); > +} > + > +static int mipi_csis_runtime_resume(struct device *dev) __maybe_unused for these four? > +{ > + return mipi_csis_pm_resume(dev, true); > +} > + > +static int mipi_csis_remove(struct platform_device *pdev) > +{ > + struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev); > + struct csi_state *state = mipi_sd_to_csis_state(mipi_sd); > + > + mipi_csis_debugfs_exit(state); > + v4l2_async_unregister_subdev(&state->mipi_sd); > + v4l2_async_notifier_unregister(&state->subdev_notifier); > + > + pm_runtime_disable(&pdev->dev); > + mipi_csis_pm_suspend(&pdev->dev, true); > + mipi_csis_clk_disable(state); > + media_entity_cleanup(&state->mipi_sd.entity); > + mutex_destroy(&state->lock); > + pm_runtime_set_suspended(&pdev->dev); > + > + return 0; > +} > + > +static const struct dev_pm_ops mipi_csis_pm_ops = { > + SET_RUNTIME_PM_OPS(mipi_csis_runtime_suspend, mipi_csis_runtime_resume, > +NULL) > + SET_SYSTEM_SLEEP_PM_OPS(mipi_csis_suspend, mipi_csis_resume) > +}; > + > +static const struct of_device_id mipi_csis_of_match[] = { > + { .compatible = "fsl,imx7-mipi-csi2", }, > + { /* sentinel */ }, > +}; > +MODULE_DEVICE_TABLE(of, mipi_csis_of_match); > + > +static struct platform_driver mipi_csis_driver = { > + .probe = mipi_csis_probe, > + .remove = mipi_csis_remove, > + .driver = { > + .of_match_table = mipi_csis_of_match, > + .name = CSIS_DRIVER_NAME, > + .pm = &mipi_csis_pm_ops, > + }, > +}; > + > +module_platform_driver(mipi_csis_driver); > + > +MODULE_DESCRIPTION("i.MX7 MIPI CSI-2 Receiver driver"); > +MODULE_LICENSE("GPL"); "GPL" or "GPL v2"? > +MODULE_ALIAS("platform:imx7-mipi-csi2"); -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v11 00/13] media: staging/imx7: add i.MX7 media driver

2019-01-30 Thread Sakari Ailus
> The csi and mipi-csi entities pass all compliance tests. For patches 1, 4 and 10--13: Acked-by: Sakari Ailus -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v11 03/13] media: staging/imx7: add imx7 CSI subdev driver

2019-01-30 Thread Sakari Ailus
;clks), > + GFP_KERNEL); > + > + if (!csi->clks) > + return -ENOMEM; > + > + for (i = 0; i < csi->num_clks; i++) > + csi->clks[i].id = imx7_csi_clk_id[i]; > + > + return devm_clk_bulk_get(dev, csi->num_clks, csi->clks); > +} > + > +static int imx7_csi_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct device_node *node = dev->of_node; > + struct imx_media_dev *imxmd; > + struct imx7_csi *csi; > + struct resource *res; > + int ret; > + > + csi = devm_kzalloc(&pdev->dev, sizeof(*csi), GFP_KERNEL); > + if (!csi) > + return -ENOMEM; > + > + platform_set_drvdata(pdev, &csi->sd); > + csi->dev = dev; > + > + ret = imx7_csi_clocks_get(csi); > + if (ret < 0) { > + dev_err(dev, "Failed to get clocks"); > + return -ENODEV; > + } > + > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + csi->irq = platform_get_irq(pdev, 0); > + if (!res || csi->irq < 0) { > + dev_err(dev, "Missing platform resources data\n"); > + return -ENODEV; > + } > + > + csi->regbase = devm_ioremap_resource(dev, res); > + if (IS_ERR(csi->regbase)) { > + dev_err(dev, "Failed platform resources map\n"); > + return -ENODEV; > + } > + > + spin_lock_init(&csi->irqlock); > + mutex_init(&csi->lock); > + > + /* install interrupt handler */ > + ret = devm_request_irq(dev, csi->irq, imx7_csi_irq_handler, 0, "csi", > +(void *)csi); > + if (ret < 0) { > + dev_err(dev, "Request CSI IRQ failed.\n"); > + ret = -ENODEV; > + goto destroy_mutex; > + } > + > + /* add media device */ > + imxmd = imx_media_dev_init(dev); > + if (IS_ERR(imxmd)) { > + ret = PTR_ERR(imxmd); > + goto destroy_mutex; > + } > + > + ret = imx_media_of_add_csi(imxmd, node); > + if (ret < 0) > + goto cleanup; > + > + ret = imx_media_dev_notifier_register(imxmd); > + if (ret < 0) > + goto cleanup; > + > + csi->imxmd = imxmd; > + v4l2_subdev_init(&csi->sd, &imx7_csi_subdev_ops); > + v4l2_set_subdevdata(&csi->sd, csi); > + csi->sd.internal_ops = &imx7_csi_internal_ops; > + csi->sd.entity.ops = &imx7_csi_entity_ops; > + csi->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; > + csi->sd.dev = &pdev->dev; > + csi->sd.owner = THIS_MODULE; > + csi->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE; > + csi->sd.grp_id = IMX_MEDIA_GRP_ID_CSI; > + snprintf(csi->sd.name, sizeof(csi->sd.name), "csi"); > + > + csi->vdev = imx_media_capture_device_init(&csi->sd, IMX7_CSI_PAD_SRC); > + if (IS_ERR(csi->vdev)) > + return PTR_ERR(csi->vdev); > + > + v4l2_ctrl_handler_init(&csi->ctrl_hdlr, 0); > + csi->sd.ctrl_handler = &csi->ctrl_hdlr; > + > + ret = v4l2_async_register_fwnode_subdev(&csi->sd, > + sizeof(struct v4l2_async_subdev), > + NULL, 0, imx7_csi_parse_endpoint); > + if (ret) > + goto free; > + > + return 0; > + > +free: > + v4l2_ctrl_handler_free(&csi->ctrl_hdlr); > + imx_media_capture_device_remove(csi->vdev); > + > +cleanup: > + v4l2_async_notifier_cleanup(&imxmd->notifier); > + v4l2_device_unregister(&imxmd->v4l2_dev); > + media_device_cleanup(&imxmd->md); > + > +destroy_mutex: > + mutex_destroy(&csi->lock); > + > + return ret; > +} > + > +static int imx7_csi_remove(struct platform_device *pdev) > +{ > + struct v4l2_subdev *sd = platform_get_drvdata(pdev); > + struct imx7_csi *csi = v4l2_get_subdevdata(sd); > + struct imx_media_dev *imxmd = csi->imxmd; > + > + imx_media_capture_device_remove(csi->vdev); I think you're missing v4l2_async_notifier_unregister() here. > + v4l2_async_notifier_cleanup(&imxmd->notifier); > + v4l2_device_unregister(&imxmd->v4l2_dev); Where is the media device unregistered? That should come before freeing control handlers --- the same for unregistering video devices. > + media_device_cleanup(&imxmd->md); > + media_entity_cleanup(&sd->entity); > + v4l2_async_unregister_subdev(sd); > + v4l2_ctrl_handler_free(&csi->ctrl_hdlr); > + mutex_destroy(&csi->lock); > + > + return 0; > +} > + > +static const struct of_device_id imx7_csi_of_match[] = { > + { .compatible = "fsl,imx7-csi" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, imx7_csi_of_match); > + > +static struct platform_driver imx7_csi_driver = { > + .probe = imx7_csi_probe, > + .remove = imx7_csi_remove, > + .driver = { > + .of_match_table = imx7_csi_of_match, > + .name = "imx7-csi", > + }, > +}; > +module_platform_driver(imx7_csi_driver); > + > +MODULE_DESCRIPTION("i.MX7 CSI subdev driver"); > +MODULE_AUTHOR("Rui Miguel Silva "); > +MODULE_LICENSE("GPL"); "GPL" or "GPL v2"? > +MODULE_ALIAS("platform:imx7-csi"); -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 2/2] media: atmel-isc: Update device tree binding documentation

2019-01-30 Thread Sakari Ailus
Hi Ken, On Tue, Jan 29, 2019 at 08:22:48PM +, Ken Sloat wrote: > > -Original Message- > > From: Sakari Ailus > > Sent: Wednesday, January 23, 2019 7:46 AM > > Cc: eugen.hris...@microchip.com; mche...@kernel.org; > > nicolas.fe...@microchip.com;

[PATCH v2 1/1] uvc: Avoid NULL pointer dereference at the end of streaming

2019-01-30 Thread Sakari Ailus
evi Rapolu Signed-off-by: Sakari Ailus Cc: sta...@vger.kernel.org Reviewed-by: Laurent Pinchart --- since v1: - Improve the comment in uvc_video_clock_update(). - Add appropriate Cc: stable, Reviewed-by: and Fixes: tags. drivers/media/usb/uvc/uvc_video.c | 8 1 file changed, 8 insertion

Re: [PATCH 1/1] uvc: Avoid NULL pointer dereference at the end of streaming

2019-01-30 Thread Sakari Ailus
Hi Laurent, On Wed, Jan 30, 2019 at 11:17:37AM +0200, Laurent Pinchart wrote: > Hi Sakari, > > Thank you for the patch. > > On Tue, Jan 29, 2019 at 11:49:44PM +0200, Sakari Ailus wrote: > > The UVC video driver converts the timestamp from hardware specific unit to > >

Re: [PATCH] media: staging/intel-ipu3: Implement lock for stream on/off operations

2019-01-30 Thread Sakari Ailus
> } > > static int __maybe_unused imgu_suspend(struct device *dev) > diff --git a/drivers/staging/media/ipu3/ipu3.h > b/drivers/staging/media/ipu3/ipu3.h > index 04fc99f47ebb..f732315f0701 100644 > --- a/drivers/staging/media/ipu3/ipu3.h > +++ b/drivers/staging/media/ipu3/ipu3.h > @@ -146,6 +146,10 @@ struct imgu_device { >* vid_buf.list and css->queue >*/ > struct mutex lock; > + > + /* Lock to protect writes to streaming flag in this struct */ > + struct mutex streaming_lock; > + > /* Forbit streaming and buffer queuing during system suspend. */ > atomic_t qbuf_barrier; > /* Indicate if system suspend take place while imgu is streaming. */ -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[PATCH 1/1] uvc: Avoid NULL pointer dereference at the end of streaming

2019-01-29 Thread Sakari Ailus
. The above is serialised by a queue specific mutex. Address the problem by skipping the clock conversion if the hardware clock sample array is already released. Reported-by: Chiranjeevi Rapolu Tested-by: Chiranjeevi Rapolu Signed-off-by: Sakari Ailus --- Hi Laurent, This seems like something

Re: devicetree: media: Documentation of Bt.656 Bus DT bindings

2019-01-29 Thread Sakari Ailus
lel (Bt.601?) interfaces. This should be documented so that new devices would use the bus type. The existing bindings still need to be supported in drivers though. I cc'd the devicetree list as well. > > > > Thanks, > > Ken Sloat > > > > I certainly agree that this should be updated to make it all consistent. -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 3/5] media: sunxi: Add A10 CSI driver

2019-01-29 Thread Sakari Ailus
> +{ > + struct sun4i_csi *csi = video_drvdata(file); > + > + return _csi_try_fmt(csi, &f->fmt.pix_mp, NULL); > +} > + > +static int csi_s_fmt_vid_cap(struct file *file, void *priv, > + struct v4l2_format *f) > +{ > + const struct sun4i_csi_format *fmt; > + struct sun4i_csi *csi = video_drvdata(file); > + int ret; > + > + ret = _csi_try_fmt(csi, &f->fmt.pix_mp, &fmt); > + if (ret) > + return ret; _csi_try_fmt() always returns 0. You could change the return type to void. > + > + csi->v_fmt = f->fmt.pix_mp; > + csi->p_fmt = fmt; > + > + return 0; > +} > + > +static int csi_g_fmt_vid_cap(struct file *file, void *priv, > + struct v4l2_format *f) > +{ > + struct sun4i_csi *csi = video_drvdata(file); > + > + f->fmt.pix_mp = csi->v_fmt; > + > + return 0; > +} > + > +static int csi_enum_fmt_vid_cap(struct file *file, void *priv, > + struct v4l2_fmtdesc *f) > +{ > + if (f->index >= ARRAY_SIZE(csi_formats)) > + return -EINVAL; > + > + f->pixelformat = csi_formats[f->index].fourcc; > + > + return 0; > +} > + > +static const struct v4l2_ioctl_ops csi_ioctl_ops = { > + .vidioc_querycap= csi_querycap, > + > + .vidioc_enum_fmt_vid_cap_mplane = csi_enum_fmt_vid_cap, > + .vidioc_g_fmt_vid_cap_mplane= csi_g_fmt_vid_cap, > + .vidioc_s_fmt_vid_cap_mplane= csi_s_fmt_vid_cap, > + .vidioc_try_fmt_vid_cap_mplane = csi_try_fmt_vid_cap, > + > + .vidioc_enum_input = csi_enum_input, > + .vidioc_g_input = csi_g_input, > + .vidioc_s_input = csi_s_input, > + > + .vidioc_reqbufs = vb2_ioctl_reqbufs, > + .vidioc_create_bufs = vb2_ioctl_create_bufs, > + .vidioc_querybuf= vb2_ioctl_querybuf, > + .vidioc_qbuf= vb2_ioctl_qbuf, > + .vidioc_dqbuf = vb2_ioctl_dqbuf, > + .vidioc_expbuf = vb2_ioctl_expbuf, > + .vidioc_prepare_buf = vb2_ioctl_prepare_buf, > + .vidioc_streamon= vb2_ioctl_streamon, > + .vidioc_streamoff = vb2_ioctl_streamoff, > +}; > + > +static int csi_open(struct file *file) > +{ > + struct sun4i_csi *csi = video_drvdata(file); > + int ret; > + > + ret = mutex_lock_interruptible(&csi->lock); > + if (ret) > + return ret; > + > + ret = pm_runtime_get_sync(csi->dev); > + if (ret < 0) > + goto err_unlock; If pm_runtime_get_sync() fails, it still increments the use count. So the label is err_pm_put. And you can drop the err_unlock label. > + > + ret = v4l2_pipeline_pm_use(&csi->vdev.entity, 1); > + if (ret) > + goto err_pm_put; > + > + ret = v4l2_fh_open(file); > + if (ret) > + goto err_pipeline_pm_put; > + > + mutex_unlock(&csi->lock); > + > + return 0; > + > +err_pipeline_pm_put: > + v4l2_pipeline_pm_use(&csi->vdev.entity, 0); > +err_pm_put: > + pm_runtime_put(csi->dev); > +err_unlock: > + mutex_unlock(&csi->lock); > + return ret; > +} > + > +static int csi_release(struct file *file) > +{ > + struct sun4i_csi *csi = video_drvdata(file); > + int ret; > + > + mutex_lock(&csi->lock); > + > + ret = v4l2_fh_release(file); v4l2_fh_release() always returns 0. I guess it could be changed to return void. The reason it has int is that it could be used as the release callback as such. > + v4l2_pipeline_pm_use(&csi->vdev.entity, 0); > + pm_runtime_put(csi->dev); > + > + mutex_unlock(&csi->lock); > + > + return ret; > +} > + > +static const struct v4l2_file_operations csi_fops = { > + .owner = THIS_MODULE, > + .open = csi_open, > + .release= csi_release, > + .unlocked_ioctl = video_ioctl2, > + .read = vb2_fop_read, > + .write = vb2_fop_write, > + .poll = vb2_fop_poll, > + .mmap = vb2_fop_mmap, > +}; > + > +int sun4i_csi_v4l2_register(struct sun4i_csi *csi) > +{ > + struct video_device *vdev = &csi->vdev; > + int ret; > + > + vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_STREAMING; > + vdev->v4l2_dev = &csi->v4l; > + vdev->queue = &csi->queue; > + strscpy(vdev->name, KBUILD_MODNAME, sizeof(vdev->name)); > + vdev->release = video_device_release_empty; > + vdev->lock = &csi->lock; > + > + /* Set a default format */ > + csi->v_fmt.pixelformat = CSI_DEFAULT_FORMAT; > + csi->v_fmt.width = CSI_DEFAULT_WIDTH; > + csi->v_fmt.height = CSI_DEFAULT_HEIGHT; > + _csi_try_fmt(csi, &csi->v_fmt, NULL); > + > + vdev->fops = &csi_fops; > + vdev->ioctl_ops = &csi_ioctl_ops; > + video_set_drvdata(vdev, csi); > + > + ret = video_register_device(&csi->vdev, VFL_TYPE_GRABBER, -1); > + if (ret) > + return ret; > + > + dev_info(csi->dev, "Device registered as %s\n", > + video_device_node_name(vdev)); > + > + return 0; > +} > + -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 1/5] dt-bindings: media: Add Allwinner A10 CSI binding

2019-01-29 Thread Sakari Ailus
oller, > with one instance supporting more channels and having an ISP. How about the graph, and endpoint configuration? You had that in v1... -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 1/2] media: dt-bindings: media: xilinx: Add Xilinx MIPI CSI-2 Rx Subsystem

2019-01-28 Thread Sakari Ailus
Hi Vishal, On Mon, Jan 14, 2019 at 09:47:41AM +, Vishal Sagar wrote: > Hi Sakari, > > Thanks for reviewing this. > > > -Original Message- > > From: Sakari Ailus [mailto:sakari.ai...@linux.intel.com] > > Sent: Tuesday, January 08, 2019 6:35 PM > >

Re: [RFC PATCH] videodev2.h: introduce VIDIOC_DQEXTEVENT

2019-01-28 Thread Sakari Ailus
Hi Hans, On Mon, Jan 28, 2019 at 10:52:40AM +0100, Hans Verkuil wrote: > On 1/28/19 10:21 AM, Sakari Ailus wrote: > > Hi Hans, > > > > Thanks for the patch. > > > > On Sat, Jan 26, 2019 at 12:06:19PM +0100, Hans Verkuil wrote: > >> This patch adds

Re: [RFC PATCH] videodev2.h: introduce VIDIOC_DQEXTEVENT

2019-01-28 Thread Sakari Ailus
', 102, struct v4l2_dbg_chip_info) > > #define VIDIOC_QUERY_EXT_CTRL_IOWR('V', 103, struct > v4l2_query_ext_ctrl) > +#define VIDIOC_DQEXTEVENT_IOR('V', 104, struct v4l2_ext_event) How do you plan to name the new buffer handling IOCTLs? I.e. with or without underscores around "EXT"? > > /* Reminder: when adding new ioctls please add support for them to > drivers/media/v4l2-core/v4l2-compat-ioctl32.c as well! */ -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3 1/3] media: mt9m111: make VIDIOC_SUBDEV_G_FMT ioctl work with V4L2_SUBDEV_FORMAT_TRY

2019-01-28 Thread Sakari Ailus
EV_G_FMT ioctl for this driver doesn't recognize > > > V4L2_SUBDEV_FORMAT_TRY and always works as if V4L2_SUBDEV_FORMAT_ACTIVE > > > is specified. > > > > > > Cc: Enrico Scholz > > > Cc: Michael Grzeschik > > > Cc: Marco Felsch >

Re: [PATCH v10 1/4] media: Media Device Allocator API

2019-01-25 Thread Sakari Ailus
ed(CONFIG_USB) > +/** > + * media_device_usb_allocate() - Allocate and return struct &media device > + * > + * @udev:struct &usb_device pointer > + * @module_name: should be filled with %KBUILD_MODNAME > + * > + * This interface should be called to allocate a Media Device when multiple > + * drivers share usb_device and the media device. This interface allocates > + * &media_device structure and calls media_device_usb_init() to initialize > + * it. > + * > + */ > +struct media_device *media_device_usb_allocate(struct usb_device *udev, > +char *module_name); > +/** > + * media_device_delete() - Release media device. Calls kref_put(). > + * > + * @mdev:struct &media_device pointer > + * @module_name: should be filled with %KBUILD_MODNAME > + * > + * This interface should be called to put Media Device Instance kref. > + */ > +void media_device_delete(struct media_device *mdev, char *module_name); > +#else > +static inline struct media_device *media_device_usb_allocate( > + struct usb_device *udev, char *module_name) > + { return NULL; } > +static inline void media_device_delete( > + struct media_device *mdev, char *module_name) { } > +#endif /* CONFIG_MEDIA_CONTROLLER */ > +#endif -- Regards, Sakari Ailus

Re: [PATCH v10 0/4] Media Device Allocator API

2019-01-25 Thread Sakari Ailus
| 29 ++- > sound/usb/quirks-table.h | 1 + > sound/usb/stream.c | 2 + > sound/usb/usbaudio.h | 6 + > 18 files changed, 723 insertions(+), 22 deletions(-) > create mode 100644 drivers/media/media-dev-allocator.c > create mode 100644 include/media/media-dev-allocator.h > create mode 100644 sound/usb/media.c > create mode 100644 sound/usb/media.h > -- Kind regards, Sakari Ailus

Re: [PATCH v10 01/13] media: staging/imx: refactor imx media device probe

2019-01-24 Thread Sakari Ailus
..b7f11c36461b 100644 > --- a/drivers/staging/media/imx/imx-media.h > +++ b/drivers/staging/media/imx/imx-media.h > @@ -226,6 +226,19 @@ int imx_media_add_async_subdev(struct imx_media_dev > *imxmd, > struct fwnode_handle *fwnode, > struct platform_device *pdev); > > +int imx_media_subdev_bound(struct v4l2_async_notifier *notifier, > +struct v4l2_subdev *sd, > +struct v4l2_async_subdev *asd); > +int imx_media_link_notify(struct media_link *link, u32 flags, > + unsigned int notification); > +int imx_media_probe_complete(struct v4l2_async_notifier *notifier); > + > +struct imx_media_dev *imx_media_dev_init(struct device *dev); > +int imx_media_dev_notifier_register(struct imx_media_dev *imxmd); > + > +void imx_media_dev_cleanup(struct imx_media_dev *imxmd); > +void imx_media_dev_notifier_unregister(struct imx_media_dev *imxmd); > + > /* imx-media-fim.c */ > struct imx_media_fim; > void imx_media_fim_eof_monitor(struct imx_media_fim *fim, ktime_t timestamp); > @@ -249,6 +262,8 @@ int imx_media_create_of_links(struct imx_media_dev *imxmd, > struct v4l2_subdev *sd); > int imx_media_create_csi_of_links(struct imx_media_dev *imxmd, > struct v4l2_subdev *csi); > +int imx_media_of_add_csi(struct imx_media_dev *imxmd, > + struct device_node *csi_np); > > /* imx-media-capture.c */ > struct imx_media_video_dev * -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [yavta PATCH v2 1/1] v4l2-ctl: Add support for META_OUTPUT buffer type

2019-01-24 Thread Sakari Ailus
Hi Hans, On Thu, Jan 24, 2019 at 09:44:13AM +0100, Hans Verkuil wrote: > Note: the subject it wrong, it's v4l-utils, not yavta. Oops, my bad. I must have been thinking of yavta when writing that. :-) And thanks for the review. > > On 1/22/19 1:05 PM, Sakari Ailus wrote: >

Re: [PATCH] media: v4l2-core: expose the device after it was registered.

2019-01-23 Thread Sakari Ailus
On Thu, Jan 24, 2019 at 03:11:53PM +0800, xinwu wrote: > Hi Sakari, > > Thanks for your response. > > > On 2019年01月22日 18:03, Sakari Ailus wrote: > > Hi Xinwu, > > > > On Tue, Jan 22, 2019 at 04:34:44PM +0800, Liu, Xinwu wrote: > > > de

Re: [PATCH v2] media: ipu3: update meta format documentation

2019-01-23 Thread Sakari Ailus
* > * @awb_config: &ipu3_uapi_awb_config_s, default resolution 16x16 > * @ae_grd_config: auto exposure statistics &ipu3_uapi_ae_grid_config > @@ -461,7 +461,7 @@ struct ipu3_uapi_awb_fr_config_s { > * @af_config: auto focus config &ipu3_uapi_af_config_s > * @awb_fr_config: &ipu3_uapi_awb_fr_config_s, default resolution 16x16 > */ > -struct ipu3_uapi_4a_config { > +struct ipu3_uapi_3a_config { > struct ipu3_uapi_awb_config_s awb_config __attribute__((aligned(32))); > struct ipu3_uapi_ae_grid_config ae_grd_config; > __u8 padding[20]; > @@ -534,7 +534,7 @@ struct ipu3_uapi_ff_status { > * @ae_raw_buffer: auto exposure raw data &ipu3_uapi_ae_raw_buffer_aligned > * @af_raw_buffer: &ipu3_uapi_af_raw_buffer for auto focus meta data > * @awb_fr_raw_buffer: value as specified by &ipu3_uapi_awb_fr_raw_buffer > - * @stats_4a_config: 4a statistics config as defined by &ipu3_uapi_4a_config. > + * @stats_3a_config: 3a statistics config as defined by &ipu3_uapi_3a_config. > * @ae_join_buffers: 1 to use ae_raw_buffer. > * @padding: padding config > * @stats_3a_bubble_per_stripe: a &ipu3_uapi_stats_3a_bubble_info_per_stripe > @@ -546,7 +546,7 @@ struct ipu3_uapi_stats_3a { > ae_raw_buffer[IPU3_UAPI_MAX_STRIPES]; > struct ipu3_uapi_af_raw_buffer af_raw_buffer; > struct ipu3_uapi_awb_fr_raw_buffer awb_fr_raw_buffer; > - struct ipu3_uapi_4a_config stats_4a_config; > + struct ipu3_uapi_3a_config stats_3a_config; > __u32 ae_join_buffers; > __u8 padding[28]; > struct ipu3_uapi_stats_3a_bubble_info_per_stripe > -- > 2.7.4 > -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 2/2] media: atmel-isc: Update device tree binding documentation

2019-01-23 Thread Sakari Ailus
> Hi Eugen, > > Yes it's true adding new documentation here may be overkill, but yes it > should say something > (as a user I always find it helpful if the docs are more verbose than not). > > So per your suggestion, how about the simplified: > "ISC supports a single port node with parallel bus and optionally Bt.656 > support." > > and I'll remit the other statements. Please still include the name of the property, as well as the valid values for it (numeric as well as human-readable). The rest of the documentation should stay in video-interfaces.txt IMO --- this is documentation for the hardware only. -- Regards, Sakari Ailus

[GIT PULL for 5.1] Yet more sensor driver patches

2019-01-22 Thread Sakari Ailus
trol clock along with power Luca Ceresoli (1): media: imx274: remote unused function imx274_read_reg Sakari Ailus (1): ov7670: Remove useless use of a ret variable .../devicetree/bindings/media/i2c/mt9m001.txt | 38 + MAINTAINERS|7 + dri

Re: [PATCH v2 12/30] media: entity: Add an iterator helper for connected pads

2019-01-22 Thread Sakari Ailus
On Tue, Jan 22, 2019 at 05:38:48PM +0200, Laurent Pinchart wrote: > Hi Sakari, > > On Tue, Jan 22, 2019 at 05:36:55PM +0200, Sakari Ailus wrote: > > On Wed, Jan 16, 2019 at 01:24:05AM +0200, Laurent Pinchart wrote: > > > On Fri, Nov 02, 2018 at 12:31:26AM +0100

Re: [PATCH v2 06/30] media: entity: Use pad as the starting point for a pipeline

2019-01-22 Thread Sakari Ailus
On Tue, Jan 22, 2019 at 05:37:15PM +0200, Laurent Pinchart wrote: > Hi Sakari, > > On Tue, Jan 22, 2019 at 05:31:34PM +0200, Sakari Ailus wrote: > > On Wed, Jan 16, 2019 at 12:54:20AM +0200, Laurent Pinchart wrote: > > > On Fri, Nov 02, 2018 at 12:31:20AM +0100

Re: [PATCH v2 16/30] v4l: subdev: Add [GS]_ROUTING subdev ioctls and operations

2019-01-22 Thread Sakari Ailus
ed-off-by: Michal Simek > > > > - Add sink and source streams for multiplexed links > > - Copy the argument back in case of an error. This is needed to let the > > caller know the number of routes. > > > > Signed-off-by: Sakari Ailus > > Revie

Re: [PATCH v2 17/30] v4l: subdev: compat: Implement handling for VIDIOC_SUBDEV_[GS]_ROUTING

2019-01-22 Thread Sakari Ailus
On Wed, Jan 16, 2019 at 01:53:03AM +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Fri, Nov 02, 2018 at 12:31:31AM +0100, Niklas Söderlund wrote: > > From: Sakari Ailus > > > > Implement compat IOCTL handlin

Re: [PATCH v2 15/30] media: entity: Look for indirect routes

2019-01-22 Thread Sakari Ailus
Hi Laurent, On Wed, Jan 16, 2019 at 01:41:08AM +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Fri, Nov 02, 2018 at 12:31:29AM +0100, Niklas Söderlund wrote: > > From: Sakari Ailus > > > > Two pads are considered having a

Re: [PATCH v2 14/30] media: entity: Add debug information in graph walk route check

2019-01-22 Thread Sakari Ailus
On Wed, Jan 16, 2019 at 01:35:14AM +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Fri, Nov 02, 2018 at 12:31:28AM +0100, Niklas Söderlund wrote: > > From: Sakari Ailus > > > > Signed-off-by: Sakari Ailus > > Reviewed-by:

Re: [PATCH v2 12/30] media: entity: Add an iterator helper for connected pads

2019-01-22 Thread Sakari Ailus
Hi Laurent, On Wed, Jan 16, 2019 at 01:24:05AM +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Fri, Nov 02, 2018 at 12:31:26AM +0100, Niklas Söderlund wrote: > > From: Sakari Ailus > > > > Add a helper macro for iterating ove

Re: [PATCH v2 06/30] media: entity: Use pad as the starting point for a pipeline

2019-01-22 Thread Sakari Ailus
Hi Laurent, On Wed, Jan 16, 2019 at 12:54:20AM +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Fri, Nov 02, 2018 at 12:31:20AM +0100, Niklas Söderlund wrote: > > From: Sakari Ailus > > > > The pipeline will be moved from the en

Re: [PATCH v2 09/30] media: entity: Swap pads if route is checked from source to sink

2019-01-22 Thread Sakari Ailus
Hi Laurent, On Wed, Jan 16, 2019 at 12:57:43AM +0200, Laurent Pinchart wrote: > Hi Sakari, > > Thank you for the patch. > > On Fri, Nov 02, 2018 at 12:31:23AM +0100, Niklas Söderlund wrote: > > From: Sakari Ailus > > > > This way the pads are always passed to

Re: [PATCH v2 03/30] media: entity: Walk the graph based on pads

2019-01-22 Thread Sakari Ailus
Hi Laurent, On Wed, Jan 16, 2019 at 01:28:22AM +0200, Laurent Pinchart wrote: > Hi Sakari, > > On Wed, Jan 16, 2019 at 12:34:07AM +0200, Sakari Ailus wrote: > > On Wed, Jan 16, 2019 at 12:21:36AM +0200, Laurent Pinchart wrote: > > > On Fri, Nov 02, 2018 at 12:31:17AM

<    1   2   3   4   5   6   7   8   9   10   >