aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-07-19media: cx23885: use generic power managementVaibhav Gupta1-3/+0
The .suspend() and .resume() callbacks are not defined for this driver. Still, their power management structure follows the legacy framework. To bring it under the generic framework, simply remove the binding of callbacks from struct "pci_driver". Compile-tested only. Signed-off-by: Vaibhav Gupta <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: sta2x11: use generic power managementVaibhav Gupta1-48/+15
With legacy PM, drivers themselves were responsible for managing the device's power states and takes care of register states. After upgrading to the generic structure, PCI core will take care of required tasks and drivers should do only device-specific operations. Thus, there is no need to call the PCI helper functions like pci_enable_device(), pci_save/restore_sate(), etc. Compile-tested only. Signed-off-by: Vaibhav Gupta <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: renesas,vsp1: Add power-domains and resetsLaurent Pinchart1-0/+14
The power-domains and resets properties are used in all DT sources in the kernel but are absent from the bindings. Document them and make them mandatory. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: renesas,vsp1: Convert binding to YAMLLaurent Pinchart3-31/+84
Convert the Renesas R-Car VSP1 text binding to YAML. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: renesas,fdp1: Add resets propertyLaurent Pinchart1-0/+5
The resets property is used in DT sources in the kernel tree. Document it and make it mandatory. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: renesas,fdp1: Make power-domains mandatoryLaurent Pinchart1-0/+1
All DT source files in the kernel tree specify the power-domains property. Make it mandatory. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: renesas,fdp1: Convert binding to YAMLLaurent Pinchart3-38/+64
Convert the Renesas R-Car FDP1 text binding to YAML. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: renesas,fcp: Add resets and iommus propertiesLaurent Pinchart1-0/+9
The resets and iommus properties are used in DT sources in the kernel tree. Document them, and make resets mandatory. The iommus property is optional as not all platforms wire the FCP to a functional IOMMU. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: renesas,fcp: Make power-domains mandatoryLaurent Pinchart1-0/+1
All DT source files in the kernel tree specify the power-domains property. Make it mandatory. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: renesas,fcp: Convert binding to YAMLLaurent Pinchart3-35/+57
Convert the Renesas R-Car FCP text binding to YAML. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: v4l2-async: Log message in case of heterogeneous fwnode matchLaurent Pinchart1-1/+23
When a notifier supplies a device fwnode and a subdev supplies an endpoint fwnode, incorrect matches may occur if multiple subdevs correspond to the same device fwnode. This can't be handled transparently in the framework, and requires the notifier to switch to endpoint fwnodes. Log a message to notify of this problem. A second message is added to help accelerating the transition to endpoint matching. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Lad Prabhakar <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: v4l2-async: Pass notifier pointer to match functionsLaurent Pinchart1-7/+11
The notifier is useful to match functions to access information about the device matching a subdev. This will be used to print messages using the correct struct device and driver name. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Lad Prabhakar <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: v4l2-async: Accept endpoints and devices for fwnode matchingLaurent Pinchart1-1/+42
fwnode matching was designed to match on nodes corresponding to a device. Some drivers, however, needed to match on endpoints, and have passed endpoint fwnodes to v4l2-async. This works when both the subdev and the notifier use the same fwnode types (endpoint or device), but makes drivers that use different types incompatible. Fix this by extending the fwnode match to handle fwnodes of different types. When the types (deduced from the presence of remote endpoints) are different, retrieve the device fwnode for the side that provides an endpoint fwnode, and compare it with the device fwnode provided by the other side. This allows interoperability between all drivers, regardless of which type of fwnode they use for matching. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Lad Prabhakar <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Tested-by: Niklas Söderlund <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: device property: Add a function to test is a fwnode is a graph endpointLaurent Pinchart1-0/+5
Drivers may need to test if a fwnode is a graph endpoint. To avoid hand-written solutions that wouldn't work for all fwnode types, add a new fwnode_graph_is_endpoint() function for this purpose. We don't need to wire it up to different backends for OF and ACPI for now, as the implementation can simply be based on checkout the presence of a remote-endpoint property. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Reviewed-by: Lad Prabhakar <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: i2c: Add RDACM20 driverJacopo Mondi6-0/+1259
The RDACM20 is a GMSL camera supporting 1280x800 resolution images developed by IMI based on an Omnivision 10635 sensor and a Maxim MAX9271 GMSL serializer. The GMSL link carries power, control (I2C) and video data over a single coax cable. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Kieran Bingham <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: i2c: Add bindings for IMI RDACM2xJacopo Mondi2-0/+161
The IMI RDACM20 and IMI RDACM21 are Gigabit Multimedia Serial Link (GMSL) camera capable of transmitting video and I2C control messages on a coax cable physical link for automotive applications. Document their device tree bindings. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Kieran Bingham <[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]>
2020-07-19media: i2c: Add MAX9286 driverKieran Bingham4-0/+1344
The MAX9286 is a 4-channel GMSL deserializer with coax or STP input and CSI-2 output. The device supports multicamera streaming applications, and features the ability to synchronise the attached cameras. CSI-2 output can be configured with 1 to 4 lanes, and a control channel is supported over I2C, which implements an I2C mux to facilitate communications with connected cameras across the reverse control channel. Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Kieran Bingham <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: i2c: Add bindings for Maxim Integrated MAX9286Laurent Pinchart1-0/+366
The MAX9286 deserializes video data received on up to 4 Gigabit Multimedia Serial Links (GMSL) and outputs them on a CSI-2 port using up to 4 data lanes. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Kieran Bingham <[email protected]> Signed-off-by: Niklas Söderlund <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: i2c: dw9768: Add DW9768 VCM driverDongchun Zhu4-0/+568
Add a V4L2 sub-device driver for DW9768 voice coil motor, providing control to set the desired focus via IIC serial interface. Signed-off-by: Dongchun Zhu <[email protected]> Reviewed-by: Tomasz Figa <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dt-bindings: media: i2c: Document DW9768 bindingsDongchun Zhu2-0/+107
Add DeviceTree Binding Documentation for Dongwoon Anatech DW9768 voice coil actuator. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Dongchun Zhu <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: i2c: imx290: replace msleep(10) with usleep_range(10000, 11000)Andrey Konovalov1-3/+3
This fixes checkpatch warnings of "msleep < 20ms can sleep for up to 20ms". Signed-off-by: Andrey Konovalov <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: staging: rkisp1: set pads array of the resizer to size 2Dafna Hirschfeld2-3/+4
Currently the 'pads' and 'pad_cfg' arrays of the rkisp1_resizer are of size 'RKISP1_ISP_PAD_MAX' which is 4. But the resizer has only two pads. Change the size of the arrays to 2 by adding and using 'RKISP1_RSZ_PAD_MAX' similar to the way it is done in the isp entity. [hverkuil: fix typos in commit log] Signed-off-by: Dafna Hirschfeld <[email protected]> Acked-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: staging: rkisp1: remove unused field alloc_ctx from struct rkisp1_deviceDafna Hirschfeld1-1/+0
The field alloc_ctx in struct rkisp1_device is not used. This patch removes it. Signed-off-by: Dafna Hirschfeld <[email protected]> Acked-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: staging: rkisp1: remove unused field ctrl_handler from struct ↵Dafna Hirschfeld1-1/+0
rkisp1_device The field ctrl_handler in struct rkisp1_device is not used. This patch removes it. Signed-off-by: Dafna Hirschfeld <[email protected]> Acked-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: staging: rkisp1: cap: in stream start, replace calls to ↵Dafna Hirschfeld1-2/+2
rkisp1_handle_buffer with rkisp1_set_next_buf The function 'rkisp1_stream_start' calls 'rkisp1_handle_buffer' in order to update the 'buf.curr' and 'buf.next' fields and configure the device before streaming starts. This cause a wrong increment of the debugs field 'frame_drop'. This patch replaces the call to 'rkisp1_handle_buffer' with a call to 'rkisp1_set_next_buf'. Signed-off-by: Dafna Hirschfeld <[email protected]> Acked-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: staging: rkisp1: cap: move code that manages the buffers to ↵Dafna Hirschfeld1-16/+14
rkisp1_set_next_buf The function 'rkisp1_set_next_buf' configures the registers according to 'cap->buf.next'. It is called after updating 'cap->buf.next' and 'cap->buf.curr'. This patch moves the code that updates those fields to rkisp1_set_next_buf. This is a preparation for later patch that change a call to 'rkisp1_handle_buffer' with a call to 'rkisp1_set_next_buf'. Signed-off-by: Dafna Hirschfeld <[email protected]> Acked-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: staging: rkisp1: cap: protect buf.curr and buf.next with buf.lockDafna Hirschfeld1-2/+3
The spinlock buf.lock should protect access to the buffers. This includes the buffers in buf.queue and also buf.curr and buf.next. The function 'rkisp1_set_next_buf' access buf.next therefore it should also be protected with the lock. Signed-off-by: Dafna Hirschfeld <[email protected]> Acked-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: staging: rkisp1: cap: don't set next buffer from rkisp1_vb2_buf_queueDafna Hirschfeld1-12/+1
The function 'rkisp1_vb2_buf_queue' sets the next buffer directly in case the capture is already streaming but no frame yet arrived from the sensor. This is an optimization that tries to avoid dropping a frame. The call atomic_read(&cap->rkisp1->isp.frame_sequence) is used to check if a frame arrived. Reading the 'frame_sequence' should be avoided outside irq handlers to avoid race conditions. This patch removes this optimization. Dropping of the first frames can be avoided if userspace queues the buffers before start streaming. If userspace starts queueing buffers only after calling 'streamon' he risks frame drops anyway. Signed-off-by: Dafna Hirschfeld <[email protected]> Acked-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: MAINTAINERS: rectify CHRONTEL CH7322 CEC DRIVER sectionLukas Bulwahn1-1/+1
Commit 7f52faabd2e5 ("media: dt-bindings: Add ch7322 media i2c device") slipped in a typo in the CHRONTEL CH7322 CEC DRIVER section. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains: warning: no file matches F: \ Documentation/devicetree/bindings/media/i2c/chontel,ch7322.yaml Fix the typo to address this warning. Signed-off-by: Lukas Bulwahn <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: tw68: Replace http links with https onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: tw5864-core: Replace http links with https onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: rtl2832_sdr: Replace HTTP links with HTTPS onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: ivtv: Replace http links with https onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: imon: Replace http links with https onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: cx18: Replace http links with https onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: add support for allegro firmware 2019.2Michael Tretter3-28/+186
Encode messages as necessary for the firmware 2019.2 and, thus, support the more recent firmware version in the driver, too. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: add a version field to mcu messagesMichael Tretter2-5/+23
In order to distinguish the message format that is expected by the firmware, add a version field to the message header. This allows to encode and decode the messages for the version of the firmware that was loaded by the driver. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: drop length field from message headerMichael Tretter3-17/+5
The length of the message will be determined when the message is encoded. Writing the size of the struct into the message in the driver won't be the actual length of the message that is send to the firmware. Therefore, drop the length field from the message. Since the header is the same for all response messages, it does not make sense to read the header in each decoding function, but we can simply decode it once before dispatching to the respective functions. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: set num_ref_idx using response of configured channelsMichael Tretter3-4/+17
The firmware decides how many reference frames shall be used und returns this information via the config blob. In order to set the number of reference frames in the PPS, the driver has to read these values from the config blob after the channel has been created in the firmware. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: add config blob for channelMichael Tretter3-8/+39
Firmware versions >= 2019.2 do not configure the channel via the mailbox interface anymore, but use a separate chunk of memory that is only referenced by the message. As the configuration must be in a format that is understood by the firmware and this format can change between firmware versions, handle it similar to the message and treat is as a blob. In order to support both methods in the driver, always use a separate blob for the channel configuration and copy that blob into the mailbox if the firmware requires it and otherwise reference it. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: encode bit fields separatelyMichael Tretter3-31/+38
Even bits in bitfields do not keep their position, but move around or move to other bitfields. Therefore, the driver has to handle bitfields differently depending on the firmware version. Create separate fields for the options that have been in bitfields and handle the bitfields when encoding the message. As a side effect, this makes the messages a bit more readable. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: support handling firmware dependent valuesMichael Tretter3-12/+16
Like the message format, also the identifiers in the messages differ between firmware versions. This especially affects the identifier for the codec that shall be used. As the messages used by the driver are now independent from the firmware, we can use the values defined by V4L2 as identifiers in the messages. Convert the V4L2 codec format to the respective firmware value when encoding the messages to binary format instead beforehand. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: don't pack MCU messagesMichael Tretter1-13/+13
The messages are now explicitly converted from the struct to the binary representation used by the firmware. Therefore, there is no need to keep the structs packed anymore. Drop the attribute and avoid confusion why the mails are packed. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: add field for number of buffersMichael Tretter3-1/+3
When pushing the buffers for the intermediate and reference frames to the MCU, the driver relied on the message size to calculate the number of buffers. As it is not necessary anymore to keep the messages binary compatible to the firmware, we can just explicitly write the number of buffers into the message. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: add explicit mail encoding and decodingMichael Tretter3-4/+391
The message format in the mailboxes differ between firmware versions. Therefore, it is necessary to decouple the mailbox format of the driver from the message format of the firmware. This allows to keep a consistent message format in the driver while still supporting various firmware versions. Add an intermediate step to encode and decode message before writing the mails to the mailboxes. On the other hand, this allows to handle optional fields in the messages, which is required for advanced features of the encoder and was not possible until now. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: rework read/write to mailboxMichael Tretter1-74/+36
Rework the functions that read and write the SRAM that is used to communicate with the MCU. As the functions will not operate on structs but on prepared binary buffers, make the buffer stride more explicit. Also, avoid any uses of struct mcu_msg_header to analyze messages in memory, because the header will be made independent of the binary representation in the mailbox. Instead explicitly access the mail size field in the mailbox. As at it, further reduce the dependency between the mailboxes and struct allegro_dev. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: allegro: rework mbox handlingMichael Tretter1-58/+87
Add a send/notify abstraction for the mailbox and separate the message handling in the driver from the code to read and write message to the mailbox. This untangles how mails are written into the MCU's SRAM and signaled to the MCU from the protocol between the driver and the firmware. Signed-off-by: Michael Tretter <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: v4l2-subdev.h: drop duplicated word in commentRandy Dunlap1-4/+4
Delete the doubled words "the" in comments. Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: media-entity.h: drop duplicated word in commentRandy Dunlap1-1/+1
Delete the doubled word "flag" in a comment. Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-07-19media: dvbdev.h: fix duplicated word in commentRandy Dunlap1-1/+1
Change the doubled word "the" in a comment to "to the". Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>