platform/kernel/linux-rpi.git
3 years agomedia: venus: hfi_parser: Check for instance after hfi platform get
Stanimir Varbanov [Sun, 7 Mar 2021 11:17:27 +0000 (12:17 +0100)]
media: venus: hfi_parser: Check for instance after hfi platform get

The inst function argument is != NULL only for Venus v1 and
we did not migrate v1 to a hfi_platform abstraction yet. So
check for instance != NULL only after hfi_platform_get returns
no error.

Fixes: e29929266be1 ("media: venus: Get codecs and capabilities from hfi platform")
Cc: stable@vger.kernel.org # v5.12
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: hfi_parser: Don't initialize parser on v1
Stanimir Varbanov [Sun, 7 Mar 2021 11:16:03 +0000 (12:16 +0100)]
media: venus: hfi_parser: Don't initialize parser on v1

The Venus v1 behaves differently comparing with the other Venus
version in respect to capability parsing and when they are send
to the driver. So we don't need to initialize hfi parser for
multiple invocations like what we do for > v1 Venus versions.

Fixes: 10865c98986b ("media: venus: parser: Prepare parser for multiple invocations")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: venc: Add support for Long Term Reference (LTR) controls
Dikshita Agarwal [Wed, 24 Mar 2021 09:54:32 +0000 (10:54 +0100)]
media: venus: venc: Add support for Long Term Reference (LTR) controls

Add support for below LTR controls in encoder:
- V4L2_CID_MPEG_VIDEO_LTR_COUNT
- V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX
- V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ctrl: add controls for long term reference.
Dikshita Agarwal [Wed, 24 Mar 2021 09:54:31 +0000 (10:54 +0100)]
media: v4l2-ctrl: add controls for long term reference.

Long Term Reference (LTR) frames are the frames that are encoded
sometime in the past and stored in the DPB buffer list to be used
as reference to encode future frames.
This change adds controls to enable this feature.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: core: Drop second v4l2 device unregister
Stanimir Varbanov [Wed, 24 Mar 2021 14:59:17 +0000 (15:59 +0100)]
media: venus: core: Drop second v4l2 device unregister

Wrong solution of rebase conflict leads to calling twice
v4l2_device_unregister in .venus_remove. Delete the second one.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agodoc: update rcu_dereference.rst reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:45:04 +0000 (14:45 +0200)]
doc: update rcu_dereference.rst reference

Changeset b00aedf978aa ("doc: Convert to rcu_dereference.txt to rcu_dereference.rst")
renamed: Documentation/RCU/rcu_dereference.txt
to: Documentation/RCU/rcu_dereference.rst.

Update its cross-reference accordingly.

Fixes: b00aedf978aa ("doc: Convert to rcu_dereference.txt to rcu_dereference.rst")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agodt-bindings:iio:dac: update microchip,mcp4725.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:45:03 +0000 (14:45 +0200)]
dt-bindings:iio:dac: update microchip,mcp4725.yaml reference

Changeset 6ced946a4bba ("dt-bindings:iio:dac:microchip,mcp4725 yaml conversion")
renamed: Documentation/devicetree/bindings/iio/dac/mcp4725.txt
to: Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml.

Update its cross-reference accordingly.

Fixes: 6ced946a4bba ("dt-bindings:iio:dac:microchip,mcp4725 yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update ti,dac7612.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:45:02 +0000 (14:45 +0200)]
MAINTAINERS: update ti,dac7612.yaml reference

Changeset 8b74e06b0f4d ("dt-bindings:iio:dac:ti,dac7612 yaml conversion")
renamed: Documentation/devicetree/bindings/iio/dac/ti,dac7612.txt
to: Documentation/devicetree/bindings/iio/dac/ti,dac7612.yaml.

Update its cross-reference accordingly.

Fixes: 8b74e06b0f4d ("dt-bindings:iio:dac:ti,dac7612 yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update snps,dw-axi-dmac.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:45:02 +0000 (14:45 +0200)]
MAINTAINERS: update snps,dw-axi-dmac.yaml reference

Changeset 8c70fb7e0a0a ("dt-bindings: dma: Add YAML schemas for dw-axi-dmac")
renamed: Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.txt
to: Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml.

Update its cross-reference accordingly.

Fixes: 8c70fb7e0a0a ("dt-bindings: dma: Add YAML schemas for dw-axi-dmac")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update st,vl53l0x.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:45:01 +0000 (14:45 +0200)]
MAINTAINERS: update st,vl53l0x.yaml reference

Changeset b4be8bd1c6a2 ("dt-bindings:iio:proximity:st,vl53l0x yaml conversion")
renamed: Documentation/devicetree/bindings/iio/proximity/vl53l0x.txt
to: Documentation/devicetree/bindings/iio/proximity/st,vl53l0x.yaml.

Update its cross-reference accordingly.

Fixes: b4be8bd1c6a2 ("dt-bindings:iio:proximity:st,vl53l0x yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update st,lsm6dsx.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:45:01 +0000 (14:45 +0200)]
MAINTAINERS: update st,lsm6dsx.yaml reference

Changeset 7a2cf8e91390 ("dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion")
renamed: Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
to: Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml.

Update its cross-reference accordingly.

Fixes: 7a2cf8e91390 ("dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update renesas,rcar-gyroadc.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:45:00 +0000 (14:45 +0200)]
MAINTAINERS: update renesas,rcar-gyroadc.yaml reference

Changeset 8c41245872e2 ("dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
to: Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml.

Update its cross-reference accordingly.

Fixes: 8c41245872e2 ("dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update pni,rm3100.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:59 +0000 (14:44 +0200)]
MAINTAINERS: update pni,rm3100.yaml reference

Changeset f383069be33e ("dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
to: Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml.

Update its cross-reference accordingly.

Fixes: f383069be33e ("dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update atmel,sama5d2-adc.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:58 +0000 (14:44 +0200)]
MAINTAINERS: update atmel,sama5d2-adc.yaml reference

Changeset 58ff1b519753 ("dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion")
renamed: Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt
to: Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml.

Update its cross-reference accordingly.

Fixes: 58ff1b519753 ("dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update mtk-sd.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:57 +0000 (14:44 +0200)]
MAINTAINERS: update mtk-sd.yaml reference

Changeset c626695ecd8b ("dt-bindings: mmc: Convert mtk-sd to json-schema")
renamed: Documentation/devicetree/bindings/mmc/mtk-sd.txt
to: Documentation/devicetree/bindings/mmc/mtk-sd.yaml.

Update its cross-reference accordingly.

Fixes: c626695ecd8b ("dt-bindings: mmc: Convert mtk-sd to json-schema")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update invensense,mpu3050.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:57 +0000 (14:44 +0200)]
MAINTAINERS: update invensense,mpu3050.yaml reference

Changeset 749787477ae4 ("dt-bindings:iio:gyro:invensense,mpu3050: txt to yaml format conversion.")
renamed: Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.txt
to: Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml.

Update its cross-reference accordingly.

Fixes: 749787477ae4 ("dt-bindings:iio:gyro:invensense,mpu3050: txt to yaml format conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update voltage-divider.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:56 +0000 (14:44 +0200)]
MAINTAINERS: update voltage-divider.yaml reference

Changeset 6f633bc91ac1 ("dt-bindings:iio:afe:voltage-divider: txt to yaml conversion")
renamed: Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
to: Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml.

Update its cross-reference accordingly.

Fixes: 6f633bc91ac1 ("dt-bindings:iio:afe:voltage-divider: txt to yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update current-sense-shunt.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:55 +0000 (14:44 +0200)]
MAINTAINERS: update current-sense-shunt.yaml reference

Changeset ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/afe/current-sense-shunt.txt
to: Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml.

Update its cross-reference accordingly.

Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update current-sense-amplifier.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:55 +0000 (14:44 +0200)]
MAINTAINERS: update current-sense-amplifier.yaml reference

Changeset fbac26b9ad21 ("dt-bindings:iio:afe:current-sense-amplifier: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.txt
to: Documentation/devicetree/bindings/iio/afe/current-sense-amplifier.yaml.

Update its cross-reference accordingly.

Fixes: fbac26b9ad21 ("dt-bindings:iio:afe:current-sense-amplifier: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update envelope-detector.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:54 +0000 (14:44 +0200)]
MAINTAINERS: update envelope-detector.yaml reference

Changeset 66a6dcc20e63 ("dt-bindings:iio:adc:envelope-detector: txt to yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
to: Documentation/devicetree/bindings/iio/adc/envelope-detector.yaml.

Update its cross-reference accordingly.

Fixes: 66a6dcc20e63 ("dt-bindings:iio:adc:envelope-detector: txt to yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update dpot-dac.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:54 +0000 (14:44 +0200)]
MAINTAINERS: update dpot-dac.yaml reference

Changeset 06d2ff6fe11e ("dt-bindings:iio:dac:dpot-dac: yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/dac/dpot-dac.txt
to: Documentation/devicetree/bindings/iio/dac/dpot-dac.yaml.

Update its cross-reference accordingly.

Fixes: 06d2ff6fe11e ("dt-bindings:iio:dac:dpot-dac: yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update st,hts221.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:53 +0000 (14:44 +0200)]
MAINTAINERS: update st,hts221.yaml reference

Changeset 9a6ac3138258 ("dt-bindings:iio:humidity:st,hts221 yaml conversion.")
renamed: Documentation/devicetree/bindings/iio/humidity/hts221.txt
to: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml.

Update its cross-reference accordingly.

Fixes: 9a6ac3138258 ("dt-bindings:iio:humidity:st,hts221 yaml conversion.")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update fsl,dpaa2-console.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:52 +0000 (14:44 +0200)]
MAINTAINERS: update fsl,dpaa2-console.yaml reference

Changeset 616fde2dd60f ("dt-bindings: misc: convert fsl,dpaa2-console from txt to YAML")
renamed: Documentation/devicetree/bindings/misc/fsl,dpaa2-console.txt
to: Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml.

Update its cross-reference accordingly.

Fixes: 616fde2dd60f ("dt-bindings: misc: convert fsl,dpaa2-console from txt to YAML")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update brcm,bcm-v3d.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:52 +0000 (14:44 +0200)]
MAINTAINERS: update brcm,bcm-v3d.yaml reference

Changeset cb18a7979a35 ("dt-bindings: gpu: Convert v3d to json-schema")
renamed: Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.txt
to: Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml.

Update its cross-reference accordingly.

Fixes: cb18a7979a35 ("dt-bindings: gpu: Convert v3d to json-schema")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update ste,mcde.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:51 +0000 (14:44 +0200)]
MAINTAINERS: update ste,mcde.yaml reference

Changeset 2abb0b994db5 ("dt-bindings: display: mcde: Convert to YAML schema")
renamed: Documentation/devicetree/bindings/display/ste,mcde.txt
to: Documentation/devicetree/bindings/display/ste,mcde.yaml.

Update its cross-reference accordingly.

Fixes: 2abb0b994db5 ("dt-bindings: display: mcde: Convert to YAML schema")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoMAINTAINERS: update adi,ad5758.yaml reference
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:50 +0000 (14:44 +0200)]
MAINTAINERS: update adi,ad5758.yaml reference

Changeset 1e6536ee349b ("dt-bindings:iio:dac:adi,ad5758 yaml conversion")
renamed: Documentation/devicetree/bindings/iio/dac/ad5758.txt
to: Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml.

Update its cross-reference accordingly.

Fixes: 1e6536ee349b ("dt-bindings:iio:dac:adi,ad5758 yaml conversion")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agodt-bindings: i3c: update i3c.yaml references
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:48 +0000 (14:44 +0200)]
dt-bindings: i3c: update i3c.yaml references

Changeset 5e4cdca887fd ("dt-bindings: i3c: Convert the bus description to yaml")
renamed: Documentation/devicetree/bindings/i3c/i3c.txt
to: Documentation/devicetree/bindings/i3c/i3c.yaml.

Update the cross-references accordingly.

Fixes: 5e4cdca887fd ("dt-bindings: i3c: Convert the bus description to yaml")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agodt-bindings: iommu: mediatek: update mediatek,iommu.yaml references
Mauro Carvalho Chehab [Tue, 6 Apr 2021 12:44:47 +0000 (14:44 +0200)]
dt-bindings: iommu: mediatek: update mediatek,iommu.yaml references

Changeset bca28426805d ("dt-bindings: iommu: mediatek: Convert IOMMU to DT schema")
renamed: Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
to: Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml.

Update the cross-references accordingly.

Fixes: bca28426805d ("dt-bindings: iommu: mediatek: Convert IOMMU to DT schema")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: ipu3-imgu: No need for kernel-doc comments in driver struct
Sakari Ailus [Tue, 23 Mar 2021 08:43:30 +0000 (09:43 +0100)]
media: staging: ipu3-imgu: No need for kernel-doc comments in driver struct

This part is rather trivial so adding more comments isn't really helpful.

Reported-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: imx258: add HDR control
Krzysztof Kozlowski [Mon, 5 Oct 2020 15:15:58 +0000 (17:15 +0200)]
media: i2c: imx258: add HDR control

The IMX258 supports High Dynamic Range with 5 levels of low/high
exposure ratio.  Add a V4L2 control for HDR (WIDE_DYNAMIC_RANGE).

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>
3 years agomedia: i2c: imx219: Balance runtime PM use-count
Lad Prabhakar [Thu, 11 Mar 2021 09:52:05 +0000 (10:52 +0100)]
media: i2c: imx219: Balance runtime PM use-count

Move incrementing/decrementing runtime PM count to
imx219_start_streaming()/imx219_stop_streaming() functions respectively.

This fixes an issue of unbalanced runtime PM count in resume callback
error path where streaming is stopped and runtime PM count is left
unbalanced.

Fixes: 1283b3b8f82b9 ("media: i2c: Add driver for Sony IMX219 sensor")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: imx219: Move out locking/unlocking of vflip and hflip controls from imx21...
Lad Prabhakar [Thu, 11 Mar 2021 09:52:04 +0000 (10:52 +0100)]
media: i2c: imx219: Move out locking/unlocking of vflip and hflip controls from imx219_set_stream

Move out locking/unlocking of vflip and hflip controls from
imx219_set_stream() to the imx219_start_streaming()/
imx219_stop_streaming() respectively.

This fixes an issue in resume callback error path where streaming is
stopped and the controls are left in locked state.

Fixes: 1283b3b8f82b9 ("media: i2c: Add driver for Sony IMX219 sensor")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l: fwnode: Rename v4l2_async_register_subdev_sensor_common
Sakari Ailus [Fri, 5 Mar 2021 16:42:34 +0000 (17:42 +0100)]
media: v4l: fwnode: Rename v4l2_async_register_subdev_sensor_common

Rename v4l2_async_register_subdev_sensor_common as
v4l2_async_register_subdev_sensor. This is a part of the effort to make
the long names present in V4L2 fwnode and async frameworks shorter.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l: fwnode: Rename and make static V4L2 async notifier helper
Sakari Ailus [Fri, 5 Mar 2021 15:59:22 +0000 (16:59 +0100)]
media: v4l: fwnode: Rename and make static V4L2 async notifier helper

Rename v4l2_async_notifier_parse_fwnode_sensor_common() as
v4l2_async_notifier_parse_fwnode_sensor() and make the function static, as
it's not used by a driver and maybe never will.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: entity: Add lockdep check to media graph walk
Sakari Ailus [Fri, 12 Mar 2021 09:05:44 +0000 (10:05 +0100)]
media: entity: Add lockdep check to media graph walk

It was always assumed that walking the media graph would require holding
the media_device graph_mutex but this was not documented nor checked for.

Add a lockdep check to graph walk init and iter, and document the need for
acquiring the graph_mutex.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: omap4iss: Acquire graph mutex for graph traversal
Sakari Ailus [Fri, 19 Mar 2021 16:31:08 +0000 (17:31 +0100)]
media: omap4iss: Acquire graph mutex for graph traversal

Acquire the graph_mutex for traversing the media graph. This seems to have
been missing all the time.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: omap3isp: Acquire graph mutex for graph traversal
Sakari Ailus [Fri, 12 Mar 2021 10:43:08 +0000 (11:43 +0100)]
media: omap3isp: Acquire graph mutex for graph traversal

Acquire the graph_mutex for traversing the media graph. This seems to have
been missing all the time.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: remove unneeded variable 'ret'
Yang Li [Wed, 10 Mar 2021 08:52:14 +0000 (09:52 +0100)]
media: i2c: remove unneeded variable 'ret'

Fix the following coccicheck warning:
./drivers/media/i2c/ov8865.c:2527:5-8: Unneeded variable: "ret". Return
"0" on line 2536

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging/intel-ipu3: Fix set_fmt error handling
Ricardo Ribalda [Wed, 10 Mar 2021 00:16:46 +0000 (01:16 +0100)]
media: staging/intel-ipu3: Fix set_fmt error handling

If there in an error during a set_fmt, do not overwrite the previous
sizes with the invalid config.

Without this patch, v4l2-compliance ends up allocating 4GiB of RAM and
causing the following OOPs

[   38.662975] ipu3-imgu 0000:00:05.0: swiotlb buffer is full (sz: 4096 bytes)
[   38.662980] DMA: Out of SW-IOMMU space for 4096 bytes at device 0000:00:05.0
[   38.663010] general protection fault: 0000 [#1] PREEMPT SMP

Cc: stable@vger.kernel.org
Fixes: 6d5f26f2e045 ("media: staging/intel-ipu3-v4l: reduce kernel stack usage")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c/ccs: fix kernel-doc header issues
Hans Verkuil [Tue, 9 Mar 2021 13:00:44 +0000 (14:00 +0100)]
media: i2c/ccs: fix kernel-doc header issues

Fix these kernel-doc warnings:

drivers/media/i2c/ccs/ccs-data.h:144: warning: expecting prototype for struct ccs_pdaf_pix_loc_block_desc. Prototype was for struct
ccs_pdaf_pix_loc_pixel_desc instead
drivers/media/i2c/ccs/ccs-quirk.h:51: warning: Function parameter or member 'post_streamoff' not described in 'ccs_quirk'
drivers/media/i2c/ccs/ccs-quirk.h:51: warning: Function parameter or member 'flags' not described in 'ccs_quirk'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: imx274: fix error return code of imx274_s_frame_interval()
Jia-Ju Bai [Fri, 5 Mar 2021 03:19:42 +0000 (04:19 +0100)]
media: i2c: imx274: fix error return code of imx274_s_frame_interval()

When __v4l2_ctrl_modify_range() fails, no error return code of
imx274_s_frame_interval() is assigned.
To fix this bug, ret is assigned with the return valye of
__v4l2_ctrl_modify_range(), and then ret is checked.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ipu3-cio2: Fix pixel-rate derived link frequency
Sakari Ailus [Mon, 15 Feb 2021 07:55:12 +0000 (08:55 +0100)]
media: ipu3-cio2: Fix pixel-rate derived link frequency

The driver uses v4l2_get_link_freq() helper to obtain the link frequency
using the LINK_FREQ but also the PIXEL_RATE control. The divisor for the
pixel rate derived link frequency was wrong, missing the bus uses double
data rate. Fix this.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Fixes: 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ccs: Fix sub-device function
Sakari Ailus [Tue, 5 Jan 2021 14:21:11 +0000 (15:21 +0100)]
media: ccs: Fix sub-device function

Fix sub-device function for the pixel array and the scaler.

It seems that the pixel array had gotten assigned as SCALER whereas the
scaler had CAM_SENSOR function. Fix this by setting the pixel array
function to CAM_SENSOR and that of scaler to SCALER.

Fixes: 9ec2ac9bd0f9 ("media: ccs: Give all subdevs a function")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: ipu3: uapi: Add "WITH Linux-syscall-note" license
Laurent Pinchart [Sun, 7 Feb 2021 23:56:10 +0000 (00:56 +0100)]
media: staging: ipu3: uapi: Add "WITH Linux-syscall-note" license

All Linux headers licensed under the GPL-2.0 must include a "WITH
Linux-syscall-note" extension in their SPDX license identifier, as
enforced by the scripts/headers_install.sh script. Fix the Intel IPU3
UAPI header currently stored with the driver in staging.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s5k5baf: remove trailing semicolon in macro definition
Tom Rix [Fri, 27 Nov 2020 16:41:23 +0000 (17:41 +0100)]
media: s5k5baf: remove trailing semicolon in macro definition

The macro use will already have a semicolon.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: remove unneeded semicolon
Yang Li [Wed, 3 Feb 2021 02:22:01 +0000 (03:22 +0100)]
media: i2c: remove unneeded semicolon

Eliminate the following coccicheck warning:
./drivers/media/i2c/ov02a10.c:703:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: renesas,drif: Add r8a77965 support
Fabrizio Castro [Wed, 21 Oct 2020 13:53:31 +0000 (15:53 +0200)]
media: dt-bindings: media: renesas,drif: Add r8a77965 support

The r8a77965 (a.k.a. R-Car M3-N) device tree schema is
compatible with the already documented R-Car Gen3 devices.

Document r8a77965 support within renesas,drif.yaml.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: renesas,drif: Add r8a77990 support
Fabrizio Castro [Wed, 21 Oct 2020 13:53:30 +0000 (15:53 +0200)]
media: dt-bindings: media: renesas,drif: Add r8a77990 support

The r8a77990 (a.k.a. R-Car E3) device tree schema is
compatible with R-Car H3 and M3-W schema.

Document r8a77990 support within renesas,drif.yaml.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: renesas,drif: Convert to json-schema
Fabrizio Castro [Wed, 21 Oct 2020 13:53:29 +0000 (15:53 +0200)]
media: dt-bindings: media: renesas,drif: Convert to json-schema

Convert the Renesas DRIF bindings to DT schema and update
MAINTAINERS accordingly.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: MAINTAINERS: Update MAINTAINERS for Renesas DRIF driver
Fabrizio Castro [Wed, 21 Oct 2020 13:53:28 +0000 (15:53 +0200)]
media: MAINTAINERS: Update MAINTAINERS for Renesas DRIF driver

Add Fabrizio castro and remove Ramesh Shanmugasundaram.

Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Reviewed-by: Ramesh Shanmugasundaram <rashanmu@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uvcvideo: Support devices that report an OT as an entity source
Laurent Pinchart [Mon, 8 Mar 2021 10:31:28 +0000 (11:31 +0100)]
media: uvcvideo: Support devices that report an OT as an entity source

Some devices reference an output terminal as the source of extension
units. This is incorrect, as output terminals only have an input pin,
and thus can't be connected to any entity in the forward direction. The
resulting topology would cause issues when registering the media
controller graph. To avoid this problem, connect the extension unit to
the source of the output terminal instead.

While at it, and while no device has been reported to be affected by
this issue, also handle forward scans where two output terminals would
be connected together, and skip the terminals found through such an
invalid connection.

Reported-and-tested-by: John Nealy <jnealy3@yahoo.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uvcvideo: Fix XU id print in forward scan
Laurent Pinchart [Sun, 21 Feb 2021 21:11:50 +0000 (22:11 +0100)]
media: uvcvideo: Fix XU id print in forward scan

An error message in the forward scan code incorrectly prints the ID of
the source entity instead of the XU entity being scanned. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx: imx7_mipi_csis: Ensure pads are connected
Laurent Pinchart [Fri, 8 Jan 2021 00:05:19 +0000 (01:05 +0100)]
media: imx: imx7_mipi_csis: Ensure pads are connected

The CSI-2 receiver requires both its sink pad and its source pad to be
connected through enabled links in order to be started. Ensure this by
setting the MEDIA_PAD_FL_MUST_CONNECT flag on both pads.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx: imx7_mipi_csis: Don't take state->lock in .link_setup()
Laurent Pinchart [Fri, 8 Jan 2021 00:05:19 +0000 (01:05 +0100)]
media: imx: imx7_mipi_csis: Don't take state->lock in .link_setup()

The .link_setup() handler uses state->lock to protect the src_sd field.
This is only used in mipi_csis_s_stream(), which can't race
.link_setup() as the MC core prevents link setup when the pipeline is
streaming. Drop the lock.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx: imx7_mipi_csis: Runtime suspend in .s_stream() error path
Laurent Pinchart [Fri, 8 Jan 2021 00:05:19 +0000 (01:05 +0100)]
media: imx: imx7_mipi_csis: Runtime suspend in .s_stream() error path

If the .s_stream() handler fails after calling pm_runtime_get_sync(),
call pm_runtime_put() in the error path.

While at it add a few blank lines to make the code more readable.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: nxp,imx7-mipi-csi2: Expand descriptions
Laurent Pinchart [Mon, 15 Feb 2021 04:27:25 +0000 (05:27 +0100)]
media: dt-bindings: media: nxp,imx7-mipi-csi2: Expand descriptions

Expand the description of the binding itself and of individual
properties to include additional information that may not be immediately
appartent from reading the reference manual. Drop the last sentence of
the phy-supply description that refers to the driver's implementation.

While at it, fix the capitalization of MIPI CSI-2 in the title.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: nxp,imx7-mipi-csi2: Indent example with 4 spaces
Laurent Pinchart [Mon, 15 Feb 2021 04:27:24 +0000 (05:27 +0100)]
media: dt-bindings: media: nxp,imx7-mipi-csi2: Indent example with 4 spaces

DT bindings examples are customarily indented with 4 spaces.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: nxp,imx7-mipi-csi2: Drop fsl,csis-hs-settle property
Laurent Pinchart [Mon, 15 Feb 2021 04:27:23 +0000 (05:27 +0100)]
media: dt-bindings: media: nxp,imx7-mipi-csi2: Drop fsl,csis-hs-settle property

The fsl,csis-hs-settle property isn't used by the driver anymore. Drop
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: nxp,imx7-mipi-csi2: Drop the reset-names property
Laurent Pinchart [Mon, 15 Feb 2021 04:27:22 +0000 (05:27 +0100)]
media: dt-bindings: media: nxp,imx7-mipi-csi2: Drop the reset-names property

The reset-names property is incorrect, as it references the reset of the
MIPI D-PHY master, which is used by the DSI controller. Fixing the
property name would create backward-compatibility issues. As the device
has a single reset, we can instead drop reset-names completely, which
also simplifies the binding.

Fix the example accordingly to use the correct reset.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vivid: update EDID
Hans Verkuil [Thu, 25 Mar 2021 07:48:21 +0000 (08:48 +0100)]
media: vivid: update EDID

The EDID had a few mistakes as reported by edid-decode:

Block 1, CTA-861 Extension Block:
  Video Data Block: For improved preferred timing interoperability, set 'Native detailed modes' to 1.
  Video Capability Data Block: S_PT is equal to S_IT and S_CE, so should be set to 0 instead.

Fixed those.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: em28xx: fix memory leak
Muhammad Usama Anjum [Wed, 24 Mar 2021 18:07:53 +0000 (19:07 +0100)]
media: em28xx: fix memory leak

If some error occurs, URB buffers should also be freed. If they aren't
freed with the dvb here, the em28xx_dvb_fini call doesn't frees the URB
buffers as dvb is set to NULL. The function in which error occurs should
do all the cleanup for the allocations it had done.

Tested the patch with the reproducer provided by syzbot. This patch
fixes the memleak.

Reported-by: syzbot+889397c820fa56adf25d@syzkaller.appspotmail.com
Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cx88: Fix a typo
Bhaskar Chowdhury [Wed, 24 Mar 2021 14:17:43 +0000 (15:17 +0100)]
media: cx88: Fix a typo

s/sillicon/silicon/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: entity: A typo fix
Bhaskar Chowdhury [Wed, 24 Mar 2021 13:21:00 +0000 (14:21 +0100)]
media: entity: A typo fix

s/cariers/carriers/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: drivers/media/pci/bt8xx/bttv-cards: fix typos
Xiaofeng Cao [Wed, 24 Mar 2021 03:29:06 +0000 (04:29 +0100)]
media: drivers/media/pci/bt8xx/bttv-cards: fix typos

change 'vodeo'     to 'video'
change 'nevery'    to 'never'
change 'is'        to 'it'
change 'connevted' to 'connected'
change 'swichers'  to 'switchers'
change 'strucure'  to 'structure'
change 'unblanced' to 'unbalanced'
change 'fonctionality' to 'functionality'

Signed-off-by: Xiaofeng Cao <caoxiaofeng@yulong.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cobalt: fix initial EDID
Hans Verkuil [Tue, 23 Mar 2021 16:12:42 +0000 (17:12 +0100)]
media: cobalt: fix initial EDID

The EDID failed with two edid-decode warnings:

Block 1, CTA-861 Extension Block:
  Video Data Block: VIC 16 is the preferred timing, overriding the first detailed timings. Is this intended?
  Video Capability Data Block: S_PT is equal to S_IT and S_CE, so should be set to 0 instead.

In addition, the first DTD had a wrong vsync value (6 instead of 5).

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s5p-mfc/s5p_mfc_common.h: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 14:31:26 +0000 (15:31 +0100)]
media: s5p-mfc/s5p_mfc_common.h: fix kernel-doc warnings

Trivial fixes for many kernel-doc warnings. Most of the comments before
enums or struct can just be that: regular comments.

So just change /** to /*.

In one remaining case it was just a wrong construct: @mem_dev[] -> @mem_dev

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx-jpeg: Pass the v4l2_jpeg_header header argument by reference
Colin Ian King [Tue, 23 Mar 2021 14:24:21 +0000 (15:24 +0100)]
media: imx-jpeg: Pass the v4l2_jpeg_header header argument by reference

Currently the header argument is being passed by value, so a copy of 256
byte structure on the stack is potentially occurring. Fix this by passing
by reference to avoid any large stack copies.

Addresses-Coverity: ("Big parameter passed by value")

Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
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>
3 years agomedia: hantro: fix kernel-doc warnings and style
Ezequiel Garcia [Tue, 23 Mar 2021 12:07:46 +0000 (13:07 +0100)]
media: hantro: fix kernel-doc warnings and style

Add a description for enum values in hantro_enc_fmt,
in order to fix these warnings:

drivers/staging/media/hantro/hantro_hw.h:149: warning: Enum value 'RK3288_VPU_ENC_FMT_YUV420P' not described in enum 'hantro_enc_fmt'
drivers/staging/media/hantro/hantro_hw.h:149: warning: Enum value 'RK3288_VPU_ENC_FMT_YUV420SP' not described in enum 'hantro_enc_fmt'
drivers/staging/media/hantro/hantro_hw.h:149: warning: Enum value 'RK3288_VPU_ENC_FMT_YUYV422' not described in enum 'hantro_enc_fmt'
drivers/staging/media/hantro/hantro_hw.h:149: warning: Enum value 'RK3288_VPU_ENC_FMT_UYVY422' not described in enum 'hantro_enc_fmt'

While here, improve the kernel-doc style, adding an empty
line before the fields of the structs.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains()
Wei Yongjun [Tue, 23 Mar 2021 11:29:03 +0000 (12:29 +0100)]
media: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains()

In case of error, the function device_link_add() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.

Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx-jpeg: Fix error return code in mxc_jpeg_probe()
Wei Yongjun [Tue, 23 Mar 2021 11:28:55 +0000 (12:28 +0100)]
media: imx-jpeg: Fix error return code in mxc_jpeg_probe()

Fix to return negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rkisp1: uapi: document which flags/structs relate to statistics config
Dafna Hirschfeld [Tue, 23 Mar 2021 09:22:11 +0000 (10:22 +0100)]
media: rkisp1: uapi: document which flags/structs relate to statistics config

Modify the documentation to point out which flags and structs are
used to configure the statistics.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx-jpeg: Fix spelling mistake "Canot" -> "Cannot"
Colin Ian King [Tue, 23 Mar 2021 09:21:41 +0000 (10:21 +0100)]
media: imx-jpeg: Fix spelling mistake "Canot" -> "Cannot"

There is a spelling mistake in a dev_err message. Fix it.

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>
3 years agomedia: exynos4-is: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 09:15:08 +0000 (10:15 +0100)]
media: exynos4-is: fix kernel-doc warnings

Fixes these kernel-doc warnings:

drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 've' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buf_count' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buf_mask' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'streaming' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'buffers' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:139: warning: Function parameter or member 'pixfmt' not described in 'fimc_is_video'
drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'src_fmt' not described in 'fimc_isp'
drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'sink_fmt' not described in 'fimc_isp'
drivers/media/platform/exynos4-is/fimc-isp.h:176: warning: Function parameter or member 'subdev_lock' not described in 'fimc_isp'
drivers/media/platform/exynos4-is/fimc-lite.h:178: warning: Function parameter or member 'events' not described in 'fimc_lite'
drivers/media/platform/exynos4-is/fimc-lite.h:178: warning: Function parameter or member 'streaming' not described in 'fimc_lite'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'wbclk' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'fimc_lite' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'clk_provider' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'subdev_notifier' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'pipelines' not described in 'fimc_md'
drivers/media/platform/exynos4-is/media-dev.h:143: warning: Function parameter or member 'link_setup_graph' not described in 'fimc_md'
drivers/media/platform/exynos4-is/fimc-core.h:261: warning: Function parameter or member 'alpha' not described in 'fimc_frame'
drivers/media/platform/exynos4-is/fimc-core.h:321: warning: Function parameter or member 'streaming' not described in 'fimc_vid_cap'
drivers/media/platform/exynos4-is/fimc-core.h:429: warning: Function parameter or member 'drv_data' not described in 'fimc_dev'
drivers/media/platform/exynos4-is/fimc-core.h:495: warning: Function parameter or member 'in_order_1p' not described in 'fimc_ctx'
drivers/media/platform/exynos4-is/fimc-core.h:673: warning: Function parameter or member 'vid_cap' not described in 'fimc_active_queue_add'
drivers/media/platform/exynos4-is/fimc-core.h:685: warning: Function parameter or member 'vid_cap' not described in 'fimc_active_queue_pop'
drivers/media/platform/exynos4-is/fimc-core.h:700: warning: Function parameter or member 'vid_cap' not described in 'fimc_pending_queue_add'
drivers/media/platform/exynos4-is/fimc-core.h:711: warning: Function parameter or member 'vid_cap' not described in 'fimc_pending_queue_pop'
drivers/media/platform/exynos4-is/fimc-reg.h:333: warning: Function parameter or member 'dev' not described in 'fimc_hw_set_dma_seq'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: exynos-gsc/gsc-core.h: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 08:52:31 +0000 (09:52 +0100)]
media: exynos-gsc/gsc-core.h: fix kernel-doc warnings

Fixes these kernel-doc warnings:

drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Enum value 'GSC_MIXER' not described in enum 'gsc_datapath'
drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Enum value 'GSC_FIMD' not described in enum 'gsc_datapath'
drivers/media/platform/exynos-gsc/gsc-core.h:76: warning: Excess enum value 'GSC_LOCAL' description in 'gsc_datapath'
drivers/media/platform/exynos-gsc/gsc-core.h:124: warning: Function parameter or member 'color' not described in 'gsc_fmt'
drivers/media/platform/exynos-gsc/gsc-core.h:124: warning: Function parameter or member 'num_comp' not described in 'gsc_fmt'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_min' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pix_align' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'in_buf_cnt' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'out_buf_cnt' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'sc_up_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'sc_down_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'poly_sc_down_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'pre_sc_down_max' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:297: warning: Function parameter or member 'local_sc_down' not described in 'gsc_variant'
drivers/media/platform/exynos-gsc/gsc-core.h:310: warning: Function parameter or member 'clk_names' not described in 'gsc_driverdata'
drivers/media/platform/exynos-gsc/gsc-core.h:310: warning: Function parameter or member 'num_clocks' not described in 'gsc_driverdata'
drivers/media/platform/exynos-gsc/gsc-core.h:340: warning: Function parameter or member 'num_clocks' not described in 'gsc_dev'
drivers/media/platform/exynos-gsc/gsc-core.h:340: warning: Function parameter or member 'v4l2_dev' not described in 'gsc_dev'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'rotation' not described in 'gsc_ctx'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'hflip' not described in 'gsc_ctx'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'vflip' not described in 'gsc_ctx'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'gsc_ctrls' not described in 'gsc_ctx'
drivers/media/platform/exynos-gsc/gsc-core.h:376: warning: Function parameter or member 'out_colorspace' not described in 'gsc_ctx'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s5p-jpeg/jpeg-core.h: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 08:39:16 +0000 (09:39 +0100)]
media: s5p-jpeg/jpeg-core.h: fix kernel-doc warnings

Fixes these warnings:

drivers/media/platform/s5p-jpeg/jpeg-core.h:136: warning: Function parameter or member 'irq_ret' not described in 's5p_jpeg'
drivers/media/platform/s5p-jpeg/jpeg-core.h:136: warning: Function parameter or member 'irq_status' not described in 's5p_jpeg'
drivers/media/platform/s5p-jpeg/jpeg-core.h:168: warning: Function parameter or member 'memplanes' not described in 's5p_jpeg_fmt'
drivers/media/platform/s5p-jpeg/jpeg-core.h:168: warning: Function parameter or member 'subsampling' not described in 's5p_jpeg_fmt'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s3c-camif/camif-core.h: fix kernel-doc warnings
Hans Verkuil [Tue, 23 Mar 2021 08:26:10 +0000 (09:26 +0100)]
media: s3c-camif/camif-core.h: fix kernel-doc warnings

Fixes these warnings:

drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'pix_limits' not described in 's3c_camif_variant'
drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'has_img_effect' not described in 's3c_camif_variant'
drivers/media/platform/s3c-camif/camif-core.h:156: warning: Function parameter or member 'vp_offset' not described in 's3c_camif_variant'
drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'vdev' not described in 'camif_vp'
drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'vb_queue' not described in 'camif_vp'
drivers/media/platform/s3c-camif/camif-core.h:232: warning: Function parameter or member 'offset' not described in 'camif_vp'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_test_pattern' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_colorfx' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'ctrl_colorfx_cbcr' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx_cb' not described in 'camif_dev'
drivers/media/platform/s3c-camif/camif-core.h:297: warning: Function parameter or member 'colorfx_cr' not described in 'camif_dev'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: allegro-dvt/nal-h264.h: fix kernel-doc: hdr -> hrd
Hans Verkuil [Tue, 23 Mar 2021 07:49:13 +0000 (08:49 +0100)]
media: allegro-dvt/nal-h264.h: fix kernel-doc: hdr -> hrd

Give typo in kernel-doc documentation: hdr -> hrd

Fixes this warning:

drivers/media/platform/allegro-dvt/nal-h264.h:33: warning: expecting prototype for struct nal_h264_hdr_parameters. Prototype was for struct
nal_h264_hrd_parameters instead

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: fix a typo
Bhaskar Chowdhury [Mon, 22 Mar 2021 02:24:31 +0000 (03:24 +0100)]
media: atomisp: fix a typo

s/Sysytem/System/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: remove duplicate include in sh_css
Zhang Yunkai [Sat, 6 Mar 2021 12:11:04 +0000 (13:11 +0100)]
media: atomisp: remove duplicate include in sh_css

'ia_css_isys.h' included in 'sh_css.c' is duplicated.
It is also included in the 30th line.

Link: https://lore.kernel.org/linux-media/20210306121104.218696-1-zhang.yunkai@zte.com.cn
Signed-off-by: Zhang Yunkai <zhang.yunkai@zte.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: atomisp: reduce kernel stack usage
Arnd Bergmann [Fri, 26 Feb 2021 14:05:02 +0000 (15:05 +0100)]
media: staging: atomisp: reduce kernel stack usage

The atomisp_set_fmt() function has multiple copies of the large
v4l2_format structure on its stack, resulting in a warning about
excessive stack usage in some rare randconfig builds.

drivers/staging/media/atomisp/pci/atomisp_cmd.c:5600:5: error: stack frame size of 1084 bytes in function 'atomisp_set_fmt' [-Werror,-Wframe-larger-than=]

Of this structure, only three members in the 'fmt.pix' member are
used, so simplify it by using the smaller v4l2_pix_format structure
directly. This reduces the stack usage to 612 bytes, and it could
be reduced further by only storing the three members that are used.

Link: https://lore.kernel.org/linux-media/20210226140524.3478346-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: omap4iss: code style - avoid macro argument precedence issues
Nikolay Kyx [Sun, 21 Feb 2021 19:53:08 +0000 (20:53 +0100)]
media: staging: media: omap4iss: code style - avoid macro argument precedence issues

This patch fixes the following checkpatch.pl check:

CHECK: Macro argument 'i' may be better as '(i)' to avoid precedence issues

in file iss_regs.h

Link: https://lore.kernel.org/linux-media/20210221195308.1451-1-knv418@gmail.com
Signed-off-by: Nikolay Kyx <knv418@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: ipu3: code style fix - missing a blank line after declarations
Nikolay Kyx [Sun, 21 Feb 2021 08:12:36 +0000 (09:12 +0100)]
media: staging: media: ipu3: code style fix - missing a blank line after declarations

This patch fixes the following checkpatch.pl warning:

WARNING: Missing a blank line after declarations

in file ipu3-css-fw.h

Link: https://lore.kernel.org/linux-media/20210221081236.9758-2-knv418@gmail.com
Signed-off-by: Nikolay Kyx <knv418@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media/atomisp: don't compile unused code
karthik alapati [Sat, 20 Feb 2021 14:16:27 +0000 (15:16 +0100)]
media: staging: media/atomisp: don't compile unused code

currently the functions defined in ibuf_ctrl_rmgr.c file are only
used by isys_init.c when CONFIG_VIDEO_ATOMISP_ISP2401 is selected
so dont't compile it when not needed, also fixes some sparse warnings

Link: https://lore.kernel.org/linux-media/YDEZu3oniT/vUMMY@karthik-strix-linux.karthek.com
Signed-off-by: karthik alapati <mail@karthek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: do not free kmalloc memory by vfree
Jiri Slaby [Fri, 19 Feb 2021 10:12:16 +0000 (11:12 +0100)]
media: atomisp: do not free kmalloc memory by vfree

fw_minibuffer[i].buffer is allocated by kmalloc in sh_css_load_blob_info
and by vmalloc in setup_binary. So use kvfree to decide which of those
allocators to use for freeing.

Also remove the useless cast.

Link: https://lore.kernel.org/linux-media/20210219101216.28406-1-jslaby@suse.cz
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: auto-select VIDEO_V4L2_SUBDEV_API
Tong Zhang [Wed, 10 Feb 2021 03:38:30 +0000 (04:38 +0100)]
media: atomisp: auto-select VIDEO_V4L2_SUBDEV_API

VIDEO_ATOMISP depends on VIDEO_V4L2_SUBDEV_API, if VIDEO_V4L2_SUBDEV_API
 is not selected, it will cause compilation error

drivers/staging/media/atomisp/pci/atomisp_cmd.c:6079:42: error:
 ‘struct v4l2_subdev_fh’ has no member named ‘pad’ atomisp_subdev_set_ffmt
(&asd->subdev, fh.pad, V4L2_SUBDEV_FORMAT_ACTIVE,

add auto select VIDEO_V4L2_SUBDEV_API if VIDEO_ATOMISP is selected

Link: https://lore.kernel.org/linux-media/20210210033830.961086-1-ztong0001@gmail.com
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: remove redundant NULL check
Yang Li [Thu, 21 Jan 2021 09:11:52 +0000 (10:11 +0100)]
media: atomisp: remove redundant NULL check

Fix below warnings reported by coccicheck:
./drivers/staging/media/atomisp/pci/atomisp_cmd.c:4269:2-8: WARNING:
NULL check before some freeing functions is not needed.
./drivers/staging/media/atomisp/pci/atomisp_cmd.c:4626:2-8: WARNING:
NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/1611220312-89384-3-git-send-email-abaci-bugfix@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: remove redundant NULL check
Yang Li [Thu, 21 Jan 2021 08:28:51 +0000 (09:28 +0100)]
media: atomisp: remove redundant NULL check

Fix below warnings reported by coccicheck:
./drivers/staging/media/atomisp/pci/sh_css_params.c:1575:2-8: WARNING:
NULL check before some freeing functions is not needed.
./drivers/staging/media/atomisp/pci/sh_css_params.c:3006:2-8: WARNING:
NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/1611217731-56866-1-git-send-email-abaci-bugfix@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: fix Wvisiblity warning
Arnd Bergmann [Fri, 8 Jan 2021 08:23:28 +0000 (09:23 +0100)]
media: atomisp: fix Wvisiblity warning

Some randconfig builds include ia_css_firmware.h without first
including linux/device.h:

In file included from atomisp/pci/mmu/sh_mmu_mrfld.c:23:
In file included from atomisp/pci/atomisp_compat.h:22:
In file included from atomisp/pci/atomisp_compat_css20.h:24:
In file included from atomisp/pci/ia_css.h:28:
In file included from atomisp/pci/ia_css_control.h:25:
drivers/staging/media/atomisp//pci/ia_css_firmware.h:52:29: error: declaration of 'struct device' will not be visible outside of this function [-Werror,-Wvisibility]

Add a forward declaration to avoid the warning.

Link: https://lore.kernel.org/linux-media/20210108082337.2305938-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: ov2722: remove unnecessary debug print
Filip Kolev [Wed, 6 Jan 2021 18:11:05 +0000 (19:11 +0100)]
media: atomisp: ov2722: remove unnecessary debug print

checkpatch.pl emits the following warning:

WARNING: Prefer using '"%s...", __func__' to using 'ov2722_remove', this function's name, in a string
+ dev_dbg(&client->dev, "ov2722_remove...\n");

This is just a "trace" call and therefore should be removed entirely;
ftrace should be used instead.

Link: https://lore.kernel.org/linux-media/20210106181158.2270-1-fil.kolev@gmail.com
Signed-off-by: Filip Kolev <fil.kolev@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/siano: Fix transmission parameters reporting for ISDB-T
Nicolas Stuardo Diaz [Tue, 22 Dec 2020 03:05:23 +0000 (04:05 +0100)]
media: media/siano: Fix transmission parameters reporting for ISDB-T

The currently used functions for converting the transmission mode and guard
interval from the internal values to the DVBv5 API values do not return
correct values for ISDB broadcasts:

- The raw (debugfs) transmission mode is an integer whose values can be
1, 2 or 3, that corresponds to 2K, 4K and 8K FFT modes respectively.
However sms_to_mode() expects values 2, 4 or 8.
- Guard interval, as defined by smscoreapi.h returns "1 divided by value"
instead of 0, 1, 2, and 3 as defined in sms_to_guard_interval_table().

This commit implements ISDB-T specific methods for converting the internal
values for the aforementioned parameters to the DVBv5 API values. It also
adds support for reporting FEC and time interleaving values for each one
of the layers.

[mchehab: fix two coding style whitespace warnings]
Link: https://lore.kernel.org/linux-media/20201222030522.28774-1-nicolasstuardodiaz@gmail.com
Signed-off-by: Nicolas Stuardo Diaz <nicolasstuardodiaz@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camera-sensor.rst: fix c:function build warning
Mauro Carvalho Chehab [Tue, 23 Mar 2021 07:08:56 +0000 (08:08 +0100)]
media: camera-sensor.rst: fix c:function build warning

The :c:function: tag evaluation depends on Sphinx version 2 or 3.
Use a syntax that should work with both versions.

Link: https://lore.kernel.org/linux-media/e4214991b7d59c0d7aa4e6e48833dc1809c47d47.1616484262.git.mchehab+huawei@kernel.org
Fixes: c0e3bcb25390 ("media: camera-sensor.rst: fix a doc build warning")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dvbdev: Fix memory leak in dvb_media_device_free()
Peilin Ye [Fri, 11 Dec 2020 08:30:39 +0000 (09:30 +0100)]
media: dvbdev: Fix memory leak in dvb_media_device_free()

dvb_media_device_free() is leaking memory. Free `dvbdev->adapter->conn`
before setting it to NULL, as documented in include/media/media-device.h:
"The media_entity instance itself must be freed explicitly by the driver
if required."

Link: https://syzkaller.appspot.com/bug?id=9bbe4b842c98f0ed05c5eed77a226e9de33bf298
Link: https://lore.kernel.org/linux-media/20201211083039.521617-1-yepeilin.cs@gmail.com
Cc: stable@vger.kernel.org
Fixes: 0230d60e4661 ("[media] dvbdev: Add RF connector if needed")
Reported-by: syzbot+7f09440acc069a0d38ac@syzkaller.appspotmail.com
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Remove redundant NULL check
Xu Wang [Fri, 25 Dec 2020 08:45:24 +0000 (09:45 +0100)]
media: atomisp: Remove redundant NULL check

./drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c:390:2-8: WARNING: NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/20201225084524.64839-1-vulab@iscas.ac.cn
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Remove redundant NULL check
Xu Wang [Fri, 25 Dec 2020 08:38:18 +0000 (09:38 +0100)]
media: atomisp: Remove redundant NULL check

Fix warnings reported by coccicheck:
./drivers/staging/media/atomisp/pci/runtime/isp_param/src/isp_param.c:159:4-10: WARNING: NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/20201225083818.64588-1-vulab@iscas.ac.cn
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: replace boolean comparison of values with bool variables
Aditya Srivastava [Mon, 14 Dec 2020 13:27:16 +0000 (14:27 +0100)]
media: atomisp: replace boolean comparison of values with bool variables

There are certain expressions in a condition in atomisp, where a boolean
variable is compared with true/false in forms such as (foo == true)
or (false != bar), which does not comply with the coding style rule by
checkpatch.pl (CHK: BOOL_COMPARISON), according to which the boolean
variables should be themselves used in the condition, rather than
comparing with true or false.

E.g. In drivers/staging/media/atomisp/pci/atomisp_compat_css20.c:

if (asd->stream_prepared == false) {

Can be replaced with:
if (!asd->stream_prepared) {

Replace such expressions with boolean variables appropriately.

Link: https://lore.kernel.org/linux-media/20201214132716.28157-1-yashsri421@gmail.com
Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Fix use after free in atomisp_alloc_css_stat_bufs()
Dan Carpenter [Mon, 14 Dec 2020 11:53:31 +0000 (12:53 +0100)]
media: atomisp: Fix use after free in atomisp_alloc_css_stat_bufs()

The "s3a_buf" is freed along with all the other items on the
"asd->s3a_stats" list.  It leads to a double free and a use after free.

Link: https://lore.kernel.org/linux-media/X9dSO3RGf7r0pq2k@mwanda
Fixes: ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Write function decleration in one line
Philipp Gerlesberger [Mon, 14 Dec 2020 11:03:57 +0000 (12:03 +0100)]
media: atomisp: Write function decleration in one line

CHECK:OPEN_ENDED_LINE: Lines should not end with a '('
WARNING:LEADING_SPACE: please, no spaces at the start of a line
Avoid these errors by writing the function decleration in one line.

Link: https://lore.kernel.org/linux-media/20201214110358.7102-12-Philipp.Gerlesberger@fau.de
Co-developed-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Philipp Gerlesberger <Philipp.Gerlesberger@fau.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Fix BLOCK_COMMENT_STYLE
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:54 +0000 (12:01 +0100)]
media: atomisp: Fix BLOCK_COMMENT_STYLE

Block comments should align the * on each line

Link: https://lore.kernel.org/linux-media/20201214110156.6152-11-Philipp.Gerlesberger@fau.de
Co-developed-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Philipp Gerlesberger <Philipp.Gerlesberger@fau.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Fix PARENTHESIS_ALIGNMENT
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:53 +0000 (12:01 +0100)]
media: atomisp: Fix PARENTHESIS_ALIGNMENT

You can sum up the two lines, because the maximum line length of
100 columns is not exceeded.

Link: https://lore.kernel.org/linux-media/20201214110156.6152-10-Philipp.Gerlesberger@fau.de
Co-developed-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Philipp Gerlesberger <Philipp.Gerlesberger@fau.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: atomisp: Delete braces
Philipp Gerlesberger [Mon, 14 Dec 2020 11:01:52 +0000 (12:01 +0100)]
media: atomisp: Delete braces

WARNING:BRACES: braces {} are not necessary for single statement blocks

Link: https://lore.kernel.org/linux-media/20201214110156.6152-9-Philipp.Gerlesberger@fau.de
Co-developed-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Andrey Khlopkov <ij72uhux@stud.informatik.uni-erlangen.de>
Signed-off-by: Philipp Gerlesberger <Philipp.Gerlesberger@fau.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>