aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-11-25media: sun6i-csi: Add capture state using vsync for page flipPaul Kocialkowski4-124/+165
The current implementation requires up to 3 buffers to properly implement page flipping without losing frames: one is configured before the video stream is started, one just after that and page flipping is synchronized to the frame done interrupt. The comment in the code mentions that "CSI will lookup the next dma buffer for next frame before the current frame done IRQ triggered". Based on observations of the CSI unit behavior, it seems that the buffer DMA address is sampled when the frame scan begins (in addition to starting the stream), which corresponds to the vblank interrupt that hits just before the frame-done interrupt of the previous frame. As a result, the address configured at the frame done interrupt is not actually used for the next frame but for the one after that. This proposal changes the page flipping sync point to the vsync interrupt, which allows the DMA address to be sampled for the next frame instead and allows operating with only two buffers. In addition to the change in the sync point, the code is refactored to introduce a notion of state that clarifies tracking of the buffers with tidy functions. Signed-off-by: Paul Kocialkowski <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: sun6i-csi: Rename sun6i_video to sun6i_csi_capturePaul Kocialkowski5-183/+187
In an effort to distinguish between the core csi engine (to be represented as the bridge) and the dma engine (the capture video device), rename the video component to capture, with the appropriate prefix. No functional change intended. [Sakari Ailus: fix wrong variable issue (video -> capture) missed in patch] Signed-off-by: Paul Kocialkowski <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: sun6i-csi: Add bridge v4l2 subdev with port managementPaul Kocialkowski6-139/+548
Introduce a bridge v4l2 subdev to prepare for separation between the processing part (bridge) and the dma engine, which is required to properly support ths isp workflow later on. Currently the bridge just manages fwnode mapping to media pads, using an async notifier (which was previously in the main code). The s_stream video op just forwards to the connected v4l2 subdev (sensor or MIPI CSI-2 bridge). The video capture device is now registered after the bridge and attaches to it with a media link. Signed-off-by: Paul Kocialkowski <[email protected]> Acked-by: Jernej Skrabec <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Support event handlersDave Stevenson1-1/+9
As noted in the headers for V4L2_SUBDEV_FL_HAS_EVENTS, "controls can send events, thus drivers exposing controls should set this flag". This driver exposes controls, but didn't reflect that it could generate events. Correct this, and add the default event handler functions. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Add support for 8bit readoutDave Stevenson1-17/+78
The sensor supports 8 or 10 bit readout modes, but the driver only supported 10 bit. Add 8 bit readout. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Add support for 1280x800 and 640x400 modesDave Stevenson1-1/+102
Adds register settings for additional modes. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Add selection API calls for cropping infoDave Stevenson1-0/+75
As required by libcamera, add the relevant cropping targets to report which portion of the sensor is being read out in any mode. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Make V4L2_CID_HBLANK r/wDave Stevenson1-11/+21
There's no reason why HBLANK has to be read-only as it only changes the TIMING_HTS register in the sensor. Remove the READ_ONLY flag, and add the relevant handling for it. The minimum value also varies based on whether continuous clock mode is being used or not, so allow hblank_min to depend on that. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Add HFLIP and VFLIP supportDave Stevenson1-1/+51
Adds support for V4L2_CID_HFLIP and V4L2_CID_VFLIP to allow flipping the image. The driver previously enabled H & V flips in the register table, therefore the controls default to the same settings to avoid changing the behaviour. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Action CID_VBLANK when set.Dave Stevenson1-16/+16
Programming the sensor with TIMING_VTS (aka LPFR) was done when triggered by a change in exposure or gain, but not when V4L2_CID_VBLANK was changed. Dynamic frame rate changes could therefore not be achieved. Separate out programming TIMING_VTS so that it is triggered by set_ctrl(V4L2_CID_VBLANK) Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Add the properties from fwnodeDave Stevenson1-2/+10
Use v4l2_ctrl_new_fwnode_properties to add V4L2_CID_CAMERA_ORIENTATION and V4L2_CID_CAMERA_SENSOR_ROTATION. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Add selection for CSI2 clock modeDave Stevenson1-2/+22
The sensor supports either having the CSI2 clock lane free running, or gated when there is no packet to transmit. The driver only selected gated (non-continuous) clock mode. Add code to allow fwnode to configure whether the clock is gated or free running. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Reduce vblank_min values based on testingDave Stevenson1-1/+1
The configured vblank_min setting of 151 (meaning VTS of 720 + 151 = 871) is far higher than the setting that works on the sensor, and there are no obvious restrictions stated in the datasheet. Reduce the vblank_min to allow for faster frame rates. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Correct HTS register for configured pixel rateDave Stevenson1-2/+2
The calculations from pixel rate, width+hblank, and height+vblank do not give the correct framerate - it's half the speed it should be. The datasheet lists the default for the TIMING_HTS registers (0x380c/d) as being 0x2d8 (728) which is less than the width of the image, so the units clearly can't be pixels. If TIMING_HTS is considered to be units of 2-pixels, then the resulting value of 0x5b0 (1456) makes all the calculations correct. This driver is reporting an HBLANK value of 250, with an image width of 1280, so TIMING_HTS is 1530 (0x5fa) pixels. However it was also setting the register to 0x5fa, thereby not taking into account it being units of 2-pixels. Correct the register value to 0x2fd so that all the timing calculations give the correct results. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Support more than 1 mode.Dave Stevenson1-18/+28
The driver currently has multiple assumptions that there is only one supported mode. Convert supported_mode to an array, and fix up all references to correctly look at that array. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Remove pixel rate from mode definitionDave Stevenson1-10/+7
The pixel rate is determined by the PLL setup in the common registers, not by the mode specific registers, therefore remove it from the mode definition and define it for all modes. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Remove format code from the modeDave Stevenson1-6/+3
The format code is independent of mode, and each mode could support both Y10 and Y8, so disassociate the code from the mode. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Split registers into common and mode specificDave Stevenson1-30/+47
Currently only one mode is supported, so all registers were dropped in one list. In preparation for adding more modes, split out the common registers from those which configure the mode. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov9282: Remove duplication of registersDave Stevenson1-6/+0
TIMING_VTS (registers 0x380e/f), EXPOSURE (registers 0x3500/1/2), and GAIN (0x3509) are all set from ov9282_update_exp_gain as part of the control handler, therefore they do not need to be in the main list of registers. Remove them. Signed-off-by: Dave Stevenson <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov5645: Call ov5645_entity_init_cfg() before registering the subdevLad Prabhakar1-2/+2
Make sure we call ov5645_entity_init_cfg() before registering the subdev to make sure default formats are set up. Suggested-by: Sakari Ailus <[email protected]> Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov5645: Make sure to call PM functionsLad Prabhakar1-5/+7
Make sure we call the PM functions while s_stream(0) even in case of errors in the code flow. v4l2-core takes care of warning the user so no need to add a warning message in the driver. Suggested-by: Sakari Ailus <[email protected]> Signed-off-by: Lad Prabhakar <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov5645: Drop empty commentLad Prabhakar1-3/+0
Drop empty multiline comment. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: ov5645: Use runtime PMLad Prabhakar1-65/+68
Switch to using runtime PM for power management. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dt-bindings: ov5645: Convert OV5645 binding to a schemaLad Prabhakar2-54/+104
Convert the simple OV5645 Device Tree binding to json-schema. The previous binding marked the below properties as required which was a driver requirement and not the device requirement so just drop them from the required list during the conversion. - clock-frequency - enable-gpios - reset-gpios Also drop the "clock-names" property as we have a single clock source for the sensor and the driver has been updated to drop the clk referencing by name. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: arm64: dts: renesas: aistarvision-mipi-adapter-2.1: Drop clock-names ↵Lad Prabhakar1-1/+0
property Now that the driver has been updated to drop fetching the clk reference by name we no longer need the clock-names property in the ov5645 sensor node. This is in preparation for removal for clock-names property from the DT binding. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ARM: dts: imx6qdl-wandboard: Drop clock-names propertyLad Prabhakar1-1/+0
Now that the driver has been updated to drop fetching the clk reference by name we no longer need the clock-names property in the ov5645 sensor node. This is in preparation for removal for clock-names property from the DT binding. Signed-off-by: Lad Prabhakar <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: ARM: dts: imx6qdl-pico: Drop clock-names propertyLad Prabhakar1-1/+0
Now that the driver has been updated to drop fetching the clk reference by name we no longer need the clock-names property in the ov5645 sensor node. This is in preparation for removal for clock-names property from the DT binding. Signed-off-by: Lad Prabhakar <[email protected]> Acked-by: Shawn Guo <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: imx412: Add new compatible stringsBryan O'Donoghue1-0/+1
The Sony imx577 uses the same silicon enabling reference code in the available examples provided as the imx412. Add in compatible strings to enable and differentiate the parts. Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: "Paul J. Murphy" <[email protected]> Cc: Daniele Alessandrelli <[email protected]> Cc: Rob Herring <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: i2c: imx412: Assign v4l2 device subname based on compat stringBryan O'Donoghue1-1/+7
imx412 and imx577 return the same chip-id when interrogated via i2c. I've confirmed this myself by Sakari suggested we should add a new compat which should be reflected in the name of the media entity https://patchwork.kernel.org/project/linux-media/patch/[email protected]/#24894500 Set up the .data parameter of of_device_id to pass a string which we use to set the media entity name. Once done we can add in imx577 as a compatible chips with the media names reflecting the directed compat string. Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: "Paul J. Murphy" <[email protected]> Cc: Daniele Alessandrelli <[email protected]> Cc: Rob Herring <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: dt-bindings: imx412: Extend compatible stringsBryan O'Donoghue1-1/+3
Add compatible bindings for imx577 which uses the same silicon enabling reference code from Sony in the available examples provided. Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: "Paul J. Murphy" <[email protected]> Cc: Daniele Alessandrelli <[email protected]> Cc: Rob Herring <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Bryan O'Donoghue <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: staging: media: tegra-video: Replace custom implementation of ↵Andy Shevchenko1-1/+1
device_match_fwnode() Replace custom implementation of the device_match_fwnode(). Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-25media: subdev: Replace custom implementation of device_match_fwnode()Andy Shevchenko1-1/+1
Replace custom implementation of the device_match_fwnode(). Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-11-21media: v4l2-core/tuner-core: Convert to i2c's .probe_new()Uwe Kleine-König1-4/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [hverkuil: deleted kerneldoc reference to removed id argument]
2022-11-21media: usb: go7007: s2250-board: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/tua9001: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/tda18250: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/tda18212: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/qm1d1c0042: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Tested-by: Akihiro Tsukada <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/qm1d1b0004: Convert to i2c's .probe_new()Uwe Kleine-König1-2/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Tested-by: Akihiro Tsukada <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/mxl301rf: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Tested-by: Akihiro Tsukada <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/mt2060: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/m88rs6000t: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/fc2580: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: tuners/e4000: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: vidtv: Convert to i2c's .probe_new()Uwe Kleine-König2-6/+4
The probe functions doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: radio/tef6862: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: radio/saa7706h: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: radio/radio-tea5764: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: i2c/wm8775: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
2022-11-21media: i2c/wm8739: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>