summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-04-22media: ov2680: Stop sending more data then requestedHans de Goede1-7/+2
There is no reason to send OV2680_END_MARGIN extra columns on top of the mode width and the same for sending extra lines over the mode height. This sending of extra lines/columns was inherited from the atomisp ov2680 driver, it is unclear why this was done and this complicates adding V4L2_CID_VBLANK support, so remove it. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: ov2680: Do not fail if data-lanes property is absentFabio Estevam1-7/+0
Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") the ov2680 driver no longer probes when the 'data-lanes' property is absent. The OV2680 sensor has only one data lane, so there is no need for describing it the devicetree. Remove the unnecessary data-lanes property check. Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: imx335: Limit analogue gain valueUmang Jain1-4/+12
The sensor gain (both analog and digital) are controlled by a single gain value where: - 0dB to 30dB correspond to analog gain - 30.3dB to 72dB correspond to digital gain (with 0.3dB step) Hence, limit the analogue gain value to 100. For digital gain, support can be added later if needed. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: imx335: Fix active area height discrepencyUmang Jain1-5/+5
The imx335 reports a recommended pixel area of - 2592x1944. The driver supported mode however limits it to height=1940. Fix the height discrepency by correctly the value of height (with updates to vblank and mode registers). The IMX335_REG_HTRIMMING should also be corrected to the start offset(i.e. 48) instead of chosing a abritrary crop start of 384. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: imx335: Use integer values for size registersUmang Jain1-6/+6
Consider integer values for registers that are related to various sizes in the register map. This helps in improving the overall readability. No functional changes intended in this patch. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: imx335: Use V4L2 CCI for accessing sensor registersUmang Jain2-330/+266
Use the new comon CCI register access helpers to replace the private register access helpers in the imx335 driver. Select V4L2_CCI_I2C Kconfig option which the imx335 driver now depends on. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: imx335: Parse fwnode propertiesKieran Bingham1-1/+9
Call the V4L2 fwnode device parser to handle controls that are standardised by the framework. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: imx335: Support 2 or 4 lane operation modesKieran Bingham1-1/+20
The IMX335 can support both 2 and 4 lane configurations. Extend the driver to configure the lane mode accordingly. Update the pixel rate depending on the number of lanes in use. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: fixup missing : in @lane_mode kerneldoc line]
2024-04-22media: v4l2-ctrls: Return handler error in creating new fwnode propertiesSakari Ailus1-0/+3
If the control handler is in an error state, return that error immediately in v4l2_ctrl_new_fwnode_properties(). Effectively the change here is that the same error code (handler's error) is returned in all cases instead of possibly returning -EINVAL. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: staging: ipu3-imgu: Update firmware pathSakari Ailus2-1/+5
Use the current firmware path in linux-firmware repository. Check the older paths still in order to avoid causing issues to the users. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: v4l: Don't turn on privacy LED if streamon failsSakari Ailus1-10/+12
Turn on the privacy LED only if streamon succeeds. This can be done after enabling streaming on the sensor. Fixes: b6e10ff6c23d ("media: v4l2-core: Make the v4l2-core code enable/disable the privacy LED if present") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: ti: j721e-csi2rx: Fix races while restarting DMAJai Luthra1-3/+2
After the frame is submitted to DMA, it may happen that the submitted list is not updated soon enough, and the DMA callback is triggered before that. This can lead to kernel crashes, so move everything in a single lock/unlock section to prevent such races. Fixes: b4a3d877dc92 ("media: ti: Add CSI2RX support for J721E") Signed-off-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: cadence: csi2rx: configure DPHY before starting source streamPratyush Yadav1-12/+14
When the source device is operating above 1.5 Gbps per lane, it needs to send the Skew Calibration Sequence before sending any HS data. If the DPHY is initialized after the source stream is started, then it might miss the sequence and not be able to receive data properly. Move the start of source subdev to the end of the sequence to make sure everything is ready to receive data before the source starts streaming. Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Fixes: 3295cf1241d3 ("media: cadence: Add support for external dphy") Tested-by: Julien Massot <julien.massot@collabora.com> Tested-by: Changhuang Liang <Changhuang.liang@starfivetech.com> Reviewed-by: Julien Massot <julien.massot@collabora.com> Reviewed-by: Changhuang Liang <Changhuang.liang@starfivetech.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: mc: mark the media devnode as registered from the, startHans Verkuil1-3/+2
First the media device node was created, and if successful it was marked as 'registered'. This leaves a small race condition where an application can open the device node and get an error back because the 'registered' flag was not yet set. Change the order: first set the 'registered' flag, then actually register the media device node. If that fails, then clear the flag. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Fixes: cf4b9211b568 ("[media] media: Media device node support") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2024-04-22media: dt-bindings: i2c: use absolute path to other schemaAlexander Stein4-4/+4
Absolute path to other DT schema is preferred over relative one. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22media: dt-bindings: sony,imx290: Allow props from video-interface-devicesAlexander Stein1-1/+4
Allow properties from video-interface-devices. This aligns the bindings to sony,imx415.yaml. Changes inspired by commit e2e73ed46c395 ("media: dt-bindings: sony,imx415: Allow props from video-interface-devices") Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-22Merge tag 'tags/media-next-imx-20240419' of ↵Hans Verkuil2-1/+34
git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git into media_stage NXP media drivers improvements. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.linuxtv.org/project/linux-media/patch/20240419103822.GA6868@pendragon.ideasonboard.com/
2024-04-19media: uvcvideo: Disable autosuspend for Insta360 LinkRicardo Ribalda2-1/+14
When the device suspends, it keeps power-cycling. The user notices it because the LED constanct oscillate between blue (ready) and no LED (off). <6>[95202.128542] usb 3-3-port4: attempt power cycle <6>[95206.070120] usb 3-3.4: new high-speed USB device number 49 using xhci_hcd <6>[95206.212027] usb 3-3.4: New USB device found, idVendor=2e1a, idProduct=4c01, bcdDevice= 2.00 <6>[95206.212044] usb 3-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=<Serial: 1> <6>[95206.212050] usb 3-3.4: Product: Insta360 Link <6>[95206.212075] usb 3-3.4: Manufacturer: Amba <7>[95206.214862] usb 3-3.4: GPIO lookup for consumer privacy <7>[95206.214866] usb 3-3.4: using lookup tables for GPIO lookup <7>[95206.214869] usb 3-3.4: No GPIO consumer privacy found <6>[95206.214871] usb 3-3.4: Found UVC 1.10 device Insta360 Link (2e1a:4c01) <3>[95206.217113] usb 3-3.4: Failed to query (GET_INFO) UVC control 14 on unit 1: -32 (exp. 1). <3>[95206.217733] usb 3-3.4: Failed to query (GET_INFO) UVC control 16 on unit 1: -32 (exp. 1). <4>[95206.223544] usb 3-3.4: Warning! Unlikely big volume range (=32767), cval->res is probably wrong. <4>[95206.223554] usb 3-3.4: [9] FU [Mic Capture Volume] ch = 1, val = -32768/-1/1 <6>[95210.698990] usb 3-3.4: USB disconnect, device number 49 <6>[95211.963090] usb 3-3.4: new high-speed USB device number 50 using xhci_hcd <6>[95212.657061] usb 3-3.4: new full-speed USB device number 51 using xhci_hcd <3>[95212.783119] usb 3-3.4: device descriptor read/64, error -32 <3>[95213.015076] usb 3-3.4: device descriptor read/64, error -32 <6>[95213.120358] usb 3-3-port4: attempt power cycle Bus 001 Device 009: ID 2e1a:4c01 Amba Insta360 Link Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x2e1a idProduct 0x4c01 bcdDevice 2.00 iManufacturer 1 Amba iProduct 2 Insta360 Link iSerial 0 bNumConfigurations 1 Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20221101-instal-v1-0-d13d1331c4b5@chromium.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-04-19media: uvcvideo: Fix power line control for Shine-Optics CameraRicardo Ribalda1-0/+9
The device does not implement the power line frequency control correctly. It is a UVC 1.5 device, but implements the control as a UVC 1.1 device. Add the corresponding control mapping override. Bus 003 Device 002: ID 3277:009e Shine-Optics Integrated Camera Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.01 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 bDeviceProtocol 1 Interface Association bMaxPacketSize0 64 idVendor 0x3277 idProduct 0x009e bcdDevice 0.01 iManufacturer 3 Shine-Optics iProduct 1 Integrated Camera iSerial 2 0001 Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240108-shine-v2-1-ddff959dab89@chromium.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-04-19media: uvcvideo: Add quirk for Logitech Rally BarRicardo Ribalda2-0/+32
Logitech Rally Bar devices, despite behaving as UVC cameras, have a different power management system that the other cameras from Logitech. USB_QUIRK_RESET_RESUME is applied to all the UVC cameras from Logitech at the usb core. Unfortunately, USB_QUIRK_RESET_RESUME causes undesired USB disconnects in the Rally Bar that make them completely unusable. There is an open discussion about if we should fix this in the core or add a quirk in the UVC driver. In order to enable this hardware, let's land this patch first, and we can revert it later if there is a different conclusion. Fixes: e387ef5c47dd ("usb: Add USB_QUIRK_RESET_RESUME for all Logitech UVC webcams") Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Devinder Khroad <dkhroad@logitech.com> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Link: https://lore.kernel.org/r/20240404-rallybar-v6-1-6d67bb6b69af@chromium.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-04-19media: dt-bindings: nxp,imx8-isi: Refuse port@1 for single pipeline modelsAlexander Stein1-0/+1
In case the hardware only supports just one pipeline, explicitly refuse port@1 in ports node. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240412095549.258870-1-alexander.stein@ew.tq-group.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-04-19media: mipi-csis: Emit V4L2_EVENT_FRAME_SYNC eventsStefan Klug1-1/+33
The Samsung CSIS MIPI receiver provides a start-of-frame interrupt and a framecount register. As the CSI receiver is the hardware unit that lies closest to the sensor, the frame counter is the best we can get on these devices. In case of the ISI available on the i.MX8 M Plus it is also the only native start-of-frame signal available. This patch exposes the sof interrupt and the framecount as V4L2_EVENT_FRAME_SYNC event on the subdevice. It was tested on a Debix-Som-A with a 6.8-rc4 kernel. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Link: https://lore.kernel.org/r/20240314093652.56923-1-stefan.klug@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-04-16media: usb: siano: Fix allocation of urbsRicardo Ribalda1-6/+14
USB urbs must be allocated with usb_alloc_urb. Quoting the manual Only use this function (usb_init_urb) if you _really_ understand what you are doing. Fix the following smatch error: drivers/media/usb/siano/smsusb.c:53:38: warning: array of flexible structures Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: loggingStefan Herdler5-38/+41
This patch fixes the following checkpatch warnings: WARNING:PRINTK_WITHOUT_KERN_LEVEL: printk() should include KERN_<LEVEL> facility level WARNING:PREFER_PR_LEVEL: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'ciintf_slot_ts_enable', this function's name, in a string CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'level' may be better as '(level)' to avoid precedence issues There was no consistent style of logging functions used so far. Convert all logging to the appropriate pr_* macros. Add a global pr_fmt macro for the whole driver. Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: miscellaneousStefan Herdler2-2/+1
This patch fixes the following checkpatch warnings: WARNING:RETURN_VOID: void function return statements are not generally useful WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: constant_comparsationStefan Herdler3-4/+4
This patch fixes the following checkpatch warnings: WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: trailing_statementsStefan Herdler1-6/+12
This patch fixes the following checkpatch errors: ERROR:TRAILING_STATEMENTS: trailing statements should be on next line Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: assign_in_ifStefan Herdler3-9/+15
This patch fixes the following checkpatch errors: ERROR:ASSIGN_IN_IF: do not use assignment in if condition Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: export_symbolStefan Herdler1-8/+7
This patch fixes the following checkpatch warnings: WARNING:EXPORT_SYMBOL: EXPORT_SYMBOL(foo); should immediately follow its function/variable Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: bracesStefan Herdler3-37/+24
This patch fixes the following checkpatch warnings and errors: WARNING:BRACES: braces {} are not necessary for any arm of this statement WARNING:BRACES: braces {} are not necessary for single statement blocks ERROR:OPEN_BRACE: that open brace { should be on the previous line CHECK:BRACES: braces {} should be used on all arms of this statement CHECK:BRACES: Unbalanced braces around else statement Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: commentsStefan Herdler4-22/+36
This patch fixes the following checkpatch warnings: WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line WARNING: It's generally not useful to have the filename in the file Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: whitespaceStefan Herdler3-458/+458
It fixes the following checkpatch errors: ERROR:SPACING: space prohibited before that ',' (ctx:WxW) ERROR:SPACING: space required after that ',' (ctx:VxV) ERROR:SWITCH_CASE_INDENT_LEVEL: switch and case should be at the same indent This patch contains the large multi line blocks. Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-16media: ttpci: coding style fixes: whitespace and newlinesStefan Herdler5-64/+68
This patch fixes the following checkpatch warnings and errors: ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar" ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar" ERROR:SPACING: space prohibited after that open parenthesis '(' ERROR:SPACING: space prohibited before that close parenthesis ')' ERROR:SPACING: space prohibited before that ',' (ctx:WxW) ERROR:SPACING: space required after that ',' (ctx:VxV) ERROR:SPACING: space required before that '-' (ctx:OxV) ERROR:SPACING: space required before the open parenthesis '(' ERROR:SPACING: spaces required around that '!=' (ctx:VxO) ERROR:SPACING: spaces required around that '<' (ctx:VxV) ERROR:SPACING: spaces required around that '=' (ctx:VxV) ERROR:SPACING: spaces required around that '>=' (ctx:VxV) WARNING:SPACING: space prohibited between function name and open parenthesis '(' WARNING:TABSTOP: Statements should start on a tabstop WARNING:LEADING_SPACE: please, no spaces at the start of a line WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements WARNING:LINE_SPACING: Missing a blank line after declarations Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: adv7180: Only request valids IRQsRicardo Ribalda1-1/+1
i2c_device_probe(), seems to assume that irq = 0 means that there is no irq to request. The driver also believes that on the clean path. So lets be consistent here. Also make smatch happy. Fix: drivers/media/i2c/adv7180.c:1526 adv7180_probe() warn: 'client->irq' from request_threaded_irq() not released on lines: 1526 Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: v4l2-ctrls-core.c: Do not use iterator outside loopRicardo Ribalda1-14/+19
Simplify a bit the code introducing a new variable for iterating through the control list. It also makes smatch happy: drivers/media/v4l2-core/v4l2-ctrls-api.c:1091 v4l2_query_ext_ctrl() warn: iterator used outside loop: 'ref' Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: fix tiny whitespace issue in 'pos = ref': use just one space]
2024-04-15media: platform: sti: hva: clk_unprepare unconditionallyRicardo Ribalda1-2/+1
hva->clk cannot be NULL at this point. Simplify the code and make smatch happy: drivers/media/platform/st/sti/hva/hva-hw.c:412 hva_hw_probe() warn: 'hva->clk' from clk_prepare() not released on lines: 412 Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: cxd2880: Replaze kmalloc with kzallocRicardo Ribalda1-1/+1
Fix smatch error: drivers/media/spi/cxd2880-spi.c:391 cxd2880_start_feed() warn: Please consider using kzalloc instead of kmalloc Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: dvb-usb: dib0700_devices: Add missing release_firmware()Ricardo Ribalda1-3/+15
Add missing release_firmware on the error paths. drivers/media/usb/dvb-usb/dib0700_devices.c:2415 stk9090m_frontend_attach() warn: 'state->frontend_firmware' from request_firmware() not released on lines: 2415. drivers/media/usb/dvb-usb/dib0700_devices.c:2497 nim9090md_frontend_attach() warn: 'state->frontend_firmware' from request_firmware() not released on lines: 2489,2497. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: dvb-frontends: drx39xyj: Refactor firmware uploadRicardo Ribalda2-28/+23
Do not cache the file, instead load it on demand. This makes smatch a happy parser: drivers/media/dvb-frontends/drx39xyj/drxj.c:11908 drx_ctrl_u_code() warn: 'fw' from request_firmware() not released on lines: 11877,11886,11896. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: tunner: xc5000: Refactor firmware loadRicardo Ribalda1-22/+17
Make sure the firmware is released when we leave xc_load_fw_and_init_tuner() This change makes smatch happy: drivers/media/tuners/xc5000.c:1213 xc_load_fw_and_init_tuner() warn: 'fw' from request_firmware() not released on lines: 1213. Cc: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: c8sectpfe: Refactor load_c8sectpfe_fwRicardo Ribalda1-1/+1
release_firmware() in the same function that it was requested. It is more clear and makes smatch happy. drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c:1146 load_c8sectpfe_fw() warn: 'fw' from request_firmware() not released on lines: 1125,1132. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: saa7134: Use devm_request_irqRicardo Ribalda1-7/+2
The handled version of request_irq let us remove the free_irq and makes smatch happier: drivers/media/pci/saa7134/saa7134-alsa.c:1186 alsa_card_saa7134_create() warn: 'dev->pci->irq' from request_irq() not released on lines: 1186 Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: solo6x10: Use devm functionsRicardo Ribalda1-3/+2
Let devm handle the life cycle of the irq request. Makes smatch happier: drivers/media/pci/solo6x10/solo6x10-core.c:631 solo_pci_probe() warn: 'pdev' from pci_request_regions() not released on lines: 631. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: solo6x10: Use pcim functionsRicardo Ribalda1-9/+2
Instead of handling manually the release of the memory regions let devm do that for us. Makes smatch happy: drivers/media/pci/solo6x10/solo6x10-core.c:631 solo_pci_probe() warn: 'pdev' from pci_request_regions() not released on lines: 631. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: videodev2: Fix v4l2_ext_control packing.Ricardo Ribalda1-1/+1
The structure is packed, which requires that all its fields need to be also packed. ./include/uapi/linux/videodev2.h:1810:2: warning: field within 'struct v4l2_ext_control' is less aligned than 'union v4l2_ext_control::(anonymous at ./include/uapi/linux/videodev2.h:1810:2)' and is usually due to 'struct v4l2_ext_control' being packed, which can lead to unaligned accesses [-Wunaligned-access] Explicitly set the inner union as packed. Marking the inner union as 'packed' does not change the layout, since the whole struct is already packed, it just silences the clang warning. See also this llvm discussion: https://github.com/llvm/llvm-project/issues/55520 Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: dvb: Fix dtvs_stats packing.Ricardo Ribalda1-1/+1
The structure is packed, which requires that all its fields need to be also packed. ./include/uapi/linux/dvb/frontend.h:854:2: warning: field within 'struct dtv_stats' is less aligned than 'union dtv_stats::(anonymous at ./include/uapi/linux/dvb/frontend.h:854:2)' and is usually due to 'struct dtv_stats' being packed, which can lead to unaligned accesses [-Wunaligned-access] Explicitly set the inner union as packed. Marking the inner union as 'packed' does not change the layout, since the whole struct is already packed, it just silences the clang warning. See also this llvm discussion: https://github.com/llvm/llvm-project/issues/55520 Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: dvb: as102-fe: Fix as10x_register_addr packingRicardo Ribalda1-1/+1
This structure is embedded in multiple other structures that are packed, which conflicts with it being aligned. drivers/media/usb/as102/as10x_cmd.h:379:30: warning: field reg_addr within 'struct as10x_dump_memory::(unnamed at drivers/media/usb/as102/as10x_cmd.h:373:2)' is less aligned than 'struct as10x_register_addr' and is usually due to 'struct as10x_dump_memory::(unnamed at drivers/media/usb/as102/as10x_cmd.h:373:2)' being packed, which can lead to unaligned accesses [-Wunaligned-access] Mark it as being packed. Marking the inner struct as 'packed' does not change the layout, since the whole struct is already packed, it just silences the clang warning. See also this llvm discussion: https://github.com/llvm/llvm-project/issues/55520 Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-15media: c8sectpfe: Do not depend on DEBUG_FSRicardo Ribalda3-3/+10
Make dependency on DEBUG_FS conditional, that way we are not forced to enable DEBUG_FS if we can to use this driver. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-04-11media: atomisp: Implement link_setup() op for ISP subdev MC entityHans de Goede1-0/+52
The atomisp driver's Android heritage makes it weird in that even though it uses MC + subdev-s it is designed to primarily be controlled through its /dev/video# node. It implements s_input() on /dev/video# to select which sensor to use, while ignoring link_setup() calls to enable a link to another sensor. Add support for selecting the active sensor the MC way by adding link_setup() support. The implementation is a bit convoluted due to the atomisp driver's heritage. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2024-04-11media: atomisp: Make MC link from ISP to /dev/video# output node immutableHans de Goede1-1/+2
The link from the ISP's source pad to the /dev/video# output v4l2-dev is always enabled and immutable, mark it as such. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>