summaryrefslogtreecommitdiff
path: root/drivers/media
AgeCommit message (Collapse)AuthorFilesLines
2021-11-30media: driver: hva: add pm_runtime_disable in the error handling code of ↵Dongliang Mu1-1/+3
hva_hw_probe In the error handling code of hva_hw_probe, it fails to invoke pm_runtime_disable in many error sites. Fix this by adding a label err_disable with pm_runtime_disable and adjust one goto from label err_clk to err_disable. Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: si470x-i2c: fix possible memory leak in si470x_i2c_probe()Yang Yingliang1-2/+1
n the 'radio->hdl.error' error handling, ctrl handler allocated by v4l2_ctrl_new_std() does not released, and caused memory leak as follows: unreferenced object 0xffff888033d54200 (size 256): comm "i2c-si470x-19", pid 909, jiffies 4294914203 (age 8.072s) hex dump (first 32 bytes): e8 69 11 03 80 88 ff ff 00 46 d5 33 80 88 ff ff .i.......F.3.... 10 42 d5 33 80 88 ff ff 10 42 d5 33 80 88 ff ff .B.3.....B.3.... backtrace: [<00000000086bd4ed>] __kmalloc_node+0x1eb/0x360 [<00000000bdb68871>] kvmalloc_node+0x66/0x120 [<00000000fac74e4c>] v4l2_ctrl_new+0x7b9/0x1c60 [videodev] [<00000000693bf940>] v4l2_ctrl_new_std+0x19b/0x270 [videodev] [<00000000c0cb91bc>] si470x_i2c_probe+0x2d3/0x9a0 [radio_si470x_i2c] [<0000000056a6f01f>] i2c_device_probe+0x4d8/0xbe0 Fix the error handling path to avoid memory leak. Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 8c081b6f9a9b ("media: radio: Critical v4l2 registration...") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: imx-pxp: Add rotation supportFabio Estevam1-2/+29
PXP allows clockwise rotation of 0°, 90°, 180° and 270°. Add support for it. Tested on a imx6ull-evk. For example, to rotate 90° the following Gstreamer pipeline can be used: gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! \ v4l2convert extra-controls=cid,rotate=90 ! \ video/x-raw,width=120,height=160 ! fbdevsink Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: imx-pxp: Initialize the spinlock prior to using itFabio Estevam1-2/+2
After devm_request_threaded_irq() is called there is a chance that an interrupt may occur before the spinlock is initialized, which will trigger a kernel oops. To prevent that, move the initialization of the spinlock prior to requesting the interrupts. Fixes: 51abcf7fdb70 ("media: imx-pxp: add i.MX Pixel Pipeline driver") Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: rcar-csi2: Optimize the selection PHTW registerSuresh Udipi1-1/+8
PHTW register is selected based on default bit rate from Table[1]. for the bit rates less than or equal to 250. Currently first value of default bit rate which is greater than or equal to the caculated mbps is selected. This selection can be further improved by selecting the default bit rate which is nearest to the calculated value. [1] specs r19uh0105ej0200-r-car-3rd-generation.pdf [Table 25.12] Fixes: 769afd212b16 ("media: rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver driver") Signed-off-by: Suresh Udipi <sudipi@jp.adit-jv.com> Signed-off-by: Michael Rodin <mrodin@de.adit-jv.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: rcar-csi2: Add warning for PHY speed less than minimumSuresh Udipi1-0/+4
Add a warning message when the selected PHY speed is less than supported minimum PHY speed given in the hsfreq table[1]. For raspberry pi camera capture on Kingfisher board with resolution 640x480, the calculated PHY speed is 48 mbps which is less than the minimum PHY speed 80 Mbps from the table[1]. But in this cases capture is successful. [1] specs r19uh0105ej0200-r-car-3rd-generation.pdf [Table 25.9] Signed-off-by: Suresh Udipi <sudipi@jp.adit-jv.com> Signed-off-by: Michael Rodin <mrodin@de.adit-jv.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: rcar-csi2: Correct the selection of hsfreqrangeSuresh Udipi1-1/+8
hsfreqrange should be chosen based on the calculated mbps which is closer to the default bit rate and within the range as per table[1]. But current calculation always selects first value which is greater than or equal to the calculated mbps which may lead to chosing a wrong range in some cases. For example for 360 mbps for H3/M3N Existing logic selects Calculated value 360Mbps : Default 400Mbps Range [368.125 -433.125 mbps] This hsfreqrange is out of range. The logic is changed to get the default value which is closest to the calculated value [1] Calculated value 360Mbps : Default 350Mbps Range [320.625 -380.625 mpbs] [1] specs r19uh0105ej0200-r-car-3rd-generation.pdf [Table 25.9] Please note that According to Renesas in Table 25.9 the range for 220 default value is corrected as below |Range (Mbps) | Default Bit rate (Mbps) | ----------------------------------------------- | 197.125-244.125 | 220 | ----------------------------------------------- Fixes: 769afd212b16 ("media: rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver driver") Signed-off-by: Suresh Udipi <sudipi@jp.adit-jv.com> Signed-off-by: Kazuyoshi Akiyama <akiyama@nds-osk.co.jp> Signed-off-by: Michael Rodin <mrodin@de.adit-jv.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: imx274: implement fwnode parsingEugen Hristev1-0/+40
Implement fwnode parsing at probe time. Check if the bus and number of lanes are supported. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: imx274: simplify probe function by adding local variable devEugen Hristev1-21/+18
Simplify probe function by adding a local variable dev instead of using &client->dev all the time. 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>
2021-11-30media: ipu3-cio2: Add INT347A to cio2-bridgeDaniel Scally1-0/+2
ACPI _HID INT347A represents the OV8865 sensor, the driver for which can support the platforms that the cio2-bridge serves. Add it to the array of supported sensors so the bridge will connect the sensor to the CIO2 device. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Fix max gain in ov8865Daniel Scally1-1/+1
The maximum gain figure in the v4l2 ctrl is wrong. The field is 12 bits wide, which is where the 8191 figure comes from, but the datasheet is specific that maximum gain is 16x (the low seven bits are fractional, so 16x gain is 2048) Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Use dev_err_probe() in ov8865Daniel Scally1-26/+20
There is a chance that regulator_get() returns -EPROBE_DEFER, in which case printing an error message is undesirable. To avoid spurious messages in dmesg in the event that -EPROBE_DEFER is returned, use dev_err_probe() on error paths for regulator_get(). Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Switch exposure control unit to linesDaniel Scally1-2/+5
The ov8865 driver currently has the unit of the V4L2_CID_EXPOSURE control as 1/16th of a line. This is what the sensor expects, but isn't very intuitive. Switch the control to be in units of a line and simply do the 16x multiplication before passing the value to the sensor. The datasheet for this sensor gives minimum exposure as 2 lines, so take the opportunity to correct the lower bounds of the control. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Add controls from fwnode to ov8865Daniel Scally1-0/+10
Add V4L2_CID_CAMERA_ORIENTATION and V4L2_CID_CAMERA_SENSOR_ROTATION controls to the ov8865 driver by attempting to parse them from firmware. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: cap exposure at height + vblank in ov8865Daniel Scally1-2/+26
Exposure limits depend on the total height; when vblank is altered (and thus the total height is altered), change the exposure limits to reflect the new cap. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Update HTS values in ov8865Daniel Scally1-54/+11
The HTS values for some of the modes in the ov8865 driver are a bit unusual, coming in lower than the output_size_x is set to. It seems like they might be calculated to fit the desired framerate into a configuration with just two data lanes. To bring this more in line with expected behaviour, raise the HTS values above the output_size_x. The corollary of that change is that the hardcoded frame intervals against the modes no longer make sense, so remove those entirely. Update the .g/s_frame_interval() callbacks to calculate the frame interval based on the current mode and the vblank and hblank settings. The implementation of the .enum_frame_interval() callback is no longer suitable since the possible frame rate is now a continuous range depending on the vblank control setting, so remove that callback entirely. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Add hblank control to ov8865Daniel Scally1-0/+14
Add a V4L2_CID_HBLANK control to the ov8865 driver. This is read only with timing control intended to be done via vblanking alone. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Add vblank control to ov8865Daniel Scally1-0/+32
Add a V4L2_CID_VBLANK control to the ov8865 driver. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Switch control to V4L2_CID_ANALOGUE_GAINDaniel Scally1-4/+5
The V4L2_CID_GAIN control for this driver configures registers that the datasheet specifies as analogue gain. Switch the control's ID to V4L2_CID_ANALOGUE_GAIN. Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Add .get_selection() support to ov8865Daniel Scally1-0/+64
The ov8865 driver's v4l2_subdev_pad_ops currently does not include .get_selection() - add support for that callback. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Support 19.2MHz input clock in ov8865Daniel Scally1-52/+143
The ov8865 driver as written expects a 24MHz input clock, but the sensor is sometimes found on x86 platforms with a 19.2MHz input clock supplied. Add a set of PLL configurations to the driver to support that rate too. As ACPI doesn't auto-configure the clock rate, check for a clock-frequency during probe and set that rate if one is found. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Defer probe if not endpoint foundDaniel Scally1-4/+2
The ov8865 driver is one of those that can be connected to a CIO2 device by the cio2-bridge code. This means that the absence of an endpoint for this device is not necessarily fatal, as one might be built by the cio2-bridge when it probes. Return -EPROBE_DEFER if no endpoint is found rather than a fatal error. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Fix incorrect value in commentDaniel Scally1-1/+1
The PLL configuration defined here sets 72MHz (which is correct), not 80MHz. Correct the comment. Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Add ACPI support to ov8865Daniel Scally1-0/+8
The ov8865 sensor is sometimes found on x86 platforms enumerated via ACPI. Add an ACPI match table to the driver so that it's probed on those platforms. Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: ov8865: Fix lockdep errorHans de Goede1-0/+2
ov8865_state_init() calls ov8865_state_mipi_configure() which uses __v4l2_ctrl_s_ctrl[_int64](). This means that sensor->mutex (which is also sensor->ctrls.handler.lock) must be locked before calling ov8865_state_init(). Note ov8865_state_mipi_configure() is also used in other places where the lock is already held so it cannot be changed itself. This fixes the following lockdep kernel WARN: [ 13.233421] WARNING: CPU: 0 PID: 8 at drivers/media/v4l2-core/v4l2-ctrls-api.c:833 __v4l2_ctrl_s_ctrl+0x4d/0x60 [videodev] ... [ 13.234063] Call Trace: [ 13.234074] ov8865_state_configure+0x98b/0xc00 [ov8865] [ 13.234095] ov8865_probe+0x4b1/0x54c [ov8865] [ 13.234117] i2c_device_probe+0x13c/0x2d0 Fixes: 11c0d8fdccc5 ("media: i2c: Add support for the OV8865 image sensor") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Re-order runtime pm initialisationDaniel Scally1-1/+1
The kerneldoc for pm_runtime_set_suspended() says: "It is not valid to call this function for devices with runtime PM enabled" To satisfy that requirement, re-order the calls so that pm_runtime_enable() is the last one. Fixes: 11c0d8fdccc5 ("media: i2c: Add support for the OV8865 image sensor") Signed-off-by: Daniel Scally <djrscally@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: ipu3-cio2: Add link freq for INT33BE entryDaniel Scally1-1/+1
Add a link frequency to the cio2-bridge table of supported sensors. This means that the driver can parse supported link frequencies from firmware in the usual way and validate that it can accommodate them. Signed-off-by: Daniel Scally <djrscally@gmail.com> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: Add support for ov5693 sensorDaniel Scally3-0/+1549
The OV5693 is a 5 Mpx CMOS image sensor, connected via MIPI CSI-2. The chip is capable of a single lane configuration, but currently only two lanes are supported. Most of the sensor's features are supported, with the main exception being the lens correction algorithm. The driver provides all mandatory, optional and recommended V4L2 controls for maximum compatibility with libcamera. [mchehab: fixed a coding style warning] Signed-off-by: Daniel Scally <djrscally@gmail.com> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: ipu3-cio2: Toggle sensor streaming in pm runtime opsDaniel Scally1-1/+16
The .suspend() and .resume() runtime_pm operations for the ipu3-cio2 driver currently do not handle the sensor's stream. Setting .s_stream() on or off for the sensor subdev means that sensors will pause and resume the stream at the appropriate time even if their drivers don't implement those operations. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <djrscally@gmail.com> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: imx274: implement enum_mbus_codeEugen Hristev1-0/+14
Current driver supports only SRGGB 10 bit RAW bayer format. Add the enum_mbus_code implementation to report this format supported. # v4l2-ctl -d /dev/v4l-subdev3 --list-subdev-mbus-codes ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0) 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 # Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: imx274: fix trivial typo obainted/obtainedEugen Hristev1-1/+1
Fix typo obainted/obtained. Fixes: 0985dd306f72 ("media: imx274: V4l2 driver for Sony imx274 CMOS sensor") Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: imx274: fix trivial typo expsoure/exposureEugen Hristev1-1/+1
Fix typo expsoure/exposure Fixes: 0985dd306f72 ("media: imx274: V4l2 driver for Sony imx274 CMOS sensor") Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: imx274: fix s_frame_interval runtime resume not requestedEugen Hristev1-0/+5
pm_runtime_resume_and_get should be called when the s_frame_interval is called. The driver will try to access device registers to configure VMAX, coarse time and exposure. Currently if the runtime is not resumed, this fails: # media-ctl -d /dev/media0 --set-v4l2 '"IMX274 1-001a":0[fmt:SRGGB10_1X10/3840x2 160@1/10]' IMX274 1-001a: imx274_binning_goodness: ask 3840x2160, size 3840x2160, goodness 0 IMX274 1-001a: imx274_binning_goodness: ask 3840x2160, size 1920x1080, goodness -3000 IMX274 1-001a: imx274_binning_goodness: ask 3840x2160, size 1280x720, goodness -4000 IMX274 1-001a: imx274_binning_goodness: ask 3840x2160, size 1280x540, goodness -4180 IMX274 1-001a: __imx274_change_compose: selected 1x1 binning IMX274 1-001a: imx274_set_frame_interval: input frame interval = 1 / 10 IMX274 1-001a: imx274_read_mbreg : addr 0x300e, val=0x1 (2 bytes) IMX274 1-001a: imx274_set_frame_interval : register SVR = 1 IMX274 1-001a: imx274_read_mbreg : addr 0x30f6, val=0x6a8 (2 bytes) IMX274 1-001a: imx274_set_frame_interval : register HMAX = 1704 IMX274 1-001a: imx274_set_frame_length : input length = 2112 IMX274 1-001a: imx274_write_mbreg : i2c bulk write failed, 30f8 = 884 (3 bytes) IMX274 1-001a: imx274_set_frame_length error = -121 IMX274 1-001a: imx274_set_frame_interval error = -121 Unable to setup formats: Remote I/O error (121) The device is not resumed thus the remote I/O error. Setting the frame interval works at streaming time, because pm_runtime_resume_and_get is called at s_stream time before sensor setup. The failure happens when only the s_frame_interval is called separately independently on streaming time. Fixes: ad97bc37426c ("media: i2c: imx274: Add IMX274 power on and off sequence") Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-30media: i2c: max9286: Depend on VIDEO_V4L2Kieran Bingham1-0/+1
The MAX9286 has not explicitly declared a dependency upon VIDEO_V4L2. While this dependency has likely always been met by configurations including it, the device does use V4L2 core, and should depend upon it. Add VIDEO_V4L2 as a dependency to match other drivers and prevent failures when compile testing. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-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>
2021-11-29media: mxl5005s: drop some dead codeMauro Carvalho Chehab1-13/+1
As reported by clang (with W=1), the ctrlVal var is never used. Yet, there are even some loops to estimate it. As this is dead code, remove it. If ever needed, someone could revert this patch. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: cobalt: drop an unused variableMauro Carvalho Chehab1-4/+1
The clock_control value is read but never actually used. Based on a comment at the code, it has to be reset at the function. So, drop the variable that stores its value. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: mtk-mdp: address a clang warningMauro Carvalho Chehab1-1/+1
The typecasts at the dvb-core generate clang warnings when W=1 is enabled. Such warning is harmless, but it causes the build to break with CONFIG_WERROR and W=1 with clang, so do the cast on a way that it won't produce warnings anymore. Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: camss: Remove unused static functionRobert Foss1-7/+0
vfe_reg_clr() is not used in camss-vfe-170.c, and can be removed. Signed-off-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2021-11-29media: davinci: vpbe_osd: mark read reg function as __always_unusedMauro Carvalho Chehab1-1/+1
Such function is currently unused, but could be needed in the future. So, keep it, marking it as __always_unused, in order to avoid a clang W=1 error. Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: imx290: mark read reg function as __always_unusedMauro Carvalho Chehab1-1/+1
Such function is currently unused, but could be needed in the future. So, keep it, marking it as __always_unused, in order to avoid a clang W=1 error. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: adv7511: drop unused functionsMauro Carvalho Chehab1-22/+0
Those are aliases for another function and not used at the current implementation. So, just drop it. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: adv7604: mark unused functions as suchMauro Carvalho Chehab1-9/+9
There are several unused helper macros there, meant to parse some fields. As those actually help to document the hardware, the better is to keep them. However, it generates clang warnings with W=1, causing build to break with CONFIG_WERROR. So, add __always_unused to fix such warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: au0828-i2c: drop a duplicated functionMauro Carvalho Chehab1-7/+0
This function is not used, so, just drop it. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: lmedm04: don't ignore errors when setting a filterMauro Carvalho Chehab1-0/+3
Solves a clang warning. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: radio-si476x: drop a container_of() abstraction macroMauro Carvalho Chehab1-6/+0
This isn't used anywhere. So, drop it. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: si470x: consolidate multiple printk'sMauro Carvalho Chehab2-25/+8
When the version warning is given, multiple dev_warn() are called. Consolidate the ones that could be merged altogether. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: si470x: fix printk warnings with clangMauro Carvalho Chehab2-6/+6
Clang doesn't like "%hu" on macros: drivers/media/radio/si470x/radio-si470x-i2c.c:414:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat] drivers/media/radio/si470x/radio-si470x-i2c.c:417:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat] Besides that, changeset cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") dropped recomendation of using %h. So, just replace them with "%u". Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: solo6x10: mark unused functions as suchMauro Carvalho Chehab1-6/+6
There are several unused helper macros there, meant to parse some fields. As those actually help to document the hardware, the better is to keep them. However, it generates clang warnings with W=1, causing build to break with CONFIG_WERROR. So, add __always_unused to fix such warnings. Acked-by: Ismael Luceno <ismael@iodev.co.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: si21xx: report eventual errors at set_frontendMauro Carvalho Chehab1-3/+4
If an error occurs while setting the registers at set_frontend, it is silently ignored. Yet, the variable status is updated. Change the logic to return an error if it fails to write values to the registers. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-29media: m88ds3103: drop reg11 calculus from m88ds3103b_select_mclk()Mauro Carvalho Chehab1-5/+1
This value is never used at the code. So, drop it. Solves a W=1 clang warning. Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>