Re: [PATCH v2] media: ov5640: do not change mode if format or frame interval is unchanged

2018-09-01 Thread Sakari Ailus
t; Sorry for inconvenience. No worries; thanks for the fix! -- Sakari Ailus e-mail: sakari.ai...@iki.fi

[GIT FIXES for 4.19] mt9v111 control handler init fix

2018-08-31 Thread Sakari Ailus
9v111: Fix v4l2-ctrl error handling drivers/media/i2c/mt9v111.c | 41 + 1 file changed, 13 insertions(+), 28 deletions(-) -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH] media: sr030pc30: inconsistent NULL checking in sr030pc30_base_config()

2018-08-31 Thread Sakari Ailus
ver's probe() function; doing the same here seems redundant. Just checking ret and failing if it's non-zero should suffice: if (ret) return ret; Let me know if you'd like to respin; I can do that as well. > > expmin = EXPOS_MIN_MS * info->pdata->clk_rate /

Re: [PATCH v3 1/2] media: dt-bindings: bind nokia,n900-ir to generic pwm-ir-tx driver

2018-08-31 Thread Sakari Ailus
it later if there's a need to e.g. do something differently for the N900 IR transmitter. It'd be nice if someone tested it, too... > { .compatible = "pwm-ir-tx", }, > { }, > }; -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCHv2 09/10] media-request: EPERM -> EACCES

2018-08-30 Thread Sakari Ailus
On Thu, Aug 30, 2018 at 01:51:39PM +0200, Hans Verkuil wrote: > On 08/30/2018 12:15 PM, Sakari Ailus wrote: > > Hi Hans, > > > > Thanks a lot for working on this! > > > > On Tue, Aug 28, 2018 at 03:49:10PM +0200, Hans Verkuil wrote: > >> From: H

[GIT PULL for 4.20] Sensor and Intel CIO2 driver cleanups, fixes

2018-08-30 Thread Sakari Ailus
: ov772x: use SCCB regmap media: ov9650: use SCCB regmap Alexey Khoroshilov (1): media: ov772x: Disable clk on error path Hugues Fruchet (1): media: ov5640: fix mode change regression Sakari Ailus (2): ov5670, ov13858: Use pm_runtime_idle i2c: Fix

Re: [PATCH 1/2] dt-bindings: dw9714, dw9807-vcm: Add files to MAINTAINERS, rename files

2018-08-30 Thread Sakari Ailus
Ping? On Mon, Jul 23, 2018 at 01:50:38PM +0300, Sakari Ailus wrote: > Add the DT binding documentation for dw9714 and dw9807-vcm to the > MAINTAINERS file. The dw9807-vcm binding documentation file is renamed to > match the dw9807's VCM bit's compatible string. > > Si

Re: [PATCHv2 09/10] media-request: EPERM -> EACCES

2018-08-30 Thread Sakari Ailus
n ERR_PTR(-EPERM); > + return ERR_PTR(-EACCES); > > filp = fget(request_fd); > if (!filp) > @@ -405,7 +405,7 @@ int media_request_object_bind(struct media_request *req, > int ret = -EBUSY; > > if (WARN_ON(!ops->release)) > - return -EPERM; > + return -EACCES; > > spin_lock_irqsave(&req->lock, flags); > -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH v2 00/23] V4L2 fwnode rework; support for default configuration

2018-08-29 Thread Sakari Ailus
Hi Steve, On Tue, Aug 28, 2018 at 05:53:51PM -0700, Steve Longerbeam wrote: > Hi Sakari, > > > On 08/27/2018 02:29 AM, Sakari Ailus wrote: > > Hello everyone, > > > > I've long thought the V4L2 fwnode framework requires some work (it's buggy > >

[RFC 1/1] v4l: samsung, ov9650: Rely on V4L2-set sub-device names

2018-08-29 Thread Sakari Ailus
driver or the module while omitting the device's I²C address and bus, leaving the devices with a static name and effectively limiting the number of such devices in a media device to 1. Address this by using the name set by the V4L2 framework. Signed-off-by: Sakari Ailus --- Hi, I'm a bit

[PATCH 0/3] Uniformly assign sub-device names

2018-08-29 Thread Sakari Ailus
brings no functional change. Sakari Ailus (3): v4l: subdev: Add a function to set an I²C sub-device's name smiapp: Use v4l2_i2c_subdev_set_name v4l: sr030pc30: Remove redundant setting of sub-device name drivers/media/i2c/smiapp/smiapp-core.c | 10 -- drivers/media/i2c/sr030p

[PATCH 2/3] smiapp: Use v4l2_i2c_subdev_set_name

2018-08-29 Thread Sakari Ailus
Use v4l2_i2c_subdev_set_name() to set the name of the smiapp driver's sub-devices. There is no functional change. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/smiapp/s

[PATCH 1/3] v4l: subdev: Add a function to set an I²C sub-device's name

2018-08-29 Thread Sakari Ailus
v4l2_i2c_subdev_set_name() can be used to assign a name to a sub-device. This way uniform names can be formed easily without having to resort to things such as snprintf in drivers. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-common.c | 18 ++ include/media/v4l2

[PATCH 3/3] sr030pc30: Remove redundant setting of sub-device name

2018-08-29 Thread Sakari Ailus
The sub-device name is set right after in v4l2_i2c_subdev_init(). Remove the redundant strcpy() call. Signed-off-by: Sakari Ailus --- drivers/media/i2c/sr030pc30.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/sr030pc30.c b/drivers/media/i2c/sr030pc30.c index 2a4882cddc51

Re: [PATCH v1 2/2] v4l: Document Intel IPU3 meta data uAPI

2018-08-28 Thread Sakari Ailus
user space compiling with it. > > By the way, I wonder if this is the right approach for controlling the > layout of ABI structs. I don't see many headers using any alignment in > uapi/ in general. Perhaps explicit padding bytes would be more > appropriate? They are also less tricky when one structure needs to be > embedded inside two or more different structures with different > alignments, which can't be done easily if you specify __aligned() on > the child struct. One of the reasons there are not so many are probably what you just elaborated above. That said, there are a few points to note here: - the alignment is generally the same here as it's due to DMA word size AFAIK, - the device can be only found in an Intel SoC which limits the architectures where the driver can actually be used to x86, 64- or 32-bit. Together these should in theory make if fairly safe. Padding in principle would be more explicit way to force struct memory layout without relying so much on the compiler doing the right thing but it'll lead to a *lot* of reserved fields, which I think is likely one of the reasons why it didn't catch up back then --- I've suggested it earlier. FWIW, the rest of the uAPI headers appear to be using __attribute__((aligned(x))). -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[PATCH v2 04/23] dt-bindings: media: Specify bus type for MIPI D-PHY, others, explicitly

2018-08-27 Thread Sakari Ailus
and Bt.656 interfaces but the means to pass that information to software wasn't there. Autodetection (value 0) is removed as an option as the property could be simply omitted in that case. Signed-off-by: Sakari Ailus --- Documentation/devicetree/bindings/media/video-interfaces.txt | 4 +++- 1

[PATCH v2 11/23] v4l: fwnode: Only assign configuration if there is no error

2018-08-27 Thread Sakari Ailus
Only assign endpoint configuration if the endpoint is parsed successfully. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers

[PATCH v2 02/23] v4l: fwnode: Use fwnode_graph_for_each_endpoint

2018-08-27 Thread Sakari Ailus
Use fwnode_graph_for_each_endpoint iterator for better readability. Signed-off-by: Sakari Ailus Reviewed-by: Niklas Söderlund --- drivers/media/v4l2-core/v4l2-fwnode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media

[PATCH v2 12/23] v4l: fwnode: Support driver-defined lane mapping defaults

2018-08-27 Thread Sakari Ailus
Make use of the default CSI-2 lane mapping from caller-passed configuration. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media

[PATCH v2 09/23] v4l: fwnode: Make use of newly specified bus types

2018-08-27 Thread Sakari Ailus
Add support for parsing CSI-2 D-PHY, parallel or Bt.656 bus explicitly. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 53 --- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b

[PATCH v2 08/23] v4l: fwnode: Detect bus type correctly

2018-08-27 Thread Sakari Ailus
types. Default to Bt.656 if no properties suggesting a bus type are found. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 31 +-- include/media/v4l2-mediabus.h | 2 ++ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/dr

[PATCH v2 05/23] v4l: fwnode: Add definitions for CSI-2 D-PHY, parallel and Bt.656 busses

2018-08-27 Thread Sakari Ailus
Add definitions corresponding to DT bindings to the CSI-2 D-PHY, parallel and Bt.656 busses. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2

[PATCH v2 01/23] v4l: fwnode: Add debug prints for V4L2 endpoint property parsing

2018-08-27 Thread Sakari Ailus
Print debug info as standard V4L2 endpoint are parsed. Signed-off-by: Sakari Ailus Reviewed-by: Niklas Söderlund --- drivers/media/v4l2-core/v4l2-fwnode.c | 108 ++ 1 file changed, 85 insertions(+), 23 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2

[PATCH v2 15/23] v4l: fwnode: Use default parallel flags

2018-08-27 Thread Sakari Ailus
The caller may provide default flags for the endpoint. Change the configuration based on what is available through the fwnode property API. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers

[PATCH v2 14/23] v4l: fwnode: Parse the graph endpoint as last

2018-08-27 Thread Sakari Ailus
Parsing the graph endpoint is always successful; therefore parse it as last. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2

[PATCH v2 18/23] v4l: fwnode: Use media bus type for bus parser selection

2018-08-27 Thread Sakari Ailus
Use the media bus types instead of the fwnode bus types internally. This is the interface to the drivers as well, making the use of the fwnode bus types more localised to the V4L2 fwnode framework. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 100

[PATCH v2 23/23] smiapp: Query the V4L2 endpoint for a specific bus type

2018-08-27 Thread Sakari Ailus
Instead of opportunistically trying to gather some information from the V4L2 endpoint, set the bus type and let the V4L2 fwnode framework figure out the configuration. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH v2 13/23] v4l: fwnode: Support default CSI-2 lane mapping for drivers

2018-08-27 Thread Sakari Ailus
Most hardware doesn't support re-mapping of the CSI-2 lanes. Especially sensor drivers have a default number of lanes. Instead of requiring the caller (the driver) to provide such a unit mapping, provide one if no mapping is configured. Signed-off-by: Sakari Ailus --- drivers/media/v4l2

[PATCH v2 07/23] v4l: fwnode: Let the caller provide V4L2 fwnode endpoint

2018-08-27 Thread Sakari Ailus
Instead of allocating the V4L2 fwnode endpoint in v4l2_fwnode_endpoint_alloc_parse, let the caller to do this. This allows setting default parameters for the endpoint which is a very common need for drivers. Signed-off-by: Sakari Ailus --- drivers/media/i2c/ov2659.c | 14

[PATCH v2 19/23] v4l: fwnode: Print bus type

2018-08-27 Thread Sakari Ailus
Print bus type either as set by the driver or as parsed from the bus-type property, as well as the guessed V4L2 media bus type. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 38 +++ 1 file changed, 38 insertions(+) diff --git a/drivers

[PATCH v2 21/23] v4l: fwnode: Support parsing of CSI-2 C-PHY endpoints

2018-08-27 Thread Sakari Ailus
The V4L2 fwnode framework only parsed CSI-2 D-PHY endpoints while C-PHY support wasn't there. Also parse endpoints for media bus type V4L2_MBUS_CSI2_CPHY. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-)

[PATCH v2 00/23] V4L2 fwnode rework; support for default configuration

2018-08-27 Thread Sakari Ailus
rwise are set. In v1 and error was returned, which would have been troublesome for the existing drivers. - Set the bus_type field to zero (i.e. guess) for existing callers of v4l2_fwnode_endpoint_(alloc_)parse. - Improved documentation for v4l2_fwnode_endpoint_parse and v4l2_fwnode_endpoint_a

[PATCH v2 17/23] v4l: fwnode: Only zero the struct if bus type is set to V4L2_MBUS_UNKNOWN

2018-08-27 Thread Sakari Ailus
In order to prepare for allowing drivers to set the defaults for a given bus, make zeroing the struct conditional based on detecting the bus. All callers now set the bus type to zero which allows only zeroing the remaining bus union. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2

[PATCH v2 06/23] v4l: mediabus: Recognise CSI-2 D-PHY and C-PHY

2018-08-27 Thread Sakari Ailus
The CSI-2 bus may use either D-PHY or C-PHY. Make this visible in media bus enum. Signed-off-by: Sakari Ailus --- drivers/gpu/ipu-v3/ipu-csi.c | 2 +- drivers/media/i2c/adv7180.c | 2 +- drivers/media/i2c/ov5640.c | 4 ++-- drivers

[PATCH v2 22/23] v4l: fwnode: Update V4L2 fwnode endpoint parsing documentation

2018-08-27 Thread Sakari Ailus
The semantics of v4l2_fwnode_endpoint_parse() and v4l2_fwnode_endpoint_alloc_parse() have changed slightly: they now take the bus type from the user as well as a default configuration for the bus that shall reflect the DT binding defaults. Document this. Signed-off-by: Sakari Ailus --- include

[PATCH v2 10/23] v4l: fwnode: Read lane inversion information despite lane numbering

2018-08-27 Thread Sakari Ailus
Read the lane inversion independently of whether the "data-lanes" property exists. This makes sense since the caller may pass the number of lanes as the default configuration while the lane inversion configuration may still be available in firmware. Signed-off-by: Sakari Ailus --- dri

[PATCH v2 20/23] v4l: fwnode: Use V4L2 fwnode endpoint media bus type if set

2018-08-27 Thread Sakari Ailus
with what's in DT. Also return -ENXIO if bus type detection failed to separate this from the rest of the errors. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/

[PATCH v2 16/23] v4l: fwnode: Initialise the V4L2 fwnode endpoints to zero

2018-08-27 Thread Sakari Ailus
-by: Sakari Ailus --- drivers/media/i2c/adv7604.c | 2 +- drivers/media/i2c/mt9v032.c | 2 +- drivers/media/i2c/ov5647.c| 2 +- drivers/media/i2c/ov7670.c| 2 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +- drivers

[PATCH v2 03/23] v4l: fwnode: The CSI-2 clock is continuous if it's not non-continuous

2018-08-27 Thread Sakari Ailus
The continuous clock flag was only set if there was a clock or data lanes. This isn't needed as such a configuration is invalid to begin with. Always set the continuous clock flag if the non-continuous property is not found. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwn

Re: [PATCHv18 24/35] videobuf2-core: embed media_request_object

2018-08-25 Thread Sakari Ailus
On Tue, Aug 14, 2018 at 04:20:36PM +0200, Hans Verkuil wrote: > From: Hans Verkuil > > Make vb2_buffer a request object. > > Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCHv18 23/35] vb2: add init_buffer buffer op

2018-08-25 Thread Sakari Ailus
> > Signed-off-by: Hans Verkuil > Reviewed-by: Mauro Carvalho Chehab Acked-by: Sakari Ailus -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCHv18 22/35] videodev2.h: Add request_fd field to v4l2_buffer

2018-08-25 Thread Sakari Ailus
. > > If a buffer is stored in a request, but not yet queued to the > driver, then V4L2_BUF_FLAG_IN_REQUEST is set. > > Signed-off-by: Hans Verkuil > Reviewed-by: Mauro Carvalho Chehab Acked-by: Sakari Ailus -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: camss: camera controls missing on vfe interfaces

2018-08-25 Thread Sakari Ailus
ver, that this is not the best time for taking > such discussions, as several core developers will be taking > vacations those days. I marked the patch obsoleted for now --- the controls available are dependent on the pipeline and the pipeline may change, leading the handler pointing to a different device's control handler. I certainly have no problems in doing this in principle, but it cannot currently be done safely nor correctly in the kernel in many cases. As the controls available in the video node, in general case, would comprise of controls from several different devices, and thus several different control handlers, there may well be duplicates and in this case the kernel would have no clue what to do in such a case. In user space you can have policies that could be applied in such a case; the kernel just provides an interface to the hardware, effectively. Regarding this topic --- there's work beginning towards supporting complex cameras in Linux and this particular matter belongs to the same problem area. -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH] media: aptina-pll: allow approximating the requested pix_clock

2018-08-25 Thread Sakari Ailus
* computes the necessary out_clock frequency. The ext_clock / out_clock > * ratio is then approximated with n / m within their respective bounds. > * For each parameter choice, the preconditions must be rechecked, > * because integer rounding errors may result in violating some of the > * preconditions. The parameter set with the least frequency error is > * returned. > */ > > Is this what you are looking for? > > Helmut -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCHv18 07/35] v4l2-device.h: add v4l2_device_supports_requests() helper

2018-08-24 Thread Sakari Ailus
On Tue, Aug 14, 2018 at 04:20:19PM +0200, Hans Verkuil wrote: > From: Hans Verkuil > > Add a simple helper function that tests if the driver supports > the request API. > > Signed-off-by: Hans Verkuil > Reviewed-by: Mauro Carvalho Chehab Acked-by: Sakari Ailus --

Re: [PATCH] media: aptina-pll: allow approximating the requested pix_clock

2018-08-23 Thread Sakari Ailus
ensor->pix_clock = pdata->pix_clock; > + sensor->pix_clock = pll.pix_clock; > > ret = mt9m032_write(client, MT9M032_PLL_CONFIG1, > (pll.m << MT9M032_PLL_CONFIG1_MUL_SHIFT) | > @@ -711,6 +711,7 @@ static int mt9m032_probe(struct i2c_client *client, > struct mt9m032_platform_data *pdata = client->dev.platform_data; > struct i2c_adapter *adapter = client->adapter; > struct mt9m032 *sensor; > + struct v4l2_ctrl *pixel_rate_ctrl; > int chip_version; > int ret; > > @@ -780,9 +781,10 @@ static int mt9m032_probe(struct i2c_client *client, > V4L2_CID_EXPOSURE, MT9M032_SHUTTER_WIDTH_MIN, > MT9M032_SHUTTER_WIDTH_MAX, 1, > MT9M032_SHUTTER_WIDTH_DEF); > - v4l2_ctrl_new_std(&sensor->ctrls, &mt9m032_ctrl_ops, > - V4L2_CID_PIXEL_RATE, pdata->pix_clock, > - pdata->pix_clock, 1, pdata->pix_clock); > + pixel_rate_ctrl = v4l2_ctrl_new_std(&sensor->ctrls, &mt9m032_ctrl_ops, > + V4L2_CID_PIXEL_RATE, > + pdata->pix_clock, pdata->pix_clock, > + 1, pdata->pix_clock); > > if (sensor->ctrls.error) { > ret = sensor->ctrls.error; > @@ -810,6 +812,11 @@ static int mt9m032_probe(struct i2c_client *client, > goto error_entity; > usleep_range(1, 11000); > > + ret = __v4l2_ctrl_modify_range(pixel_rate_ctrl, sensor->pix_clock, > +sensor->pix_clock, 1, sensor->pix_clock); > + if (ret < 0) > + goto error_entity; > + > ret = v4l2_ctrl_handler_setup(&sensor->ctrls); > if (ret < 0) > goto error_entity; > -- > 2.11.0 > -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH v1 2/2] v4l: Document Intel IPU3 meta data uAPI

2018-08-22 Thread Sakari Ailus
s://en.wikipedia.org/wiki/Interval_(mathematics)> > > Yet, you're listing from 2^3 to 2^7, and that's confusing. Perhaps > you want to say, instead, that the valid values are at the 3..7 range? > If so, please use something like "values at the [3..7] range". I'd prefer either 3..7 or [3, 7], but the latter is formal. Whether a range is closed or (partially) open matters less with integers though. -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [RFC] Request API questions

2018-08-21 Thread Sakari Ailus
; > > FYI, VIDIOC_G_(EXT_)CTRL returns EINVAL if an unsupported control is > > queried, so if we decided to keep the "cache" functionality after all, > > perhaps we should stay consistent with it? > > Reference: > > https://www.kernel.org/doc/html/latest/media/uapi/v4l/vidioc-g-ext-ctrls.html#return-value > > > > My suggestion would be: > > - EINVAL: the control was not in the request, (if we keep the cache > > functionality) > > - EPERM: the value is not ready, (we selected this code for Decoder > > Interface to mean that CAPTURE format is not ready, which is similar; > > perhaps that could be consistent?) > > > > Note that EINVAL would only apply to writable controls, while EPERM > > only to volatile controls, since the latter can only change due to > > request completion (non-volatile controls can only change as an effect > > of user space action). > > > > I'm inclined to just always return EPERM when calling G_EXT_CTRLS for > a request. We can always relax this in the future. > > So when a request is not yet queued G_EXT_CTRLS returns EPERM, when > queued but not completed it returns EBUSY and once completed it will > work as it does today. It may not be trivial to figure out the state of the request when a control is being accessed. Besides, it could conceivably change during the IOCTL call. How about just using EPERM (or EBUSY) in all cases? -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [RFC] Request API questions

2018-08-20 Thread Sakari Ailus
ent for just ignoring it is that older kernels that do not know > about >this flag will ignore it as well. There is no check against unknown flags. -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH 05/21] dt-bindings: media: Specify bus type for MIPI D-PHY, others, explicitly

2018-08-16 Thread Sakari Ailus
Hi Rob, On Thu, Aug 16, 2018 at 07:48:24AM -0600, Rob Herring wrote: > On Thu, Aug 16, 2018 at 3:17 AM Sakari Ailus > wrote: > > > > Ping? > > > > On Wed, Aug 01, 2018 at 02:16:27PM +0300, Sakari Ailus wrote: > > > Hi Rob, > > > > > > Than

Re: [PATCH 05/21] dt-bindings: media: Specify bus type for MIPI D-PHY, others, explicitly

2018-08-16 Thread Sakari Ailus
Ping? On Wed, Aug 01, 2018 at 02:16:27PM +0300, Sakari Ailus wrote: > Hi Rob, > > Thanks for the review. > > On Tue, Jul 31, 2018 at 03:32:10PM -0600, Rob Herring wrote: > > On Mon, Jul 23, 2018 at 04:46:50PM +0300, Sakari Ailus wrote: > > > Allow specifying the

Re: why does aptina_pll_calculate insist on exact division?

2018-08-14 Thread Sakari Ailus
Hi, On Tue, Aug 14, 2018 at 10:30:14AM +0300, Laurent Pinchart wrote: > Hi Helmut, > > (CC'ing Sakari Ailus who is our current PLL expert after spending so much > time > on the SMIA PLL code) > > On Tuesday, 14 August 2018 09:35:40 EEST Helmut Grohne wrote: > >

Re: [BUG, RFC] media: Wrong module gets acquired

2018-08-14 Thread Sakari Ailus
l2_device_register_subdev(struct v4l2_device > *v4l2_dev, > #endif > error_module: > if (!sd->owner_v4l2_dev) > - module_put(sd->owner); > + module_put(v4l2_dev->dev->driver->owner); > sd->v4l2_dev = NULL; > return err; > } > @@ -318,6 +319,6 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd) > #endif > video_unregister_device(sd->devnode); > if (!sd->owner_v4l2_dev) > - module_put(sd->owner); > + module_put(v4l2_dev->dev->driver->owner); > } > EXPORT_SYMBOL_GPL(v4l2_device_unregister_subdev); > -- > 2.18.0 > -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 00/21] V4L2 fwnode rework; support for default configuration

2018-08-13 Thread Sakari Ailus
Hi Jacopo, On Fri, Aug 10, 2018 at 12:38:57PM +0200, jacopo mondi wrote: > Hi Sakari, >thanks for this nice rework > > On Mon, Jul 23, 2018 at 04:46:45PM +0300, Sakari Ailus wrote: > > Hello everyone, > > > > I've long thought the V4L2 fwnode framework req

[GIT PULL for 4.19] Fix for mt9v111 driver

2018-08-03 Thread Sakari Ailus
08-04 01:05:44 +0300) Jacopo Mondi (1): media: i2c: mt9v111: Fix v4l2-ctrl error handling drivers/media/i2c/mt9v111.c | 41 + 1 file changed, 13 insertions(+), 28 deletions(-) -- Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [RESEND PATCH v4] media: imx208: Add imx208 camera sensor driver

2018-08-03 Thread Sakari Ailus
Print more error log during error handling. > -- Remove mutex_destroy() from imx208_free_controls(). > -- Add more comments. > since v3: > -- Set explicit indices to link frequencies. Could you add support for obtaining the link frequencies from firmware, please? -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 2/2] media: v4l2-common: simplify v4l2_i2c_subdev_init name generation

2018-08-03 Thread Sakari Ailus
On Fri, Aug 03, 2018 at 03:46:32PM +0200, Philippe De Muyter wrote: > Hi Sakari, > > On Fri, Aug 03, 2018 at 03:43:15PM +0300, Sakari Ailus wrote: > > Hi Philippe, > > > > On Wed, Aug 01, 2018 at 11:20:57PM +0200, Philippe De Muyter wrote: > > > When v4l2

Re: [PATCH 2/2] media: v4l2-common: simplify v4l2_i2c_subdev_init name generation

2018-08-03 Thread Sakari Ailus
the effect of this on the actual sub-device (and entity) names? Looking at i2c_dev_set_name(), this will be different. We can't change the existing entity naming in drivers, this will break applications that expect them to be named in a certain way. -- Kind regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCHv5 01/12] media: add 'index' to struct media_v2_pad

2018-08-03 Thread Sakari Ailus
eally trivial to just expose this information, so implement this. > > >> > > >> Signed-off-by: Hans Verkuil > > >> Acked-by: Sakari Ailus > > >> --- > > >> > > >> drivers/media/media-device.c | 1 + > > >>

Re: [PATCH v6 07/13] media: dt-bindings: add bindings for i.MX7 media driver

2018-08-02 Thread Sakari Ailus
power-domains = <&pgc_mipi_phy>; > +phy-supply = <®_1p0d>; > +resets = <&src IMX7_RESET_MIPI_PHY_MRST>; > +reset-names = "mrst"; > +fsl,csis-hs-settle = <3>; > + > +port@0 { > +reg = <0>; > + > +mipi_from_sensor: endpoint { > +remote-endpoint = <&ov2680_to_mipi>; > +data-lanes = <1>; > +}; > +}; > + > +port@1 { > +reg = <1>; > + > +mipi_vc0_to_csi_mux: endpoint { > +remote-endpoint = <&csi_mux_from_mipi_vc0>; > +}; > +}; > +}; -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH] media: imx258: remove test pattern map from driver

2018-08-02 Thread Sakari Ailus
rnal_ops = { > .open = imx258_open, > }; > @@ -1250,6 +1237,7 @@ static int imx258_probe(struct i2c_client *client) > > /* Initialize subdev */ > imx258->sd.internal_ops = &imx258_internal_ops; > + imx258->sd.entity.ops = &imx258_subdev_entity_ops; > imx258->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > imx258->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; > -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 05/21] dt-bindings: media: Specify bus type for MIPI D-PHY, others, explicitly

2018-08-01 Thread Sakari Ailus
Hi Rob, Thanks for the review. On Tue, Jul 31, 2018 at 03:32:10PM -0600, Rob Herring wrote: > On Mon, Jul 23, 2018 at 04:46:50PM +0300, Sakari Ailus wrote: > > Allow specifying the bus type explicitly for MIPI D-PHY, parallel and > > Bt.656 busses. This is useful for devices that

[PATCH 1/1] i2c: Fix pm_runtime_get_if_in_use() usage in sensor drivers

2018-07-30 Thread Sakari Ailus
only. Address this for drivers where this pattern exists. This patch has been produced using the following command: $ git grep -l pm_runtime_get_if_in_use -- drivers/media/i2c/ | \ xargs perl -i -pe 's/(pm_runtime_get_if_in_use\(.*\)) \<\= 0/!$1/' Signed-off-by: Sakari Ailus

Re: [PATCH v2] media: imx208: Add imx208 camera sensor driver

2018-07-30 Thread Sakari Ailus
hat make use of the function. I can submit a fix for those as well. I suppose most people use these with runtime PM enabled as this hasn't been spotted previously. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2] media: imx208: Add imx208 camera sensor driver

2018-07-30 Thread Sakari Ailus
Signed-off-by: Ping-Chung Chen Could you add obtaining the valid link frequencies from the firmware, i.e. use v4l2_fwnode_endpoint_alloc_parse()? -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 1/1] mt9v111: Fix compiler warning by initialising a variable

2018-07-30 Thread Sakari Ailus
On Mon, Jul 30, 2018 at 09:51:25AM +0200, jacopo mondi wrote: > Hi Sakari, > > On Mon, Jul 30, 2018 at 10:26:27AM +0300, Sakari Ailus wrote: > > While this isn't a bug, initialise the variable to quash the warning. > > > > Reported-by: Stephen Rothwell

[PATCH 1/1] mt9v111: Fix compiler warning by initialising a variable

2018-07-30 Thread Sakari Ailus
While this isn't a bug, initialise the variable to quash the warning. Reported-by: Stephen Rothwell Signed-off-by: Sakari Ailus --- drivers/media/i2c/mt9v111.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/mt9v111.c b/drivers/media/i2c/mt9v111.c

[GIT PULL for 4.19] New sensor drivers, cropping support for imx274, dw9807 VCM driver rename

2018-07-27 Thread Sakari Ailus
va (2): media: ov2680: dt: Add bindings for OV2680 media: ov2680: Add Omnivision OV2680 sensor driver Sakari Ailus (1): dw9807-vcm: Recognise this is just the VCM bit of the device .../bindings/media/i2c/aptina,mt9v111.txt | 46 + .../devicetree/bindings/media/i2c/ov268

Re: [PATCH v7 2/2] media: ov2680: Add Omnivision OV2680 sensor driver

2018-07-25 Thread Sakari Ailus
Rui, Could you provide a MAINTAINERS entry patch for the driver as well as the DT bindings? I'll squash that to the first one. -- Regards, Sakari Ailus e-mail: sakari.ai...@iki.fi

Re: [PATCH] media.h: remove linux/version.h include

2018-07-25 Thread Sakari Ailus
ource relied on media.h > to include it. > > Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus -- Sakari Ailus e-mail: sakari.ai...@iki.fi

[GIT PULL for 4.19] ov2680 driver and dw9807 driver rename

2018-07-25 Thread Sakari Ailus
gnise this is just the VCM bit of the device (2018-07-25 15:45:08 +0300) Rui Miguel Silva (2): media: ov2680: dt: Add bindings for OV2680 media: ov2680: Add Omnivision OV2680 sensor driver Sakari Ailus (1):

Re: [PATCH v3 18/35] media: camss: Add basic runtime PM support

2018-07-25 Thread Sakari Ailus
Hi Todor, On Wed, Jul 25, 2018 at 01:01:31PM +0300, Todor Tomov wrote: > Hi Sakari, > > Thank you for review. > > On 24.07.2018 15:49, Sakari Ailus wrote: > > Hi Todor, > > > > On Mon, Jul 23, 2018 at 02:02:35PM +0300, Todor Tomov wrote: > >> There i

Re: [PATCH v10 2/2] media: V3s: Add support for Allwinner CSI.

2018-07-25 Thread Sakari Ailus
Hi Yong, On Wed, Jul 25, 2018 at 06:42:24PM +0800, Yong wrote: > Hi Sakari, > > On Wed, 18 Jul 2018 12:55:14 +0300 > Sakari Ailus wrote: > > > Hi Yong, > > > > On Thu, Jul 05, 201

Re: [RFC] media: thermal I2C cameras metadata

2018-07-25 Thread Sakari Ailus
On Tue, Jul 24, 2018 at 11:05:47PM -0700, Matt Ranostay wrote: > On Mon, Jul 23, 2018 at 4:35 AM, Sakari Ailus wrote: > > Hi Matt, > > > > On Sun, Jul 15, 2018 at 11:05:42PM -0700, Matt Ranostay wrote: > >> Hello et all, > >> > >> So curre

Re: [PATCH v6 00/17] media: imx: Switch to subdev notifiers

2018-07-24 Thread Sakari Ailus
l > > Patches 01-14 are > Tested-by: Philipp Zabel > on i.MX6 with Toshiba TC358743 connected via MIPI CSI-2. > > History: > > v6: > - Export v4l2_async_notifier_init(), which must be called by all > drivers before the first call to v4l2_async_notifier_add

[PATCH 11/21] v4l: fwnode: Support driver-defined lane mapping defaults

2018-07-23 Thread Sakari Ailus
Make use of the default CSI-2 lane mapping from caller-passed configuration. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media

[PATCH 05/21] dt-bindings: media: Specify bus type for MIPI D-PHY, others, explicitly

2018-07-23 Thread Sakari Ailus
and Bt.656 interfaces but the means to pass that information to software wasn't there. Autodetection (value 0) is removed as an option as the property could be simply omitted in that case. Signed-off-by: Sakari Ailus --- Documentation/devicetree/bindings/media/video-interfaces.txt | 4 +++- 1

[PATCH 03/21] v4l: fwnode: Detect bus type correctly

2018-07-23 Thread Sakari Ailus
types. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 43 +++ include/media/v4l2-mediabus.h | 2 ++ 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core

[PATCH 01/21] v4l: fwnode: Add debug prints for V4L2 endpoint property parsing

2018-07-23 Thread Sakari Ailus
Print debug info as standard V4L2 endpoint are parsed. Signed-off-by: Sakari Ailus Reviewed-by: Niklas Söderlund --- drivers/media/v4l2-core/v4l2-fwnode.c | 108 ++ 1 file changed, 85 insertions(+), 23 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2

[PATCH 14/21] v4l: fwnode: Use default parallel flags

2018-07-23 Thread Sakari Ailus
The caller may provide default flags for the endpoint. Change the configuration based on what is available through the fwnode property API. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers

[PATCH 02/21] v4l: fwnode: Use fwnode_graph_for_each_endpoint

2018-07-23 Thread Sakari Ailus
Use fwnode_graph_for_each_endpoint iterator for better readability. Signed-off-by: Sakari Ailus Reviewed-by: Niklas Söderlund --- drivers/media/v4l2-core/v4l2-fwnode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media

[PATCH 00/21] V4L2 fwnode rework; support for default configuration

2018-07-23 Thread Sakari Ailus
would be beneficial: the code flows are rather convoluted and different hardware tends to excercise different flows while the use of the use of defaults has a similar effect. Comments are welcome. I've pushed the patches (including Steve's) here: https://git.linuxtv.org/sailus/media_t

[PATCH 21/21] smiapp: Query the V4L2 endpoint for a specific bus type

2018-07-23 Thread Sakari Ailus
Instead of opportunistically trying to gather some information from the V4L2 endpoint, set the bus type and let the V4L2 fwnode framework figure out the configuration. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH 06/21] v4l: fwnode: Add definitions for CSI-2 D-PHY, parallel and Bt.656 busses

2018-07-23 Thread Sakari Ailus
Add definitions corresponding to DT bindings to the CSI-2 D-PHY, parallel and Bt.656 busses. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2

[PATCH 04/21] v4l: fwnode: The CSI-2 clock is continuous if it's not non-continuous

2018-07-23 Thread Sakari Ailus
ation that this is CSI-2 as it's set in the absence of the property. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c ind

[PATCH 18/21] v4l: fwnode: Use V4L2 fwnode endpoint media bus type if set

2018-07-23 Thread Sakari Ailus
with what's in DT. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 8914abd20ee8..56e3b63

[PATCH 09/21] v4l: fwnode: Read lane inversion information despite lane numbering

2018-07-23 Thread Sakari Ailus
Read the lane inversion independently of whether the "data-lanes" property exists. This makes sense since the caller may pass the number of lanes as the default configuration while the lane inversion configuration may still be available in firmware. Signed-off-by: Sakari Ailus --- dri

[PATCH 10/21] v4l: fwnode: Only assign configuration if there is no error

2018-07-23 Thread Sakari Ailus
Only assign endpoint configuration if the endpoint is parsed successfully. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers

[PATCH 15/21] v4l: fwnode: Allow setting default parameters

2018-07-23 Thread Sakari Ailus
Instead of allocating the V4L2 fwnode endpoint in v4l2_fwnode_endpoint_alloc_parse, let the caller to do this. This allows setting default parameters for the endpoint which is a very common need for drivers. Signed-off-by: Sakari Ailus --- drivers/media/i2c/ov2659.c | 14

[PATCH 16/21] v4l: fwnode: Use media bus type for bus parser selection

2018-07-23 Thread Sakari Ailus
Use the media bus types instead of the fwnode bus types internally. This is the interface to the drivers as well, making the use of the fwnode bus types more localised to the V4L2 fwnode framework. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 98

[PATCH 17/21] v4l: fwnode: Print bus type

2018-07-23 Thread Sakari Ailus
Print bus type either as set by the driver or as parsed from the bus-type property, as well as the guessed V4L2 media bus type. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 38 +++ 1 file changed, 38 insertions(+) diff --git a/drivers

[PATCH 08/21] v4l: fwnode: Make use of newly specified bus types

2018-07-23 Thread Sakari Ailus
Make use of bus type specified for an endpoint. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 48 ++- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2

[PATCH 12/21] v4l: fwnode: Support default CSI-2 lane mapping for drivers

2018-07-23 Thread Sakari Ailus
Most hardware doesn't support re-mapping of the CSI-2 lanes. Especially sensor drivers have a default number of lanes. Instead of requiring the caller (the driver) to provide such a unit mapping, provide one if no mapping is configured. Signed-off-by: Sakari Ailus --- drivers/media/v4l2

[PATCH 20/21] v4l: fwnode: Update V4L2 fwnode endpoint parsing documentation

2018-07-23 Thread Sakari Ailus
The semantics of v4l2_fwnode_endpoint_parse() and v4l2_fwnode_endpoint_alloc_parse() have changed slightly: they now take the bus type from the user as well as a default configuration for the bus that shall reflect the DT binding defaults. Document this. Signed-off-by: Sakari Ailus --- drivers

[PATCH 19/21] v4l: fwnode: Support parsing of CSI-2 C-PHY endpoints

2018-07-23 Thread Sakari Ailus
The V4L2 fwnode framework only parsed CSI-2 D-PHY endpoints while C-PHY support wasn't there. Also parse endpoints for media bus type V4L2_MBUS_CSI2_CPHY. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-)

[PATCH 07/21] v4l: mediabus: Recognise CSI-2 D-PHY and C-PHY

2018-07-23 Thread Sakari Ailus
The CSI-2 bus may use either D-PHY or C-PHY. Make this visible in media bus enum. Signed-off-by: Sakari Ailus --- drivers/gpu/ipu-v3/ipu-csi.c | 2 +- drivers/media/i2c/adv7180.c | 2 +- drivers/media/i2c/ov5640.c | 4 ++-- drivers

[PATCH 13/21] v4l: fwnode: Parse the graph endpoint as last

2018-07-23 Thread Sakari Ailus
Parsing the graph endpoint is always successful; therefore parse it as last. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 26 +- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers

Re: [RFC] media: thermal I2C cameras metadata

2018-07-23 Thread Sakari Ailus
of just exposing the EEPROM to the user space as-is using the NVMEM API. This information is very, very device specific and therefore using a generic interface to access individual values there isn't really useful. -- Sakari Ailus e-mail: sakari.ai...@iki.fi

[PATCH 2/2] dw9807-vcm: Recognise this is just the VCM bit of the device

2018-07-23 Thread Sakari Ailus
The dw9807 contains a voice coil lens driver as well as an EEPROM. This driver is just for the VCM. Reflect this in the driver's name --- this is already the case for the compatible string, for instance. Signed-off-by: Sakari Ailus --- drivers/media/i2c/Kconfig

[PATCH 1/2] dt-bindings: dw9714, dw9807-vcm: Add files to MAINTAINERS, rename files

2018-07-23 Thread Sakari Ailus
Add the DT binding documentation for dw9714 and dw9807-vcm to the MAINTAINERS file. The dw9807-vcm binding documentation file is renamed to match the dw9807's VCM bit's compatible string. Signed-off-by: Sakari Ailus --- .../bindings/media/i2c/{dongwoon,dw9807.txt => dongwoon,dw9807

<    4   5   6   7   8   9   10   11   12   13   >