aboutsummaryrefslogtreecommitdiff
path: root/drivers/media
AgeCommit message (Collapse)AuthorFilesLines
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 <[email protected]> Reviewed-by: Umang Jain <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Reviewed-by: Umang Jain <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Fixes: 3295cf1241d3 ("media: cadence: Add support for external dphy") Tested-by: Julien Massot <[email protected]> Tested-by: Changhuang Liang <[email protected]> Reviewed-by: Julien Massot <[email protected]> Reviewed-by: Changhuang Liang <[email protected]> Signed-off-by: Jai Luthra <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Acked-by: Sakari Ailus <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Fixes: cf4b9211b568 ("[media] media: Media device node support") Cc: [email protected] Signed-off-by: Sakari Ailus <[email protected]>
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 <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
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 <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
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 <[email protected]> Reviewed-by: Devinder Khroad <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Ricardo Ribalda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
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 <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Reviewed-by: Umang Jain <[email protected]> Signed-off-by: Stefan Klug <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: v4l2-subdev: Fix stream handling for crop APILaurent Pinchart1-0/+2
When support for streams was added to the V4L2 subdev API, the v4l2_subdev_crop structure was extended with a stream field, but the field was not handled in the core code that translates the VIDIOC_SUBDEV_[GS]_CROP ioctls to the selection API. Fix it. Fixes: 2f91e10ee6fd ("media: subdev: add stream based configuration") Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: mc: Fix graph walk in media_pipeline_startTomi Valkeinen1-0/+6
The graph walk tries to follow all links, even if they are not between pads. This causes a crash with, e.g. a MEDIA_LNK_FL_ANCILLARY_LINK link. Fix this by allowing the walk to proceed only for MEDIA_LNK_FL_DATA_LINK links. Signed-off-by: Tomi Valkeinen <[email protected]> Cc: [email protected] # for 6.1 and later Fixes: ae219872834a ("media: mc: entity: Rewrite media_pipeline_start()") Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: dw9714: Update e-mail addressesSakari Ailus1-3/+3
Remove inactive e-mail addresses. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: ipu3-cio2: Update e-mail addressesSakari Ailus1-4/+4
Remove e-mail addresses that are no longer valid. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: i2c: et8ek8: Don't strip remove function when driver is builtinUwe Kleine-König1-2/+2
Using __exit for the remove function results in the remove callback being discarded with CONFIG_VIDEO_ET8EK8=y. When such a device gets unbound (e.g. using sysfs or hotplug), the driver is just removed without the cleanup being performed. This results in resource leaks. Fix it by compiling in the remove callback unconditionally. This also fixes a W=1 modpost warning: WARNING: modpost: drivers/media/i2c/et8ek8/et8ek8: section mismatch in reference: et8ek8_i2c_driver+0x10 (section: .data) -> et8ek8_remove (section: .exit.text) Fixes: c5254e72b8ed ("[media] media: Driver for Toshiba et8ek8 5MP sensor") Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: ipu-cio2: Remove unnecessary runtime PM power state settingBjorn Helgaas2-15/+0
ipu-cio2 uses generic power management, and pci_pm_runtime_suspend() and pci_pm_runtime_resume() already take care of setting the PCI device power state, so the driver doesn't need to do it explicitly. Remove explicit setting to D3hot or D0 during runtime suspend and resume. Remove #defines that are no longer used. Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Hyungwoo Yang <[email protected]> Cc: Rajmohan Mani <[email protected]> Cc: Vijaykumar Ramya <[email protected]> Cc: Samu Onkalo <[email protected]> Cc: Jouni Högander <[email protected]> Cc: Jouni Ukkonen <[email protected]> Cc: Antti Laakso <[email protected]> [Sakari Ailus: Remove now-redundant local variables.] Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: ov2680: Allow probing if link-frequencies is absentFabio Estevam1-2/+7
Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") the ov2680 no longer probes on a imx7s-warp7: ov2680 1-0036: error -EINVAL: supported link freq 330000000 not found ov2680 1-0036: probe with driver ov2680 failed with error -22 As the 'link-frequencies' property is not mandatory, allow the probe to succeed by skipping the link-frequency verification when the property is absent. Cc: [email protected] Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: ov2680: Clear the 'ret' variable on successFabio Estevam1-0/+1
Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") even when the correct 'link-frequencies' property is passed in the devicetree, the driver fails to probe: ov2680 1-0036: probe with driver ov2680 failed with error -22 The reason is that the variable 'ret' may contain the -EINVAL value from a previous assignment: ret = fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency", &rate); Fix the problem by clearing 'ret' on the successful path. Tested on imx7s-warp board with the following devicetree: port { ov2680_to_mipi: endpoint { remote-endpoint = <&mipi_from_sensor>; clock-lanes = <0>; data-lanes = <1>; link-frequencies = /bits/ 64 <330000000>; }; }; Cc: [email protected] Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") Suggested-by: Hans de Goede <[email protected]> Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: ov2740: Fix LINK_FREQ and PIXEL_RATE control value reportingSakari Ailus1-5/+6
The driver dug the supported link frequency up from the V4L2 fwnode endpoint and used it internally, but failed to report this in the LINK_FREQ and PIXEL_RATE controls. Fix this. Fixes: 0677a2d9b735 ("media: ov2740: Add support for 180 MHz link frequency") Cc: [email protected] # for v6.8 and later Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Bingbu Cao <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: v4l: async: Properly re-initialise notifier entry in unregisterSakari Ailus1-1/+1
The notifier_entry of a notifier is not re-initialised after unregistering the notifier. This leads to dangling pointers being left there so use list_del_init() to return the notifier_entry an empty list. Fixes: b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init") Cc: <[email protected]> # for 6.6 and later Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: v4l: async: Don't set notifier's V4L2 device if registering failsSakari Ailus1-7/+1
The V4L2 device used to be set when the notifier was registered but this has been moved to the notifier initialisation. Don't touch the V4L2 device if registration fails. Fixes: b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init") Cc: <[email protected]> # for 6.6 and later Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: v4l: async: Fix notifier list entry initAlexander Stein1-0/+2
struct v4l2_async_notifier has several list_head members, but only waiting_list and done_list are initialized. notifier_entry was kept 'zeroed' leading to an uninitialized list_head. This results in a NULL-pointer dereference if csi2_async_register() fails, e.g. node for remote endpoint is disabled, and returns -ENOTCONN. The following calls to v4l2_async_nf_unregister() results in a NULL pointer dereference. Add the missing list head initializer. Fixes: b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init") Cc: <[email protected]> # for 6.6 and later Signed-off-by: Alexander Stein <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-10media: ipu3-cio2: Request IRQ earlierSakari Ailus1-5/+5
Call devm_request_irq() before registering the async notifier, as otherwise it would be possible to use the device before the interrupts could be delivered to the driver. Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-09media: v4l2-subdev: Remove non-pad dv timing callbacksPaweł Anikiel1-3/+3
After the conversion of dv timing calls to use a pad argument is done, remove the old callbacks. Update the subdev ioctl handlers to use the new callbacks. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-09media: vpif_display: Use pad variant of dv timing subdev callsPaweł Anikiel1-1/+1
Use the pad variant for all (s|g|query)_dv_timings subdev calls, which includes a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-09media: vpif_capture: Use pad variant of dv timing subdev callsPaweł Anikiel1-2/+2
Use the pad variant for all (s|g|query)_dv_timings subdev calls, which includes a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2024-04-09media: rcar-vin: Use pad variant of dv timing subdev callsPaweł Anikiel1-3/+6
Use the pad variant for all (s|g|query)_dv_timings subdev calls, which includes a pad argument. Signed-off-by: Paweł Anikiel <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>