aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-11-16media: v4l2-fwnode: Say it's fine to use v4l2_fwnode_endpoint_parseGravatar Sakari Ailus 1-3/+3
Earlier it was expected that there would be more variable size endpoint properties and that most if not all drivers would need them. For that reason it was expected also that v4l2_fwnode_endpoint_parse would no longer be needed. What actually happened that not all drivers require "link-frequencies", the only variable size media endpoint property without a small upper limit. Therefore drivers that do not need that information are fine using v4l2_fwnode_endpoint_parse. So don't tell drivers to use v4l2_fwnode_endpoint_alloc_parse in all cases. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: v4l2-fwnode: Rework v4l2_fwnode_endpoint_parse documentationGravatar Sakari Ailus 1-22/+40
Rework the documentation of v4l2_fwnode_endpoint_parse for better readability, usefulness and correctness. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: v4l2-fwnode: Don't zero parts of struct v4l2_fwnode_endpoint anymoreGravatar Sakari Ailus 1-12/+0
Don't zero parts of the vep argument to v4l2_fwnode_endpoint_parse() anymore as this can no longer be done while still supporting defaults on multiple bus types. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: v4l2-fwnode: v4l2_fwnode_endpoint_parse caller must init vep argumentGravatar Sakari Ailus 1-0/+6
Document that the caller of v4l2_fwnode_endpoint_parse() must init the fields of struct v4l2_fwnode_endpoint (vep argument) fields. It used to be that the fields were zeroed by v4l2_fwnode_endpoint_parse when bus type was set to V4L2_MBUS_UNKNOWN but with recent changes (Fixes: line below) that no longer makes sense. Fixes: bb4bba9232fc ("media: v4l2-fwnode: Make bus configuration a struct") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: adv748x: Zero entire struct v4l2_fwnode_endpointGravatar Sakari Ailus 1-2/+1
The v4l2_fwnode_parse_endpoint() function can make use of defaults in multiple bus types. To use this feature, all callers must zero the rest of the fields of this struct, too. All other drivers appear to do that already apart from this one. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: dt-bindings: convert CODA VPU bindings to yamlGravatar Philipp Zabel 3-32/+109
Convert to YAML and add generic IP core compatibles "cnm,codadx6", "cnm,codahx4", "cnm,coda7541", and "cnm,coda960" in addition to the SoC specific compatibles. The new generic compatibles are already used in the SoC device trees and replace the free form comments. For example: - compatible : should be "fsl,<chip>-src" for i.MX SoCs: (a) "fsl,imx27-vpu" for CodaDx6 present in i.MX27 turns into: properties: compatible: oneOf: - items: - const: fsl,imx27-vpu - const: cnm,codadx6 This allows to properly specify the secondary JPEG unit interrupt that is only present on cnm,coda960. Also add the missing "fsl,imx6dl-vpu", "cnm,coda960" compatible. The AXI bus connection to the internal SRAM is different between i.MX6Q and i.MX6DL, which requires the driver to load a different firmware depending on the SoC. Further, specify the power-domain property for i.MX6 and change the clock order from "ahb", "per" to "per", "ahb". This order is currently used in all SoC device trees. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: dt-bindings: media: ov772x: Document endpoint propsGravatar Jacopo Mondi 1-0/+44
Document endpoint properties for the parallel bus type and add them to the example. Specify a few constraints: - If the bus type is BT.656 no hsync or vsync polarities can be specified. - If the bus width is 10 bits, not data-shift can be applied. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: dt-bindings: media: ov772x: Make bus-type mandatoryGravatar Jacopo Mondi 1-0/+16
In order to establish required properties based on the selected bus type, make the 'bus-type' property mandatory. As this change documents an endpoint property, also document the 'remote-endpoint' one now that the 'endpoint' schema has been expanded. Binary compatibility with existing DTB is kept as the driver does not enforce the property to be present, and shall fall-back to default parallel bus configuration, which was the only supported bus type, if the property is not specified. Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: dt-bindings: media: ov772x: Convert to json-schemaGravatar Jacopo Mondi 3-41/+75
Convert the ov772x binding document to json-schema and update the MAINTAINERS file accordingly. Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: dt-bindings: media: imx214: Convert to json-schemaGravatar Jacopo Mondi 3-54/+134
Convert the imx214 bindings document to json-schema and update the MAINTAINERS file accordingly. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: dt-bindings: media: mt9v111: Convert to json-schemaGravatar Jacopo Mondi 3-47/+76
Convert the mt9v111 bindings document to json-schema and update the MAINTAINERS file accordingly. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: imx274: add support for sensor mode6, 1280x540Gravatar Eugen Hristev 1-14/+70
Add support for the mode 6 for the sensor, this mode uses 3/8 subsampling and 3 horizontal binning. Aspect ratio is changed. Split the bin_ratio variable into two parts, one for width and one for height, as the ratio is no longer preserved when doing subsampling in this mode. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: imx274: remove binning enumGravatar Eugen Hristev 1-8/+1
Binning enum is unused. Remove from driver. Suggested-by: Sakari Ailus <sakari.ailus@ifi.fi> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx274: Add IMX274 power on and off sequenceGravatar Sowjanya Komatineni 1-50/+134
IMX274 has analog 2.8V supply, digital core 1.8V supply, and vddl digital io 1.2V supply which are optional based on camera module design. IMX274 also need external 24Mhz clock and is optional based on camera module design. This patch adds support for IMX274 power on and off to enable and disable these supplies and external clock. Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx274: Remove stop stream i2c writes during removeGravatar Sowjanya Komatineni 1-3/+0
Sensor should already be in standby during remove and there is no need to configure sensor registers for stream stop. Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx274: Fix Y_OUT_SIZE register settingGravatar Sowjanya Komatineni 1-1/+1
As per Sony IMX274 Y_OUT_SIZE should be the height of effective image output from the sensor which are the actual total lines sent over MIPI CSI to receiver. So, Y_OUT_SIZE should be same as crop height and this patch fixes it. Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: v4l2-async: Fix trivial documentation typoGravatar Kieran Bingham 1-1/+1
Fix the incorrect spelling asyncrhronous as asynchronous, which is visible in the public documentation of enum v4l2_async_match_type. Fixes: ab4f5a4afc2d ("[media] v4l2-async: document the remaining stuff") Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: ov2740: select regmapGravatar Sergey Senozhatsky 1-0/+1
Fix OV2740 build breakage by selecting REGMAP_I2C config: ov2740.c:1011:23: error: variable has incomplete type 'struct regmap_config' struct regmap_config regmap_config = { }; ^ ov2740.c:1011:9: note: forward declaration of 'struct regmap_config' struct regmap_config regmap_config = { }; ^ ov2740.c:1028:11: error: implicit declaration of function 'devm_regmap_init_i2c' regmap = devm_regmap_init_i2c(client, &regmap_config); Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: ov2740: change the minimal exposure value to 4Gravatar Bingbu Cao 1-1/+1
The minimal valid exposure value should be 4 lines instead of 8 for ov2740 mannual exposure control. Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: tvp5150: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: smiapp: simplify getting state containerGravatar Krzysztof Kozlowski 1-15/+13
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov8856: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov7740: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov5695: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov5675: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov5670: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov2740: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov2685: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov2680: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ov13858: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: hi556: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: et8ek8: simplify getting state containerGravatar Krzysztof Kozlowski 1-5/+3
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: dw9768: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ak7375: simplify getting state containerGravatar Krzysztof Kozlowski 1-5/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: adv7180: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: adp1653: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: ad5820: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx355: silence unused acpi_device_id warningGravatar Krzysztof Kozlowski 1-1/+1
If driver is built without ACPI, the struct acpi_device_id won't be used: drivers/media/i2c/imx355.c:1836:36: warning: 'imx355_acpi_ids' defined but not used [-Wunused-const-variable=] [Sakari Ailus: Added a space before __maybe_unused] Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx355: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx319: silence unused acpi_device_id warningGravatar Krzysztof Kozlowski 1-1/+1
If driver is built without ACPI, the struct acpi_device_id won't be used: drivers/media/i2c/imx319.c:2536:36: warning: 'imx319_acpi_ids' defined but not used [-Wunused-const-variable=] Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx319: simplify getting state containerGravatar Krzysztof Kozlowski 1-4/+2
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx290: simplify getting state containerGravatar Krzysztof Kozlowski 1-6/+4
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. White at it, use 'dev' directly instead of 'imx290->dev'. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: i2c: imx219: simplify getting state containerGravatar Krzysztof Kozlowski 1-10/+6
The pointer to 'struct v4l2_subdev' is stored in drvdata via v4l2_i2c_subdev_init() so there is no point of a dance like: struct i2c_client *client = to_i2c_client(struct device *dev) struct v4l2_subdev *sd = i2c_get_clientdata(client); This allows to remove local variable 'client' and few pointer dereferences. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: v4l2-fwnode: Return -EINVAL for invalid bus-typeGravatar Lad Prabhakar 2-1/+7
Return -EINVAL if invalid bus-type is detected while parsing endpoints. Fixes: 26c1126c9b56 ("media: v4l: fwnode: Use media bus type for bus parser selection") Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: staging: rkisp1: rsz: make const array static, makes object smallerGravatar Colin Ian King 1-2/+4
Don't populate the const array dev_names on the stack but instead it static. Makes the object code smaller by 15 bytes. Before: text data bss dec hex filename 17091 2648 64 19803 4d5b media/rkisp1/rkisp1-resizer.o After: text data bss dec hex filename 17012 2712 64 19788 4d4c media/rkisp1/rkisp1-resizer.o (gcc version 10.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: MAINTAINERS: camss: Add Robert Foss as co-maintainerGravatar Robert Foss 1-0/+1
I would like to contribute some of my time to co-maintain the CAMSS driver. I'm currently working to extend CAMSS to new hardware platforms. Signed-off-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: remove unneeded breakGravatar Tom Rix 5-27/+0
A break is not needed if it is preceded by a return Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: staging: media: imx: remove unnecessary variable useGravatar Deepak R Varma 1-2/+1
Use of variable vc_num is unnecessary here as it is used only once. Instead, the value can directly be used in place of the variable. Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com> Acked-by: Steve Longerbeam <slongerbeam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: staging: media: imx: remove commented codeGravatar Deepak R Varma 1-7/+0
The virtual channel is always treated as 0 once the stream enters CSI's. Commented code in the "#if 0" can be safely removed as it will not serve any purpose in future. Issue reported by checkpatch script. Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com> Acked-by: Steve Longerbeam <slongerbeam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-11-16media: rcar-vin: Add support for suspend and resumeGravatar Niklas Söderlund 2-4/+57
Add support for suspend and resume by stopping and starting the video pipeline while still retaining all buffers given to the driver by user-space and internally allocated ones, this gives the application a seamless experience. Buffers are never returned to user-space unprocessed so user-space don't notice when suspending. When resuming the driver restarts the capture session using the internal scratch buffer, this happens before user-space is unfrozen, this leads to speedy response times once the application resumes its execution. As the entire pipeline is stopped on suspend all subdevices in use are also stopped, and if they enter a shutdown state when not streaming (such as the R-Car CSI-2 driver) they too will be suspended and resumed in sync with the VIN driver. To be able to do keep track of which VINs should be resumed a new internal state SUSPENDED is added to recode this. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>