[PATCH 1/3] videobuf2-core: Prevent size alignment wrapping buffer size to 0

2018-12-13 Thread Sakari Ailus
PAGE_ALIGN() may wrap the buffer size around to 0. Prevent this by checking that the aligned value is not smaller than the unaligned one. Note on backporting to stable: the file used to be under drivers/media/v4l2-core, it was moved to the current location after 4.14. Signed-off-by: Sakari Ailus

[PATCH 2/3] videobuf2-dma-sg: Prevent size from overflowing

2018-12-13 Thread Sakari Ailus
Note on backporting to stable: the file used to be under drivers/media/v4l2-core, it was moved to the current location after 4.14. Signed-off-by: Sakari Ailus Cc: sta...@vger.kernel.org --- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v9 15/22] media: staging/intel-ipu3: Add Intel IPU3 meta data uAPI

2018-12-13 Thread Sakari Ailus
From: Yong Zhi These meta formats are used on Intel IPU3 ImgU video queues to carry 3A statistics and ISP pipeline parameters. V4L2_META_FMT_IPU3_3A V4L2_META_FMT_IPU3_PARAMS Signed-off-by: Yong Zhi Signed-off-by: Chao C Li Signed-off-by: Rajmohan Mani Signed-off-by: Sakari Ailus

[PATCH v9 08/22] media: staging/intel-ipu3: css: Add support for firmware management

2018-12-13 Thread Sakari Ailus
From: Yong Zhi Introduce functions to load and install ImgU FW blobs. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-css-fw.c | 264 +++ drivers/staging/media/ipu3/ipu3-css-fw.h | 188 ++ 2 files changed

[PATCH v9 17/22] ipu3-imgu: Fix compiler warnings

2018-12-13 Thread Sakari Ailus
Address a few false positive compiler warnings related to uninitialised variables. While at it, use bool where bool is needed and %u to print an unsigned integer. Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3.c | 8 1 file changed, 4 insertions(+), 4 deletions

[PATCH v9 20/22] media: v4l: Add Intel IPU3 meta buffer formats

2018-12-13 Thread Sakari Ailus
From: Yong Zhi Add IPU3-specific meta formats for processing parameters and 3A statistics. V4L2_META_FMT_IPU3_PARAMS V4L2_META_FMT_IPU3_STAT_3A Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- Documentation/media/uapi/v4l/meta-formats.rst | 1 + .../media/uapi/v4l/pixfmt

[PATCH v9 13/22] media: staging/intel-ipu3: Add v4l2 driver based on media framework

2018-12-13 Thread Sakari Ailus
From: Yong Zhi Implement video driver that utilizes v4l2, vb2 queue support and media controller APIs. The driver exposes single subdevice and six nodes. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-v4l2.c | 1086 1

[PATCH v9 00/22] ImgU driver

2018-12-13 Thread Sakari Ailus
dual pipe support Rajmohan Mani (1): doc-rst: Add Intel IPU3 documentation Sakari Ailus (6): v4l: Add support for V4L2_BUF_TYPE_META_OUTPUT docs-rst: v4l: Document V4L2_BUF_TYPE_META_OUTPUT interface ipu3-imgu: Fix compiler warnings ipu3-imgu: Fix firmware binary location staging

[PATCH v9 02/22] docs-rst: v4l: Document V4L2_BUF_TYPE_META_OUTPUT interface

2018-12-13 Thread Sakari Ailus
Document the interface for metadata output, including V4L2_BUF_TYPE_META_OUTPUT buffer type and V4L2_CAP_META_OUTPUT capability bits. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Reviewed-by: Tomasz Figa Tested-by: Tian Shu Qiu --- Documentation/media/uapi/v4l/buffer.rst | 3

[PATCH v9 11/22] media: staging/intel-ipu3: css: Initialize css hardware

2018-12-13 Thread Sakari Ailus
From: Yong Zhi This patch implements the functions to initialize and configure IPU3 h/w such as clock, irq and power. Signed-off-by: Yong Zhi Signed-off-by: Tomasz Figa Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-css.c | 537 ++ drivers

[PATCH v9 10/22] media: staging/intel-ipu3: css: Compute and program ccs

2018-12-13 Thread Sakari Ailus
From: Yong Zhi A collection of routines that are mainly used to calculate the parameters for accelerator cluster. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-css-params.c | 2915 ++ drivers/staging/media/ipu3/ipu3-css

[PATCH v9 22/22] staging/ipu3-imgu: Add MAINTAINERS entry

2018-12-13 Thread Sakari Ailus
Add a MAINTAINERS entry for the ImgU driver. Signed-off-by: Sakari Ailus --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3e9f1710ed13e..9ed5cff35e075 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7587,6 +7587,14 @@ S: Maintained

[PATCH v9 18/22] ipu3-imgu: Fix firmware binary location

2018-12-13 Thread Sakari Ailus
The firmware binary is located under "intel" directory in the linux-firmware repository. Reflect this in the driver. Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-css-fw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/ipu

[PATCH v9 03/22] media: staging/intel-ipu3: abi: Add register definitions and enum

2018-12-13 Thread Sakari Ailus
From: Yong Zhi Add macros and enums used for IPU3 firmware interface. Signed-off-by: Yong Zhi Signed-off-by: Rajmohan Mani Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-abi.h | 661 ++ 1 file changed, 661

[PATCH v9 12/22] media: staging/intel-ipu3: Add css pipeline programming

2018-12-13 Thread Sakari Ailus
From: Yong Zhi This provides helper library to be used by v4l2 level to program imaging pipelines and control the streaming. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-css.c | 1740 + 1 file changed, 1740 insertions

[PATCH v9 05/22] media: staging/intel-ipu3: mmu: Implement driver

2018-12-13 Thread Sakari Ailus
From: Tomasz Figa This driver translates IO virtual address to physical address based on two levels page tables. Signed-off-by: Tomasz Figa Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-mmu.c | 561 ++ drivers/staging

[PATCH v9 04/22] media: staging/intel-ipu3: abi: Add structs

2018-12-13 Thread Sakari Ailus
From: Yong Zhi This add all the structs of IPU3 firmware ABI. Signed-off-by: Yong Zhi Signed-off-by: Rajmohan Mani Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-abi.h | 1350 + 1 file changed, 1350 insertions

[PATCH v9 19/22] doc-rst: Add Intel IPU3 documentation

2018-12-13 Thread Sakari Ailus
From: Rajmohan Mani This patch adds the details about the IPU3 Imaging Unit driver (both CIO2 and IMGU). Signed-off-by: Rajmohan Mani Signed-off-by: Sakari Ailus --- Documentation/media/v4l-drivers/index.rst | 1 + Documentation/media/v4l-drivers/ipu3.rst | 326

[PATCH v9 14/22] media: staging/intel-ipu3: Add imgu top level pci device driver

2018-12-13 Thread Sakari Ailus
Signed-off-by: Tomasz Figa Signed-off-by: Sakari Ailus --- drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/ipu3/Kconfig | 14 + drivers/staging/media/ipu3/Makefile | 11 + drivers/staging/media/ipu3/TODO | 23 + drivers

[PATCH v9 06/22] media: staging/intel-ipu3: Implement DMA mapping functions

2018-12-13 Thread Sakari Ailus
From: Tomasz Figa This driver uses IOVA space for buffer mapping through IPU3 MMU to transfer data between imaging pipelines and system DDR. Signed-off-by: Tomasz Figa Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-dmamap.c | 270

[PATCH v9 21/22] staging/ipu3-imgu: Address documentation comments

2018-12-13 Thread Sakari Ailus
Address comments on the documentation after Yong's original patch. Signed-off-by: Sakari Ailus --- .../media/uapi/v4l/pixfmt-meta-intel-ipu3.rst | 2 +- Documentation/media/v4l-drivers/ipu3.rst | 343 - drivers/staging/media/ipu3

[PATCH v9 07/22] media: staging/intel-ipu3: css: Add dma buff pool utility functions

2018-12-13 Thread Sakari Ailus
From: Yong Zhi The pools are used to store previous parameters set by user with the parameter queue. Due to pipelining, there needs to be multiple sets (up to four) of parameters which are queued in a host-to-sp queue. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- drivers/staging

[PATCH v9 01/22] v4l: Add support for V4L2_BUF_TYPE_META_OUTPUT

2018-12-13 Thread Sakari Ailus
highly structured. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Reviewed-by: Tomasz Figa Tested-by: Tian Shu Qiu --- drivers/media/common/videobuf2/videobuf2-v4l2.c | 1 + drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 2 ++ drivers/media/v4l2-core/v4l2-dev.c | 12

Re: [PATCH v7 02/16] doc-rst: Add Intel IPU3 documentation

2018-12-13 Thread Sakari Ailus
d with 2592x1944 [#f4]_ resolution, with desired output > > +resolution as 2560x1920 and viewfinder resolution as 2560x1920, the > > following +v4l2n command can be used. This helps process the raw bayer > > frames and +produces the desired results for the main output image and the > > viewfinder +output, in NV12 format. > > + > > +v4l2n --pipe=4 --load=/tmp/frame-#.bin --open=/dev/video4 > > +--fmt=type:VIDEO_OUTPUT_MPLANE,width=2592,height=1944,pixelformat=0X4733706 > > 9 +--reqbufs=type:VIDEO_OUTPUT_MPLANE,count:1 --pipe=1 > > --output=/tmp/frames.out +--open=/dev/video5 > > +--fmt=type:VIDEO_CAPTURE_MPLANE,width=2560,height=1920,pixelformat=NV12 > > +--reqbufs=type:VIDEO_CAPTURE_MPLANE,count:1 --pipe=2 > > --output=/tmp/frames.vf +--open=/dev/video6 > > +--fmt=type:VIDEO_CAPTURE_MPLANE,width=2560,height=1920,pixelformat=NV12 > > +--reqbufs=type:VIDEO_CAPTURE_MPLANE,count:1 --pipe=3 --open=/dev/video7 > > +--output=/tmp/frames.3A --fmt=type:META_CAPTURE,? > > +--reqbufs=count:1,type:META_CAPTURE --pipe=1,2,3,4 --stream=5 > > You can replace this with four yavta commands. Ditto. > > > +where /dev/video4, /dev/video5, /dev/video6 and /dev/video7 devices point > > to +input, output, viewfinder and 3A statistics video nodes respectively. + > > +Converting the raw bayer image into YUV domain > > +-- > > + > > +The processed images after the above step, can be converted to YUV domain > > +as below. > > + > > +Main output frames > > +~~ > > + > > +raw2pnm -x2560 -y1920 -fNV12 /tmp/frames.out /tmp/frames.out.pnm > > PNM is an umbrella term that refers to any of the PBM, PGM or PPM format. As > the raw2pnm tool outputs PPM files, let's name them .ppm here and below. This > helps with some image viewers that use file extensions to identify the > format, > and have trouble handling .pnm files. Fixed. > > > +where 2560x1920 is output resolution, NV12 is the video format, followed > > +by input frame and output PNM file. > > + > > +Viewfinder output frames > > + > > + > > +raw2pnm -x2560 -y1920 -fNV12 /tmp/frames.vf /tmp/frames.vf.pnm > > + > > +where 2560x1920 is output resolution, NV12 is the video format, followed > > +by input frame and output PNM file. > > + > > +Example user space code for IPU3 > > + > > + > > +User space code that configures and uses IPU3 is available here. > > + > > +https://chromium.googlesource.com/chromiumos/platform/arc-camera/+/master/ > > + > > +The source can be located under hal/intel directory. > > + > > +References > > +== > > + > > +include/uapi/linux/intel-ipu3.h > > + > > +.. [#f1] https://github.com/intel/nvt > > + > > +.. [#f2] http://git.ideasonboard.org/yavta.git > > + > > +.. [#f3] http://git.ideasonboard.org/?p=media-ctl.git;a=summary > > + > > +.. [#f4] ImgU limitation requires an additional 16x16 for all input > > resolutions > > -- > Regards, > > Laurent Pinchart > > > -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[PATCH 1/1] staging/ipu3-imgu: Address documentation comments

2018-12-13 Thread Sakari Ailus
Address comments on the documentation after Yong's original patch. Signed-off-by: Sakari Ailus --- .../media/uapi/v4l/pixfmt-meta-intel-ipu3.rst | 2 +- Documentation/media/v4l-drivers/ipu3.rst | 343 - drivers/staging/media/ipu3

[PATCH 1/1] ipu3-imgu: Fix firmware binary location

2018-12-12 Thread Sakari Ailus
The firmware binary is located under "intel" directory in the linux-firmware repository. Reflect this in the driver. Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3-css-fw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/ipu

[PATCH 1/1] ipu3-cio2: Use MEDIA_ENT_F_VID_IF_BRIDGE as receiver entity function

2018-12-12 Thread Sakari Ailus
43463] ipu3-cio2 :00:14.3: Entity type for entity ipu3-csi2 2 was not initialized! [5.043502] ipu3-cio2 :00:14.3: Entity type for entity ipu3-csi2 3 was not initialized! Signed-off-by: Sakari Ailus --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 1 + 1 file changed, 1 insertion(+)

[v4l-utils PATCH 2/2] v4l2-compliance: Add support for metadata output

2018-12-10 Thread Sakari Ailus
From: Yong Zhi Add support for metadata output video nodes, in other words, V4L2_CAP_META_OUTPUT and V4L2_BUF_TYPE_META_OUTPUT. Signed-off-by: Sakari Ailus Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus --- utils/common/v4l-helpers.h | 14 +- utils/common

[v4l-utils PATCH 1/2] Update uAPI headers from the kernel

2018-12-10 Thread Sakari Ailus
This brings the META_OUTPUT buffer type as well as the related capability. Signed-off-by: Sakari Ailus --- include/linux/videodev2.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 9350bdc1..6aae99ea 100644 --- a/include/linux

[v4l-utils PATCH 0/2] META_OUTPUT buffer type support for v4l2-compliance

2018-12-10 Thread Sakari Ailus
Hi all, Here are the patches needed to support the META_OUTPUT queue type for v4l2-compliance. The patch that adds the support is preceded by the kernel header update --- the headers have been recently updated and there were no other changes. Sakari Ailus (1): Update uAPI headers from the

Re: [GIT PULL for 4.20] META_OUTPUT buffer type and the ipu3 staging driver

2018-12-10 Thread sakari . ailus
ase pull. The non-staging patches have been > around for more than half a year and they're relatively simple. s/4\.20/4.21/g -- Sakari Ailus

[GIT PULL for 4.20] META_OUTPUT buffer type and the ipu3 staging driver

2018-12-10 Thread sakari . ailus
ging driver for 4.20 Cao,Bing Bu (1): media: staging/intel-ipu3: Add dual pipe support Sakari Ailus (3): v4l: Add support for V4L2_BUF_TYPE_META_OUTPUT docs-rst: v4l: Document V4L2_BUF_TYPE_META_OUTPUT interface ipu3-imgu: Fix compiler warn

Re: [PATCH v8 00/17] Intel IPU3 ImgU patchset

2018-12-10 Thread sakari . ailus
t; - ipu3-css-params.c > fix indentation, 0-day scan warnings etc. > - ipu3-css.c > fix warning about NULL comparison. (Sakari) > - intel-ipu3.h: > remove redundant IPU3_ALIGN attribute (Sakari). > fix up un-needed fields in struct ipu3_uapi_params (Sakari) >

[PATCH 1/1] ipu3-imgu: Fix compiler warnings

2018-12-10 Thread Sakari Ailus
Address a few false positive compiler warnings related to uninitialised variables. While at it, use bool where bool is needed and %u to print an unsigned integer. Signed-off-by: Sakari Ailus --- drivers/staging/media/ipu3/ipu3.c | 8 1 file changed, 4 insertions(+), 4 deletions

Re: [PATCH] v4l2: i2c: ov7670: Fix PLL bypass register values

2018-12-10 Thread sakari . ailus
time to make sure that when using > > > ov7670 "info->pll_bypass" is set to false. > > > > > > Signed-off-by: Jacopo Mondi > > > > I assume this is still valid and long overdue for merging. :-) No other > > work in the area seem to have been done so I'm picking it up... > > > > It should still be valid, and should still apply regardless of its > age :) Is it worth a proper 'Fixes' tag? > > Fixes: f6dd927f34d6 ("[media] media: ov7670: calculate framerate properly for > ov7675") Thanks; I added that to the commit message. -- Sakari Ailus

Re: Invite for IRC meeting: Re: [PATCHv4 01/10] videodev2.h: add tag support

2018-12-10 Thread Sakari Ailus
On Mon, Dec 10, 2018 at 08:59:36AM +0100, Hans Verkuil wrote: > Wed works for me. Same here. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH] v4l2: i2c: ov7670: Fix PLL bypass register values

2018-12-09 Thread sakari . ailus
sed in > set/get_framerate() functions used by ov7675 only, it is not necessary > to check for the device id at probe time to make sure that when using > ov7670 "info->pll_bypass" is set to false. > > Signed-off-by: Jacopo Mondi I assume this is still valid and long overdue for merging. :-) No other work in the area seem to have been done so I'm picking it up... -- Regards, Sakari Ailus

Re: [PATCH] v4l: Add simple packed Bayer raw12 pixel formats

2018-12-09 Thread sakari . ailus
6', 0x00, 0x00, 0x10, 0x00, \ > 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} > #define UVC_GUID_FORMAT_GB16 \ > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 5d1a3685bea9..56807acf8c6d 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -610,6 +610,13 @@ struct v4l2_pix_format { > #define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C') > #define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C') > #define V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C') > + > + /* 12bit raw bayer simple packed, 6 bytes for every 4 pixels */ Begin the comment at the start of the line, please. > +#define V4L2_PIX_FMT_SBGGR12SP v4l2_fourcc('B', 'G', 'C', 'p') > +#define V4L2_PIX_FMT_SGBRG12SP v4l2_fourcc('G', 'B', 'C', 'p') > +#define V4L2_PIX_FMT_SGRBG12SP v4l2_fourcc('G', 'R', 'C', 'p') > +#define V4L2_PIX_FMT_SRGGB12SP v4l2_fourcc('R', 'G', 'C', 'p') > + > /* 14bit raw bayer packed, 7 bytes for every 4 pixels */ > #define V4L2_PIX_FMT_SBGGR14P v4l2_fourcc('p', 'B', 'E', 'E') > #define V4L2_PIX_FMT_SGBRG14P v4l2_fourcc('p', 'G', 'E', 'E') -- Kind regards, Sakari Ailus

Re: [PATCH v8 17/17] doc-rst: Add Intel IPU3 documentation

2018-12-09 Thread Sakari Ailus
d-off-by: Rajmohan Mani -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 1/4] media: soc_camera: ov9640: move ov9640 out of soc_camera

2018-12-09 Thread Sakari Ailus
Hi Petr, What's the status of this set? It would seem that addressing the issues is fairly trivial. Please also see a few comments below. On Fri, Sep 14, 2018 at 10:54:51PM +0200, Petr Cvek wrote: > Dne 14.9.2018 v 14:59 Sakari Ailus napsal(a): > > Hi Petr, > > > > Th

Re: [PATCH 1/6] media: v4l2-subdev: stub v4l2_subdev_get_try_format() ??

2018-12-09 Thread sakari . ailus
_API. > > I'll be following up with a v2 after I get a response from you. It will > address locking issues found with smatch: one introduced by my patch > and one that was there before. Hans wrote a patch that enables VIDEO_V4L2_SUBDEV_API if MEDIA_CAMERA_SUPPORT has been selected. So much of these #ifdefs will not be needed going forward. It's an RFC for now, but that'd require a lot of conditional compiling in drivers. https://patchwork.linuxtv.org/patch/53370/> The current use of the get_fmt callback serves the regular V4L2 API use, in which case getting the try format is not meaningful. -- Regards, Sakari Ailus

[GIT FIXES for 4.20] Fwnode parsing fix

2018-12-07 Thread sakari . ailus
+), 2 deletions(-) -- Sakari Ailus

Re: [PATCH 1/2] media: pxa_camera: don't deferenciate a NULL pointer

2018-12-07 Thread Sakari Ailus
sure WARN_ON(1) is necessary. A lot of drivers simply do it this way without WARN_ON(). > + WARN_ON(1); > + return -ENODEV; > } else { > pcdev->platform_flags = pcdev->pdata->flags; > pcdev->mclk = pcdev->pdata->mclk_10khz * 1; -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[PATCH v2 1/1] media: Add a Kconfig option for the Request API

2018-12-05 Thread Sakari Ailus
as buffer flags. The driver requiring requests (cedrus) now depends on the Kconfig option as well. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil --- since v1: - Write out the #ifdef's in request creation - The option's functionality was reversed in request creation, fixed that

[PATCH 1/1] ipu3-cio2: Allow probe to succeed if there are no sensors connected

2018-12-05 Thread Sakari Ailus
The device won't be powered off on systems that have no sensors connected unless it has a driver bound to it. Allow that to happen even if there are no sensors connected to cio2. Signed-off-by: Sakari Ailus --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 3 ++- 1 file changed, 2 insertions(

[PATCH 1/1] media: Add a Kconfig option for the Request API

2018-12-05 Thread Sakari Ailus
as buffer flags. The driver requiring requests (cedrus) now depends on the Kconfig option as well. Signed-off-by: Sakari Ailus --- I hope this covers now everything... I was thinking how to make the option name itself more worrisome but I couldn't come up with a better language that wou

[GIT PULL for 4.21] More sensor driver patches

2018-12-05 Thread sakari . ailus
-async.c | 4 - drivers/media/v4l2-core/v4l2-fwnode.c | 2 +- 10 files changed, 703 insertions(+), 337 deletions(-) -- Regards, Sakari Ailus

[PATCH 1/1] v4l uapi: Make "Vertical Colour Bars" menu item a little more generic

2018-12-04 Thread Sakari Ailus
The test pattern could contain a different number of colour bars than eight, make the entry more useful by removing "Eight " from the name. Signed-off-by: Sakari Ailus --- include/uapi/linux/v4l2-controls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/

Re: [PATCH 1/1] media: Use common test pattern menu entries

2018-12-04 Thread sakari . ailus
On Tue, Nov 27, 2018 at 07:19:52PM +0800, Bingbu Cao wrote: > > On 11/27/2018 05:33 PM, Sakari Ailus wrote: > > diff --git a/include/uapi/linux/v4l2-controls.h > > b/include/uapi/linux/v4l2-controls.h > > index 998983a6e6b7..a74ff6f1ac88 100644 > > --- a/incl

[PATCH v2 1/1] media: Use common test pattern menu entries

2018-12-04 Thread Sakari Ailus
While the test pattern menu itself is not standardised, many devices support the same test patterns. Aligning the menu entries helps the user space to use the interface, and adding macros for the menu entry strings helps to keep them aligned. Signed-off-by: Sakari Ailus --- since v1: - Fix

Re: [PATCH 1/6] media: dt-bindings: media: sun6i: Separate H3 compatible from A31

2018-12-04 Thread sakari . ailus
perhaps elaborate a bit this is about CSI. Fine details... I think it's fine as-is for now. > > > Reviewed-by: Jagan Teki > > BTW, I know you've been trying to get CSI to work on the A64. > I have it working for the Bananapi-M64. The CSI SCLK needs to > be lowered to 300 MHz or the image gets corrupted. > > ChenYu -- Sakari Ailus

Re: [PATCH v2] v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields

2018-12-04 Thread sakari . ailus
e/v4l2-ioctl.c > @@ -1512,6 +1512,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, > struct v4l2_format *p = arg; > struct video_device *vfd = video_devdata(file); > int ret = check_fmt(file, p->type); > + int i; unsigned int; same below. With that, Acke

Re: [PATCH v2 00/30] v4l: add support for multiplexed streams

2018-12-03 Thread Sakari Ailus
them, but I still. X-) I noticed that the new [GS]_ROUTING interface has no documentation currently. Could you write it? Also what I'd like to see is the media graph of a device that is driven by these drivers. That'd help to better understand the use case also for those who haven't worked with the patches. Thanks. -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

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

2018-12-03 Thread Sakari Ailus
t; + state->pads); > + if (ret < 0) > + goto unregister_subdev; > + > + memcpy(state->events, mipi_csis_events, sizeof(state->events)); > + > + 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: > + media_entity_cleanup(&state->mipi_sd.entity); > +unregister_subdev: > + v4l2_async_unregister_subdev(&state->mipi_sd); > +disable_clock: > + mipi_csis_clk_disable(state); > + > + 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: > + 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: > + 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) > +{ > + 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); > + > + 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); > + 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"); > +MODULE_ALIAS("platform:imx7-mipi-csi2"); -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH] media: unify some sony camera sensors pattern naming

2018-12-03 Thread Sakari Ailus
amera sensors have same test pattern > > > definitions, this patch unify the pattern naming > > > to make it more clear to the userspace. > > > > > > Suggested-by: Sakari Ailus > > > Signed-off-by: Bingbu Cao > > > --- > > > drive

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-12-03 Thread Sakari Ailus
Hi Laurent, On Fri, Nov 30, 2018 at 01:07:53AM +0200, Laurent Pinchart wrote: > Hello Bing, > > On Wednesday, 7 November 2018 06:16:47 EET Bing Bu Cao wrote: > > On 11/01/2018 08:03 PM, Sakari Ailus wrote: > > > On Mon, Oct 29, 2018 at 03:22:54PM -0700, Yong Zhi wrote: &g

Re: [PATCH v7 03/16] v4l: Add Intel IPU3 meta data uAPI

2018-12-01 Thread Sakari Ailus
Hi Yong, On Thu, Nov 29, 2018 at 11:06:23PM +, Zhi, Yong wrote: > Hi, Sakari, > > > -Original Message- > > From: Sakari Ailus [mailto:sakari.ai...@linux.intel.com] > > Sent: Thursday, November 29, 2018 4:46 PM > > To: Zhi, Yong > > Cc: linux-media

Re: Possible regression in v4l2-async

2018-11-30 Thread Sakari Ailus
Hi Niklas, On Fri, Nov 30, 2018 at 03:25:29AM +0100, Niklas Söderlund wrote: > Hi Sakari, Steve, > > Thanks for your quick response. > > On 2018-11-29 22:37:53 +0200, Sakari Ailus wrote: > > Hi Steve, Niklas, > > > > On Thu, Nov 29, 2018 at 11:41:3

Re: [PATCH v7 00/16] Intel IPU3 ImgU patchset

2018-11-30 Thread Sakari Ailus
Hi Laurent, On Fri, Nov 30, 2018 at 01:09:37AM +0200, Laurent Pinchart wrote: > Hi Sakari, > > > On Friday, 9 November 2018 12:09:54 EET Sakari Ailus wrote: > > On Wed, Nov 07, 2018 at 12:16:47PM +0800, Bing Bu Cao wrote: > > > On 11/01/2018 08:03 PM, Sakari Ailus w

Re: Possible regression in v4l2-async

2018-11-29 Thread Sakari Ailus
example, no driver should be > doing that. So removing the list_lock from v4l2_async_notifier_init() is > probably safe. The notifier is not registered with v4l2-async at that point. I agree, apart from "probably". It is safe. Niklas: would you like to send a patch? :-) -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v7 09/16] intel-ipu3: css: Add support for firmware management

2018-11-28 Thread Sakari Ailus
define IMGU_FW_NAME "ipu3-fw.bin" Shouldn't this be "intel/ipu3-fw.bin"? -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH for v4.20 0/5] vb2 fixes (mostly request API related)

2018-11-28 Thread sakari . ailus
ve marked all these patches for 4.20, but I think it is also possible > to apply them for 4.21 since the request API is only used by virtual > drivers and a staging driver. For patches 2--5: Acked-by: Sakari Ailus -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH for v4.20 1/5] vb2: don't call __vb2_queue_cancel if vb2_start_streaming failed

2018-11-28 Thread Sakari Ailus
treaming if sufficient buffers > are queued') > Cc: # for v4.16 and up Acked-by: Sakari Ailus > --- > drivers/media/common/videobuf2/videobuf2-core.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/media/common/videobuf2/videobu

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-28 Thread Sakari Ailus
On Wed, Nov 28, 2018 at 09:29:01AM +0100, Marco Felsch wrote: > On 18-11-27 23:15, Sakari Ailus wrote: > > On Tue, Nov 27, 2018 at 11:02:53AM +0100, Marco Felsch wrote: > > > From: Enrico Scholz > > > > > > The chip can be configured to output data transitions

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-27 Thread Sakari Ailus
2 + select V4L2_FWNODE help This driver supports MT9M111, MT9M112 and MT9M131 cameras from Micron/Aptina -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 03:12:29PM +0100, Philipp Zabel wrote: > Hi Sakari, > > On Tue, 2018-11-27 at 15:50 +0200, Sakari Ailus wrote: > > Hi Philipp, > > > > On Tue, Nov 27, 2018 at 02:39:27PM +0100, Philipp Zabel wrote: > > > Hi Sakari, > > > &g

Re: [PATCH v3 5/6] dt-bindings: media: mt9m111: add pclk-sample property

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 03:21:05PM +0100, Marco Felsch wrote: > Hi Sakari, > > On 18-11-27 15:13, Sakari Ailus wrote: > > Hi Marco, > > > > On Tue, Nov 27, 2018 at 11:02:52AM +0100, Marco Felsch wrote: > > > Add the pclk-sample property to the list of optio

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-27 Thread Sakari Ailus
Hi Philipp, On Tue, Nov 27, 2018 at 02:39:27PM +0100, Philipp Zabel wrote: > Hi Sakari, > > On Tue, 2018-11-27 at 15:19 +0200, Sakari Ailus wrote: > > Hi Marco, > > > > On Tue, Nov 27, 2018 at 11:02:53AM +0100, Marco Felsch wrote: > > > From: Enrico

Re: [PATCH v4 2/2] dt-bindings: Document the Rockchip RK1608 bindings

2018-11-27 Thread Sakari Ailus
@1 { > + sensor_in0: endpoint@0 { reg missing here and below. > + remote-endpoint = <&sensor_out0>; > + }; > + /* If you have a second sensor, > + * add the 'endpoint@1' node here. > + */ > + sensor_in1: endpoint@1 { > + remote-endpoint = <&sensor_out1>; > + }; > + }; > + }; > + }; > +}; > diff --git a/MAINTAINERS b/MAINTAINERS > index b2a98e3..04d227b 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -141,6 +141,7 @@ M:Leo Wen > S: Maintained > F: drivers/media/spi/rk1608.c > F: drivers/media/spi/rk1608.h > +F: Documentation/devicetree/bindings/media/rk1608.txt > > 3C59X NETWORK DRIVER > M: Steffen Klassert -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH v3 6/6] media: mt9m111: allow to setup pixclk polarity

2018-11-27 Thread Sakari Ailus
endpoint_free(bus_cfg); + v4l2_fwnode_endpoint_free(&bus_cfg); out_put_fw: fwnode_handle_put(np); Please base on current media tree master on the next time. Thanks. -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3 5/6] dt-bindings: media: mt9m111: add pclk-sample property

2018-11-27 Thread Sakari Ailus
mt9m111_1: endpoint { > remote-endpoint = <&pxa_camera>; > + pclk-sample = <1>; > }; > }; > }; -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [RESEND PATCH 1/1] media: Use common test pattern menu entries

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 01:11:42PM +0100, Luca Ceresoli wrote: > Hi Sakari, Bingbu, > > On 27/11/18 10:34, Sakari Ailus wrote: > > While the test pattern menu itself is not standardised, many devices > > support the same test patterns. Aligning the menu entries helps the user

Re: [PATCH v3 05/14] media: dt-bindings: marvell,mmp2-ccic: Add Marvell MMP2 camera

2018-11-27 Thread Sakari Ailus
reg = <0xd420a000 0x800>; > + interrupts = <42>; > + clocks = <&soc_clocks MMP2_CLK_CCIC0>; > + clock-names = "axi"; > + #clock-cells = <0>; > + clock-output-names = "mclk"; > + > + port { > + camera0_0: endpoint { > + remote-endpoint = <&ov7670_0>; > + }; > + }; > + }; -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

[RESEND PATCH 1/1] media: Use common test pattern menu entries

2018-11-27 Thread Sakari Ailus
While the test pattern menu itself is not standardised, many devices support the same test patterns. Aligning the menu entries helps the user space to use the interface, and adding macros for the menu entry strings helps to keep them aligned. Signed-off-by: Sakari Ailus --- Fixed Andy's

Re: [PATCH v2] media: unify some sony camera sensors pattern naming

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 05:03:26PM +0800, bingbu@intel.com wrote: > From: Bingbu Cao > > Some Sony camera sensors have same pattern > definitions, this patch unify the pattern naming > to make it more clear to the userspace. > > Suggested-by: Sakari Ailus > S

[PATCH 1/1] media: Use common test pattern menu entries

2018-11-27 Thread Sakari Ailus
While the test pattern menu itself is not standardised, many devices support the same test patterns. Aligning the menu entries helps the user space to use the interface, and adding macros for the menu entry strings helps to keep them aligned. Signed-off-by: Sakari Ailus --- drivers/media/i2c

Re: [PATCH 2/2] media: imx355: fix wrong order in test pattern menus

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 10:45:02AM +0800, Bingbu Cao wrote: > > > On 11/26/2018 04:57 PM, Sakari Ailus wrote: > > Hi Bing Bu, > > > > On Mon, Nov 26, 2018 at 03:43:34PM +0800, bingbu@intel.com wrote: > > > From: Bingbu Cao > > > > &g

Re: [PATCH 1/3] media: imx274: don't declare events, they are not implemented

2018-11-27 Thread Sakari Ailus
On Tue, Nov 27, 2018 at 10:09:08AM +0100, Luca Ceresoli wrote: > Hi Sakari, > > On 27/11/18 09:38, Sakari Ailus wrote: > > Hi Luca, > > > > On Tue, Nov 27, 2018 at 09:34:43AM +0100, Luca Ceresoli wrote: > >> The V4L2_SUBDEV_FL_HAS_EVENTS flag should

Re: [PATCH] media: unify some sony camera sensors pattern naming

2018-11-27 Thread Sakari Ailus
ming > > to make it more clear to the userspace. > > > > Suggested-by: Sakari Ailus > > Signed-off-by: Bingbu Cao > > --- > > drivers/media/i2c/imx258.c | 8 > > drivers/media/i2c/imx319.c | 8 > > drivers/media/i2c/imx355.c |

Re: [PATCH] media: imx274: fix stack corruption in imx274_read_reg

2018-11-27 Thread Sakari Ailus
l); > if (err) > dev_err(&priv->client->dev, > "%s : i2c read failed, addr = %x\n", __func__, addr); > else > dev_dbg(&priv->client->dev, > "%s : addr 0x%x, val=0x%x\n", __func__, > - addr, *val); > + addr, uint_val); > + > + *val = uint_val; > return err; > } > > -- > 2.17.1 > -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH 1/3] media: imx274: don't declare events, they are not implemented

2018-11-27 Thread Sakari Ailus
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; > + sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > > /* initialize subdev media pad */ > imx274->pad.flags = MEDIA_PAD_FL_SOURCE; -- Sakari Ailus sakari.ai...@linux.intel.com

[PATCH 1/1] v4l: ioctl: Allow drivers to fill in the format description

2018-11-26 Thread Sakari Ailus
description begins with a non-nil character before issuing the warning. Signed-off-by: Sakari Ailus Suggested-by: Hans Verkuil --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2

Re: [PATCH 2/2] media: imx355: fix wrong order in test pattern menus

2018-11-26 Thread Sakari Ailus
t Vertical Colour Bars", "Colour Bars With Fade to Grey", "Pseudorandom Sequence (PN9)", }; It's not strictly necessary from interface point of view, but for the user space it'd be good to align the naming. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v3] media: video-i2c: check if chip struct has set_power function

2018-11-25 Thread Sakari Ailus
Hi Matt, On Sat, Nov 24, 2018 at 02:03:23PM -0800, Matt Ranostay wrote: > Not all future supported video chips will always have power management > support, and so it is important to check before calling set_power() is > defined. > > Cc: Sakari Ailus > Cc: Hans Verkuil &g

Re: 'bad remote port parent' warnings

2018-11-23 Thread Sakari Ailus
oint@0 (-22) > [3.457342] imx-ipuv3-csi: probe of imx-ipuv3-csi.1 failed with error -22 > [3.464498] imx-ipuv3 280.ipu: driver could not parse > port@0/endpoint@0 (-22) > [3.472120] imx-ipuv3-csi: probe of imx-ipuv3-csi.4 failed with error -22 I'm not sure if this is a real prob

[yavta PATCH 1/1] Zero dev in main()

2018-11-22 Thread Sakari Ailus
From: Sakari Ailus This is necessary since video_open() may not be always called soon Signed-off-by: Sakari Ailus --- yavta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yavta.c b/yavta.c index c7986bd..de5376d 100644 --- a/yavta.c +++ b/yavta.c @@ -342,7 +342,6

Re: is it possible to use single IOCTL to setup media pipeline?

2018-11-22 Thread Sakari Ailus
XT_CTRLS for configuring the media > topology would solve the performance problem. There have been ideas of moving all IOCTL handling to the media device, in a way that would allow issuing them in the same fashion than controls. This was discussed in last year's media summit actually. I think this could be done once the request API is otherwise working for e.g. camera devices. I don't expect this to materialise in near (or even medium) term though. -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

[GIT PULL for 4.21] Sensor and CSI driver patches

2018-11-22 Thread Sakari Ailus
A31 compatible Nathan Chancellor (1): media: imx214: Remove unnecessary self assignment in for loop Rui Miguel Silva (1): media: ov2680: fix null dereference at power on Sakari Ailus (2): v4l: uAPI doc: Simplify NATIVE_SIZE selection target documentation v4l: uAPI doc: Chang

Re: [PATCH v3 03/14] media: ov7670: hook s_power onto v4l2 core

2018-11-22 Thread Sakari Ailus
ower_off: > - ov7670_s_power(sd, 0); > + ov7670_power_off(sd); > clk_disable: > clk_disable_unprepare(info->clk); > return ret; > @@ -1945,7 +1983,7 @@ static int ov7670_remove(struct i2c_client *client) > v4l2_ctrl_handler_free(&info->hdl); > clk_disable_unprepare(info->clk); > media_entity_cleanup(&info->sd.entity); > - ov7670_s_power(sd, 0); > + ov7670_power_off(sd); > return 0; > } > Could you consider instead switching to runtime PM? A few drivers such as the ov2685 driver does that already. -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH v2 for v4.4 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-22 Thread Sakari Ailus
On Tue, Nov 20, 2018 at 09:21:50AM -0200, Mauro Carvalho Chehab wrote: > Em Tue, 20 Nov 2018 12:49:46 +0200 > Sakari Ailus escreveu: > > > Hi Greg, > > > > On Mon, Nov 19, 2018 at 06:46:21PM +0100, Greg Kroah-Hartman wrote: > > > On Mon, Nov 19, 2018 at

Re: [PATCH] media: ov2680: fix null dereference at power on

2018-11-22 Thread Sakari Ailus
erwise they'll wrap in git log. I've re-wrapped it this time. Thanks. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v8 03/12] media: staging/imx7: add imx7 CSI subdev driver

2018-11-21 Thread Sakari Ailus
struct v4l2_async_subdev *asd) > +{ > + return fwnode_device_is_available(asd->match.fwnode) ? 0 : -EINVAL; > +} > + > +static int imx7_csi_parse_dt(struct imx7_csi *csi) > +{ > + struct device *dev = csi->dev; > + > + csi->clk_disp_axi = devm_clk_get(dev, "axi"); > + if (IS_ERR(csi->clk_disp_axi)) { > + dev_err(dev, "Could not get csi axi clock\n"); > + return -ENODEV; > + } > + > + csi->clk_disp_dcic = devm_clk_get(dev, "dcic"); > + if (IS_ERR(csi->clk_disp_dcic)) { > + dev_err(dev, "Could not get disp dcic clock\n"); > + return -ENODEV; > + } > + > + csi->clk_csi_mclk = devm_clk_get(dev, "mclk"); > + if (IS_ERR(csi->clk_csi_mclk)) { > + dev_err(dev, "Could not get csi mclk clock\n"); > + return -ENODEV; > + } Could you use devm_clk_bulk_get()? > + > + return 0; > +} > + > +static int imx7_csi_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct device_node *node = dev->of_node; > + 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_parse_dt(csi); > + if (ret < 0) > + 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"); > + return -ENODEV; mutex_destroy(); better to add a label below. > + } > + > + /* add media device */ > + csi->imxmd = imx_media_dev_init(dev); > + if (IS_ERR(csi->imxmd)) > + return PTR_ERR(csi->imxmd); > + > + ret = imx_media_of_add_csi(csi->imxmd, node); > + if (ret < 0) > + goto media_cleanup; > + > + ret = imx_media_dev_notifier_register(csi->imxmd); > + if (ret < 0) > + goto media_cleanup; > + > + 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); > + mutex_destroy(&csi->lock); > + imx_media_capture_device_remove(csi->vdev); > + > +media_cleanup: > + imx_media_dev_cleanup(csi->imxmd); > + > + 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); > + > + v4l2_ctrl_handler_free(&csi->ctrl_hdlr); > + mutex_destroy(&csi->lock); Please unregister the devices before the two above lines. > + imx_media_capture_device_remove(csi->vdev); > + imx_media_dev_notifier_unregister(csi->imxmd); > + imx_media_dev_cleanup(csi->imxmd); > + media_entity_cleanup(&sd->entity); > + v4l2_async_unregister_subdev(sd); > + > + 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"); > +MODULE_ALIAS("platform:imx7-csi"); -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v8 05/12] media: dt-bindings: add bindings for i.MX7 media driver

2018-11-21 Thread Sakari Ailus
Hi Rui, On Wed, Nov 21, 2018 at 11:15:51AM +, Rui Miguel Silva wrote: > Add bindings documentation for i.MX7 media drivers. > The imx7 MIPI CSI2 and imx7 CMOS Sensor Interface. > > Signed-off-by: Rui Miguel Silva > Reviewed-by: Rob Herring > Acked-by: Sakari Ailus >

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

2018-11-21 Thread Sakari Ailus
e callback gets called once there are no file handles open to the device. That may well be much later than the device has been unbound from the driver. -- Sakari Ailus sakari.ai...@linux.intel.com

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

2018-11-21 Thread Sakari Ailus
Hi Maxime, On Thu, Nov 15, 2018 at 08:04:24PM +0100, Maxime Ripard wrote: > Hi Sakari, > > On Tue, Nov 13, 2018 at 10:38:55AM +0200, Sakari Ailus wrote: > > > + - allwinner,has-isp: Whether the CSI controller has an ISP > > > + associated to it o

[PATCH 1/1] v4l: uAPI doc: Changing frame interval won't change format

2018-11-21 Thread Sakari Ailus
Document that changing the frame interval has no effect on frame size. While this was the assumption in the API, it was not documented as such. Signed-off-by: Sakari Ailus --- Documentation/media/uapi/v4l/vidioc-g-parm.rst | 3 +++ Documentation/media/uapi/v4l/vidioc-subdev-g

Re: [PATCH] media: video-i2c: don't use msleep for 1ms - 20ms

2018-11-20 Thread Sakari Ailus
ce msleep(2) by usleep_range(2000, 3000). > > Reported-by: Hans Verkuil > Cc: Matt Ranostay > Cc: Sakari Ailus > Cc: Hans Verkuil > Cc: Mauro Carvalho Chehab > Signed-off-by: Akinobu Mita Acked-by: Sakari Ailus -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [linux-sunxi] [PATCH v12 2/2] media: V3s: Add support for Allwinner CSI.

2018-11-20 Thread Sakari Ailus
notifier); > > > + struct v4l2_device *v4l2_dev = &csi->v4l2_dev; > > > + struct v4l2_subdev *sd; > > > + int ret; > > > + > > > + dev_dbg(csi->dev, "notify complete, all subdevs registered\n"); > > > + > > > + if (notifier->num_subdevs != 1) > > > > drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c: In function > > ‘sun6i_subdev_notify_complete’: > > drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c:646:14: error: > > ‘struct v4l2_async_notifier’ has no member named ‘num_subdevs’ > > This build issues on linux-next, let me know you have next version > changes for this, thanks. I've applied Maxime's fixes to the patch that went in: https://git.linuxtv.org/sailus/media_tree.git/commit/?id=78d1d55a4fe1f82b83278c93803fbdf6226f698f> -- Sakari Ailus sakari.ai...@linux.intel.com

Re: 'bad remote port parent' warnings

2018-11-20 Thread Sakari Ailus
eo-mux 20e.iomuxc-gpr:ipu2_csi1_mux: bad remote > port parent > > Is there anything we should do to prevent this from happening? Where's the DT source for the board? -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 for v4.4 1/1] v4l: event: Add subscription to list before calling "add" operation

2018-11-20 Thread Sakari Ailus
Hi Greg, On Mon, Nov 19, 2018 at 06:46:21PM +0100, Greg Kroah-Hartman wrote: > On Mon, Nov 19, 2018 at 07:03:54PM +0200, Sakari Ailus wrote: > > Hi Greg, > > > > On Mon, Nov 19, 2018 at 04:14:00PM +0100, Greg Kroah-Hartman wrote: > > > On Wed, Nov 14, 2018 at 11:37:

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