Re: [PATCH v10 03/14] media: v4l2-fwnode: add initial connector parsing support

2019-10-23 Thread Sakari Ailus
Hi Marco, Apologies for the delay. On Wed, Oct 02, 2019 at 10:07:35AM +0200, Marco Felsch wrote: > Hi Sakari, > > On 19-10-02 10:03, Sakari Ailus wrote: > > Hi Marco, > > > > On Fri, Aug 30, 2019 at 12:16:35PM +0200, Marco Felsch wrote: > > > The patch add

Re: [PATCH v2] doc-rst: add more info for resolution change blocks in ipu3

2019-10-23 Thread Sakari Ailus
f view. +the hardware requirement along with keeping the maximum field of view. The intermediate resolutions can be generated by specific tool and this information can be obtained by looking at the following IPU3 ImgU configuration table. -- Sakari Ailus

[PATCH 1/1] v4l2-fwnode: Print the node name while parsing endpoints

2019-10-21 Thread Sakari Ailus
Print the node name during endpoint parsing for better debuggability. Depends-on: ("lib/vsprintf: Add %pfw conversion specifier for printing fwnode names") Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletion

[GIT PULL for 5.5] SMIA patches for 5.5

2019-10-21 Thread Sakari Ailus
+0300) SMIA patches for 5.5 Sakari Ailus (14): smiapp: Use the BIT macro where appropriate, remove useless definition smiapp: Fix error handling at NVM reading smiapp: Refactor reading NVM page smiapp

[GIT PULL for 5.5] Sensor and lens driver patches

2019-10-21 Thread Sakari Ailus
e/bindings/media/i2c/imx290.txt create mode 100644 drivers/media/i2c/imx290.c -- Sakari Ailus

Re: OMAP3 ISP v4l2 inconsistency on DM3730

2019-10-20 Thread Sakari Ailus
Hi Hans, On Sun, Oct 20, 2019 at 07:26:20PM +0200, Hans Verkuil wrote: > On 10/20/19 7:35 AM, Laurent Pinchart wrote: > > Hi Adam, > > > > On Sat, Oct 19, 2019 at 11:14:03AM -0500, Adam Ford wrote: > >> On Fri, Oct 18, 2019 at 4:17 PM Sakari Ailus wrote: > >&

Re: OMAP3 ISP v4l2 inconsistency on DM3730

2019-10-18 Thread Sakari Ailus
On Fri, Oct 18, 2019 at 04:10:23PM -0500, Adam Ford wrote: > On Fri, Oct 18, 2019 at 4:00 PM Sakari Ailus wrote: > > > > HI Adam, > > > > On Fri, Oct 18, 2019 at 02:38:57PM -0500, Adam Ford wrote: > > > I have a DM3730 with a parallel mt9p031 sensor attached

[PATCH 1/1] smiapp: Destroy sensor's mutex

2019-10-18 Thread Sakari Ailus
Destroy the mutex initialised by the driver in probe. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index

Re: OMAP3 ISP v4l2 inconsistency on DM3730

2019-10-18 Thread Sakari Ailus
#x27;: > Metadata: > encoder : Lavf57.83.100 > Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 480x272, > q=2-31, 72765 kb/s, 17.42 fps, 17.42 tbn, 17.42 tbc > Metadata: > encoder : Lavc57.107.100 rawvideo > > > This shows me the information is available in some ways from v4l2, but > I wonder if there is a missing IOCTL for VIDIOC_ENUM_FMT for the isp > driver somewhere. Shouldn't VIDIOC_ENUM_FMT return UYVY? > > I noticed vpbe_display.c has a function that appears to correspond to > this. There is a patch at [1] for an older kernel. Is this something > worth pursuing? > > [1] - > https://stackoverflow.com/questions/20693155/gstreamer-failed-to-enumerate-video-formats-and-inappropriate-ioctl-for-device -- Kind regards, Sakari Ailus

Re: [PATCH v4 01/11] dt-bindings: video-interfaces: Document 'location' property

2019-10-18 Thread Sakari Ailus
2 - External. The device is not attached directly to the system but is > + attached in a way that allows it to move freely. > > Optional endpoint properties > -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v4 06/11] media: v4l2-fwnode: Add helper to parse device properties

2019-10-18 Thread Sakari Ailus
ller to allocate a > + * valid @struct v4l2_fwnode_device_properties structure and provide a > pointer > + * to it in the @props parameter. > + * > + * Return: > + * % 0 on success > + * %-EINVAL if a parsed property value is not valid > + */ > +int v4l2_fwnode_device_parse(struct device *dev, > + struct v4l2_fwnode_device_properties *props); > + > /** > * typedef parse_endpoint_func - Driver's callback function to be called on > * each V4L2 fwnode endpoint. -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v4 00/11] media: Report camera sensor properties

2019-10-18 Thread Sakari Ailus
ACPI tables > > I know there are still doubts the two properties might well apply to > modern devices with movable cameras, but I still think they cover 99% of > devices > out there at the moment. Could you cc this on the next time (or bounce now) this to the devicetree list, please? -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH] media: v4l2-subdev: Don't use __u32 internally

2019-10-18 Thread Sakari Ailus
duced a few local > functions, unfortunately with arguments of type __u32, reserved for use > in Linux uAPI. Use u32 instead. > > Suggested-by: Sakari Ailus > Signed-off-by: Janusz Krzysztofik Thanks! Acked-by: Sakari Ailus -- Sakari Ailus sakari.ai...@linux.intel.com

[PATCH 2/3] smiapp: Avoid maintaining power state information

2019-10-18 Thread Sakari Ailus
Instead of keeping track of the power state ourselves, let runtime PM handle it. This also splits handling controls between side effect management and writing the new configuration to the sensor's registers. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c

[PATCH 3/3] smiapp: Put the device again if starting streaming fails

2019-10-18 Thread Sakari Ailus
If there was an error in starting streaming, put the runtime usage count of the device. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c

[PATCH 0/3] smiapp PM improvements, omap3isp system crash fix

2019-10-18 Thread Sakari Ailus
Hi folks, Here's a few patches remaining from my previous smiapp and omap3isp sets. Sakari Ailus (3): omap3isp: Don't restart CCDC if we're about to stop smiapp: Avoid maintaining power state information smiapp: Put the device again if starting streaming fails drivers/m

[PATCH 1/3] omap3isp: Don't restart CCDC if we're about to stop

2019-10-18 Thread Sakari Ailus
there's an intent to stop streaming and if there isn't, then set the new buffer and re-enable CCDC. Signed-off-by: Sakari Ailus --- drivers/media/platform/omap3isp/ispccdc.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/omap3isp/is

[PATCH 7/7] omap3isp: Ignore failure of stopping streaming on external subdev

2019-10-17 Thread Sakari Ailus
The isp was marked to have failed to stop if stopping streaming on an external subdev failed. The return value from the external subdev should be ignored instead as it is not part of the ISP and thus the ISP does not need to be reset for that reason. Signed-off-by: Sakari Ailus --- drivers

[PATCH 5/7] smiapp: Register sensor after enabling runtime PM on the device

2019-10-17 Thread Sakari Ailus
Earlier it was possible that the parts of the driver that assumed runtime PM was enabled were being called before runtime PM was enabled in the driver's probe function. So enable runtime PM before registering the sub-device. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-c

[PATCH 6/7] smiapp: Rename update_mode as pll_blanking_update

2019-10-17 Thread Sakari Ailus
Rename the confusingly named smiapp_update_mode() function as smiapp_pll_blanking_update(). The function is used to calculate new PLL and blanking configuration after binning or scaling configuration has been changed. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 6

[PATCH 3/7] smiapp: Don't update sensor configuration during power-on init

2019-10-17 Thread Sakari Ailus
The sensor configuration since it was previously powered off was not changed, so no need to update the PLL configuration etc. What is necessary though is to re-apply the configuration to the sensor's registers. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 4 --

[PATCH 1/7] smiapp: Don't get binning limits dynamically

2019-10-17 Thread Sakari Ailus
-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 65 -- 1 file changed, 65 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index a274527987b8..bf054b2e8e8b 100644 --- a/drivers/media/i2c/smiapp

[PATCH 4/7] smiapp: Use non-binned and binned limits correctly

2019-10-17 Thread Sakari Ailus
Use non-binned limits when binning is disabled and binned when they're enabled. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 27 +++--- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core

[PATCH 0/7] smiapp binning limit cleanups, runtime PM fix and a omap3isp fix

2019-10-17 Thread Sakari Ailus
Hi folks, This set cleans up binning limit handling and fixes runtime PM use by enabling runtime PM *before* any functionality requiring runtime PM may be used. Also a small omap3isp fix is included. Sakari Ailus (7): smiapp: Don't get binning limits dynamically smiapp: Move bi

[PATCH 2/7] smiapp: Move binning configuration to streaming start

2019-10-17 Thread Sakari Ailus
Only write the binning configuration at stream start. It has no effect otherwise. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 43 +- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b

Re: [RFC,V2,07/11] media: platform: Add Mediatek ISP P1 private control

2019-10-02 Thread Sakari Ailus
On Wed, Oct 02, 2019 at 01:55:59PM +0300, Sakari Ailus wrote: > Hi Jungo, Hans, > > On Mon, May 13, 2019 at 10:46:46AM +0200, Hans Verkuil wrote: > > On 5/10/19 3:58 AM, Jungo Lin wrote: > ... > > > +struct v4l2_ctrl_config mtk_cam_controls[] = { > > > + {

Re: [RFC,V2,07/11] media: platform: Add Mediatek ISP P1 private control

2019-10-02 Thread Sakari Ailus
tk_cam_dev *cam_dev, > > + struct v4l2_ctrl_handler *hdl); > > + > > +#endif /* __MTK_CAM_CTRL_H__ */ > > diff --git a/include/uapi/linux/v4l2-controls.h > > b/include/uapi/linux/v4l2-controls.h > > index 06479f2fb3ae..cbe8f5f7782b 10064

Re: [RFC PATCH V3 1/5] dt-bindings: mt8183: Added DIP dt-bindings

2019-10-02 Thread Sakari Ailus
- > .../bindings/media/mediatek,mt8183-dip.txt| 40 +++ Could you add a MAINTAINERS entry for this, please? Same for the driver. -- Sakari Ailus

Re: [RFC PATCH V3 5/5] media: platform: mtk-mdp3: Add struct tuning_addr and img_sw_buffer

2019-10-02 Thread Sakari Ailus
g_sw_buffer is also added. This struct has no cpu address > field and uses a handle instead so that we don't pass a cpu address > to co-processor. > > Signed-off-by: Frederic Chen If the driver depends on this patch, it needs to come before the driver. -- Sakari Ailus

Re: [RFC PATCH V3 3/5] media: platform: Add Mediatek DIP driver KConfig

2019-10-02 Thread Sakari Ailus
g, and rotation function. > > Signed-off-by: Frederic Chen Please merge this to the patch adding the driver. -- Sakari Ailus

Re: [PATCH v10 03/14] media: v4l2-fwnode: add initial connector parsing support

2019-10-02 Thread Sakari Ailus
+ * > + * A reference is taken to both the connector and the connector destination > + * where the connector belongs to. This must be dropped when no longer > needed. > + * Also the memory it has allocated to store the variable size data must be > + * freed. Both dropping the references and freeing the memory is done by > + * v4l2_fwnode_connector_free(). > + * > + * Return: > + * * %0 on success or a negative error code on failure: > + * * %-ENOMEM if memory allocation failed > + * * %-ENOLINK if the connector can't be found > + * * %-EINVAL on parsing failure > + */ > +int v4l2_fwnode_connector_alloc_parse(struct fwnode_handle *fwnode, > + struct v4l2_fwnode_connector *connector); > + > /** > * typedef parse_endpoint_func - Driver's callback function to be called on > * each V4L2 fwnode endpoint. -- Kind regards, Sakari Ailus

[GIT PULL for 5.5] Sensor driver patches

2019-10-01 Thread Sakari Ailus
d crop rectangle not in sync with hardware Sakari Ailus (2): v4l: Put camera sensor, lens and flash drivers under MEDIA_CAMERA_SUPPORT v4l: fwnode: Make v4l2_fwnode_endpoint_free() safer YueHaibing (1): media: max2175: Fix build error without CONFIG_REGMAP_I2C zhengbin (1):

Re: [PATCH] media: i2c: ov5695: Modify the function of async register subdev related devices

2019-09-30 Thread Sakari Ailus
ret = v4l2_async_register_subdev_sensor_common(sd); > > if (ret) { > > dev_err(dev, "v4l2 async register subdev failed\n"); > > goto err_clean_entity; > > -- > > 2.9.2 > > > > Otherwise: > > Reviewed-by: Tomasz Figa Thanks! -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [RFC PATCH] media: rename VFL_TYPE_GRABBER to _VIDEO

2019-09-27 Thread Sakari Ailus
drivers that use it (very easy > search-and-replace) > and finally remove the old GRABBER enum. Acked-by: Sakari Ailus -- Sakari Ailus

[PATCH 0/7] SMIA NVM handling improvements

2019-09-24 Thread Sakari Ailus
Hi all, This set removes the need for the nokia,nvm-size property, and contains small fixes and improvements as well. Sakari Ailus (7): smiapp: Use the BIT macro where appropriate, remove useless definition smiapp: Fix error handling at NVM reading smiapp: Refactor reading NVM page

[PATCH 3/7] smiapp: Refactor reading NVM page

2019-09-24 Thread Sakari Ailus
Split out reading a single NVM page into a separate function. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 83 ++ 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c

[PATCH 2/7] smiapp: Fix error handling at NVM reading

2019-09-24 Thread Sakari Ailus
If NVM reading failed, the device was left powered on. Fix that. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index

[PATCH 6/7] smiapp: Support probing NVM size

2019-09-24 Thread Sakari Ailus
The interface supports probing for the NVM size but this was not implemented in the driver. Do that now. This will also make nokia,nvm-size property redundant. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 103 - drivers/media/i2c/smiapp

[PATCH 7/7] dt-bindings: smia: Remove documentation of nokia,nvm-size

2019-09-24 Thread Sakari Ailus
ge is no longer available. Thus remove this property. Signed-off-by: Sakari Ailus --- Documentation/devicetree/bindings/media/i2c/nokia,smia.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/devicetree/bindings/media/i2c/nokia,smia.txt b/Documentation/devicetree/bindings/media/i2c

[PATCH 1/7] smiapp: Use the BIT macro where appropriate, remove useless definition

2019-09-24 Thread Sakari Ailus
The BIT macro is a better way to define register bits, for 1 << bit is risky for 32-bit registers. Also remove the definition of SMIAPP_DATA_TRANSFER_IF_1_CTRL_RD_EN which has a value of zero. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 3 +-- drivers/med

[PATCH 4/7] smiapp: Add definitions for data transfer if capability bits

2019-09-24 Thread Sakari Ailus
The data transfer capability register was defined but its bits were not. Do that now. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-reg.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/i2c/smiapp/smiapp-reg.h b/drivers/media/i2c/smiapp/smiapp-reg.h index

[PATCH 5/7] smiapp: Don't poll for NVM ready on devices that don't need it

2019-09-24 Thread Sakari Ailus
Only some devices require polling for NVM ready. Do the polling only on devices that need it. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 28 -- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp

Re: [RFC PATCH V3 4/5] platform: mtk-isp: Add Mediatek DIP driver

2019-09-23 Thread Sakari Ailus
Hi Frederic, On Tue, Sep 10, 2019 at 03:22:43AM +0800, frederic.c...@mediatek.com wrote: > From: Frederic Chen > > This patch adds the driver of Digital Image Processing (DIP) > unit in Mediatek ISP system, providing image format > conversion, resizing, and rotation features. > > The mtk-isp di

Re: [RFC PATCH V3 0/5] media: platform: Add support for Digital Image Processing (DIP) on mt8183 SoC

2019-09-23 Thread Sakari Ailus
troller framework. I posted the main part of the DIP driver as RFC to > discuss first and would like some review comments. Could you post media-ctl -p and media-ctl --print-dot outputs for this driver, please? -- Sakari Ailus

[PATCH 1/1] v4l: fwnode: Make v4l2_fwnode_endpoint_free() safer

2019-09-23 Thread Sakari Ailus
Assign vep->link_frequencies to NULL after releasing its memory. Without this change, multiple calls to v4l2_fwnode_endpoint_free() would result in double kfree calls. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 1 + 1 file changed, 1 insertion(+) diff --gi

[PATCH 1/1] v4l: Put camera sensor, lens and flash drivers under MEDIA_CAMERA_SUPPORT

2019-09-23 Thread Sakari Ailus
se devices without that in practice. Signed-off-by: Sakari Ailus --- drivers/media/i2c/Kconfig | 51 +-- 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index fcffcc31d168..3ef778819c5f 10

Re: [PATCHv4 0/3] v4l2-core: Add metadata type to vfl_devnode_type

2019-09-23 Thread Sakari Ailus
inline code, > right? The current drivers all create dedicated metadata devices. Not right now, no. But it's just a question of when, not if. > > Also, this specific use-case is for capture only. Do you think this > might be needed for metadata output as well? As Laurent noted, the DMA engines don't know the data they handle, so in principle it's possible that this could be relevant for output, too. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [RFC PATCH V4 3/4] dt-bindings: mt8183: Add sensor interface dt-bindings

2019-09-18 Thread Sakari Ailus
6000>; > + reg-names = "base_reg", "rx_reg"; > + interrupts = ; > + power-domains = <&scpsys MT8183_POWER_DOMAIN_CAM>; > + clocks = <&camsys CLK_CAM_SENINF>, > + <&topckgen CLK_TOP_MUX_SENINF>; > + clock-names = "CLK_CAM_SENINF", "CLK_TOP_MUX_SENINF"; > + } > + -- Regards, Sakari Ailus

Re: [RFC PATCH V4 2/4] media: platform: Add Mediatek sensor interface driver KConfig

2019-09-18 Thread Sakari Ailus
to create image > + capture application such as video recording and still image > + capture. > + > -- > 2.18.0 > -- Sakari Ailus

Re: [RFC PATCH V4 1/4] media: platform: mtk-isp: Add Mediatek sensor interface driver

2019-09-18 Thread Sakari Ailus
Hi Luis, On Sun, Sep 15, 2019 at 02:50:01PM +0800, Louis Kuo wrote: > This patch adds Mediat:ek's sensor interface driver. Sensor interface > driver > is a MIPI-CSI2 host driver, namely, a HW camera interface controller. > It support a widely adopted, simple, high-speed protocol primarily > intend

Re: [V2, 1/2] media: dt-bindings: media: i2c: Add bindings for ov8856

2019-09-17 Thread Sakari Ailus
> New bindings in YAML, please. My understanding is text documents are still fine. We don't have things like graph.txt or video-interfaces.txt in YAML yet either. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCHv2 1/2] v4l: Add macros for printing V4L fourcc values

2019-09-16 Thread Sakari Ailus
On Mon, Sep 16, 2019 at 12:04:32PM +0200, Hans Verkuil wrote: > From: Sakari Ailus > > Add two macros that facilitate printing V4L fourcc values with printf > family of functions. v4l2_fourcc_conv provides the printf conversion > specifier for printing formats and v4l2_fourcc_ar

Re: [PATCHv2 0/2] Add helper functions to print a fourcc

2019-09-16 Thread Sakari Ailus
Hans! Can you take these to your tree (perhaps pending some sort of agreement with Mauro)? -- Regards, Sakari Ailus

Re: [PATCH 2/2] v4l2-ioctl.c: use new V4L2_FOURCC_CONV/ARGS macros

2019-09-16 Thread Sakari Ailus
> - (char)((fmt->pixelformat >> 24) & 0x7f), > - (fmt->pixelformat & (1UL << 31)) ? > "-BE" : ""); > + snprintf(fmt->description, sz, V4L2_FOURCC_CONV, > + V4L2_FOURCC_ARGS(fmt->pixelformat)); > break; > } > } Acked-by: Sakari Ailus -- Sakari Ailus

Re: [PATCH 1/2] videodev2.h: add macros to print a fourcc

2019-09-16 Thread Sakari Ailus
Hi Hans, On Mon, Sep 16, 2019 at 11:00:46AM +0200, Hans Verkuil wrote: > Add new macros V4L2_FOURCC_CONV and V4L2_FOURCC_ARGS for use > in code that prints a fourcc. These macros can be used in both > kernel and userspace. > > Signed-off-by: Hans Verkuil > Suggeste

Re: [V2, 2/2] media: i2c: Add more sensor modes for ov8856 camera sensor

2019-09-13 Thread Sakari Ailus
er_free(sd->ctrl_handler); > pm_runtime_disable(&client->dev); > + if (!pm_runtime_status_suspended(&client->dev)) > + __ov8856_power_off(ov8856); > + pm_runtime_set_suspended(&client->dev); > mutex_destroy(&ov8856->mutex); > > return 0; > @@ -1172,6 +1752,7 @@ static int ov8856_remove(struct i2c_client *client) > static int ov8856_probe(struct i2c_client *client) > { > struct ov8856 *ov8856; > + unsigned int i; > int ret; > > ret = ov8856_check_hwcfg(&client->dev); > @@ -1186,6 +1767,42 @@ static int ov8856_probe(struct i2c_client *client) > return -ENOMEM; > > v4l2_i2c_subdev_init(&ov8856->sd, client, &ov8856_subdev_ops); > + ov8856->fmt.code = MEDIA_BUS_FMT_SGRBG10_1X10; > + > + ov8856->xvclk = devm_clk_get(&client->dev, "xvclk"); Does this work on ACPI? See e.g. the smiapp driver for an example. The same applies to the rest of the chunk. > + if (IS_ERR(ov8856->xvclk)) { > + dev_err(&client->dev, "failed to get xvclk\n"); > + return -EINVAL; > + } > + > + ret = clk_set_rate(ov8856->xvclk, OV8856_XVCLK_TYP); > + if (ret < 0) { > + dev_err(&client->dev, "failed to set xvclk rate (24MHz)\n"); > + return ret; > + } > + if (clk_get_rate(ov8856->xvclk) != OV8856_XVCLK_TYP) > + dev_warn(&client->dev, > + "xvclk mismatched, modes are based on 24MHz\n"); > + > + ov8856->n_shutdn_gpio = devm_gpiod_get(&client->dev, "reset", > +GPIOD_OUT_LOW); > + if (IS_ERR(ov8856->n_shutdn_gpio)) { > + dev_err(&client->dev, "failed to get reset-gpios\n"); > + return -EINVAL; > + } > + > + for (i = 0; i < OV8856_NUM_SUPPLIES; i++) > + ov8856->supplies[i].supply = ov8856_supply_names[i]; > + > + ret = devm_regulator_bulk_get(&client->dev, OV8856_NUM_SUPPLIES, > + ov8856->supplies); > + if (ret) > + dev_warn(&client->dev, "failed to get regulators\n"); > + > + ret = __ov8856_power_on(ov8856); > + if (ret) > + dev_warn(&client->dev, "failed to power on\n"); > + > ret = ov8856_identify_module(ov8856); > if (ret) { > dev_err(&client->dev, "failed to find sensor: %d", ret); > @@ -1251,11 +1868,18 @@ static const struct acpi_device_id ov8856_acpi_ids[] > = { > MODULE_DEVICE_TABLE(acpi, ov8856_acpi_ids); > #endif > > +static const struct of_device_id ov8856_of_match[] = { > + { .compatible = "ovti,ov8856" }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, ov8856_of_match); > + > static struct i2c_driver ov8856_i2c_driver = { > .driver = { > .name = "ov8856", > .pm = &ov8856_pm_ops, > .acpi_match_table = ACPI_PTR(ov8856_acpi_ids), > + .of_match_table = ov8856_of_match, > }, > .probe_new = ov8856_probe, > .remove = ov8856_remove, -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

[PATCH v2 6/6] smiapp: Avoid fall-through in switch

2019-09-12 Thread Sakari Ailus
Remove switch fall-through cases in the driver. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index

Re: [PATCH 6/6] smiapp: Avoid fall-through in switch

2019-09-12 Thread Sakari Ailus
On Thu, Sep 12, 2019 at 03:17:54PM +0200, Hans Verkuil wrote: > On 8/19/19 2:47 PM, Sakari Ailus wrote: > > Remove switch fall-through cases in the driver. > > > > Signed-off-by: Sakari Ailus > > --- > > drivers/media/i2c/smiapp/smiapp-core.c | 11 +--

Re: [PATCH 2/6] v4l: subdev: Provide a locking scheme for subdev operations

2019-09-12 Thread Sakari Ailus
Hi Hans, On Thu, Sep 12, 2019 at 03:11:27PM +0200, Hans Verkuil wrote: > On 8/19/19 2:47 PM, Sakari Ailus wrote: > > The V4L2 sub-device's operations are called both from other drivers as > > well as through the IOCTL uAPI. Previously the sub-device drivers were > > resp

Re: [V1, 2/2] media: i2c: Add more sensor mode for ov8856 camera sensor

2019-09-09 Thread Sakari Ailus
Hi Dongchun, On Mon, Sep 09, 2019 at 04:46:15PM +0800, Dongchun Zhu wrote: > Hi Sakari, > > On Thu, 2019-08-08 at 16:53 +0300, Sakari Ailus wrote: > > Hi Dongchun, > > > > Thanks for the patch. > > > > On Thu, Aug 08, 2019 at 05:22:15PM +0800, dong

Re: [V4, 1/2] media: dt-bindings: media: i2c: Add bindings for OV02A10

2019-09-09 Thread Sakari Ailus
The practice has been to add the MAINTAINERS entry along with the DT bindings. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [V4, 2/2] media: i2c: Add Omnivision OV02A10 camera sensor driver

2019-09-08 Thread Sakari Ailus
return ret; > + } > + > + ret = clk_set_rate(ov02a10->eclk, ov02a10->eclk_freq); > + if (ret) { > + dev_err(dev, "failed to set eclk frequency (24MHz)\n"); > + return ret; > + } > + > + if (clk_get_rate(ov02a10->eclk) != OV02A10_ECLK_FREQ) { > + dev_warn(dev, "wrong eclk frequency %d Hz, expected: %d Hz\n", > + ov02a10->eclk_freq, OV02A10_ECLK_FREQ); > + return -EINVAL; > + } > + > + ov02a10->pd_gpio = devm_gpiod_get(dev, "powerdown", GPIOD_OUT_HIGH); > + if (IS_ERR(ov02a10->pd_gpio)) { > + dev_err(dev, "failed to get powerdown-gpios\n"); > + return -EINVAL; > + } > + > + ov02a10->n_rst_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); > + if (IS_ERR(ov02a10->n_rst_gpio)) { > + dev_err(dev, "failed to get reset-gpios\n"); > + return -EINVAL; > + } > + > + for (i = 0; i < OV02A10_NUM_SUPPLIES; i++) > + ov02a10->supplies[i].supply = ov02a10_supply_names[i]; > + > + ret = devm_regulator_bulk_get(dev, > + OV02A10_NUM_SUPPLIES, Fits on a single line. > + ov02a10->supplies); > + if (ret) { > + dev_err(dev, "failed to get regulators\n"); > + return ret; > + } > + > + mutex_init(&ov02a10->mutex); > + ov02a10->cur_mode = &supported_modes[0]; > + ret = ov02a10_initialize_controls(ov02a10); > + if (ret) { > + dev_err(dev, "failed to initialize controls\n"); > + goto err_destroy_mutex; > + } > + > + ret = __ov02a10_power_on(ov02a10); > + if (ret) > + goto err_free_handler; > + > + ret = ov02a10_check_sensor_id(ov02a10); > + if (ret) > + goto err_power_off; > + > + ov02a10->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > + ov02a10->subdev.entity.ops = &ov02a10_subdev_entity_ops; > + ov02a10->subdev.entity.function = MEDIA_ENT_F_CAM_SENSOR; > + ov02a10->pad.flags = MEDIA_PAD_FL_SOURCE; > + ret = media_entity_pads_init(&ov02a10->subdev.entity, 1, &ov02a10->pad); > + if (ret < 0) { > + dev_err(dev, "failed to init entity pads: %d", ret); > + goto err_power_off; > + } > + > + ret = v4l2_async_register_subdev(&ov02a10->subdev); > + if (ret) { > + dev_err(dev, "failed to register V4L2 subdev: %d", > + ret); > + goto err_clean_entity; > + } > + > + pm_runtime_set_active(dev); > + pm_runtime_enable(dev); > + pm_runtime_idle(dev); > + > + dev_info(dev, "ov02a10 probe --\n"); Ditto. > + return 0; > + > +err_clean_entity: > + media_entity_cleanup(&ov02a10->subdev.entity); > +err_power_off: > + __ov02a10_power_off(ov02a10); > +err_free_handler: > + v4l2_ctrl_handler_free(ov02a10->subdev.ctrl_handler); > +err_destroy_mutex: > + mutex_destroy(&ov02a10->mutex); > + > + return ret; > +} > + > +static int ov02a10_remove(struct i2c_client *client) > +{ > + struct v4l2_subdev *sd = i2c_get_clientdata(client); > + struct ov02a10 *ov02a10 = to_ov02a10(sd); > + > + v4l2_async_unregister_subdev(sd); > + media_entity_cleanup(&sd->entity); > + v4l2_ctrl_handler_free(sd->ctrl_handler); > + pm_runtime_disable(&client->dev); > + if (!pm_runtime_status_suspended(&client->dev)) > + __ov02a10_power_off(ov02a10); > + pm_runtime_set_suspended(&client->dev); > + mutex_destroy(&ov02a10->mutex); > + > + return 0; > +} > + > +static const struct of_device_id ov02a10_of_match[] = { > + { .compatible = "ovti,ov02a10" }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, ov02a10_of_match); > + > +static struct i2c_driver ov02a10_i2c_driver = { > + .driver = { > + .name = "ov02a10", > + .pm = &ov02a10_pm_ops, > + .of_match_table = ov02a10_of_match, > + }, > + .probe_new = &ov02a10_probe, > + .remove = &ov02a10_remove, > +}; > + > +module_i2c_driver(ov02a10_i2c_driver); > + > +MODULE_AUTHOR("Dongchun Zhu "); > +MODULE_DESCRIPTION("OmniVision OV02A10 sensor driver"); > +MODULE_LICENSE("GPL v2"); > + -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [V4, 1/2] media: dt-bindings: media: i2c: Add bindings for OV02A10

2019-09-08 Thread Sakari Ailus
@@ -11816,6 +11816,13 @@ T: git git://linuxtv.org/media_tree.git > S: Maintained > F: drivers/media/i2c/ov13858.c > > +OMNIVISION OV02A10 SENSOR DRIVER > +M: Dongchun Zhu > +L: linux-media@vger.kernel.org > +T: git git://linuxtv.org/media_tree.git > +S: Maintained > +F: Documentation/devicetree/bindings/media/i2c/ov02a10.txt > + > OMNIVISION OV2680 SENSOR DRIVER > M: Rui Miguel Silva > L: linux-media@vger.kernel.org -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2] media: mc-device.c: fix memleak in media_device_register_entity

2019-09-06 Thread Sakari Ailus
On Fri, Sep 06, 2019 at 01:36:02PM +0300, Laurent Pinchart wrote: > Hi Sakari, > > On Fri, Sep 06, 2019 at 01:11:34PM +0300, Sakari Ailus wrote: > > On Fri, Sep 06, 2019 at 12:12:03PM +0300, Laurent Pinchart wrote: > > > On Mon, Aug 19, 2019 at 09:51:30AM +0800, zh

Re: [PATCH v2] media: mc-device.c: fix memleak in media_device_register_entity

2019-09-06 Thread Sakari Ailus
> > Reported-by: Hulk Robot > > Signed-off-by: zhengbin > > This looks good to me. > > Reviewed-by: Laurent Pinchart > > and applied to my tree, for v5.5. Hmm. This is in my tree as well. Would you like to drop it from yours? :-) -- Sakari Ailus sakari.ai...@linux.intel.com

[GIT PULL for 5.4] MC fix and sensor driver cleanup

2019-09-05 Thread Sakari Ailus
+- drivers/media/mc/mc-device.c | 65 ++-- 2 files changed, 34 insertions(+), 33 deletions(-) -- Regards, Sakari Ailus

Re: [V2, 1/2] media: i2c: dw9768: Add DT support and MAINTAINERS entry

2019-09-05 Thread Sakari Ailus
On Thu, Sep 05, 2019 at 01:49:28PM +0200, Javier Martinez Canillas wrote: > On Thu, Sep 5, 2019 at 1:35 PM Andy Shevchenko > wrote: > > > > On Thu, Sep 05, 2019 at 01:48:30PM +0300, Sakari Ailus wrote: > > > On Thu, Sep 05, 2019 at 01:14:06PM +0300, Andy Shevchenko wr

Re: [V2, 1/2] media: i2c: dw9768: Add DT support and MAINTAINERS entry

2019-09-05 Thread Sakari Ailus
two separate patches Why? The MAINTAINERS entry is usually added in the first patch needing it, isn't it? -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [V3, 2/2] media: i2c: Add Omnivision OV02A10 camera sensor driver

2019-09-05 Thread Sakari Ailus
ge(7*1000, 8*1000), as used in patch v1? > https://patchwork.kernel.org/patch/10957225/ Yes, please. -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [V2, 2/2] media: i2c: Add DW9768 VCM driver

2019-09-05 Thread Sakari Ailus
On Thu, Sep 05, 2019 at 01:19:08PM +0300, Andy Shevchenko wrote: > On Thu, Sep 05, 2019 at 11:21:34AM +0300, Sakari Ailus wrote: > > On Thu, Sep 05, 2019 at 03:21:42PM +0800, dongchun@mediatek.com wrote: > > > From: Dongchun Zhu > > > > +static const struct

Re: [V2, 2/2] media: i2c: Add DW9768 VCM driver

2019-09-05 Thread Sakari Ailus
= i2c_get_clientdata(client); > + struct dw9768 *dw9768 = sd_to_dw9768_vcm(sd); > + > + return dw9768_power_off(dw9768); Please merge this function with dw9768_power_off(); same for dw9768_vcm_resume() below. > +} > + > +static int __maybe_unused dw9768_vcm_resume(struct device *dev) > +{ > + struct i2c_client *client = to_i2c_client(dev); > + struct v4l2_subdev *sd = i2c_get_clientdata(client); > + struct dw9768 *dw9768 = sd_to_dw9768_vcm(sd); > + > + return dw9768_power_on(dw9768); > +} > + > +static const struct i2c_device_id dw9768_id_table[] = { > + { DW9768_NAME, 0 }, > + { }, Could you drop the I²C ID table? > +}; > +MODULE_DEVICE_TABLE(i2c, dw9768_id_table); > + > +static const struct of_device_id dw9768_of_table[] = { > + { .compatible = "dongwoon,dw9768" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, dw9768_of_table); > + > +static const struct dev_pm_ops dw9768_pm_ops = { > + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, > + pm_runtime_force_resume) > + SET_RUNTIME_PM_OPS(dw9768_vcm_suspend, dw9768_vcm_resume, NULL) > +}; > + > +static struct i2c_driver dw9768_i2c_driver = { > + .driver = { > + .name = DW9768_NAME, > + .pm = &dw9768_pm_ops, > + .of_match_table = dw9768_of_table, > + }, > + .probe_new = dw9768_probe, > + .remove = dw9768_remove, > + .id_table = dw9768_id_table, > +}; > + > +module_i2c_driver(dw9768_i2c_driver); > + > +MODULE_AUTHOR("Dongchun Zhu "); > +MODULE_DESCRIPTION("DW9768 VCM driver"); > +MODULE_LICENSE("GPL v2"); -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH v2 09/10] media: i2c: ov5670: Report native size and crop bounds

2019-09-03 Thread Sakari Ailus
in mode selection, the result could be ambiguous. In practice this hasn't been an actual issue. Better sensor drivers (such as smiapp) do not have this problem as the configurations (cropping in three different places as well as binning and scaling) can be all independently configured. So with some

[GIT PULL v2 for 5.4] sun4i csi driver sparse fix

2019-08-30 Thread Sakari Ailus
i csi driver Maxime Ripard (1): media: sun4i: Make sun4i_csi_formats static drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- Sakari Ailus

[GIT PULL for 5.4] sun4i csi driver sparse fix

2019-08-30 Thread Sakari Ailus
river Maxime Ripard (1): media: sun4i: Make sun4i_csi_formats static drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- Sakari Ailus

Re: [PATCH] v4l2-core: fix coding style for the two new c files

2019-08-26 Thread Sakari Ailus
) > +struct v4l2_subdev > +*v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, Hmm. I'd put the asterisk on the previous line --- it's part of the type after all. Reviewed-by: Sakari Ailus > +struct i2c_adapter *adapter, > +

Re: [RFC PATCH V3 1/4] media: platform: mtk-isp: Add Mediatek sensor interface driver

2019-08-26 Thread Sakari Ailus
Hi Luis, On Thu, Jun 06, 2019 at 06:00:30PM +0800, Louis Kuo wrote: > This patch adds Mediat:ek's sensor interface driver. Sensor interface > driver > is a MIPI-CSI2 host driver, namely, a HW camera interface controller. > It support a widely adopted, simple, high-speed protocol primarily > intend

Re: [RFC PATCH V3 2/4] media: platform: Add Mediatek sensor interface driver KConfig

2019-08-26 Thread Sakari Ailus
rding and still image > + capture. Rather than being a separate patch, this should go in with the driver. The DT bindings should precede the driver, and you'll need a MAINTAINERS entry for the driver, too. -- Sakari Ailus

Re: [RFC PATCH V3 3/4] dt-bindings: mt8183: Add sensor interface dt-bindings

2019-08-26 Thread Sakari Ailus
gt; CLK_TOP_MUX_SENINF>; Please wrap before 80 and align the above two lines. > + clock-names = > + "CLK_CAM_SENINF", "CLK_TOP_MUX_SENINF"; No need to wrap here. > + } > + > -- > 1.9.1 This must be old. -- Regards, Sakari Ailus

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

2019-08-26 Thread Sakari Ailus
d to mix those. Please; it improves readability. > > > Note that you need to call the upstream sub-device's s_stream op from here > > as well. > > I tought this is done by the host driver trough iterating over the whole > graph? The driver starting the pipeline is only expected to call s_stream on the next sub-device in the pipeline. ... > > > +static int tc358746_apply_fw(struct tc358746_state *state) > > > +{ > > > + struct v4l2_subdev *sd = &state->sd; > > > + struct tc358746_csi_param *csi_setting; > > > + int err, i; > > > > unsigned int i > > Yes. > > > > + > > > + for (i = 0; i < state->link_frequencies_num; i++) { > > > + csi_setting = &state->link_freq_settings[i]; > > > + > > > + err = tc358746_calculate_csi_txtimings(state, csi_setting); > > > + if (err) { > > > + v4l2_err(sd, "Failed to calc csi-tx tminings\n"); > > > + return err; > > > + } > > > + } > > > + > > > + /* > > > + * Set it to the hw default value. The correct value will be set during > > > + * set_fmt(), since it depends on the pclk and and the resulution. > > > + */ > > > + state->vb_fifo = 1; > > > + > > > + err = clk_prepare_enable(state->refclk); > > > + if (err) { > > > + v4l2_err(sd, "Failed to enable clock\n"); > > > + return err; > > > + } > > > > Is there a need to keep the clock running even if the device is not > > streaming? Please consider adding runtime PM support. That's not strictly > > needed for the patch to be merged though IMO. > > Thats a good point. The Chip can act as clk-provider fo rother devices. > So I would probably say yes. If this is the case, wouldn't it be appropriate to take that into account in DT bindings? If there's no need for that clock, then this chip could be powered off. If the support for that is impelemented later on, then there's a small risk of breaking systems where declaring those clocks was forgotten. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

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

2019-08-26 Thread Sakari Ailus
}; > + }; > + }; > + }; > +}; > diff --git a/MAINTAINERS b/MAINTAINERS > index 57f496cff999..833b3c8fb301 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -15955,6 +15955,13 @@ S: Maintained > F: drivers/media/i2c/tc358743* > F: include/media/i2c/tc358743.h > > +TOSHIBA TC358746 DRIVER > +M: Marco Felsch > +L: linux-media@vger.kernel.org > +S: Maintained > +F: drivers/media/i2c/tc358746* > +F: Documentation/devicetree/bindings/media/i2c/toshiba,tc358746.txt > + > TOSHIBA WMI HOTKEYS DRIVER > M: Azael Avalos > L: platform-driver-...@vger.kernel.org -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 3/5] ov5670: Support probe whilst the device is off

2019-08-26 Thread Sakari Ailus
Hi Tomasz, On Fri, Jun 07, 2019 at 04:54:06PM +0900, Tomasz Figa wrote: > On Wed, Jun 5, 2019 at 7:15 PM Sakari Ailus > wrote: > > > > Hi Tomasz, > > > > On Wed, Jun 05, 2019 at 04:07:52PM +0900, Tomasz Figa wrote: > > > Hi Sakari, > > > > &

[GIT PULL for 5.4] A10 CSI driver and atmel-isi fix

2019-08-23 Thread Sakari Ailus
/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c -- Kind regards, Sakari Ailus

Re: [V3, 2/2] media: i2c: Add Omnivision OV02A10 camera sensor driver

2019-08-21 Thread Sakari Ailus
still. Oh well. ... > > +static struct i2c_driver ov02a10_i2c_driver = { > > + .driver = { > > + .name = "ov02a10", > > + .pm = &ov02a10_pm_ops, > > + .of_match_table = ov02a10_of_match, > > Please use of_match_ptr() wrapper. Not really needed; the driver does expect regulators, GPIOs etc., but by leaving out of_match_ptr(), the driver will also probe on ACPI based systems. -- Regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [PATCH 3/4] pxa-camera: Match with device node, not the port node

2019-08-21 Thread Sakari Ailus
Hi Robert, On Wed, Aug 21, 2019 at 09:26:59AM +0200, Robert Jarzmik wrote: > Sakari Ailus writes: > > > V4L2 fwnode matching right now still works based on device nodes, not port > > nodes. Fix this. > Mmmh why does it need a fix, and what's wrong on device node matchi

Re: [PATCH v2] media: ov5640: add support of V4L2_CID_LINK_FREQ

2019-08-20 Thread Sakari Ailus
Hi Hugues, On Tue, Jul 02, 2019 at 04:05:46PM +, Hugues FRUCHET wrote: > Hi Sakari, > > On 6/27/19 6:05 PM, Sakari Ailus wrote: > > Hi Hugues, > > > > On Thu, Jun 27, 2019 at 02:57:04PM +0200, Hugues Fruchet wrote: > >> Add support of V4L2_CID_LINK_FRE

[PATCH 3/6] smiapp: Error handling cleanups and fixes

2019-08-19 Thread Sakari Ailus
: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 48 ++ 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 9adf8e034e7d..c9d0416f9b03 100644 --- a/drivers/media/i2c

[PATCH 5/6] smiapp: Remove the active field from sensor's struct

2019-08-19 Thread Sakari Ailus
The active field was used to track whether the sensor was powered when settings its controls. This is no longer needed as runtime PM is used to determine this instead. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 4 drivers/media/i2c/smiapp/smiapp-regs.c | 3

[PATCH 4/6] smiapp: Rely on V4L2 sub-device framework to do the locking

2019-08-19 Thread Sakari Ailus
Rely on the V4L2 sub-device framework to perform the locking for this driver. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 140 +++-- 1 file changed, 36 insertions(+), 104 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b

[PATCH 6/6] smiapp: Avoid fall-through in switch

2019-08-19 Thread Sakari Ailus
Remove switch fall-through cases in the driver. Signed-off-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index

[PATCH 1/6] v4l: subdev: Set sd->devnode before registering the subdev

2019-08-19 Thread Sakari Ailus
ind a video node there. Assign the devnode field before registering the device, and assign it back to NULL if the registration failed. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core

[PATCH 2/6] v4l: subdev: Provide a locking scheme for subdev operations

2019-08-19 Thread Sakari Ailus
ver's data related to a device across the driver's ops. Access to the driver's controls through the control framework works as usual, i.e. using a different mutex. Signed-off-by: Sakari Ailus --- include/media/v4l2-subdev.h | 25 + 1 file changed, 17 insert

[PATCH 0/6] Provide a serialisation mechanism for subdev ops

2019-08-19 Thread Sakari Ailus
anups, too). Generally drivers that handle multiple sub-devices need to take special care when making nested calls (hopefully as few as possible, but starting streaming comes to mind). We may need an unlocked variant of the macro as well. Sakari Ailus (6): v4l: subdev: Set sd->devnode before re

Re: [V3, 2/2] media: i2c: Add Omnivision OV02A10 camera sensor driver

2019-08-19 Thread Sakari Ailus
freq); > + > + ret = clk_set_rate(ov02a10->xvclk, xclk_freq); > + if (ret) { > + dev_err(dev, "Failed to set xvclk frequency (24MHz)\n"); > + return ret; > + } > + > + ov02a10->powerdown_gpio = devm_gpiod_get(dev, "powerdown", > + GPIOD_OUT_LOW); > + if (IS_ERR(ov02a10->powerdown_gpio)) { > + dev_err(dev, "Failed to get powerdown-gpios\n"); > + return -EINVAL; > + } > + > + ov02a10->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); > + if (IS_ERR(ov02a10->reset_gpio)) { > + dev_err(dev, "Failed to get reset-gpios\n"); > + return -EINVAL; > + } > + > + ret = ov02a10_configure_regulators(ov02a10); > + if (ret) { > + dev_err(dev, "Failed to get power regulators\n"); > + return ret; > + } > + > + mutex_init(&ov02a10->mutex); > + ov02a10->cur_mode = &supported_modes[0]; > + ret = ov02a10_initialize_controls(ov02a10); > + if (ret) { > + dev_err(dev, "Failed to initialize controls\n"); > + goto err_destroy_mutex; > + } > + > + ret = __ov02a10_power_on(ov02a10); > + if (ret) > + goto err_free_handler; > + > + ret = ov02a10_check_sensor_id(ov02a10); > + if (ret) > + goto err_power_off; > + > + ov02a10->subdev.internal_ops = &ov02a10_internal_ops; > + ov02a10->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > + ov02a10->subdev.entity.ops = &ov02a10_subdev_entity_ops; > + ov02a10->subdev.entity.function = MEDIA_ENT_F_CAM_SENSOR; > + ov02a10->pad.flags = MEDIA_PAD_FL_SOURCE; > + ret = media_entity_pads_init(&ov02a10->subdev.entity, 1, &ov02a10->pad); > + if (ret < 0) { > + dev_err(dev, "failed to init entity pads: %d", ret); > + goto err_power_off; > + } > + > + ret = v4l2_async_register_subdev(&ov02a10->subdev); > + if (ret) { > + dev_err(dev, "failed to register V4L2 subdev: %d", > + ret); > + goto err_clean_entity; > + } > + > + pm_runtime_set_active(dev); > + pm_runtime_enable(dev); > + pm_runtime_idle(dev); > + > + dev_info(dev, "ov02a10 probe --\n"); This isn't very informative. The driver already prints errors when probing fails and otherwise it succeeds. Please remove. > + return 0; > + > +err_clean_entity: > + media_entity_cleanup(&ov02a10->subdev.entity); > +err_power_off: > + __ov02a10_power_off(ov02a10); > +err_free_handler: > + v4l2_ctrl_handler_free(ov02a10->subdev.ctrl_handler); > +err_destroy_mutex: > + mutex_destroy(&ov02a10->mutex); > + > + return ret; > +} > + > +static int ov02a10_remove(struct i2c_client *client) > +{ > + struct v4l2_subdev *sd = i2c_get_clientdata(client); > + struct ov02a10 *ov02a10 = to_ov02a10(sd); > + > + v4l2_async_unregister_subdev(sd); > + media_entity_cleanup(&sd->entity); > + v4l2_ctrl_handler_free(sd->ctrl_handler); > + pm_runtime_disable(&client->dev); > + if (!pm_runtime_status_suspended(&client->dev)) > + __ov02a10_power_off(ov02a10); > + pm_runtime_set_suspended(&client->dev); > + mutex_destroy(&ov02a10->mutex); > + > + return 0; > +} > + > +#if IS_ENABLED(CONFIG_OF) > +static const struct of_device_id ov02a10_of_match[] = { > + { .compatible = "ovti,ov02a10" }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, ov02a10_of_match); > +#endif > + > +static struct i2c_driver ov02a10_i2c_driver = { > + .driver = { > + .name = "ov02a10", > + .pm = &ov02a10_pm_ops, > + .of_match_table = ov02a10_of_match, > + }, > + .probe_new = &ov02a10_probe, > + .remove = &ov02a10_remove, > +}; > + > +module_i2c_driver(ov02a10_i2c_driver); > + > +MODULE_AUTHOR("Dongchun Zhu "); > +MODULE_DESCRIPTION("OmniVision OV02A10 sensor driver"); > +MODULE_LICENSE("GPL v2"); -- Kind regards, Sakari Ailus sakari.ai...@linux.intel.com

Re: [RFC,V2,1/2] media: dt-bindings: media: i2c: Add bindings for OV02A10

2019-08-17 Thread Sakari Ailus
> > > From sensor datasheet, OV02A10 supports 1-lane MIPI interface. If only one lane is supported, the property should be omitted: there's nothing that the driver needs to know here. -- Sakari Ailus

Re: [PATCH] media: mc-device.c: fix memleak in media_device_register_entity

2019-08-16 Thread Sakari Ailus
return ret; > } This does not compile; the function is defined after it's used here. Could you move the function definition up, just above this function, please? -- Sakari Ailus sakari.ai...@linux.intel.com

Re: [RFC 2/5] media: v4l2-ctrl: Document V4L2_CID_LOCATION

2019-08-15 Thread Sakari Ailus
On Thu, Aug 15, 2019 at 03:59:38PM +0300, Laurent Pinchart wrote: > Hi Sakari, > > On Thu, Aug 15, 2019 at 10:00:25AM +0300, Sakari Ailus wrote: > > On Wed, Aug 14, 2019 at 10:28:12PM +0200, Jacopo Mondi wrote: > > > Add documentation for the V4L2_CID_LOCATION c

[GIT PULL v2 for 5.4] More sensor driver, omap3isp and documentation patches

2019-08-14 Thread Sakari Ailus
pport for flash and lens devices Sakari Ailus (6): ov8856: Check reading clock frequency succeeded omap3isp: Set device on omap3isp subdevs omap3isp: Don't set streaming state on random subdevs v4l: Documentation: Serial busses use parallel mbus codes v4l: Docu

[PATCH 1/1] MAINTAINERS: Add entry for the ov5670 driver

2019-08-14 Thread Sakari Ailus
The ov5670 driver didn't get a MAINTAINERS entry when it was merged. Add one now. Signed-off-by: Sakari Ailus --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 74c51fe3f25c..69d3fa86cf18 100644 --- a/MAINTAINERS +++ b/MAINTA

Re: [PATCH v3 1/3] ARM: dts: imx6ul: Add csi node

2019-08-14 Thread Sakari Ailus
;clks IMX6UL_CLK_CSI>; > + clock-names = "mclk"; > + status = "disabled"; > + }; > + > lcdif: lcdif@21c8000 { > compatible = "fsl,imx6ul-lcdif", > "fsl,imx28-lcdif"; > reg = <0x021c8000 0x4000>; -- Sakari Ailus

[GIT PULL for 5.4] More sensor driver, omap3isp and documentation patches

2019-08-14 Thread Sakari Ailus
quiel Garcia (1): media: i2c: ov5645: Fix power sequence Luca Weiss (1): media: ov5640: Add support for flash and lens devices Sakari Ailus (5): ov8856: Check reading clock frequency succeeded omap3isp: Set device on omap3isp subdevs omap3isp: Don't set streamin

  1   2   3   4   5   6   7   8   9   10   >