media updates for v5.14-rc1

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+QmuaPwR3wnBdVwACF8+vY7k4RUFAmDZzHUACgkQCF8+vY7k
 4RWjmQ//QSMEAlz/Xv7YmnkheMEbEvMGgRzUK6UIzfbI9sb2ZPx/1dYySVExrPba
 Z1WtrH9oEZGX75IwRSBb6Kb0j2k3E1Y9UZzaAAofE4yyrw5sH8oNvhxhAdak+YRC
 XaVJq3xulIq/ClsEyaDzZPFfIhZ5Uo/Cz9s4bZMiA8IwZOImnttJmbrw+Og9ly0+
 TrvA0MMkO790h+OOnu5Lv1Q2qJZXaVoTIZ+/icDW29WbQdTQnEZ6XOz/Y+4BZFwW
 dA49MLdz7BlypV7a3ijIM4ENPrPmmRIf5agKkQ13Z84gNH14Vb8zShDFq2vHwdKC
 7qqvZLuCug/GyK7hyPQHOM8b7wN2utNMZCJIcWVob4oZDzHSvLO+wFI4RCI/RBdY
 3tOxrH5cd1FJXB5Vi4KtWNk2Ne63UyaJUYSDk9j30LSwNC/EA6+7fc9LeRY2ykNg
 rSD8aXMBoHWtxPxBH5O1ljVdbvG4f8Ds6Yb1cjrxvQWIXvzE7TIC2zhRl0o/r6My
 1BWOkVVHw0i5/U+PTyQnVK2XYprq0Jp0b9a0ErkJoOtRpd4VW0pFFcDzWN2tlR0h
 McIinHAXdeZO6qHbNMyArYcwfTgWP51IWKm5qDQxPtEnrZDQIjbG3GfZZz9wtks/
 Moz7vUTbSUaxSqY/Eg+meg1lilU/lyee9O6hhKCDsVQDxaZUKU8=
 =VQX8
 -----END PGP SIGNATURE-----

Merge tag 'media/v5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:

 - V4L2 core control API was split into separate files

 - New RC maps: tango and tc-90405

 - Hantro driver got support for G2/HEVC decoder

 - av7710 is moving to staging, together with some legacy APIs

 - several cleanups related to compat_ioctl32 code

 - Move the MPEG-2 stateless control type out of staging

 - Address several issues with RPM get logic on media drivers

 - Lots of cleanups, bug fixes and improvements.

* tag 'media/v5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (394 commits)
  media: s5p-mfc: Fix display delay control creation
  media: mtk-vpu: on suspend, read/write regs only if vpu is running
  media: video-mux: Skip dangling endpoints
  media: Fix Media Controller API config checks
  media: i2c: rdacm20: Re-work ov10635 reset
  media: i2c: rdacm20: Check return values
  media: i2c: rdacm20: Report camera module name
  media: i2c: rdacm20: Enable noise immunity
  media: i2c: rdacm20: Embed 'serializer' field
  media: i2c: rdacm21: Power up OV10640 before OV490
  media: i2c: rdacm21: Fix OV10640 powerup
  media: i2c: rdacm21: Add delay after OV490 reset
  media: i2c: max9271: Introduce wake_up() function
  media: i2c: max9271: Check max9271_write() return
  media: i2c: max9286: Rework comments in .bound()
  media: i2c: max9286: Define high channel amplitude
  media: i2c: max9286: Cache channel amplitude
  media: i2c: max9286: Rename reverse_channel_mv
  media: i2c: max9286: Adjust parameters indent
  media: hantro: add support for Rockchip RK3036
  ...
This commit is contained in:
Linus Torvalds 2021-06-28 15:49:58 -07:00
commit 31e798fd6f
556 changed files with 19192 additions and 14777 deletions

View File

@ -15,11 +15,12 @@ Authors:
General information General information
------------------- -------------------
This class of cards has a bt878a as the PCI interface, and require the bttv driver This class of cards has a bt878a as the PCI interface, and require the bttv
for accessing the i2c bus and the gpio pins of the bt8xx chipset. driver for accessing the i2c bus and the gpio pins of the bt8xx chipset.
Please see :doc:`bttv-cardlist` for a complete list of Cards based on the Please see Documentation/admin-guide/media/bttv-cardlist.rst for a complete
Conexant Bt8xx PCI bridge supported by the Linux Kernel. list of Cards based on the Conexant Bt8xx PCI bridge supported by the
Linux Kernel.
In order to be able to compile the kernel, some config options should be In order to be able to compile the kernel, some config options should be
enabled:: enabled::
@ -80,7 +81,7 @@ for dvb-bt8xx drivers by passing modprobe parameters may be necessary.
Running TwinHan and Clones Running TwinHan and Clones
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
As shown at :doc:`bttv-cardlist`, TwinHan and As shown at Documentation/admin-guide/media/bttv-cardlist.rst, TwinHan and
clones use ``card=113`` modprobe parameter. So, in order to properly clones use ``card=113`` modprobe parameter. So, in order to properly
detect it for devices without EEPROM, you should use:: detect it for devices without EEPROM, you should use::
@ -105,12 +106,12 @@ The autodetected values are determined by the cards' "response string".
In your logs see f. ex.: dst_get_device_id: Recognize [DSTMCI]. In your logs see f. ex.: dst_get_device_id: Recognize [DSTMCI].
For bug reports please send in a complete log with verbose=4 activated. For bug reports please send in a complete log with verbose=4 activated.
Please also see :doc:`ci`. Please also see Documentation/admin-guide/media/ci.rst.
Running multiple cards Running multiple cards
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
See :doc:`bttv-cardlist` for a complete list of See Documentation/admin-guide/media/bttv-cardlist.rst for a complete list of
Card ID. Some examples: Card ID. Some examples:
=========================== === =========================== ===

View File

@ -24,7 +24,8 @@ If your board has digital TV, you'll also need::
./scripts/config -m DVB_BT8XX ./scripts/config -m DVB_BT8XX
In this case, please see :doc:`bt8xx` for additional notes. In this case, please see Documentation/admin-guide/media/bt8xx.rst
for additional notes.
Make bttv work with your card Make bttv work with your card
----------------------------- -----------------------------
@ -39,7 +40,7 @@ If it doesn't bttv likely could not autodetect your card and needs some
insmod options. The most important insmod option for bttv is "card=n" insmod options. The most important insmod option for bttv is "card=n"
to select the correct card type. If you get video but no sound you've to select the correct card type. If you get video but no sound you've
very likely specified the wrong (or no) card type. A list of supported very likely specified the wrong (or no) card type. A list of supported
cards is in :doc:`bttv-cardlist`. cards is in Documentation/admin-guide/media/bttv-cardlist.rst.
If bttv takes very long to load (happens sometimes with the cheap If bttv takes very long to load (happens sometimes with the cheap
cards which have no tuner), try adding this to your modules configuration cards which have no tuner), try adding this to your modules configuration
@ -57,8 +58,8 @@ directory should be enough for it to be autoload during the driver's
probing mode (e. g. when the Kernel boots or when the driver is probing mode (e. g. when the Kernel boots or when the driver is
manually loaded via ``modprobe`` command). manually loaded via ``modprobe`` command).
If your card isn't listed in :doc:`bttv-cardlist` or if you have If your card isn't listed in Documentation/admin-guide/media/bttv-cardlist.rst
trouble making audio work, please read :ref:`still_doesnt_work`. or if you have trouble making audio work, please read :ref:`still_doesnt_work`.
Autodetecting cards Autodetecting cards
@ -77,8 +78,8 @@ the Subsystem ID in the second line, looks like this:
only bt878-based cards can have a subsystem ID (which does not mean only bt878-based cards can have a subsystem ID (which does not mean
that every card really has one). bt848 cards can't have a Subsystem that every card really has one). bt848 cards can't have a Subsystem
ID and therefore can't be autodetected. There is a list with the ID's ID and therefore can't be autodetected. There is a list with the ID's
at :doc:`bttv-cardlist` (in case you are interested or want to mail at Documentation/admin-guide/media/bttv-cardlist.rst
patches with updates). (in case you are interested or want to mail patches with updates).
.. _still_doesnt_work: .. _still_doesnt_work:
@ -259,15 +260,15 @@ bug. It is very helpful if you can tell where exactly it broke
With a hard freeze you probably doesn't find anything in the logfiles. With a hard freeze you probably doesn't find anything in the logfiles.
The only way to capture any kernel messages is to hook up a serial The only way to capture any kernel messages is to hook up a serial
console and let some terminal application log the messages. /me uses console and let some terminal application log the messages. /me uses
screen. See :doc:`/admin-guide/serial-console` for details on setting screen. See Documentation/admin-guide/serial-console.rst for details on
up a serial console. setting up a serial console.
Read :doc:`/admin-guide/bug-hunting` to learn how to get any useful Read Documentation/admin-guide/bug-hunting.rst to learn how to get any useful
information out of a register+stack dump printed by the kernel on information out of a register+stack dump printed by the kernel on
protection faults (so-called "kernel oops"). protection faults (so-called "kernel oops").
If you run into some kind of deadlock, you can try to dump a call trace If you run into some kind of deadlock, you can try to dump a call trace
for each process using sysrq-t (see :doc:`/admin-guide/sysrq`). for each process using sysrq-t (see Documentation/admin-guide/sysrq.rst).
This way it is possible to figure where *exactly* some process in "D" This way it is possible to figure where *exactly* some process in "D"
state is stuck. state is stuck.

View File

@ -11,12 +11,14 @@ its supported drivers.
Please see: Please see:
- :doc:`/userspace-api/media/index` Documentation/userspace-api/media/index.rst
for the userspace APIs used on media devices.
- :doc:`/driver-api/media/index` - for the userspace APIs used on media devices.
for driver development information and Kernel APIs used by
media devices; Documentation/driver-api/media/index.rst
- for driver development information and Kernel APIs used by
media devices;
The media subsystem The media subsystem
=================== ===================

View File

@ -234,22 +234,23 @@ The IPU3 ImgU pipelines can be configured using the Media Controller, defined at
Running mode and firmware binary selection Running mode and firmware binary selection
------------------------------------------ ------------------------------------------
ImgU works based on firmware, currently the ImgU firmware support run 2 pipes in ImgU works based on firmware, currently the ImgU firmware support run 2 pipes
time-sharing with single input frame data. Each pipe can run at certain mode - in time-sharing with single input frame data. Each pipe can run at certain mode
"VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture, and - "VIDEO" or "STILL", "VIDEO" mode is commonly used for video frames capture,
"STILL" is used for still frame capture. However, you can also select "VIDEO" to and "STILL" is used for still frame capture. However, you can also select
capture still frames if you want to capture images with less system load and "VIDEO" to capture still frames if you want to capture images with less system
power. For "STILL" mode, ImgU will try to use smaller BDS factor and output load and power. For "STILL" mode, ImgU will try to use smaller BDS factor and
larger bayer frame for further YUV processing than "VIDEO" mode to get high output larger bayer frame for further YUV processing than "VIDEO" mode to get
quality images. Besides, "STILL" mode need XNR3 to do noise reduction, hence high quality images. Besides, "STILL" mode need XNR3 to do noise reduction,
"STILL" mode will need more power and memory bandwidth than "VIDEO" mode. TNR hence "STILL" mode will need more power and memory bandwidth than "VIDEO" mode.
will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is running at TNR will be enabled in "VIDEO" mode and bypassed by "STILL" mode. ImgU is
“VIDEO” mode by default, the user can use v4l2 control V4L2_CID_INTEL_IPU3_MODE running at "VIDEO" mode by default, the user can use v4l2 control
(currently defined in drivers/staging/media/ipu3/include/intel-ipu3.h) to query V4L2_CID_INTEL_IPU3_MODE (currently defined in
and set the running mode. For user, there is no difference for buffer queueing drivers/staging/media/ipu3/include/uapi/intel-ipu3.h) to query and set the
between the "VIDEO" and "STILL" mode, mandatory input and main output node running mode. For user, there is no difference for buffer queueing between the
should be enabled and buffers need be queued, the statistics and the view-finder "VIDEO" and "STILL" mode, mandatory input and main output node should be
queues are optional. enabled and buffers need be queued, the statistics and the view-finder queues
are optional.
The firmware binary will be selected according to current running mode, such log The firmware binary will be selected according to current running mode, such log
"using binary if_to_osys_striped " or "using binary if_to_osys_primary_striped" "using binary if_to_osys_striped " or "using binary if_to_osys_primary_striped"
@ -586,7 +587,7 @@ preserved.
References References
========== ==========
.. [#f5] drivers/staging/media/ipu3/include/intel-ipu3.h .. [#f5] drivers/staging/media/ipu3/include/uapi/intel-ipu3.h
.. [#f1] https://github.com/intel/nvt .. [#f1] https://github.com/intel/nvt

View File

@ -50,7 +50,8 @@ To build and install, you should run::
Once the new Kernel is booted, saa7134 driver should be loaded automatically. Once the new Kernel is booted, saa7134 driver should be loaded automatically.
Depending on the card you might have to pass ``card=<nr>`` as insmod option. Depending on the card you might have to pass ``card=<nr>`` as insmod option.
If so, please check :doc:`saa7134-cardlist` for valid choices. If so, please check Documentation/admin-guide/media/saa7134-cardlist.rst
for valid choices.
Once you have your card type number, you can pass a modules configuration Once you have your card type number, you can pass a modules configuration
via a file (usually, it is either ``/etc/modules.conf`` or some file at via a file (usually, it is either ``/etc/modules.conf`` or some file at

View File

@ -0,0 +1,114 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2016-2021 Microchip Technology, Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/atmel,isc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Atmel Image Sensor Controller (ISC)
maintainers:
- Eugen Hristev <eugen.hristev@microchip.com>
description: |
The Image Sensor Controller (ISC) device provides the video input capabilities for the
Atmel/Microchip AT91 SAMA family of devices.
The ISC has a single parallel input that supports RAW Bayer, RGB or YUV video,
with both external synchronization and BT.656 synchronization for the latter.
properties:
compatible:
const: atmel,sama5d2-isc
reg:
maxItems: 1
interrupts:
maxItems: 1
clocks:
minItems: 3
maxItems: 3
clock-names:
items:
- const: hclock
- const: iscck
- const: gck
'#clock-cells':
const: 0
clock-output-names:
const: isc-mck
port:
$ref: /schemas/graph.yaml#/properties/port
description:
Input port node, single endpoint describing the input pad.
properties:
endpoint:
$ref: video-interfaces.yaml#
properties:
remote-endpoint: true
bus-width:
enum: [8, 9, 10, 11, 12]
default: 12
hsync-active:
enum: [0, 1]
default: 1
vsync-active:
enum: [0, 1]
default: 1
pclk-sample:
enum: [0, 1]
default: 1
required:
- remote-endpoint
additionalProperties: false
additionalProperties: false
required:
- compatible
- reg
- clocks
- clock-names
- '#clock-cells'
- clock-output-names
- port
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
isc: isc@f0008000 {
compatible = "atmel,sama5d2-isc";
reg = <0xf0008000 0x4000>;
interrupts = <46 IRQ_TYPE_LEVEL_HIGH 5>;
clocks = <&isc_clk>, <&iscck>, <&isc_gclk>;
clock-names = "hclock", "iscck", "gck";
#clock-cells = <0>;
clock-output-names = "isc-mck";
port {
isc_0: endpoint {
remote-endpoint = <&ov7740_0>;
hsync-active = <1>;
vsync-active = <0>;
pclk-sample = <1>;
bus-width = <8>;
};
};
};

View File

@ -1,65 +0,0 @@
Atmel Image Sensor Controller (ISC)
----------------------------------------------
Required properties for ISC:
- compatible
Must be "atmel,sama5d2-isc".
- reg
Physical base address and length of the registers set for the device.
- interrupts
Should contain IRQ line for the ISC.
- clocks
List of clock specifiers, corresponding to entries in
the clock-names property;
Please refer to clock-bindings.txt.
- clock-names
Required elements: "hclock", "iscck", "gck".
- #clock-cells
Should be 0.
- clock-output-names
Should be "isc-mck".
- pinctrl-names, pinctrl-0
Please refer to pinctrl-bindings.txt.
ISC supports a single port node with parallel bus. It should contain one
'port' child node with child 'endpoint' node. Please refer to the bindings
defined in Documentation/devicetree/bindings/media/video-interfaces.txt.
Example:
isc: isc@f0008000 {
compatible = "atmel,sama5d2-isc";
reg = <0xf0008000 0x4000>;
interrupts = <46 IRQ_TYPE_LEVEL_HIGH 5>;
clocks = <&isc_clk>, <&iscck>, <&isc_gclk>;
clock-names = "hclock", "iscck", "gck";
#clock-cells = <0>;
clock-output-names = "isc-mck";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>;
port {
isc_0: endpoint {
remote-endpoint = <&ov7740_0>;
hsync-active = <1>;
vsync-active = <0>;
pclk-sample = <1>;
};
};
};
i2c1: i2c@fc028000 {
ov7740: camera@21 {
compatible = "ovti,ov7740";
reg = <0x21>;
clocks = <&isc>;
clock-names = "xvclk";
assigned-clocks = <&isc>;
assigned-clock-rates = <24000000>;
port {
ov7740_0: endpoint {
remote-endpoint = <&isc_0>;
};
};
};
};

View File

@ -0,0 +1,67 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/i2c/rda,rda5807.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Unisoc Communications RDA5807 FM radio receiver
maintainers:
- Paul Cercueil <paul@crapouillou.net>
properties:
compatible:
enum:
- rda,rda5807
reg:
description: I2C address.
maxItems: 1
power-supply: true
rda,lnan:
description: Use LNAN input port.
type: boolean
rda,lnap:
description: Use LNAP input port.
type: boolean
rda,analog-out:
description: Enable analog audio output.
type: boolean
rda,i2s-out:
description: Enable I2S digital audio output.
type: boolean
rda,lna-microamp:
description: LNA working current, in micro-amperes.
default: 2500
enum: [1800, 2100, 2500, 3000]
required:
- compatible
- reg
- power-supply
additionalProperties: false
examples:
- |
i2c0 {
#address-cells = <1>;
#size-cells = <0>;
radio@11 {
compatible = "rda,rda5807";
reg = <0x11>;
power-supply = <&ldo6>;
rda,lnan;
rda,lnap;
rda,analog-out;
};
};

View File

@ -9,6 +9,7 @@ Required properties:
"mediatek,mt8173-vcodec-enc" for mt8173 avc encoder. "mediatek,mt8173-vcodec-enc" for mt8173 avc encoder.
"mediatek,mt8183-vcodec-enc" for MT8183 encoder. "mediatek,mt8183-vcodec-enc" for MT8183 encoder.
"mediatek,mt8173-vcodec-dec" for MT8173 decoder. "mediatek,mt8173-vcodec-dec" for MT8173 decoder.
"mediatek,mt8192-vcodec-enc" for MT8192 encoder.
- reg : Physical base address of the video codec registers and length of - reg : Physical base address of the video codec registers and length of
memory mapped region. memory mapped region.
- interrupts : interrupt number to the cpu. - interrupts : interrupt number to the cpu.
@ -22,6 +23,7 @@ Required properties:
- iommus : should point to the respective IOMMU block with master port as - iommus : should point to the respective IOMMU block with master port as
argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
for details. for details.
- dma-ranges : describes the dma address range space that the codec hw access.
One of the two following nodes: One of the two following nodes:
- mediatek,vpu : the node of the video processor unit, if using VPU. - mediatek,vpu : the node of the video processor unit, if using VPU.
- mediatek,scp : the node of the SCP unit, if using SCP. - mediatek,scp : the node of the SCP unit, if using SCP.

View File

@ -0,0 +1,47 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
maintainers:
- Emil Velikov <emil.velikov@collabora.com>
description:
Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
properties:
compatible:
const: microchip,sama5d4-vdec
reg:
maxItems: 1
interrupts:
maxItems: 1
clocks:
maxItems: 1
required:
- compatible
- reg
- interrupts
- clocks
additionalProperties: false
examples:
- |
#include <dt-bindings/clock/at91.h>
#include <dt-bindings/interrupt-controller/irq.h>
vdec0: vdec@300000 {
compatible = "microchip,sama5d4-vdec";
reg = <0x00300000 0x100000>;
interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
};

View File

@ -0,0 +1,129 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) 2021 Microchip Technology, Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/microchip,xisc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip eXtended Image Sensor Controller (XISC)
maintainers:
- Eugen Hristev <eugen.hristev@microchip.com>
description: |
The eXtended Image Sensor Controller (XISC) device provides the video input capabilities for the
Microchip AT91 SAM family of devices.
The XISC has a single internal parallel input that supports RAW Bayer, RGB or YUV video.
The source can be either a demuxer from a CSI2 type of bus, or a simple direct bridge to a
parallel sensor.
The XISC provides one clock output that is used to clock the demuxer/bridge.
properties:
compatible:
const: microchip,sama7g5-isc
reg:
maxItems: 1
interrupts:
maxItems: 1
clocks:
maxItems: 1
clock-names:
items:
- const: hclock
'#clock-cells':
const: 0
clock-output-names:
const: isc-mck
microchip,mipi-mode:
type: boolean
description:
As the XISC is usually connected to a demux/bridge, the XISC receives
the same type of input, however, it should be aware of the type of
signals received. The mipi-mode enables different internal handling
of the data and clock lines.
port:
$ref: /schemas/graph.yaml#/properties/port
description:
Input port node, single endpoint describing the input pad.
properties:
endpoint:
$ref: video-interfaces.yaml#
properties:
bus-type:
enum: [5, 6]
remote-endpoint: true
bus-width:
enum: [8, 9, 10, 11, 12]
default: 12
hsync-active:
enum: [0, 1]
default: 1
vsync-active:
enum: [0, 1]
default: 1
pclk-sample:
enum: [0, 1]
default: 1
required:
- remote-endpoint
- bus-type
additionalProperties: false
additionalProperties: false
required:
- compatible
- reg
- clocks
- clock-names
- '#clock-cells'
- clock-output-names
- port
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/at91.h>
#include <dt-bindings/interrupt-controller/irq.h>
xisc: xisc@e1408000 {
compatible = "microchip,sama7g5-isc";
reg = <0xe1408000 0x2000>;
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 56>;
clock-names = "hclock";
#clock-cells = <0>;
clock-output-names = "isc-mck";
port {
xisc_in: endpoint {
bus-type = <5>; /* Parallel */
remote-endpoint = <&csi2dc_out>;
hsync-active = <1>;
vsync-active = <1>;
bus-width = <12>;
};
};
};

View File

@ -4,15 +4,17 @@
$id: http://devicetree.org/schemas/media/nxp,imx7-mipi-csi2.yaml# $id: http://devicetree.org/schemas/media/nxp,imx7-mipi-csi2.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml#
title: NXP i.MX7 MIPI CSI-2 receiver title: NXP i.MX7 and i.MX8 MIPI CSI-2 receiver
maintainers: maintainers:
- Rui Miguel Silva <rmfrfs@gmail.com> - Rui Miguel Silva <rmfrfs@gmail.com>
- Laurent Pinchart <laurent.pinchart@ideasonboard.com>
description: |- description: |-
The NXP i.MX7 SoC family includes a MIPI CSI-2 receiver IP core, documented The NXP i.MX7 and i.MX8 families contain SoCs that include a MIPI CSI-2
as "CSIS V3.3". The IP core seems to originate from Samsung, and may be receiver IP core named CSIS. The IP core originates from Samsung, and may be
compatible with some of the Exynos4 ad S5P SoCs. compatible with some of the Exynos4 and S5P SoCs. i.MX7 SoCs use CSIS version
3.3, and i.MX8 SoCs use CSIS version 3.6.3.
While the CSI-2 receiver is separate from the MIPI D-PHY IP core, the PHY is While the CSI-2 receiver is separate from the MIPI D-PHY IP core, the PHY is
completely wrapped by the CSIS and doesn't expose a control interface of its completely wrapped by the CSIS and doesn't expose a control interface of its
@ -20,7 +22,9 @@ description: |-
properties: properties:
compatible: compatible:
const: fsl,imx7-mipi-csi2 enum:
- fsl,imx7-mipi-csi2
- fsl,imx8mm-mipi-csi2
reg: reg:
maxItems: 1 maxItems: 1
@ -29,16 +33,20 @@ properties:
maxItems: 1 maxItems: 1
clocks: clocks:
minItems: 3
items: items:
- description: The peripheral clock (a.k.a. APB clock) - description: The peripheral clock (a.k.a. APB clock)
- description: The external clock (optionally used as the pixel clock) - description: The external clock (optionally used as the pixel clock)
- description: The MIPI D-PHY clock - description: The MIPI D-PHY clock
- description: The AXI clock
clock-names: clock-names:
minItems: 3
items: items:
- const: pclk - const: pclk
- const: wrap - const: wrap
- const: phy - const: phy
- const: axi
power-domains: power-domains:
maxItems: 1 maxItems: 1
@ -71,16 +79,30 @@ properties:
properties: properties:
data-lanes: data-lanes:
oneOf: items:
- items: minItems: 1
- const: 1 maxItems: 4
- items: items:
- const: 1 - const: 1
- const: 2 - const: 2
- const: 3
- const: 4
required: required:
- data-lanes - data-lanes
allOf:
- if:
properties:
compatible:
contains:
const: fsl,imx7-mipi-csi2
then:
properties:
data-lanes:
items:
maxItems: 2
port@1: port@1:
$ref: /schemas/graph.yaml#/properties/port $ref: /schemas/graph.yaml#/properties/port
description: description:
@ -93,12 +115,29 @@ required:
- clocks - clocks
- clock-names - clock-names
- power-domains - power-domains
- phy-supply
- resets
- ports - ports
additionalProperties: false additionalProperties: false
allOf:
- if:
properties:
compatible:
contains:
const: fsl,imx7-mipi-csi2
then:
required:
- phy-supply
- resets
else:
properties:
clocks:
minItems: 4
clock-names:
minItems: 4
phy-supply: false
resets: false
examples: examples:
- | - |
#include <dt-bindings/clock/imx7d-clock.h> #include <dt-bindings/clock/imx7d-clock.h>
@ -106,7 +145,7 @@ examples:
#include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/reset/imx7-reset.h> #include <dt-bindings/reset/imx7-reset.h>
mipi_csi: mipi-csi@30750000 { mipi-csi@30750000 {
compatible = "fsl,imx7-mipi-csi2"; compatible = "fsl,imx7-mipi-csi2";
reg = <0x30750000 0x10000>; reg = <0x30750000 0x10000>;
interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
@ -144,4 +183,46 @@ examples:
}; };
}; };
- |
#include <dt-bindings/clock/imx8mm-clock.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
mipi-csi@32e30000 {
compatible = "fsl,imx8mm-mipi-csi2";
reg = <0x32e30000 0x1000>;
interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <333000000>;
clocks = <&clk IMX8MM_CLK_DISP_APB_ROOT>,
<&clk IMX8MM_CLK_CSI1_ROOT>,
<&clk IMX8MM_CLK_CSI1_PHY_REF>,
<&clk IMX8MM_CLK_DISP_AXI_ROOT>;
clock-names = "pclk", "wrap", "phy", "axi";
power-domains = <&mipi_pd>;
status = "disabled";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
imx8mm_mipi_csi_in: endpoint {
remote-endpoint = <&imx477_out>;
data-lanes = <1 2 3 4>;
};
};
port@1 {
reg = <1>;
imx8mm_mipi_csi_out: endpoint {
remote-endpoint = <&csi_in>;
};
};
};
};
... ...

View File

@ -45,6 +45,7 @@ properties:
- rc-cec - rc-cec
- rc-cinergy - rc-cinergy
- rc-cinergy-1400 - rc-cinergy-1400
- rc-ct-90405
- rc-d680-dmb - rc-d680-dmb
- rc-delock-61959 - rc-delock-61959
- rc-dib0700-nec - rc-dib0700-nec
@ -125,7 +126,6 @@ properties:
- rc-snapstream-firefly - rc-snapstream-firefly
- rc-streamzap - rc-streamzap
- rc-su3000 - rc-su3000
- rc-tango
- rc-tanix-tx3mini - rc-tanix-tx3mini
- rc-tanix-tx5max - rc-tanix-tx5max
- rc-tbs-nec - rc-tbs-nec

View File

@ -25,6 +25,7 @@ properties:
- renesas,r8a774e1-csi2 # RZ/G2H - renesas,r8a774e1-csi2 # RZ/G2H
- renesas,r8a7795-csi2 # R-Car H3 - renesas,r8a7795-csi2 # R-Car H3
- renesas,r8a7796-csi2 # R-Car M3-W - renesas,r8a7796-csi2 # R-Car M3-W
- renesas,r8a77961-csi2 # R-Car M3-W+
- renesas,r8a77965-csi2 # R-Car M3-N - renesas,r8a77965-csi2 # R-Car M3-N
- renesas,r8a77970-csi2 # R-Car V3M - renesas,r8a77970-csi2 # R-Car V3M
- renesas,r8a77980-csi2 # R-Car V3H - renesas,r8a77980-csi2 # R-Car V3H

View File

@ -0,0 +1,196 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
# Copyright (C) 2021 Renesas Electronics Corp.
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/renesas,isp.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Renesas R-Car ISP Channel Selector
maintainers:
- Niklas Söderlund <niklas.soderlund@ragnatech.se>
description:
The R-Car ISP Channel Selector provides MIPI CSI-2 VC and DT filtering
capabilities for the Renesas R-Car family of devices. It is used in
conjunction with the R-Car VIN and CSI-2 modules, which provides the video
capture capabilities.
properties:
compatible:
items:
- enum:
- renesas,r8a779a0-isp # V3U
reg:
maxItems: 1
interrupts:
maxItems: 1
clocks:
maxItems: 1
power-domains:
maxItems: 1
resets:
maxItems: 1
ports:
$ref: /schemas/graph.yaml#/properties/ports
properties:
port@0:
$ref: /schemas/graph.yaml#/properties/port
description:
Input port node, multiple endpoints describing the connected R-Car
CSI-2 receivers.
port@1:
$ref: /schemas/graph.yaml#/properties/port
description:
Single endpoint describing the R-Car VIN connected to output port 0.
port@2:
$ref: /schemas/graph.yaml#/properties/port
description:
Single endpoint describing the R-Car VIN connected to output port 1.
port@3:
$ref: /schemas/graph.yaml#/properties/port
description:
Single endpoint describing the R-Car VIN connected to output port 2.
port@4:
$ref: /schemas/graph.yaml#/properties/port
description:
Single endpoint describing the R-Car VIN connected to output port 3.
port@5:
$ref: /schemas/graph.yaml#/properties/port
description:
Single endpoint describing the R-Car VIN connected to output port 4.
port@6:
$ref: /schemas/graph.yaml#/properties/port
description:
Single endpoint describing the R-Car VIN connected to output port 5.
port@7:
$ref: /schemas/graph.yaml#/properties/port
description:
Single endpoint describing the R-Car VIN connected to output port 6.
port@8:
$ref: /schemas/graph.yaml#/properties/port
description:
Single endpoint describing the R-Car VIN connected to output port 7.
required:
- port@0
- port@1
- port@2
- port@3
- port@4
- port@5
- port@6
- port@7
- port@8
required:
- compatible
- reg
- interrupts
- clocks
- power-domains
- resets
- ports
additionalProperties: false
examples:
- |
#include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/r8a779a0-sysc.h>
isp1: isp@fed20000 {
compatible = "renesas,r8a779a0-isp";
reg = <0xfed20000 0x10000>;
interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 613>;
power-domains = <&sysc R8A779A0_PD_A3ISP01>;
resets = <&cpg 613>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
isp1csi41: endpoint@1 {
reg = <1>;
remote-endpoint = <&csi41isp1>;
};
};
port@1 {
reg = <1>;
isp1vin08: endpoint {
remote-endpoint = <&vin08isp1>;
};
};
port@2 {
reg = <2>;
isp1vin09: endpoint {
remote-endpoint = <&vin09isp1>;
};
};
port@3 {
reg = <3>;
isp1vin10: endpoint {
remote-endpoint = <&vin10isp1>;
};
};
port@4 {
reg = <4>;
isp1vin11: endpoint {
remote-endpoint = <&vin11isp1>;
};
};
port@5 {
reg = <5>;
isp1vin12: endpoint {
remote-endpoint = <&vin12isp1>;
};
};
port@6 {
reg = <6>;
isp1vin13: endpoint {
remote-endpoint = <&vin13isp1>;
};
};
port@7 {
reg = <7>;
isp1vin14: endpoint {
remote-endpoint = <&vin14isp1>;
};
};
port@8 {
reg = <8>;
isp1vin15: endpoint {
remote-endpoint = <&vin15isp1>;
};
};
};
};

View File

@ -46,11 +46,13 @@ properties:
- renesas,vin-r8a7779 # R-Car H1 - renesas,vin-r8a7779 # R-Car H1
- renesas,vin-r8a7795 # R-Car H3 - renesas,vin-r8a7795 # R-Car H3
- renesas,vin-r8a7796 # R-Car M3-W - renesas,vin-r8a7796 # R-Car M3-W
- renesas,vin-r8a77961 # R-Car M3-W+
- renesas,vin-r8a77965 # R-Car M3-N - renesas,vin-r8a77965 # R-Car M3-N
- renesas,vin-r8a77970 # R-Car V3M - renesas,vin-r8a77970 # R-Car V3M
- renesas,vin-r8a77980 # R-Car V3H - renesas,vin-r8a77980 # R-Car V3H
- renesas,vin-r8a77990 # R-Car E3 - renesas,vin-r8a77990 # R-Car E3
- renesas,vin-r8a77995 # R-Car D3 - renesas,vin-r8a77995 # R-Car D3
- renesas,vin-r8a779a0 # R-Car V3U
reg: reg:
maxItems: 1 maxItems: 1
@ -111,7 +113,7 @@ properties:
description: VIN channel number description: VIN channel number
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 15 maximum: 31
ports: ports:
$ref: /schemas/graph.yaml#/properties/ports $ref: /schemas/graph.yaml#/properties/ports
@ -187,6 +189,29 @@ properties:
- required: - required:
- endpoint@3 - endpoint@3
port@2:
$ref: /schemas/graph.yaml#/properties/port
description:
Input port node, multiple endpoints describing all the R-Car ISP
modules connected the VIN.
properties:
endpoint@0:
$ref: /schemas/graph.yaml#/properties/endpoint
description: Endpoint connected to ISP0.
endpoint@1:
$ref: /schemas/graph.yaml#/properties/endpoint
description: Endpoint connected to ISP1.
endpoint@2:
$ref: /schemas/graph.yaml#/properties/endpoint
description: Endpoint connected to ISP2.
endpoint@3:
$ref: /schemas/graph.yaml#/properties/endpoint
description: Endpoint connected to ISP3.
required: required:
- compatible - compatible
- reg - reg

View File

@ -15,7 +15,11 @@ description: |-
properties: properties:
compatible: compatible:
const: rockchip,rk3399-vdec oneOf:
- const: rockchip,rk3399-vdec
- items:
- const: rockchip,rk3228-vdec
- const: rockchip,rk3399-vdec
reg: reg:
maxItems: 1 maxItems: 1
@ -37,6 +41,10 @@ properties:
- const: cabac - const: cabac
- const: core - const: core
assigned-clocks: true
assigned-clock-rates: true
power-domains: power-domains:
maxItems: 1 maxItems: 1

View File

@ -15,10 +15,19 @@ description:
properties: properties:
compatible: compatible:
enum: oneOf:
- rockchip,rk3288-vpu - enum:
- rockchip,rk3328-vpu - rockchip,rk3036-vpu
- rockchip,rk3399-vpu - rockchip,rk3066-vpu
- rockchip,rk3288-vpu
- rockchip,rk3328-vpu
- rockchip,rk3399-vpu
- items:
- const: rockchip,rk3188-vpu
- const: rockchip,rk3066-vpu
- items:
- const: rockchip,rk3228-vpu
- const: rockchip,rk3399-vpu
reg: reg:
maxItems: 1 maxItems: 1
@ -35,12 +44,20 @@ properties:
- const: vdpu - const: vdpu
clocks: clocks:
maxItems: 2 oneOf:
- maxItems: 2
- maxItems: 4
clock-names: clock-names:
items: oneOf:
- const: aclk - items:
- const: hclk - const: aclk
- const: hclk
- items:
- const: aclk_vdpu
- const: hclk_vdpu
- const: aclk_vepu
- const: hclk_vepu
power-domains: power-domains:
maxItems: 1 maxItems: 1

View File

@ -1,21 +0,0 @@
Sigma Designs Tango IR NEC/RC-5/RC-6 decoder (SMP86xx and SMP87xx)
Required properties:
- compatible: "sigma,smp8642-ir"
- reg: address/size of NEC+RC5 area, address/size of RC6 area
- interrupts: spec for IR IRQ
- clocks: spec for IR clock (typically the crystal oscillator)
Optional properties:
- linux,rc-map-name: see Documentation/devicetree/bindings/media/rc.txt
Example:
ir@10518 {
compatible = "sigma,smp8642-ir";
reg = <0x10518 0x18>, <0x105e0 0x1c>;
interrupts = <21 IRQ_TYPE_EDGE_RISING>;
clocks = <&xtal>;
};

View File

@ -21,7 +21,7 @@ log, telling which card type is used. Like this one::
You should verify this is correct. If it isn't, you have to pass the You should verify this is correct. If it isn't, you have to pass the
correct board type as insmod argument, ``insmod bttv card=2`` for correct board type as insmod argument, ``insmod bttv card=2`` for
example. The file :doc:`/admin-guide/media/bttv-cardlist` has a list example. The file Documentation/admin-guide/media/bttv-cardlist.rst has a list
of valid arguments for card. of valid arguments for card.
If your card isn't listed there, you might check the source code for If your card isn't listed there, you might check the source code for

View File

@ -210,7 +210,7 @@ pll_multiplier 0x0306 16
op_pix_clk_div 0x0308 16 op_pix_clk_div 0x0308 16
op_sys_clk_div 0x030a 16 op_sys_clk_div 0x030a 16
op_pre_pll_clk_div 0x030c 16 op_pre_pll_clk_div 0x030c 16
op_pll_multiplier 0x031e 16 op_pll_multiplier 0x030e 16
pll_mode 0x0310 8 pll_mode 0x0310 8
- f 0 0 - f 0 0
- e single 0 - e single 0

View File

@ -72,13 +72,14 @@ $uc_header =~ s/[^A-Z0-9]/_/g;
my $copyright = "/* Copyright (C) 2019--2020 Intel Corporation */\n"; my $copyright = "/* Copyright (C) 2019--2020 Intel Corporation */\n";
my $license = "SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause"; my $license = "SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause";
my $note = "/*\n * Generated by $0;\n * do not modify.\n */\n";
for my $fh ($A, $LC) { for my $fh ($A, $LC) {
print $fh "// $license\n$copyright\n" if defined $fh; print $fh "// $license\n$copyright$note\n" if defined $fh;
} }
for my $fh ($H, $LH) { for my $fh ($H, $LH) {
print $fh "/* $license */\n$copyright\n"; print $fh "/* $license */\n$copyright$note\n";
} }
sub bit_def($) { sub bit_def($) {

View File

@ -319,7 +319,7 @@ Conexant bt866 TV encoder
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
- is used in AVS6EYES, and - is used in AVS6EYES, and
- can generate: NTSC/PAL, PAL­M, PAL­N - can generate: NTSC/PAL, PAL-M, PAL-N
The adv717x, should be able to produce PAL N. But you find nothing PAL N The adv717x, should be able to produce PAL N. But you find nothing PAL N
specific in the registers. Seem that you have to reuse a other standard specific in the registers. Seem that you have to reuse a other standard

View File

@ -11,11 +11,13 @@ its supported drivers.
Please see: Please see:
- :doc:`/admin-guide/media/index` Documentation/admin-guide/media/index.rst
for usage information about media subsystem and supported drivers;
- :doc:`/userspace-api/media/index` - for usage information about media subsystem and supported drivers;
for the userspace APIs used on media devices.
Documentation/userspace-api/media/index.rst
- for the userspace APIs used on media devices.
.. only:: html .. only:: html

View File

@ -7,8 +7,8 @@ PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
UAPI = $(srctree)/include/uapi/linux UAPI = $(srctree)/include/uapi/linux
KAPI = $(srctree)/include/linux KAPI = $(srctree)/include/linux
FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \ FILES = ca.h.rst dmx.h.rst frontend.h.rst net.h.rst \
videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
TARGETS := $(addprefix $(BUILDDIR)/, $(FILES)) TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
@ -21,9 +21,6 @@ quiet_gen_rst = echo ' PARSE $(patsubst $(srctree)/%,%,$<)'; \
silent_gen_rst = ${gen_rst} silent_gen_rst = ${gen_rst}
$(BUILDDIR)/audio.h.rst: ${UAPI}/dvb/audio.h ${PARSER} $(SRC_DIR)/audio.h.rst.exceptions
@$($(quiet)gen_rst)
$(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions $(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions
@$($(quiet)gen_rst) @$($(quiet)gen_rst)
@ -36,9 +33,6 @@ $(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend
$(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions $(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions
@$($(quiet)gen_rst) @$($(quiet)gen_rst)
$(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} $(SRC_DIR)/video.h.rst.exceptions
@$($(quiet)gen_rst)
$(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions $(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions
@$($(quiet)gen_rst) @$($(quiet)gen_rst)

View File

@ -1,19 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Ignore header name
ignore define _DVBAUDIO_H_
# Undocumented audio caps, as this is a deprecated API anyway
ignore define AUDIO_CAP_DTS
ignore define AUDIO_CAP_LPCM
ignore define AUDIO_CAP_MP1
ignore define AUDIO_CAP_MP2
ignore define AUDIO_CAP_MP3
ignore define AUDIO_CAP_AAC
ignore define AUDIO_CAP_OGG
ignore define AUDIO_CAP_SDDS
ignore define AUDIO_CAP_AC3
# some typedefs should point to struct/enums
replace typedef audio_mixer_t :c:type:`audio_mixer`
replace typedef audio_status_t :c:type:`audio_status`

View File

@ -0,0 +1,19 @@
.. SPDX-License-Identifier: GPL-2.0
Hantro video decoder driver
===========================
The Hantro video decoder driver implements the following driver-specific controls:
``V4L2_CID_HANTRO_HEVC_SLICE_HEADER_SKIP (integer)``
Specifies to Hantro HEVC video decoder driver the number of data (in bits) to
skip in the slice segment header.
If non-IDR, the bits to be skipped go from syntax element "pic_output_flag"
to before syntax element "slice_temporal_mvp_enabled_flag".
If IDR, the skipped bits are just "pic_output_flag"
(separate_colour_plane_flag is not supported).
.. note::
This control is not yet part of the public kernel API and
it is expected to change.

View File

@ -33,6 +33,7 @@ For more details see the file COPYING in the source distribution of Linux.
ccs ccs
cx2341x-uapi cx2341x-uapi
hantro
imx-uapi imx-uapi
max2175 max2175
meye-uapi meye-uapi

View File

@ -82,7 +82,7 @@ appropriately.
:widths: 1 16 :widths: 1 16
- - ``EMFILE`` - - ``EMFILE``
- “Too many open files”, i.e. no more filters available. - "Too many open files", i.e. no more filters available.
The generic error codes are described at the The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter. :ref:`Generic Error Codes <gen-errors>` chapter.

View File

@ -34,7 +34,7 @@ Description
This system call returns filtered data, which might be section or Packetized This system call returns filtered data, which might be section or Packetized
Elementary Stream (PES) data. The filtered data is transferred from Elementary Stream (PES) data. The filtered data is transferred from
the drivers internal circular buffer to ``buf``. The maximum amount of data the driver's internal circular buffer to ``buf``. The maximum amount of data
to be transferred is implied by count. to be transferred is implied by count.
.. note:: .. note::

View File

@ -37,7 +37,7 @@ parameters provided. A timeout may be defined stating number of seconds
to wait for a section to be loaded. A value of 0 means that no timeout to wait for a section to be loaded. A value of 0 means that no timeout
should be applied. Finally there is a flag field where it is possible to should be applied. Finally there is a flag field where it is possible to
state whether a section should be CRC-checked, whether the filter should state whether a section should be CRC-checked, whether the filter should
be a ”one-shot” filter, i.e. if the filtering operation should be be a "one-shot" filter, i.e. if the filtering operation should be
stopped after the first section is received, and whether the filtering stopped after the first section is received, and whether the filtering
operation should be started immediately (without waiting for a operation should be started immediately (without waiting for a
:ref:`DMX_START` ioctl call). If a filter was previously set-up, this :ref:`DMX_START` ioctl call). If a filter was previously set-up, this

View File

@ -14,10 +14,3 @@ Digital TV uAPI headers
.. kernel-include:: $BUILDDIR/ca.h.rst .. kernel-include:: $BUILDDIR/ca.h.rst
.. kernel-include:: $BUILDDIR/net.h.rst .. kernel-include:: $BUILDDIR/net.h.rst
Legacy uAPI
***********
.. kernel-include:: $BUILDDIR/audio.h.rst
.. kernel-include:: $BUILDDIR/video.h.rst

View File

@ -107,7 +107,7 @@ Audio and video decoder
a Systems on a Chip (SoC) integrated circuit. a Systems on a Chip (SoC) integrated circuit.
It may also not be needed for certain usages (e.g. for data-only It may also not be needed for certain usages (e.g. for data-only
uses like “internet over satellite”). uses like "internet over satellite").
:ref:`stb_components` shows a crude schematic of the control and data :ref:`stb_components` shows a crude schematic of the control and data
flow between those components. flow between those components.
@ -148,9 +148,9 @@ individual devices are called:
- ``/dev/dvb/adapterN/caM``, - ``/dev/dvb/adapterN/caM``,
where ``N`` enumerates the Digital TV cards in a system starting from 0, and where ``N`` enumerates the Digital TV cards in a system starting from 0, and
``M`` enumerates the devices of each type within each adapter, starting ``M`` enumerates the devices of each type within each adapter, starting
from 0, too. We will omit the “``/dev/dvb/adapterN/``\ ” in the further from 0, too. We will omit the "``/dev/dvb/adapterN/``\ " in the further
discussion of these devices. discussion of these devices.
More details about the data structures and function calls of all the More details about the data structures and function calls of all the

View File

@ -11,11 +11,6 @@ The APIs described here **should not** be used on new drivers or applications.
The DVBv3 frontend API has issues with new delivery systems, including The DVBv3 frontend API has issues with new delivery systems, including
DVB-S2, DVB-T2, ISDB, etc. DVB-S2, DVB-T2, ISDB, etc.
There's just one driver for a very legacy hardware using the Digital TV
audio and video APIs. No modern drivers should use it. Instead, audio and
video should be using the V4L2 and ALSA APIs, and the pipelines should
be set via the Media Controller API.
.. attention:: .. attention::
The APIs described here doesn't necessarily reflect the current The APIs described here doesn't necessarily reflect the current
@ -28,5 +23,3 @@ be set via the Media Controller API.
:maxdepth: 1 :maxdepth: 1
frontend_legacy_dvbv3_api frontend_legacy_dvbv3_api
video
audio

View File

@ -13,14 +13,14 @@ GNU Free Documentation License
=========== ===========
The purpose of this License is to make a manual, textbook, or other The purpose of this License is to make a manual, textbook, or other
written document “free” in the sense of freedom: to assure everyone the written document "free" in the sense of freedom: to assure everyone the
effective freedom to copy and redistribute it, with or without modifying effective freedom to copy and redistribute it, with or without modifying
it, either commercially or noncommercially. Secondarily, this License it, either commercially or noncommercially. Secondarily, this License
preserves for the author and publisher a way to get credit for their preserves for the author and publisher a way to get credit for their
work, while not being considered responsible for modifications made by work, while not being considered responsible for modifications made by
others. others.
This License is a kind of “copyleft”, which means that derivative works This License is a kind of "copyleft", which means that derivative works
of the document must themselves be free in the same sense. It of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft license complements the GNU General Public License, which is a copyleft license
designed for free software. designed for free software.
@ -44,21 +44,21 @@ works whose purpose is instruction or reference.
This License applies to any manual or other work that contains a notice This License applies to any manual or other work that contains a notice
placed by the copyright holder saying it can be distributed under the placed by the copyright holder saying it can be distributed under the
terms of this License. The “Document”, below, refers to any such manual terms of this License. The "Document", below, refers to any such manual
or work. Any member of the public is a licensee, and is addressed as or work. Any member of the public is a licensee, and is addressed as
“you”. "you".
.. _fdl-modified: .. _fdl-modified:
A “Modified Version” of the Document means any work containing the A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language. modifications and/or translated into another language.
.. _fdl-secondary: .. _fdl-secondary:
A “Secondary Section” is a named appendix or a front-matter section of A "Secondary Section" is a named appendix or a front-matter section of
the :ref:`Document <fdl-document>` that deals exclusively with the the :ref:`Document <fdl-document>` that deals exclusively with the
relationship of the publishers or authors of the Document to the relationship of the publishers or authors of the Document to the
Document's overall subject (or to related matters) and contains nothing Document's overall subject (or to related matters) and contains nothing
@ -72,7 +72,7 @@ regarding them.
.. _fdl-invariant: .. _fdl-invariant:
The “Invariant Sections” are certain The "Invariant Sections" are certain
:ref:`Secondary Sections <fdl-secondary>` whose titles are designated, :ref:`Secondary Sections <fdl-secondary>` whose titles are designated,
as being those of Invariant Sections, in the notice that says that the as being those of Invariant Sections, in the notice that says that the
:ref:`Document <fdl-document>` is released under this License. :ref:`Document <fdl-document>` is released under this License.
@ -80,14 +80,14 @@ as being those of Invariant Sections, in the notice that says that the
.. _fdl-cover-texts: .. _fdl-cover-texts:
The “Cover Texts” are certain short passages of text that are listed, as The "Cover Texts" are certain short passages of text that are listed, as
Front-Cover Texts or Back-Cover Texts, in the notice that says that the Front-Cover Texts or Back-Cover Texts, in the notice that says that the
:ref:`Document <fdl-document>` is released under this License. :ref:`Document <fdl-document>` is released under this License.
.. _fdl-transparent: .. _fdl-transparent:
A “Transparent” copy of the :ref:`Document <fdl-document>` means a A "Transparent" copy of the :ref:`Document <fdl-document>` means a
machine-readable copy, represented in a format whose specification is machine-readable copy, represented in a format whose specification is
available to the general public, whose contents can be viewed and edited available to the general public, whose contents can be viewed and edited
directly and straightforwardly with generic text editors or (for images directly and straightforwardly with generic text editors or (for images
@ -97,7 +97,7 @@ formatters or for automatic translation to a variety of formats suitable
for input to text formatters. A copy made in an otherwise Transparent for input to text formatters. A copy made in an otherwise Transparent
file format whose markup has been designed to thwart or discourage file format whose markup has been designed to thwart or discourage
subsequent modification by readers is not Transparent. A copy that is subsequent modification by readers is not Transparent. A copy that is
not “Transparent” is called “Opaque”. not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ASCII Examples of suitable formats for Transparent copies include plain ASCII
without markup, Texinfo input format, LaTeX input format, SGML or XML without markup, Texinfo input format, LaTeX input format, SGML or XML
@ -111,10 +111,10 @@ word processors for output purposes only.
.. _fdl-title-page: .. _fdl-title-page:
The “Title Page” means, for a printed book, the title page itself, plus The "Title Page" means, for a printed book, the title page itself, plus
such following pages as are needed to hold, legibly, the material this such following pages as are needed to hold, legibly, the material this
License requires to appear in the title page. For works in formats which License requires to appear in the title page. For works in formats which
do not have any title page as such, “Title Page” means the text near the do not have any title page as such, "Title Page" means the text near the
most prominent appearance of the work's title, preceding the beginning most prominent appearance of the work's title, preceding the beginning
of the body of the text. of the body of the text.
@ -242,11 +242,11 @@ Modified Version:
Include an unaltered copy of this License. Include an unaltered copy of this License.
- **I.** - **I.**
Preserve the section entitled “History”, and its title, and add to it Preserve the section entitled "History", and its title, and add to it
an item stating at least the title, year, new authors, and publisher an item stating at least the title, year, new authors, and publisher
of the :ref:`Modified Version <fdl-modified>` as given on the of the :ref:`Modified Version <fdl-modified>` as given on the
:ref:`Title Page <fdl-title-page>`. If there is no section entitled :ref:`Title Page <fdl-title-page>`. If there is no section entitled
“History” in the :ref:`Document <fdl-document>`, create one stating "History" in the :ref:`Document <fdl-document>`, create one stating
the title, year, authors, and publisher of the Document as given on the title, year, authors, and publisher of the Document as given on
its Title Page, then add an item describing the Modified Version as its Title Page, then add an item describing the Modified Version as
stated in the previous sentence. stated in the previous sentence.
@ -256,13 +256,13 @@ Modified Version:
:ref:`Document <fdl-document>` for public access to a :ref:`Document <fdl-document>` for public access to a
:ref:`Transparent <fdl-transparent>` copy of the Document, and :ref:`Transparent <fdl-transparent>` copy of the Document, and
likewise the network locations given in the Document for previous likewise the network locations given in the Document for previous
versions it was based on. These may be placed in the “History” versions it was based on. These may be placed in the "History"
section. You may omit a network location for a work that was section. You may omit a network location for a work that was
published at least four years before the Document itself, or if the published at least four years before the Document itself, or if the
original publisher of the version it refers to gives permission. original publisher of the version it refers to gives permission.
- **K.** - **K.**
In any section entitled “Acknowledgements” or “Dedications”, preserve In any section entitled "Acknowledgements" or "Dedications", preserve
the section's title, and preserve in the section all the substance the section's title, and preserve in the section all the substance
and tone of each of the contributor acknowledgements and/or and tone of each of the contributor acknowledgements and/or
dedications given therein. dedications given therein.
@ -274,11 +274,11 @@ Modified Version:
part of the section titles. part of the section titles.
- **M.** - **M.**
Delete any section entitled “Endorsements”. Such a section may not be Delete any section entitled "Endorsements". Such a section may not be
included in the :ref:`Modified Version <fdl-modified>`. included in the :ref:`Modified Version <fdl-modified>`.
- **N.** - **N.**
Do not retitle any existing section as “Endorsements” or to conflict Do not retitle any existing section as "Endorsements" or to conflict
in title with any :ref:`Invariant Section <fdl-invariant>`. in title with any :ref:`Invariant Section <fdl-invariant>`.
If the :ref:`Modified Version <fdl-modified>` includes new If the :ref:`Modified Version <fdl-modified>` includes new
@ -290,7 +290,7 @@ of :ref:`Invariant Sections <fdl-invariant>` in the Modified Version's
license notice. These titles must be distinct from any other section license notice. These titles must be distinct from any other section
titles. titles.
You may add a section entitled “Endorsements”, provided it contains You may add a section entitled "Endorsements", provided it contains
nothing but endorsements of your nothing but endorsements of your
:ref:`Modified Version <fdl-modified>` by various parties--for :ref:`Modified Version <fdl-modified>` by various parties--for
example, statements of peer review or that the text has been approved by example, statements of peer review or that the text has been approved by
@ -337,11 +337,11 @@ the original author or publisher of that section if known, or else a
unique number. Make the same adjustment to the section titles in the unique number. Make the same adjustment to the section titles in the
list of Invariant Sections in the license notice of the combined work. list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections entitled “History” in In the combination, you must combine any sections entitled "History" in
the various original documents, forming one section entitled “History”; the various original documents, forming one section entitled "History";
likewise combine any sections entitled “Acknowledgements”, and any likewise combine any sections entitled "Acknowledgements", and any
sections entitled “Dedications”. You must delete all sections entitled sections entitled "Dedications". You must delete all sections entitled
“Endorsements.” "Endorsements."
.. _fdl-section6: .. _fdl-section6:
@ -372,7 +372,7 @@ with other separate and independent documents or works, in or on a
volume of a storage or distribution medium, does not as a whole count as volume of a storage or distribution medium, does not as a whole count as
a :ref:`Modified Version <fdl-modified>` of the Document, provided no a :ref:`Modified Version <fdl-modified>` of the Document, provided no
compilation copyright is claimed for the compilation. Such a compilation compilation copyright is claimed for the compilation. Such a compilation
is called an “aggregate”, and this License does not apply to the other is called an "aggregate", and this License does not apply to the other
self-contained works thus compiled with the Document , on account of self-contained works thus compiled with the Document , on account of
their being thus compiled, if they are not themselves derivative works their being thus compiled, if they are not themselves derivative works
of the Document. If the :ref:`Cover Text <fdl-cover-texts>` of the Document. If the :ref:`Cover Text <fdl-cover-texts>`
@ -429,7 +429,7 @@ concerns. See
Each version of the License is given a distinguishing version number. If Each version of the License is given a distinguishing version number. If
the :ref:`Document <fdl-document>` specifies that a particular the :ref:`Document <fdl-document>` specifies that a particular
numbered version of this License “or any later version” applies to it, numbered version of this License "or any later version" applies to it,
you have the option of following the terms and conditions either of that you have the option of following the terms and conditions either of that
specified version or of any later version that has been published (not specified version or of any later version that has been published (not
as a draft) by the Free Software Foundation. If the Document does not as a draft) by the Free Software Foundation. If the Document does not
@ -455,13 +455,13 @@ notices just after the title page:
being LIST THEIR TITLES, with the being LIST THEIR TITLES, with the
:ref:`Front-Cover Texts <fdl-cover-texts>` being LIST, and with :ref:`Front-Cover Texts <fdl-cover-texts>` being LIST, and with
the :ref:`Back-Cover Texts <fdl-cover-texts>` being LIST. A copy the :ref:`Back-Cover Texts <fdl-cover-texts>` being LIST. A copy
of the license is included in the section entitled GNU Free of the license is included in the section entitled "GNU Free
Documentation License. Documentation License".
If you have no :ref:`Invariant Sections <fdl-invariant>`, write with If you have no :ref:`Invariant Sections <fdl-invariant>`, write "with
no Invariant Sections instead of saying which ones are invariant. If no Invariant Sections" instead of saying which ones are invariant. If
you have no :ref:`Front-Cover Texts <fdl-cover-texts>`, write no you have no :ref:`Front-Cover Texts <fdl-cover-texts>`, write "no
Front-Cover Texts” instead of “Front-Cover Texts being LIST”; likewise Front-Cover Texts" instead of "Front-Cover Texts being LIST"; likewise
for :ref:`Back-Cover Texts <fdl-cover-texts>`. for :ref:`Back-Cover Texts <fdl-cover-texts>`.
If your document contains nontrivial examples of program code, we If your document contains nontrivial examples of program code, we

View File

@ -116,7 +116,7 @@ Glossary
- :term:`RC API`; and - :term:`RC API`; and
- :term:`V4L2 API`. - :term:`V4L2 API`.
See :doc:`index`. See Documentation/userspace-api/media/index.rst.
MC API MC API
**Media Controller API** **Media Controller API**

View File

@ -11,12 +11,14 @@ used by media devices.
Please see: Please see:
- :doc:`/admin-guide/media/index` Documentation/admin-guide/media/index.rst
for usage information about media subsystem and supported drivers;
- :doc:`/driver-api/media/index` - for usage information about media subsystem and supported drivers;
for driver development information and Kernel APIs used by
media devices; Documentation/driver-api/media/index.rst
- for driver development information and Kernel APIs used by
media devices;
.. only:: html .. only:: html

View File

@ -51,7 +51,7 @@ ISO 13818-1
=========== ===========
:title: ITU-T Rec. H.222.0 | ISO/IEC 13818-1 "Information technology Generic coding of moving pictures and associated audio information: Systems" :title: ITU-T Rec. H.222.0 | ISO/IEC 13818-1 "Information technology --- Generic coding of moving pictures and associated audio information: Systems"
:author: International Telecommunication Union (http://www.itu.ch), International Organisation for Standardisation (http://www.iso.ch) :author: International Telecommunication Union (http://www.itu.ch), International Organisation for Standardisation (http://www.iso.ch)
@ -61,7 +61,7 @@ ISO 13818-2
=========== ===========
:title: ITU-T Rec. H.262 | ISO/IEC 13818-2 "Information technology Generic coding of moving pictures and associated audio information: Video" :title: ITU-T Rec. H.262 | ISO/IEC 13818-2 "Information technology --- Generic coding of moving pictures and associated audio information: Video"
:author: International Telecommunication Union (http://www.itu.ch), International Organisation for Standardisation (http://www.iso.ch) :author: International Telecommunication Union (http://www.itu.ch), International Organisation for Standardisation (http://www.iso.ch)
@ -150,7 +150,7 @@ ITU-T.81
======== ========
:title: ITU-T Recommendation T.81 "Information Technology — Digital Compression and Coding of Continous-Tone Still Images — Requirements and Guidelines" :title: ITU-T Recommendation T.81 "Information Technology --- Digital Compression and Coding of Continous-Tone Still Images --- Requirements and Guidelines"
:author: International Telecommunication Union (http://www.itu.int) :author: International Telecommunication Union (http://www.itu.int)
@ -310,7 +310,7 @@ ISO 12232:2006
============== ==============
:title: Photography — Digital still cameras — Determination of exposure index, ISO speed ratings, standard output sensitivity, and recommended exposure index :title: Photography --- Digital still cameras --- Determination of exposure index, ISO speed ratings, standard output sensitivity, and recommended exposure index
:author: International Organization for Standardization (http://www.iso.org) :author: International Organization for Standardization (http://www.iso.org)

View File

@ -38,7 +38,7 @@ Conventions and Notations Used in This Document
6. i = [a..b]: sequence of integers from a to b, inclusive, i.e. i = 6. i = [a..b]: sequence of integers from a to b, inclusive, i.e. i =
[0..2]: i = 0, 1, 2. [0..2]: i = 0, 1, 2.
7. Given an ``OUTPUT`` buffer A, then A represents a buffer on the ``CAPTURE`` 7. Given an ``OUTPUT`` buffer A, then A' represents a buffer on the ``CAPTURE``
queue containing data that resulted from processing buffer A. queue containing data that resulted from processing buffer A.
.. _decoder-glossary: .. _decoder-glossary:
@ -288,7 +288,7 @@ Initialization
Changing the ``OUTPUT`` format may change the currently set ``CAPTURE`` Changing the ``OUTPUT`` format may change the currently set ``CAPTURE``
format. How the new ``CAPTURE`` format is determined is up to the decoder format. How the new ``CAPTURE`` format is determined is up to the decoder
and the client must ensure it matches its needs afterwards. and the client must ensure it matches its needs afterwards.
2. Allocate source (bytestream) buffers via :c:func:`VIDIOC_REQBUFS` on 2. Allocate source (bytestream) buffers via :c:func:`VIDIOC_REQBUFS` on
``OUTPUT``. ``OUTPUT``.
@ -874,7 +874,7 @@ it may be affected as per normal decoder operation.
any of the following results on the ``CAPTURE`` queue is allowed: any of the following results on the ``CAPTURE`` queue is allowed:
{A, B, G, H}, {A, G, H}, {G, H}. {A', B', G', H'}, {A', G', H'}, {G', H'}.
To determine the CAPTURE buffer containing the first decoded frame after the To determine the CAPTURE buffer containing the first decoded frame after the
seek, the client may observe the timestamps to match the CAPTURE and OUTPUT seek, the client may observe the timestamps to match the CAPTURE and OUTPUT

View File

@ -1244,3 +1244,217 @@ FWHT Flags
* - __u8 * - __u8
- ``padding[3]`` - ``padding[3]``
- Applications and drivers must set this to zero. - Applications and drivers must set this to zero.
.. _v4l2-codec-stateless-mpeg2:
``V4L2_CID_STATELESS_MPEG2_SEQUENCE (struct)``
Specifies the sequence parameters (as extracted from the bitstream) for the
associated MPEG-2 slice data. This includes fields matching the syntax
elements from the sequence header and sequence extension parts of the
bitstream as specified by :ref:`mpeg2part2`.
.. c:type:: v4l2_ctrl_mpeg2_sequence
.. raw:: latex
\small
.. cssclass:: longtable
.. tabularcolumns:: |p{1.4cm}|p{6.5cm}|p{9.4cm}|
.. flat-table:: struct v4l2_ctrl_mpeg2_sequence
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u16
- ``horizontal_size``
- The width of the displayable part of the frame's luminance component.
* - __u16
- ``vertical_size``
- The height of the displayable part of the frame's luminance component.
* - __u32
- ``vbv_buffer_size``
- Used to calculate the required size of the video buffering verifier,
defined (in bits) as: 16 * 1024 * vbv_buffer_size.
* - __u16
- ``profile_and_level_indication``
- The current profile and level indication as extracted from the
bitstream.
* - __u8
- ``chroma_format``
- The chrominance sub-sampling format (1: 4:2:0, 2: 4:2:2, 3: 4:4:4).
* - __u8
- ``flags``
- See :ref:`MPEG-2 Sequence Flags <mpeg2_sequence_flags>`.
.. _mpeg2_sequence_flags:
``MPEG-2 Sequence Flags``
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - ``V4L2_MPEG2_SEQ_FLAG_PROGRESSIVE``
- 0x01
- Indication that all the frames for the sequence are progressive instead
of interlaced.
.. raw:: latex
\normalsize
``V4L2_CID_STATELESS_MPEG2_PICTURE (struct)``
Specifies the picture parameters (as extracted from the bitstream) for the
associated MPEG-2 slice data. This includes fields matching the syntax
elements from the picture header and picture coding extension parts of the
bitstream as specified by :ref:`mpeg2part2`.
.. c:type:: v4l2_ctrl_mpeg2_picture
.. raw:: latex
\small
.. cssclass:: longtable
.. tabularcolumns:: |p{1.0cm}|p{5.6cm}|p{10.7cm}|
.. flat-table:: struct v4l2_ctrl_mpeg2_picture
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u64
- ``backward_ref_ts``
- Timestamp of the V4L2 capture buffer to use as backward reference, used
with B-coded and P-coded frames. The timestamp refers to the
``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
:c:func:`v4l2_timeval_to_ns()` function to convert the struct
:c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
* - __u64
- ``forward_ref_ts``
- Timestamp for the V4L2 capture buffer to use as forward reference, used
with B-coded frames. The timestamp refers to the ``timestamp`` field in
struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
function to convert the struct :c:type:`timeval` in struct
:c:type:`v4l2_buffer` to a __u64.
* - __u32
- ``flags``
- See :ref:`MPEG-2 Picture Flags <mpeg2_picture_flags>`.
* - __u8
- ``f_code[2][2]``
- Motion vector codes.
* - __u8
- ``picture_coding_type``
- Picture coding type for the frame covered by the current slice
(V4L2_MPEG2_PIC_CODING_TYPE_I, V4L2_MPEG2_PIC_CODING_TYPE_P or
V4L2_MPEG2_PIC_CODING_TYPE_B).
* - __u8
- ``picture_structure``
- Picture structure (1: interlaced top field, 2: interlaced bottom field,
3: progressive frame).
* - __u8
- ``intra_dc_precision``
- Precision of Discrete Cosine transform (0: 8 bits precision,
1: 9 bits precision, 2: 10 bits precision, 3: 11 bits precision).
* - __u8
- ``reserved[5]``
- Applications and drivers must set this to zero.
.. _mpeg2_picture_flags:
``MPEG-2 Picture Flags``
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - ``V4L2_MPEG2_PIC_FLAG_TOP_FIELD_FIRST``
- 0x00000001
- If set and it's an interlaced stream, top field is output first.
* - ``V4L2_MPEG2_PIC_FLAG_FRAME_PRED_DCT``
- 0x00000002
- If set only frame-DCT and frame prediction are used.
* - ``V4L2_MPEG2_PIC_FLAG_CONCEALMENT_MV``
- 0x00000004
- If set motion vectors are coded for intra macroblocks.
* - ``V4L2_MPEG2_PIC_FLAG_Q_SCALE_TYPE``
- 0x00000008
- This flag affects the inverse quantization process.
* - ``V4L2_MPEG2_PIC_FLAG_INTRA_VLC``
- 0x00000010
- This flag affects the decoding of transform coefficient data.
* - ``V4L2_MPEG2_PIC_FLAG_ALT_SCAN``
- 0x00000020
- This flag affects the decoding of transform coefficient data.
* - ``V4L2_MPEG2_PIC_FLAG_REPEAT_FIRST``
- 0x00000040
- This flag affects the decoding process of progressive frames.
* - ``V4L2_MPEG2_PIC_FLAG_PROGRESSIVE``
- 0x00000080
- Indicates whether the current frame is progressive.
.. raw:: latex
\normalsize
``V4L2_CID_STATELESS_MPEG2_QUANTISATION (struct)``
Specifies quantisation matrices, in zigzag scanning order, for the
associated MPEG-2 slice data. This control is initialized by the kernel
to the matrices default values. If a bitstream transmits a user-defined
quantisation matrices load, applications are expected to use this control.
Applications are also expected to set the control loading the default
values, if the quantisation matrices need to be reset, for instance on a
sequence header. This process is specified by section 6.3.7.
"Quant matrix extension" of the specification.
.. c:type:: v4l2_ctrl_mpeg2_quantisation
.. tabularcolumns:: |p{0.8cm}|p{8.0cm}|p{8.5cm}|
.. cssclass:: longtable
.. raw:: latex
\small
.. flat-table:: struct v4l2_ctrl_mpeg2_quantisation
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u8
- ``intra_quantiser_matrix[64]``
- The quantisation matrix coefficients for intra-coded frames, in zigzag
scanning order. It is relevant for both luma and chroma components,
although it can be superseded by the chroma-specific matrix for
non-4:2:0 YUV formats.
* - __u8
- ``non_intra_quantiser_matrix[64]``
- The quantisation matrix coefficients for non-intra-coded frames, in
zigzag scanning order. It is relevant for both luma and chroma
components, although it can be superseded by the chroma-specific matrix
for non-4:2:0 YUV formats.
* - __u8
- ``chroma_intra_quantiser_matrix[64]``
- The quantisation matrix coefficients for the chominance component of
intra-coded frames, in zigzag scanning order. Only relevant for
non-4:2:0 YUV formats.
* - __u8
- ``chroma_non_intra_quantiser_matrix[64]``
- The quantisation matrix coefficients for the chrominance component of
non-intra-coded frames, in zigzag scanning order. Only relevant for
non-4:2:0 YUV formats.
.. raw:: latex
\normalsize

View File

@ -1606,223 +1606,6 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L6_BR (integer)`` ``V4L2_CID_MPEG_VIDEO_H264_HIER_CODING_L6_BR (integer)``
Indicates bit rate (bps) for hierarchical coding layer 6 for H264 encoder. Indicates bit rate (bps) for hierarchical coding layer 6 for H264 encoder.
.. _v4l2-mpeg-mpeg2:
``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (struct)``
Specifies the slice parameters (as extracted from the bitstream) for the
associated MPEG-2 slice data. This includes the necessary parameters for
configuring a stateless hardware decoding pipeline for MPEG-2.
The bitstream parameters are defined according to :ref:`mpeg2part2`.
.. note::
This compound control is not yet part of the public kernel API and
it is expected to change.
.. c:type:: v4l2_ctrl_mpeg2_slice_params
.. tabularcolumns:: |p{5.6cm}|p{4.6cm}|p{7.1cm}|
.. cssclass:: longtable
.. flat-table:: struct v4l2_ctrl_mpeg2_slice_params
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u32
- ``bit_size``
- Size (in bits) of the current slice data.
* - __u32
- ``data_bit_offset``
- Offset (in bits) to the video data in the current slice data.
* - struct :c:type:`v4l2_mpeg2_sequence`
- ``sequence``
- Structure with MPEG-2 sequence metadata, merging relevant fields from
the sequence header and sequence extension parts of the bitstream.
* - struct :c:type:`v4l2_mpeg2_picture`
- ``picture``
- Structure with MPEG-2 picture metadata, merging relevant fields from
the picture header and picture coding extension parts of the bitstream.
* - __u64
- ``backward_ref_ts``
- Timestamp of the V4L2 capture buffer to use as backward reference, used
with B-coded and P-coded frames. The timestamp refers to the
``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
:c:func:`v4l2_timeval_to_ns()` function to convert the struct
:c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
* - __u64
- ``forward_ref_ts``
- Timestamp for the V4L2 capture buffer to use as forward reference, used
with B-coded frames. The timestamp refers to the ``timestamp`` field in
struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
function to convert the struct :c:type:`timeval` in struct
:c:type:`v4l2_buffer` to a __u64.
* - __u32
- ``quantiser_scale_code``
- Code used to determine the quantization scale to use for the IDCT.
.. c:type:: v4l2_mpeg2_sequence
.. cssclass:: longtable
.. tabularcolumns:: |p{1.4cm}|p{6.5cm}|p{9.4cm}|
.. flat-table:: struct v4l2_mpeg2_sequence
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u16
- ``horizontal_size``
- The width of the displayable part of the frame's luminance component.
* - __u16
- ``vertical_size``
- The height of the displayable part of the frame's luminance component.
* - __u32
- ``vbv_buffer_size``
- Used to calculate the required size of the video buffering verifier,
defined (in bits) as: 16 * 1024 * vbv_buffer_size.
* - __u16
- ``profile_and_level_indication``
- The current profile and level indication as extracted from the
bitstream.
* - __u8
- ``progressive_sequence``
- Indication that all the frames for the sequence are progressive instead
of interlaced.
* - __u8
- ``chroma_format``
- The chrominance sub-sampling format (1: 4:2:0, 2: 4:2:2, 3: 4:4:4).
.. c:type:: v4l2_mpeg2_picture
.. raw:: latex
\small
.. cssclass:: longtable
.. tabularcolumns:: |p{1.0cm}|p{5.6cm}|p{10.7cm}|
.. flat-table:: struct v4l2_mpeg2_picture
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u8
- ``picture_coding_type``
- Picture coding type for the frame covered by the current slice
(V4L2_MPEG2_PICTURE_CODING_TYPE_I, V4L2_MPEG2_PICTURE_CODING_TYPE_P or
V4L2_MPEG2_PICTURE_CODING_TYPE_B).
* - __u8
- ``f_code[2][2]``
- Motion vector codes.
* - __u8
- ``intra_dc_precision``
- Precision of Discrete Cosine transform (0: 8 bits precision,
1: 9 bits precision, 2: 10 bits precision, 3: 11 bits precision).
* - __u8
- ``picture_structure``
- Picture structure (1: interlaced top field, 2: interlaced bottom field,
3: progressive frame).
* - __u8
- ``top_field_first``
- If set to 1 and interlaced stream, top field is output first.
* - __u8
- ``frame_pred_frame_dct``
- If set to 1, only frame-DCT and frame prediction are used.
* - __u8
- ``concealment_motion_vectors``
- If set to 1, motion vectors are coded for intra macroblocks.
* - __u8
- ``q_scale_type``
- This flag affects the inverse quantization process.
* - __u8
- ``intra_vlc_format``
- This flag affects the decoding of transform coefficient data.
* - __u8
- ``alternate_scan``
- This flag affects the decoding of transform coefficient data.
* - __u8
- ``repeat_first_field``
- This flag affects the decoding process of progressive frames.
* - __u16
- ``progressive_frame``
- Indicates whether the current frame is progressive.
.. raw:: latex
\normalsize
``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION (struct)``
Specifies quantization matrices (as extracted from the bitstream) for the
associated MPEG-2 slice data.
.. note::
This compound control is not yet part of the public kernel API and
it is expected to change.
.. c:type:: v4l2_ctrl_mpeg2_quantization
.. tabularcolumns:: |p{0.8cm}|p{8.0cm}|p{8.5cm}|
.. cssclass:: longtable
.. raw:: latex
\small
.. flat-table:: struct v4l2_ctrl_mpeg2_quantization
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u8
- ``load_intra_quantiser_matrix``
- One bit to indicate whether to load the ``intra_quantiser_matrix`` data.
* - __u8
- ``load_non_intra_quantiser_matrix``
- One bit to indicate whether to load the ``non_intra_quantiser_matrix``
data.
* - __u8
- ``load_chroma_intra_quantiser_matrix``
- One bit to indicate whether to load the
``chroma_intra_quantiser_matrix`` data, only relevant for non-4:2:0 YUV
formats.
* - __u8
- ``load_chroma_non_intra_quantiser_matrix``
- One bit to indicate whether to load the
``chroma_non_intra_quantiser_matrix`` data, only relevant for non-4:2:0
YUV formats.
* - __u8
- ``intra_quantiser_matrix[64]``
- The quantization matrix coefficients for intra-coded frames, in zigzag
scanning order. It is relevant for both luma and chroma components,
although it can be superseded by the chroma-specific matrix for
non-4:2:0 YUV formats.
* - __u8
- ``non_intra_quantiser_matrix[64]``
- The quantization matrix coefficients for non-intra-coded frames, in
zigzag scanning order. It is relevant for both luma and chroma
components, although it can be superseded by the chroma-specific matrix
for non-4:2:0 YUV formats.
* - __u8
- ``chroma_intra_quantiser_matrix[64]``
- The quantization matrix coefficients for the chominance component of
intra-coded frames, in zigzag scanning order. Only relevant for
non-4:2:0 YUV formats.
* - __u8
- ``chroma_non_intra_quantiser_matrix[64]``
- The quantization matrix coefficients for the chrominance component of
non-intra-coded frames, in zigzag scanning order. Only relevant for
non-4:2:0 YUV formats.
.. raw:: latex
\normalsize
``V4L2_CID_FWHT_I_FRAME_QP (integer)`` ``V4L2_CID_FWHT_I_FRAME_QP (integer)``
Quantization parameter for an I frame for FWHT. Valid range: from 1 Quantization parameter for an I frame for FWHT. Valid range: from 1
to 31. to 31.
@ -2924,6 +2707,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
* - __u8 * - __u8
- ``chroma_format_idc`` - ``chroma_format_idc``
- -
* - __u8
- ``sps_max_sub_layers_minus1``
-
* - __u64 * - __u64
- ``flags`` - ``flags``
- See :ref:`Sequence Parameter Set Flags <hevc_sps_flags>` - See :ref:`Sequence Parameter Set Flags <hevc_sps_flags>`
@ -3000,6 +2786,12 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
* - __u8 * - __u8
- ``num_extra_slice_header_bits`` - ``num_extra_slice_header_bits``
- -
* - __u8
- ``num_ref_idx_l0_default_active_minus1``
- Specifies the inferred value of num_ref_idx_l0_active_minus1
* - __u8
- ``num_ref_idx_l1_default_active_minus1``
- Specifies the inferred value of num_ref_idx_l1_active_minus1
* - __s8 * - __s8
- ``init_qp_minus26`` - ``init_qp_minus26``
- -
@ -3053,7 +2845,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
:stub-columns: 0 :stub-columns: 0
:widths: 1 1 2 :widths: 1 1 2
* - ``V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT`` * - ``V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT_ENABLED``
- 0x00000001 - 0x00000001
- -
* - ``V4L2_HEVC_PPS_FLAG_OUTPUT_FLAG_PRESENT`` * - ``V4L2_HEVC_PPS_FLAG_OUTPUT_FLAG_PRESENT``
@ -3110,6 +2902,14 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
* - ``V4L2_HEVC_PPS_FLAG_SLICE_SEGMENT_HEADER_EXTENSION_PRESENT`` * - ``V4L2_HEVC_PPS_FLAG_SLICE_SEGMENT_HEADER_EXTENSION_PRESENT``
- 0x00040000 - 0x00040000
- -
* - ``V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT``
- 0x00080000
- Specifies the presence of deblocking filter control syntax elements in
the PPS
* - ``V4L2_HEVC_PPS_FLAG_UNIFORM_SPACING``
- 0x00100000
- Specifies that tile column boundaries and likewise tile row boundaries
are distributed uniformly across the picture
.. raw:: latex .. raw:: latex
@ -3200,9 +3000,6 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
* - __u8 * - __u8
- ``pic_struct`` - ``pic_struct``
- -
* - __u8
- ``num_active_dpb_entries``
- The number of entries in ``dpb``.
* - __u8 * - __u8
- ``ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]`` - ``ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
- The list of L0 reference elements as indices in the DPB. - The list of L0 reference elements as indices in the DPB.
@ -3210,22 +3007,8 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
- ``ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]`` - ``ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
- The list of L1 reference elements as indices in the DPB. - The list of L1 reference elements as indices in the DPB.
* - __u8 * - __u8
- ``num_rps_poc_st_curr_before`` - ``padding``
- The number of reference pictures in the short-term set that come before
the current frame.
* - __u8
- ``num_rps_poc_st_curr_after``
- The number of reference pictures in the short-term set that come after
the current frame.
* - __u8
- ``num_rps_poc_lt_curr``
- The number of reference pictures in the long-term set.
* - __u8
- ``padding[7]``
- Applications and drivers must set this to zero. - Applications and drivers must set this to zero.
* - struct :c:type:`v4l2_hevc_dpb_entry`
- ``dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
- The decoded picture buffer, for meta-data about reference frames.
* - struct :c:type:`v4l2_hevc_pred_weight_table` * - struct :c:type:`v4l2_hevc_pred_weight_table`
- ``pred_weight_table`` - ``pred_weight_table``
- The prediction weight coefficients for inter-picture prediction. - The prediction weight coefficients for inter-picture prediction.
@ -3277,6 +3060,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
* - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED`` * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED``
- 0x00000100 - 0x00000100
- -
* - ``V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT``
- 0x00000200
-
.. raw:: latex .. raw:: latex
@ -3478,3 +3264,78 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
encoding the next frame queued after setting this control. encoding the next frame queued after setting this control.
This provides a bitmask which consists of bits [0, LTR_COUNT-1]. This provides a bitmask which consists of bits [0, LTR_COUNT-1].
This is applicable to the H264 and HEVC encoders. This is applicable to the H264 and HEVC encoders.
``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS (struct)``
Specifies various decode parameters, especially the references picture order
count (POC) for all the lists (short, long, before, current, after) and the
number of entries for each of them.
These parameters are defined according to :ref:`hevc`.
They are described in section 8.3 "Slice decoding process" of the
specification.
.. c:type:: v4l2_ctrl_hevc_decode_params
.. cssclass:: longtable
.. flat-table:: struct v4l2_ctrl_hevc_decode_params
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __s32
- ``pic_order_cnt_val``
- PicOrderCntVal as described in section 8.3.1 "Decoding process
for picture order count" of the specification.
* - __u8
- ``num_active_dpb_entries``
- The number of entries in ``dpb``.
* - struct :c:type:`v4l2_hevc_dpb_entry`
- ``dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
- The decoded picture buffer, for meta-data about reference frames.
* - __u8
- ``num_poc_st_curr_before``
- The number of reference pictures in the short-term set that come before
the current frame.
* - __u8
- ``num_poc_st_curr_after``
- The number of reference pictures in the short-term set that come after
the current frame.
* - __u8
- ``num_poc_lt_curr``
- The number of reference pictures in the long-term set.
* - __u8
- ``poc_st_curr_before[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
- PocStCurrBefore as described in section 8.3.2 "Decoding process for reference
picture set.
* - __u8
- ``poc_st_curr_after[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
- PocStCurrAfter as described in section 8.3.2 "Decoding process for reference
picture set.
* - __u8
- ``poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
- PocLtCurr as described in section 8.3.2 "Decoding process for reference
picture set.
* - __u64
- ``flags``
- See :ref:`Decode Parameters Flags <hevc_decode_params_flags>`
.. _hevc_decode_params_flags:
``Decode Parameters Flags``
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - ``V4L2_HEVC_DECODE_PARAM_FLAG_IRAP_PIC``
- 0x00000001
-
* - ``V4L2_HEVC_DECODE_PARAM_FLAG_IDR_PIC``
- 0x00000002
-
* - ``V4L2_HEVC_DECODE_PARAM_FLAG_NO_OUTPUT_OF_PRIOR``
- 0x00000004
-

View File

@ -112,12 +112,13 @@ Compressed Formats
- 'MG2S' - 'MG2S'
- MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream. - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream.
This format is adapted for stateless video decoders that implement a This format is adapted for stateless video decoders that implement a
MPEG-2 pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`). MPEG-2 pipeline with the :ref:`stateless_decoder`.
Metadata associated with the frame to decode is required to be passed Metadata associated with the frame to decode is required to be passed
through the ``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS`` control and through the ``V4L2_CID_STATELESS_MPEG2_SEQUENCE`` and
quantization matrices can optionally be specified through the ``V4L2_CID_STATELESS_MPEG2_PICTURE`` controls.
``V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION`` control. Quantisation matrices can optionally be specified through the
See the :ref:`associated Codec Control IDs <v4l2-mpeg-mpeg2>`. ``V4L2_CID_STATELESS_MPEG2_QUANTISATION`` control.
See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-mpeg2>`.
Exactly one output and one capture buffer must be provided for use with Exactly one output and one capture buffer must be provided for use with
this pixel format. The output buffer must contain the appropriate number this pixel format. The output buffer must contain the appropriate number
of macroblocks to decode a full corresponding frame to the matching of macroblocks to decode a full corresponding frame to the matching

View File

@ -78,4 +78,4 @@ hardware and algorithm details.
Intel IPU3 ImgU uAPI data types Intel IPU3 ImgU uAPI data types
=============================== ===============================
.. kernel-doc:: drivers/staging/media/ipu3/include/intel-ipu3.h .. kernel-doc:: drivers/staging/media/ipu3/include/uapi/intel-ipu3.h

View File

@ -221,6 +221,18 @@ still cause this situation.
- ``p_vp8_frame`` - ``p_vp8_frame``
- A pointer to a struct :c:type:`v4l2_ctrl_vp8_frame`. Valid if this control is - A pointer to a struct :c:type:`v4l2_ctrl_vp8_frame`. Valid if this control is
of type ``V4L2_CTRL_TYPE_VP8_FRAME``. of type ``V4L2_CTRL_TYPE_VP8_FRAME``.
* - struct :c:type:`v4l2_ctrl_mpeg2_sequence` *
- ``p_mpeg2_sequence``
- A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_sequence`. Valid if this control is
of type ``V4L2_CTRL_TYPE_MPEG2_SEQUENCE``.
* - struct :c:type:`v4l2_ctrl_mpeg2_picture` *
- ``p_mpeg2_picture``
- A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_picture`. Valid if this control is
of type ``V4L2_CTRL_TYPE_MPEG2_PICTURE``.
* - struct :c:type:`v4l2_ctrl_mpeg2_quantisation` *
- ``p_mpeg2_quantisation``
- A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_quantisation`. Valid if this control is
of type ``V4L2_CTRL_TYPE_MPEG2_QUANTISATION``.
* - struct :c:type:`v4l2_ctrl_hdr10_cll_info` * * - struct :c:type:`v4l2_ctrl_hdr10_cll_info` *
- ``p_hdr10_cll`` - ``p_hdr10_cll``
- A pointer to a struct :c:type:`v4l2_ctrl_hdr10_cll_info`. Valid if this control is - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_cll_info`. Valid if this control is

View File

@ -417,18 +417,24 @@ See also the examples in :ref:`control`.
- any - any
- An unsigned 32-bit valued control ranging from minimum to maximum - An unsigned 32-bit valued control ranging from minimum to maximum
inclusive. The step value indicates the increment between values. inclusive. The step value indicates the increment between values.
* - ``V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS`` * - ``V4L2_CTRL_TYPE_MPEG2_QUANTISATION``
- n/a - n/a
- n/a - n/a
- n/a - n/a
- A struct :c:type:`v4l2_ctrl_mpeg2_slice_params`, containing MPEG-2 - A struct :c:type:`v4l2_ctrl_mpeg2_quantisation`, containing MPEG-2
slice parameters for stateless video decoders. quantisation matrices for stateless video decoders.
* - ``V4L2_CTRL_TYPE_MPEG2_QUANTIZATION`` * - ``V4L2_CTRL_TYPE_MPEG2_SEQUENCE``
- n/a - n/a
- n/a - n/a
- n/a - n/a
- A struct :c:type:`v4l2_ctrl_mpeg2_quantization`, containing MPEG-2 - A struct :c:type:`v4l2_ctrl_mpeg2_sequence`, containing MPEG-2
quantization matrices for stateless video decoders. sequence parameters for stateless video decoders.
* - ``V4L2_CTRL_TYPE_MPEG2_PICTURE``
- n/a
- n/a
- n/a
- A struct :c:type:`v4l2_ctrl_mpeg2_picture`, containing MPEG-2
picture parameters for stateless video decoders.
* - ``V4L2_CTRL_TYPE_AREA`` * - ``V4L2_CTRL_TYPE_AREA``
- n/a - n/a
- n/a - n/a
@ -495,6 +501,12 @@ See also the examples in :ref:`control`.
- n/a - n/a
- A struct :c:type:`v4l2_ctrl_vp8_frame`, containing VP8 - A struct :c:type:`v4l2_ctrl_vp8_frame`, containing VP8
frame parameters for stateless video decoders. frame parameters for stateless video decoders.
* - ``V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS``
- n/a
- n/a
- n/a
- A struct :c:type:`v4l2_ctrl_hevc_decode_params`, containing HEVC
decoding parameters for stateless video decoders.
.. raw:: latex .. raw:: latex

View File

@ -1,39 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# Ignore header name
ignore define _UAPI_DVBVIDEO_H_
# This is a deprecated obscure API. Just ignore things we don't know
ignore define VIDEO_CMD_PLAY
ignore define VIDEO_CMD_STOP
ignore define VIDEO_CMD_FREEZE
ignore define VIDEO_CMD_CONTINUE
ignore define VIDEO_CMD_FREEZE_TO_BLACK
ignore define VIDEO_CMD_STOP_TO_BLACK
ignore define VIDEO_CMD_STOP_IMMEDIATELY
ignore define VIDEO_PLAY_FMT_NONE
ignore define VIDEO_PLAY_FMT_GOP
ignore define VIDEO_VSYNC_FIELD_UNKNOWN
ignore define VIDEO_VSYNC_FIELD_ODD
ignore define VIDEO_VSYNC_FIELD_EVEN
ignore define VIDEO_VSYNC_FIELD_PROGRESSIVE
ignore define VIDEO_EVENT_SIZE_CHANGED
ignore define VIDEO_EVENT_FRAME_RATE_CHANGED
ignore define VIDEO_EVENT_DECODER_STOPPED
ignore define VIDEO_EVENT_VSYNC
ignore define VIDEO_CAP_MPEG1
ignore define VIDEO_CAP_MPEG2
ignore define VIDEO_CAP_SYS
ignore define VIDEO_CAP_PROG
ignore define VIDEO_CAP_SPU
ignore define VIDEO_CAP_NAVI
ignore define VIDEO_CAP_CSS
# some typedefs should point to struct/enums
replace typedef video_format_t :c:type:`video_format`
replace typedef video_system_t :c:type:`video_system`
replace typedef video_displayformat_t :c:type:`video_displayformat`
replace typedef video_size_t :c:type:`video_size`
replace typedef video_stream_source_t :c:type:`video_stream_source`
replace typedef video_play_state_t :c:type:`video_play_state`
replace typedef video_navi_pack_t :c:type:`video_navi_pack`

View File

@ -134,8 +134,9 @@ replace symbol V4L2_CTRL_TYPE_STRING :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_U16 :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_U16 :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_U32 :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_U32 :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_U8 :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_U8 :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_MPEG2_SEQUENCE :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_MPEG2_QUANTIZATION :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_MPEG2_PICTURE :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_MPEG2_QUANTISATION :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_H264_SPS :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_H264_SPS :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_H264_PPS :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_H264_PPS :c:type:`v4l2_ctrl_type`
replace symbol V4L2_CTRL_TYPE_H264_SCALING_MATRIX :c:type:`v4l2_ctrl_type` replace symbol V4L2_CTRL_TYPE_H264_SCALING_MATRIX :c:type:`v4l2_ctrl_type`

View File

@ -11290,6 +11290,7 @@ F: include/media/imx.h
MEDIA DRIVERS FOR FREESCALE IMX7 MEDIA DRIVERS FOR FREESCALE IMX7
M: Rui Miguel Silva <rmfrfs@gmail.com> M: Rui Miguel Silva <rmfrfs@gmail.com>
M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
S: Maintained S: Maintained
T: git git://linuxtv.org/media_tree.git T: git git://linuxtv.org/media_tree.git
@ -11399,6 +11400,7 @@ L: linux-renesas-soc@vger.kernel.org
S: Supported S: Supported
T: git git://linuxtv.org/media_tree.git T: git git://linuxtv.org/media_tree.git
F: Documentation/devicetree/bindings/media/renesas,csi2.yaml F: Documentation/devicetree/bindings/media/renesas,csi2.yaml
F: Documentation/devicetree/bindings/media/renesas,isp.yaml
F: Documentation/devicetree/bindings/media/renesas,vin.yaml F: Documentation/devicetree/bindings/media/renesas,vin.yaml
F: drivers/media/platform/rcar-vin/ F: drivers/media/platform/rcar-vin/
@ -11988,11 +11990,13 @@ MICROCHIP ISC DRIVER
M: Eugen Hristev <eugen.hristev@microchip.com> M: Eugen Hristev <eugen.hristev@microchip.com>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
S: Supported S: Supported
F: Documentation/devicetree/bindings/media/atmel-isc.txt F: Documentation/devicetree/bindings/media/atmel,isc.yaml
F: Documentation/devicetree/bindings/media/microchip,xisc.yaml
F: drivers/media/platform/atmel/atmel-isc-base.c F: drivers/media/platform/atmel/atmel-isc-base.c
F: drivers/media/platform/atmel/atmel-isc-regs.h F: drivers/media/platform/atmel/atmel-isc-regs.h
F: drivers/media/platform/atmel/atmel-isc.h F: drivers/media/platform/atmel/atmel-isc.h
F: drivers/media/platform/atmel/atmel-sama5d2-isc.c F: drivers/media/platform/atmel/atmel-sama5d2-isc.c
F: drivers/media/platform/atmel/atmel-sama7g5-isc.c
F: include/linux/atmel-isc-media.h F: include/linux/atmel-isc-media.h
MICROCHIP ISI DRIVER MICROCHIP ISI DRIVER
@ -17004,6 +17008,13 @@ S: Maintained
F: drivers/ssb/ F: drivers/ssb/
F: include/linux/ssb/ F: include/linux/ssb/
SONY IMX208 SENSOR DRIVER
M: Sakari Ailus <sakari.ailus@linux.intel.com>
L: linux-media@vger.kernel.org
S: Maintained
T: git git://linuxtv.org/media_tree.git
F: drivers/media/i2c/imx208.c
SONY IMX214 SENSOR DRIVER SONY IMX214 SENSOR DRIVER
M: Ricardo Ribalda <ribalda@kernel.org> M: Ricardo Ribalda <ribalda@kernel.org>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org

View File

@ -101,6 +101,13 @@
ranges = <0 0x100000 0x2400>; ranges = <0 0x100000 0x2400>;
}; };
vdec0: vdec@300000 {
compatible = "microchip,sama5d4-vdec";
reg = <0x00300000 0x100000>;
interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
};
usb0: gadget@400000 { usb0: gadget@400000 {
compatible = "atmel,sama5d3-udc"; compatible = "atmel,sama5d3-udc";
reg = <0x00400000 0x100000 reg = <0x00400000 0x100000

View File

@ -35,10 +35,13 @@ MODULE_PARM_DESC(debug, "debug level (0-2)");
static int s5p_cec_adap_enable(struct cec_adapter *adap, bool enable) static int s5p_cec_adap_enable(struct cec_adapter *adap, bool enable)
{ {
int ret;
struct s5p_cec_dev *cec = cec_get_drvdata(adap); struct s5p_cec_dev *cec = cec_get_drvdata(adap);
if (enable) { if (enable) {
pm_runtime_get_sync(cec->dev); ret = pm_runtime_resume_and_get(cec->dev);
if (ret < 0)
return ret;
s5p_cec_reset(cec); s5p_cec_reset(cec);
@ -51,7 +54,7 @@ static int s5p_cec_adap_enable(struct cec_adapter *adap, bool enable)
} else { } else {
s5p_cec_mask_tx_interrupts(cec); s5p_cec_mask_tx_interrupts(cec);
s5p_cec_mask_rx_interrupts(cec); s5p_cec_mask_rx_interrupts(cec);
pm_runtime_disable(cec->dev); pm_runtime_put(cec->dev);
} }
return 0; return 0;

View File

@ -13,6 +13,10 @@ config VIDEO_TVEEPROM
tristate tristate
depends on I2C depends on I2C
config TTPCI_EEPROM
tristate
depends on I2C
config CYPRESS_FIRMWARE config CYPRESS_FIRMWARE
tristate tristate
depends on USB depends on USB

View File

@ -3,3 +3,4 @@ obj-y += b2c2/ saa7146/ siano/ v4l2-tpg/ videobuf2/
obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o obj-$(CONFIG_VIDEO_CX2341X) += cx2341x.o
obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
obj-$(CONFIG_CYPRESS_FIRMWARE) += cypress_firmware.o obj-$(CONFIG_CYPRESS_FIRMWARE) += cypress_firmware.o
obj-$(CONFIG_TTPCI_EEPROM) += ttpci-eeprom.o

View File

@ -26,8 +26,8 @@ Copyright (C) 2006-2008, Uri Shkolnik
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static struct list_head g_smsdvb_clients; static LIST_HEAD(g_smsdvb_clients);
static struct mutex g_smsdvb_clientslock; static DEFINE_MUTEX(g_smsdvb_clientslock);
static u32 sms_to_guard_interval_table[] = { static u32 sms_to_guard_interval_table[] = {
[0] = GUARD_INTERVAL_1_32, [0] = GUARD_INTERVAL_1_32,
@ -1212,6 +1212,10 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev,
return 0; return 0;
media_graph_error: media_graph_error:
mutex_lock(&g_smsdvb_clientslock);
list_del(&client->entry);
mutex_unlock(&g_smsdvb_clientslock);
smsdvb_debugfs_release(client); smsdvb_debugfs_release(client);
client_error: client_error:
@ -1236,9 +1240,6 @@ static int __init smsdvb_module_init(void)
{ {
int rc; int rc;
INIT_LIST_HEAD(&g_smsdvb_clients);
mutex_init(&g_smsdvb_clientslock);
smsdvb_debugfs_register(); smsdvb_debugfs_register();
rc = smscore_register_hotplug(smsdvb_hotplug); rc = smscore_register_hotplug(smsdvb_hotplug);

View File

@ -939,6 +939,20 @@ void vb2_queue_release(struct vb2_queue *q)
} }
EXPORT_SYMBOL_GPL(vb2_queue_release); EXPORT_SYMBOL_GPL(vb2_queue_release);
int vb2_queue_change_type(struct vb2_queue *q, unsigned int type)
{
if (type == q->type)
return 0;
if (vb2_is_busy(q))
return -EBUSY;
q->type = type;
return 0;
}
EXPORT_SYMBOL_GPL(vb2_queue_change_type);
__poll_t vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait) __poll_t vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
{ {
struct video_device *vfd = video_devdata(file); struct video_device *vfd = video_devdata(file);

View File

@ -720,7 +720,7 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter)
ret = dmxdev->demux->allocate_section_feed(dmxdev->demux, ret = dmxdev->demux->allocate_section_feed(dmxdev->demux,
secfeed, secfeed,
dvb_dmxdev_section_callback); dvb_dmxdev_section_callback);
if (ret < 0) { if (!*secfeed) {
pr_err("DVB (%s): could not alloc feed\n", pr_err("DVB (%s): could not alloc feed\n",
__func__); __func__);
return ret; return ret;

View File

@ -1386,6 +1386,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
err = -EINVAL; err = -EINVAL;
goto out_unlock; goto out_unlock;
} }
slot = array_index_nospec(slot, ca->slot_count);
info->type = CA_CI_LINK; info->type = CA_CI_LINK;
info->flags = 0; info->flags = 0;

View File

@ -23,6 +23,7 @@
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/semaphore.h> #include <linux/semaphore.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/nospec.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
@ -1063,107 +1064,97 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
return 0; return 0;
} }
#define _DTV_CMD(n, s, b) \ #define _DTV_CMD(n) \
[n] = { \ [n] = #n
.name = #n, \
.cmd = n, \
.set = s,\
.buffer = b \
}
struct dtv_cmds_h { static char *dtv_cmds[DTV_MAX_COMMAND + 1] = {
char *name; /* A display name for debugging purposes */ _DTV_CMD(DTV_TUNE),
_DTV_CMD(DTV_CLEAR),
__u32 cmd; /* A unique ID */
/* Flags */
__u32 set:1; /* Either a set or get property */
__u32 buffer:1; /* Does this property use the buffer? */
__u32 reserved:30; /* Align */
};
static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
_DTV_CMD(DTV_TUNE, 1, 0),
_DTV_CMD(DTV_CLEAR, 1, 0),
/* Set */ /* Set */
_DTV_CMD(DTV_FREQUENCY, 1, 0), _DTV_CMD(DTV_FREQUENCY),
_DTV_CMD(DTV_BANDWIDTH_HZ, 1, 0), _DTV_CMD(DTV_BANDWIDTH_HZ),
_DTV_CMD(DTV_MODULATION, 1, 0), _DTV_CMD(DTV_MODULATION),
_DTV_CMD(DTV_INVERSION, 1, 0), _DTV_CMD(DTV_INVERSION),
_DTV_CMD(DTV_DISEQC_MASTER, 1, 1), _DTV_CMD(DTV_DISEQC_MASTER),
_DTV_CMD(DTV_SYMBOL_RATE, 1, 0), _DTV_CMD(DTV_SYMBOL_RATE),
_DTV_CMD(DTV_INNER_FEC, 1, 0), _DTV_CMD(DTV_INNER_FEC),
_DTV_CMD(DTV_VOLTAGE, 1, 0), _DTV_CMD(DTV_VOLTAGE),
_DTV_CMD(DTV_TONE, 1, 0), _DTV_CMD(DTV_TONE),
_DTV_CMD(DTV_PILOT, 1, 0), _DTV_CMD(DTV_PILOT),
_DTV_CMD(DTV_ROLLOFF, 1, 0), _DTV_CMD(DTV_ROLLOFF),
_DTV_CMD(DTV_DELIVERY_SYSTEM, 1, 0), _DTV_CMD(DTV_DELIVERY_SYSTEM),
_DTV_CMD(DTV_HIERARCHY, 1, 0), _DTV_CMD(DTV_HIERARCHY),
_DTV_CMD(DTV_CODE_RATE_HP, 1, 0), _DTV_CMD(DTV_CODE_RATE_HP),
_DTV_CMD(DTV_CODE_RATE_LP, 1, 0), _DTV_CMD(DTV_CODE_RATE_LP),
_DTV_CMD(DTV_GUARD_INTERVAL, 1, 0), _DTV_CMD(DTV_GUARD_INTERVAL),
_DTV_CMD(DTV_TRANSMISSION_MODE, 1, 0), _DTV_CMD(DTV_TRANSMISSION_MODE),
_DTV_CMD(DTV_INTERLEAVING, 1, 0), _DTV_CMD(DTV_INTERLEAVING),
_DTV_CMD(DTV_ISDBT_PARTIAL_RECEPTION, 1, 0), _DTV_CMD(DTV_ISDBT_PARTIAL_RECEPTION),
_DTV_CMD(DTV_ISDBT_SOUND_BROADCASTING, 1, 0), _DTV_CMD(DTV_ISDBT_SOUND_BROADCASTING),
_DTV_CMD(DTV_ISDBT_SB_SUBCHANNEL_ID, 1, 0), _DTV_CMD(DTV_ISDBT_SB_SUBCHANNEL_ID),
_DTV_CMD(DTV_ISDBT_SB_SEGMENT_IDX, 1, 0), _DTV_CMD(DTV_ISDBT_SB_SEGMENT_IDX),
_DTV_CMD(DTV_ISDBT_SB_SEGMENT_COUNT, 1, 0), _DTV_CMD(DTV_ISDBT_SB_SEGMENT_COUNT),
_DTV_CMD(DTV_ISDBT_LAYER_ENABLED, 1, 0), _DTV_CMD(DTV_ISDBT_LAYER_ENABLED),
_DTV_CMD(DTV_ISDBT_LAYERA_FEC, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERA_FEC),
_DTV_CMD(DTV_ISDBT_LAYERA_MODULATION, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERA_MODULATION),
_DTV_CMD(DTV_ISDBT_LAYERA_SEGMENT_COUNT, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERA_SEGMENT_COUNT),
_DTV_CMD(DTV_ISDBT_LAYERA_TIME_INTERLEAVING, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERA_TIME_INTERLEAVING),
_DTV_CMD(DTV_ISDBT_LAYERB_FEC, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERB_FEC),
_DTV_CMD(DTV_ISDBT_LAYERB_MODULATION, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERB_MODULATION),
_DTV_CMD(DTV_ISDBT_LAYERB_SEGMENT_COUNT, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERB_SEGMENT_COUNT),
_DTV_CMD(DTV_ISDBT_LAYERB_TIME_INTERLEAVING, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERB_TIME_INTERLEAVING),
_DTV_CMD(DTV_ISDBT_LAYERC_FEC, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERC_FEC),
_DTV_CMD(DTV_ISDBT_LAYERC_MODULATION, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERC_MODULATION),
_DTV_CMD(DTV_ISDBT_LAYERC_SEGMENT_COUNT, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERC_SEGMENT_COUNT),
_DTV_CMD(DTV_ISDBT_LAYERC_TIME_INTERLEAVING, 1, 0), _DTV_CMD(DTV_ISDBT_LAYERC_TIME_INTERLEAVING),
_DTV_CMD(DTV_STREAM_ID, 1, 0), _DTV_CMD(DTV_STREAM_ID),
_DTV_CMD(DTV_DVBT2_PLP_ID_LEGACY, 1, 0), _DTV_CMD(DTV_DVBT2_PLP_ID_LEGACY),
_DTV_CMD(DTV_SCRAMBLING_SEQUENCE_INDEX, 1, 0), _DTV_CMD(DTV_SCRAMBLING_SEQUENCE_INDEX),
_DTV_CMD(DTV_LNA, 1, 0), _DTV_CMD(DTV_LNA),
/* Get */ /* Get */
_DTV_CMD(DTV_DISEQC_SLAVE_REPLY, 0, 1), _DTV_CMD(DTV_DISEQC_SLAVE_REPLY),
_DTV_CMD(DTV_API_VERSION, 0, 0), _DTV_CMD(DTV_API_VERSION),
_DTV_CMD(DTV_ENUM_DELSYS, 0, 0), _DTV_CMD(DTV_ENUM_DELSYS),
_DTV_CMD(DTV_ATSCMH_PARADE_ID, 1, 0), _DTV_CMD(DTV_ATSCMH_PARADE_ID),
_DTV_CMD(DTV_ATSCMH_RS_FRAME_ENSEMBLE, 1, 0), _DTV_CMD(DTV_ATSCMH_RS_FRAME_ENSEMBLE),
_DTV_CMD(DTV_ATSCMH_FIC_VER, 0, 0), _DTV_CMD(DTV_ATSCMH_FIC_VER),
_DTV_CMD(DTV_ATSCMH_NOG, 0, 0), _DTV_CMD(DTV_ATSCMH_NOG),
_DTV_CMD(DTV_ATSCMH_TNOG, 0, 0), _DTV_CMD(DTV_ATSCMH_TNOG),
_DTV_CMD(DTV_ATSCMH_SGN, 0, 0), _DTV_CMD(DTV_ATSCMH_SGN),
_DTV_CMD(DTV_ATSCMH_PRC, 0, 0), _DTV_CMD(DTV_ATSCMH_PRC),
_DTV_CMD(DTV_ATSCMH_RS_FRAME_MODE, 0, 0), _DTV_CMD(DTV_ATSCMH_RS_FRAME_MODE),
_DTV_CMD(DTV_ATSCMH_RS_CODE_MODE_PRI, 0, 0), _DTV_CMD(DTV_ATSCMH_RS_CODE_MODE_PRI),
_DTV_CMD(DTV_ATSCMH_RS_CODE_MODE_SEC, 0, 0), _DTV_CMD(DTV_ATSCMH_RS_CODE_MODE_SEC),
_DTV_CMD(DTV_ATSCMH_SCCC_BLOCK_MODE, 0, 0), _DTV_CMD(DTV_ATSCMH_SCCC_BLOCK_MODE),
_DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_A, 0, 0), _DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_A),
_DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_B, 0, 0), _DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_B),
_DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_C, 0, 0), _DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_C),
_DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_D, 0, 0), _DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_D),
/* Statistics API */ /* Statistics API */
_DTV_CMD(DTV_STAT_SIGNAL_STRENGTH, 0, 0), _DTV_CMD(DTV_STAT_SIGNAL_STRENGTH),
_DTV_CMD(DTV_STAT_CNR, 0, 0), _DTV_CMD(DTV_STAT_CNR),
_DTV_CMD(DTV_STAT_PRE_ERROR_BIT_COUNT, 0, 0), _DTV_CMD(DTV_STAT_PRE_ERROR_BIT_COUNT),
_DTV_CMD(DTV_STAT_PRE_TOTAL_BIT_COUNT, 0, 0), _DTV_CMD(DTV_STAT_PRE_TOTAL_BIT_COUNT),
_DTV_CMD(DTV_STAT_POST_ERROR_BIT_COUNT, 0, 0), _DTV_CMD(DTV_STAT_POST_ERROR_BIT_COUNT),
_DTV_CMD(DTV_STAT_POST_TOTAL_BIT_COUNT, 0, 0), _DTV_CMD(DTV_STAT_POST_TOTAL_BIT_COUNT),
_DTV_CMD(DTV_STAT_ERROR_BLOCK_COUNT, 0, 0), _DTV_CMD(DTV_STAT_ERROR_BLOCK_COUNT),
_DTV_CMD(DTV_STAT_TOTAL_BLOCK_COUNT, 0, 0), _DTV_CMD(DTV_STAT_TOTAL_BLOCK_COUNT),
}; };
static char *dtv_cmd_name(u32 cmd)
{
cmd = array_index_nospec(cmd, DTV_MAX_COMMAND);
return dtv_cmds[cmd];
}
/* Synchronise the legacy tuning parameters into the cache, so that demodulator /* Synchronise the legacy tuning parameters into the cache, so that demodulator
* drivers can use a single set_frontend tuning function, regardless of whether * drivers can use a single set_frontend tuning function, regardless of whether
* it's being used for the legacy or new API, reducing code and complexity. * it's being used for the legacy or new API, reducing code and complexity.
@ -1346,6 +1337,7 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
struct file *file) struct file *file)
{ {
int ncaps; int ncaps;
unsigned int len = 1;
switch (tvp->cmd) { switch (tvp->cmd) {
case DTV_ENUM_DELSYS: case DTV_ENUM_DELSYS:
@ -1355,6 +1347,7 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
ncaps++; ncaps++;
} }
tvp->u.buffer.len = ncaps; tvp->u.buffer.len = ncaps;
len = ncaps;
break; break;
case DTV_FREQUENCY: case DTV_FREQUENCY:
tvp->u.data = c->frequency; tvp->u.data = c->frequency;
@ -1532,27 +1525,51 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
/* Fill quality measures */ /* Fill quality measures */
case DTV_STAT_SIGNAL_STRENGTH: case DTV_STAT_SIGNAL_STRENGTH:
tvp->u.st = c->strength; tvp->u.st = c->strength;
if (tvp->u.buffer.len > MAX_DTV_STATS * sizeof(u32))
tvp->u.buffer.len = MAX_DTV_STATS * sizeof(u32);
len = tvp->u.buffer.len;
break; break;
case DTV_STAT_CNR: case DTV_STAT_CNR:
tvp->u.st = c->cnr; tvp->u.st = c->cnr;
if (tvp->u.buffer.len > MAX_DTV_STATS * sizeof(u32))
tvp->u.buffer.len = MAX_DTV_STATS * sizeof(u32);
len = tvp->u.buffer.len;
break; break;
case DTV_STAT_PRE_ERROR_BIT_COUNT: case DTV_STAT_PRE_ERROR_BIT_COUNT:
tvp->u.st = c->pre_bit_error; tvp->u.st = c->pre_bit_error;
if (tvp->u.buffer.len > MAX_DTV_STATS * sizeof(u32))
tvp->u.buffer.len = MAX_DTV_STATS * sizeof(u32);
len = tvp->u.buffer.len;
break; break;
case DTV_STAT_PRE_TOTAL_BIT_COUNT: case DTV_STAT_PRE_TOTAL_BIT_COUNT:
tvp->u.st = c->pre_bit_count; tvp->u.st = c->pre_bit_count;
if (tvp->u.buffer.len > MAX_DTV_STATS * sizeof(u32))
tvp->u.buffer.len = MAX_DTV_STATS * sizeof(u32);
len = tvp->u.buffer.len;
break; break;
case DTV_STAT_POST_ERROR_BIT_COUNT: case DTV_STAT_POST_ERROR_BIT_COUNT:
tvp->u.st = c->post_bit_error; tvp->u.st = c->post_bit_error;
if (tvp->u.buffer.len > MAX_DTV_STATS * sizeof(u32))
tvp->u.buffer.len = MAX_DTV_STATS * sizeof(u32);
len = tvp->u.buffer.len;
break; break;
case DTV_STAT_POST_TOTAL_BIT_COUNT: case DTV_STAT_POST_TOTAL_BIT_COUNT:
tvp->u.st = c->post_bit_count; tvp->u.st = c->post_bit_count;
if (tvp->u.buffer.len > MAX_DTV_STATS * sizeof(u32))
tvp->u.buffer.len = MAX_DTV_STATS * sizeof(u32);
len = tvp->u.buffer.len;
break; break;
case DTV_STAT_ERROR_BLOCK_COUNT: case DTV_STAT_ERROR_BLOCK_COUNT:
tvp->u.st = c->block_error; tvp->u.st = c->block_error;
if (tvp->u.buffer.len > MAX_DTV_STATS * sizeof(u32))
tvp->u.buffer.len = MAX_DTV_STATS * sizeof(u32);
len = tvp->u.buffer.len;
break; break;
case DTV_STAT_TOTAL_BLOCK_COUNT: case DTV_STAT_TOTAL_BLOCK_COUNT:
tvp->u.st = c->block_count; tvp->u.st = c->block_count;
if (tvp->u.buffer.len > MAX_DTV_STATS * sizeof(u32))
tvp->u.buffer.len = MAX_DTV_STATS * sizeof(u32);
len = tvp->u.buffer.len;
break; break;
default: default:
dev_dbg(fe->dvb->device, dev_dbg(fe->dvb->device,
@ -1561,18 +1578,13 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
return -EINVAL; return -EINVAL;
} }
if (!dtv_cmds[tvp->cmd].buffer) if (len < 1)
dev_dbg(fe->dvb->device, len = 1;
"%s: GET cmd 0x%08x (%s) = 0x%08x\n",
__func__, tvp->cmd, dtv_cmds[tvp->cmd].name, dev_dbg(fe->dvb->device,
tvp->u.data); "%s: GET cmd 0x%08x (%s) len %d: %*ph\n",
else __func__, tvp->cmd, dtv_cmd_name(tvp->cmd),
dev_dbg(fe->dvb->device, tvp->u.buffer.len, tvp->u.buffer.len, tvp->u.buffer.data);
"%s: GET cmd 0x%08x (%s) len %d: %*ph\n",
__func__,
tvp->cmd, dtv_cmds[tvp->cmd].name,
tvp->u.buffer.len,
tvp->u.buffer.len, tvp->u.buffer.data);
return 0; return 0;
} }
@ -1870,7 +1882,7 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
else else
dev_dbg(fe->dvb->device, dev_dbg(fe->dvb->device,
"%s: SET cmd 0x%08x (%s) to 0x%08x\n", "%s: SET cmd 0x%08x (%s) to 0x%08x\n",
__func__, cmd, dtv_cmds[cmd].name, data); __func__, cmd, dtv_cmd_name(cmd), data);
switch (cmd) { switch (cmd) {
case DTV_CLEAR: case DTV_CLEAR:
/* /*

View File

@ -45,6 +45,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/nospec.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/dvb/net.h> #include <linux/dvb/net.h>
#include <linux/uio.h> #include <linux/uio.h>
@ -1462,14 +1463,20 @@ static int dvb_net_do_ioctl(struct file *file,
struct net_device *netdev; struct net_device *netdev;
struct dvb_net_priv *priv_data; struct dvb_net_priv *priv_data;
struct dvb_net_if *dvbnetif = parg; struct dvb_net_if *dvbnetif = parg;
int if_num = dvbnetif->if_num;
if (dvbnetif->if_num >= DVB_NET_DEVICES_MAX || if (if_num >= DVB_NET_DEVICES_MAX) {
!dvbnet->state[dvbnetif->if_num]) { ret = -EINVAL;
goto ioctl_error;
}
if_num = array_index_nospec(if_num, DVB_NET_DEVICES_MAX);
if (!dvbnet->state[if_num]) {
ret = -EINVAL; ret = -EINVAL;
goto ioctl_error; goto ioctl_error;
} }
netdev = dvbnet->device[dvbnetif->if_num]; netdev = dvbnet->device[if_num];
priv_data = netdev_priv(netdev); priv_data = netdev_priv(netdev);
dvbnetif->pid=priv_data->pid; dvbnetif->pid=priv_data->pid;
@ -1522,14 +1529,20 @@ static int dvb_net_do_ioctl(struct file *file,
struct net_device *netdev; struct net_device *netdev;
struct dvb_net_priv *priv_data; struct dvb_net_priv *priv_data;
struct __dvb_net_if_old *dvbnetif = parg; struct __dvb_net_if_old *dvbnetif = parg;
int if_num = dvbnetif->if_num;
if (dvbnetif->if_num >= DVB_NET_DEVICES_MAX || if (if_num >= DVB_NET_DEVICES_MAX) {
!dvbnet->state[dvbnetif->if_num]) { ret = -EINVAL;
goto ioctl_error;
}
if_num = array_index_nospec(if_num, DVB_NET_DEVICES_MAX);
if (!dvbnet->state[if_num]) {
ret = -EINVAL; ret = -EINVAL;
goto ioctl_error; goto ioctl_error;
} }
netdev = dvbnet->device[dvbnetif->if_num]; netdev = dvbnet->device[if_num];
priv_data = netdev_priv(netdev); priv_data = netdev_priv(netdev);
dvbnetif->pid=priv_data->pid; dvbnetif->pid=priv_data->pid;

View File

@ -506,6 +506,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
break; break;
if (minor == MAX_DVB_MINORS) { if (minor == MAX_DVB_MINORS) {
list_del (&dvbdev->list_head);
kfree(dvbdevfops); kfree(dvbdevfops);
kfree(dvbdev); kfree(dvbdev);
up_write(&minor_rwsem); up_write(&minor_rwsem);
@ -526,6 +527,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
__func__); __func__);
dvb_media_device_free(dvbdev); dvb_media_device_free(dvbdev);
list_del (&dvbdev->list_head);
kfree(dvbdevfops); kfree(dvbdevfops);
kfree(dvbdev); kfree(dvbdev);
mutex_unlock(&dvbdev_register_lock); mutex_unlock(&dvbdev_register_lock);
@ -541,6 +543,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
pr_err("%s: failed to create device dvb%d.%s%d (%ld)\n", pr_err("%s: failed to create device dvb%d.%s%d (%ld)\n",
__func__, adap->num, dnames[type], id, PTR_ERR(clsdev)); __func__, adap->num, dnames[type], id, PTR_ERR(clsdev));
dvb_media_device_free(dvbdev); dvb_media_device_free(dvbdev);
list_del (&dvbdev->list_head);
kfree(dvbdevfops); kfree(dvbdevfops);
kfree(dvbdev); kfree(dvbdev);
return PTR_ERR(clsdev); return PTR_ERR(clsdev);

View File

@ -323,18 +323,6 @@ config DVB_TDA10071
comment "DVB-T (terrestrial) frontends" comment "DVB-T (terrestrial) frontends"
depends on DVB_CORE depends on DVB_CORE
config DVB_SP8870
tristate "Spase sp8870 based"
depends on DVB_CORE && I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
help
A DVB-T tuner module. Say Y when you want to support this frontend.
This driver needs external firmware. Please use the command
"<kerneldir>/scripts/get_dvb_firmware sp8870" to
download/extract it, and then copy it to /usr/lib/hotplug/firmware
or /lib/firmware (depending on configuration of firmware hotplug).
config DVB_SP887X config DVB_SP887X
tristate "Spase sp887x based" tristate "Spase sp887x based"
depends on DVB_CORE && I2C depends on DVB_CORE && I2C

View File

@ -20,7 +20,6 @@ obj-$(CONFIG_DVB_PLL) += dvb-pll.o
obj-$(CONFIG_DVB_STV0299) += stv0299.o obj-$(CONFIG_DVB_STV0299) += stv0299.o
obj-$(CONFIG_DVB_STB0899) += stb0899.o obj-$(CONFIG_DVB_STB0899) += stb0899.o
obj-$(CONFIG_DVB_STB6100) += stb6100.o obj-$(CONFIG_DVB_STB6100) += stb6100.o
obj-$(CONFIG_DVB_SP8870) += sp8870.o
obj-$(CONFIG_DVB_CX22700) += cx22700.o obj-$(CONFIG_DVB_CX22700) += cx22700.o
obj-$(CONFIG_DVB_S5H1432) += s5h1432.o obj-$(CONFIG_DVB_S5H1432) += s5h1432.o
obj-$(CONFIG_DVB_CX24110) += cx24110.o obj-$(CONFIG_DVB_CX24110) += cx24110.o

View File

@ -75,9 +75,9 @@ TYPEDEFS
u16 result_len; u16 result_len;
/*< result length in byte */ /*< result length in byte */
u16 *parameter; u16 *parameter;
/*< General purpous param */ /*< General purpose param */
u16 *result; u16 *result;
/*< General purpous param */}; /*< General purpose param */};
/*============================================================================*/ /*============================================================================*/
/*============================================================================*/ /*============================================================================*/
@ -131,7 +131,7 @@ TYPEDEFS
DRXJ_CFG_MAX /* dummy, never to be used */}; DRXJ_CFG_MAX /* dummy, never to be used */};
/* /*
* /struct enum drxj_cfg_smart_ant_io * smart antenna i/o. * /enum drxj_cfg_smart_ant_io * smart antenna i/o.
*/ */
enum drxj_cfg_smart_ant_io { enum drxj_cfg_smart_ant_io {
DRXJ_SMT_ANT_OUTPUT = 0, DRXJ_SMT_ANT_OUTPUT = 0,
@ -139,7 +139,7 @@ enum drxj_cfg_smart_ant_io {
}; };
/* /*
* /struct struct drxj_cfg_smart_ant * Set smart antenna. * /struct drxj_cfg_smart_ant * Set smart antenna.
*/ */
struct drxj_cfg_smart_ant { struct drxj_cfg_smart_ant {
enum drxj_cfg_smart_ant_io io; enum drxj_cfg_smart_ant_io io;
@ -159,7 +159,7 @@ struct drxj_agc_status {
/* DRXJ_CFG_AGC_RF, DRXJ_CFG_AGC_IF */ /* DRXJ_CFG_AGC_RF, DRXJ_CFG_AGC_IF */
/* /*
* /struct enum drxj_agc_ctrl_mode * Available AGCs modes in the DRXJ. * /enum drxj_agc_ctrl_mode * Available AGCs modes in the DRXJ.
*/ */
enum drxj_agc_ctrl_mode { enum drxj_agc_ctrl_mode {
DRX_AGC_CTRL_AUTO = 0, DRX_AGC_CTRL_AUTO = 0,
@ -167,7 +167,7 @@ struct drxj_agc_status {
DRX_AGC_CTRL_OFF}; DRX_AGC_CTRL_OFF};
/* /*
* /struct struct drxj_cfg_agc * Generic interface for all AGCs present on the DRXJ. * /struct drxj_cfg_agc * Generic interface for all AGCs present on the DRXJ.
*/ */
struct drxj_cfg_agc { struct drxj_cfg_agc {
enum drx_standard standard; /* standard for which these settings apply */ enum drx_standard standard; /* standard for which these settings apply */
@ -183,7 +183,7 @@ struct drxj_agc_status {
/* DRXJ_CFG_PRE_SAW */ /* DRXJ_CFG_PRE_SAW */
/* /*
* /struct struct drxj_cfg_pre_saw * Interface to configure pre SAW sense. * /struct drxj_cfg_pre_saw * Interface to configure pre SAW sense.
*/ */
struct drxj_cfg_pre_saw { struct drxj_cfg_pre_saw {
enum drx_standard standard; /* standard to which these settings apply */ enum drx_standard standard; /* standard to which these settings apply */
@ -193,7 +193,7 @@ struct drxj_agc_status {
/* DRXJ_CFG_AFE_GAIN */ /* DRXJ_CFG_AFE_GAIN */
/* /*
* /struct struct drxj_cfg_afe_gain * Interface to configure gain of AFE (LNA + PGA). * /struct drxj_cfg_afe_gain * Interface to configure gain of AFE (LNA + PGA).
*/ */
struct drxj_cfg_afe_gain { struct drxj_cfg_afe_gain {
enum drx_standard standard; /* standard to which these settings apply */ enum drx_standard standard; /* standard to which these settings apply */
@ -220,14 +220,14 @@ struct drxj_agc_status {
}; };
/* /*
* /struct struct drxj_cfg_vsb_misc * symbol error rate * /struct drxj_cfg_vsb_misc * symbol error rate
*/ */
struct drxj_cfg_vsb_misc { struct drxj_cfg_vsb_misc {
u32 symb_error; u32 symb_error;
/*< symbol error rate sps */}; /*< symbol error rate sps */};
/* /*
* /enum enum drxj_mpeg_output_clock_rate * Mpeg output clock rate. * /enum drxj_mpeg_output_clock_rate * Mpeg output clock rate.
* *
*/ */
enum drxj_mpeg_start_width { enum drxj_mpeg_start_width {
@ -235,7 +235,7 @@ struct drxj_agc_status {
DRXJ_MPEG_START_WIDTH_8CLKCYC}; DRXJ_MPEG_START_WIDTH_8CLKCYC};
/* /*
* /enum enum drxj_mpeg_output_clock_rate * Mpeg output clock rate. * /enum drxj_mpeg_output_clock_rate * Mpeg output clock rate.
* *
*/ */
enum drxj_mpeg_output_clock_rate { enum drxj_mpeg_output_clock_rate {
@ -261,7 +261,7 @@ struct drxj_agc_status {
enum drxj_mpeg_start_width mpeg_start_width; /*< set MPEG output start width */}; enum drxj_mpeg_start_width mpeg_start_width; /*< set MPEG output start width */};
/* /*
* /enum enum drxj_xtal_freq * Supported external crystal reference frequency. * /enum drxj_xtal_freq * Supported external crystal reference frequency.
*/ */
enum drxj_xtal_freq { enum drxj_xtal_freq {
DRXJ_XTAL_FREQ_RSVD, DRXJ_XTAL_FREQ_RSVD,
@ -270,14 +270,15 @@ struct drxj_agc_status {
DRXJ_XTAL_FREQ_4MHZ}; DRXJ_XTAL_FREQ_4MHZ};
/* /*
* /enum enum drxj_xtal_freq * Supported external crystal reference frequency. * /enum drxj_xtal_freq * Supported external crystal reference frequency.
*/ */
enum drxji2c_speed { enum drxji2c_speed {
DRXJ_I2C_SPEED_400KBPS, DRXJ_I2C_SPEED_400KBPS,
DRXJ_I2C_SPEED_100KBPS}; DRXJ_I2C_SPEED_100KBPS};
/* /*
* /struct struct drxj_cfg_hw_cfg * Get hw configuration, such as crystal reference frequency, I2C speed, etc... * /struct drxj_cfg_hw_cfg * Get hw configuration, such as crystal
* reference frequency, I2C speed, etc...
*/ */
struct drxj_cfg_hw_cfg { struct drxj_cfg_hw_cfg {
enum drxj_xtal_freq xtal_freq; enum drxj_xtal_freq xtal_freq;
@ -364,7 +365,7 @@ struct drxj_cfg_oob_misc {
DRXJ_SIF_ATTENUATION_9DB}; DRXJ_SIF_ATTENUATION_9DB};
/* /*
* /struct struct drxj_cfg_atv_output * SIF attenuation setting. * /struct drxj_cfg_atv_output * SIF attenuation setting.
* *
*/ */
struct drxj_cfg_atv_output { struct drxj_cfg_atv_output {
@ -453,10 +454,10 @@ struct drxj_cfg_atv_output {
enum drxuio_mode uio_gpio_mode; /*< current mode of ASEL pin */ enum drxuio_mode uio_gpio_mode; /*< current mode of ASEL pin */
enum drxuio_mode uio_irqn_mode; /*< current mode of IRQN pin */ enum drxuio_mode uio_irqn_mode; /*< current mode of IRQN pin */
/* IQM fs frequecy shift and inversion */ /* IQM fs frequency shift and inversion */
u32 iqm_fs_rate_ofs; /*< frequency shifter setting after setchannel */ u32 iqm_fs_rate_ofs; /*< frequency shifter setting after setchannel */
bool pos_image; /*< True: positive image */ bool pos_image; /*< True: positive image */
/* IQM RC frequecy shift */ /* IQM RC frequency shift */
u32 iqm_rc_rate_ofs; /*< frequency shifter setting after setchannel */ u32 iqm_rc_rate_ofs; /*< frequency shifter setting after setchannel */
/* ATV configuration */ /* ATV configuration */

View File

@ -224,7 +224,9 @@ static int mxl692_validate_fw_header(struct mxl692_dev *dev,
u32 ix, temp; u32 ix, temp;
__be32 *local_buf = NULL; __be32 *local_buf = NULL;
u8 temp_cksum = 0; u8 temp_cksum = 0;
const u8 fw_hdr[] = { 0x4D, 0x31, 0x10, 0x02, 0x40, 0x00, 0x00, 0x80 }; static const u8 fw_hdr[] = {
0x4D, 0x31, 0x10, 0x02, 0x40, 0x00, 0x00, 0x80
};
if (memcmp(buffer, fw_hdr, 8) != 0) { if (memcmp(buffer, fw_hdr, 8) != 0) {
status = -EINVAL; status = -EINVAL;

View File

@ -1130,8 +1130,6 @@ static int rtl2832_sdr_g_fmt_sdr_cap(struct file *file, void *priv,
f->fmt.sdr.pixelformat = dev->pixelformat; f->fmt.sdr.pixelformat = dev->pixelformat;
f->fmt.sdr.buffersize = dev->buffersize; f->fmt.sdr.buffersize = dev->buffersize;
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
return 0; return 0;
} }
@ -1149,7 +1147,6 @@ static int rtl2832_sdr_s_fmt_sdr_cap(struct file *file, void *priv,
if (vb2_is_busy(q)) if (vb2_is_busy(q))
return -EBUSY; return -EBUSY;
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
for (i = 0; i < dev->num_formats; i++) { for (i = 0; i < dev->num_formats; i++) {
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) { if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
dev->pixelformat = formats[i].pixelformat; dev->pixelformat = formats[i].pixelformat;
@ -1177,7 +1174,6 @@ static int rtl2832_sdr_try_fmt_sdr_cap(struct file *file, void *priv,
dev_dbg(&pdev->dev, "pixelformat fourcc %4.4s\n", dev_dbg(&pdev->dev, "pixelformat fourcc %4.4s\n",
(char *)&f->fmt.sdr.pixelformat); (char *)&f->fmt.sdr.pixelformat);
memset(f->fmt.sdr.reserved, 0, sizeof(f->fmt.sdr.reserved));
for (i = 0; i < dev->num_formats; i++) { for (i = 0; i < dev->num_formats; i++) {
if (formats[i].pixelformat == f->fmt.sdr.pixelformat) { if (formats[i].pixelformat == f->fmt.sdr.pixelformat) {
f->fmt.sdr.buffersize = formats[i].buffersize; f->fmt.sdr.buffersize = formats[i].buffersize;

View File

@ -217,6 +217,7 @@ config VIDEO_ADV7180
depends on GPIOLIB && VIDEO_V4L2 && I2C depends on GPIOLIB && VIDEO_V4L2 && I2C
select MEDIA_CONTROLLER select MEDIA_CONTROLLER
select VIDEO_V4L2_SUBDEV_API select VIDEO_V4L2_SUBDEV_API
select V4L2_ASYNC
help help
Support for the Analog Devices ADV7180 video decoder. Support for the Analog Devices ADV7180 video decoder.
@ -534,6 +535,7 @@ config VIDEO_ADV7175
config VIDEO_ADV7343 config VIDEO_ADV7343
tristate "ADV7343 video encoder" tristate "ADV7343 video encoder"
depends on I2C depends on I2C
select V4L2_ASYNC
help help
Support for Analog Devices I2C bus based ADV7343 encoder. Support for Analog Devices I2C bus based ADV7343 encoder.
@ -652,6 +654,7 @@ config SDR_MAX2175
tristate "Maxim 2175 RF to Bits tuner" tristate "Maxim 2175 RF to Bits tuner"
depends on VIDEO_V4L2 && MEDIA_SDR_SUPPORT && I2C depends on VIDEO_V4L2 && MEDIA_SDR_SUPPORT && I2C
select REGMAP_I2C select REGMAP_I2C
select V4L2_ASYNC
help help
Support for Maxim 2175 tuner. It is an advanced analog/digital Support for Maxim 2175 tuner. It is an advanced analog/digital
radio receiver with RF-to-Bits front-end designed for SDR solutions. radio receiver with RF-to-Bits front-end designed for SDR solutions.
@ -668,6 +671,7 @@ menu "Miscellaneous helper chips"
config VIDEO_THS7303 config VIDEO_THS7303
tristate "THS7303/53 Video Amplifier" tristate "THS7303/53 Video Amplifier"
depends on VIDEO_V4L2 && I2C depends on VIDEO_V4L2 && I2C
select V4L2_ASYNC
help help
Support for TI THS7303/53 video amplifier Support for TI THS7303/53 video amplifier
@ -738,6 +742,17 @@ config VIDEO_HI556
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called hi556. module will be called hi556.
config VIDEO_IMX208
tristate "Sony IMX208 sensor support"
depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
depends on MEDIA_CAMERA_SUPPORT
help
This is a Video4Linux2 sensor driver for the Sony
IMX208 camera.
To compile this driver as a module, choose M here: the
module will be called imx208.
config VIDEO_IMX214 config VIDEO_IMX214
tristate "Sony IMX214 sensor support" tristate "Sony IMX214 sensor support"
depends on GPIOLIB && I2C && VIDEO_V4L2 depends on GPIOLIB && I2C && VIDEO_V4L2
@ -1341,6 +1356,7 @@ config VIDEO_AD5820
tristate "AD5820 lens voice coil support" tristate "AD5820 lens voice coil support"
depends on GPIOLIB && I2C && VIDEO_V4L2 depends on GPIOLIB && I2C && VIDEO_V4L2
select MEDIA_CONTROLLER select MEDIA_CONTROLLER
select V4L2_ASYNC
help help
This is a driver for the AD5820 camera lens voice coil. This is a driver for the AD5820 camera lens voice coil.
It is used for example in Nokia N900 (RX-51). It is used for example in Nokia N900 (RX-51).
@ -1350,6 +1366,7 @@ config VIDEO_AK7375
depends on I2C && VIDEO_V4L2 depends on I2C && VIDEO_V4L2
select MEDIA_CONTROLLER select MEDIA_CONTROLLER
select VIDEO_V4L2_SUBDEV_API select VIDEO_V4L2_SUBDEV_API
select V4L2_ASYNC
help help
This is a driver for the AK7375 camera lens voice coil. This is a driver for the AK7375 camera lens voice coil.
AK7375 is a 12 bit DAC with 120mA output current sink AK7375 is a 12 bit DAC with 120mA output current sink
@ -1361,6 +1378,7 @@ config VIDEO_DW9714
depends on I2C && VIDEO_V4L2 depends on I2C && VIDEO_V4L2
select MEDIA_CONTROLLER select MEDIA_CONTROLLER
select VIDEO_V4L2_SUBDEV_API select VIDEO_V4L2_SUBDEV_API
select V4L2_ASYNC
help help
This is a driver for the DW9714 camera lens voice coil. This is a driver for the DW9714 camera lens voice coil.
DW9714 is a 10 bit DAC with 120mA output current sink DW9714 is a 10 bit DAC with 120mA output current sink
@ -1384,6 +1402,7 @@ config VIDEO_DW9807_VCM
depends on I2C && VIDEO_V4L2 depends on I2C && VIDEO_V4L2
select MEDIA_CONTROLLER select MEDIA_CONTROLLER
select VIDEO_V4L2_SUBDEV_API select VIDEO_V4L2_SUBDEV_API
select V4L2_ASYNC
help help
This is a driver for the DW9807 camera lens voice coil. This is a driver for the DW9807 camera lens voice coil.
DW9807 is a 10 bit DAC with 100mA output current sink DW9807 is a 10 bit DAC with 100mA output current sink
@ -1399,6 +1418,7 @@ config VIDEO_ADP1653
tristate "ADP1653 flash support" tristate "ADP1653 flash support"
depends on I2C && VIDEO_V4L2 depends on I2C && VIDEO_V4L2
select MEDIA_CONTROLLER select MEDIA_CONTROLLER
select V4L2_ASYNC
help help
This is a driver for the ADP1653 flash controller. It is used for This is a driver for the ADP1653 flash controller. It is used for
example in Nokia N900. example in Nokia N900.
@ -1408,6 +1428,7 @@ config VIDEO_LM3560
depends on I2C && VIDEO_V4L2 depends on I2C && VIDEO_V4L2
select MEDIA_CONTROLLER select MEDIA_CONTROLLER
select REGMAP_I2C select REGMAP_I2C
select V4L2_ASYNC
help help
This is a driver for the lm3560 dual flash controllers. It controls This is a driver for the lm3560 dual flash controllers. It controls
flash, torch LEDs. flash, torch LEDs.
@ -1417,6 +1438,7 @@ config VIDEO_LM3646
depends on I2C && VIDEO_V4L2 depends on I2C && VIDEO_V4L2
select MEDIA_CONTROLLER select MEDIA_CONTROLLER
select REGMAP_I2C select REGMAP_I2C
select V4L2_ASYNC
help help
This is a driver for the lm3646 dual flash controllers. It controls This is a driver for the lm3646 dual flash controllers. It controls
flash, torch LEDs. flash, torch LEDs.

View File

@ -116,6 +116,7 @@ obj-$(CONFIG_VIDEO_ML86V7667) += ml86v7667.o
obj-$(CONFIG_VIDEO_OV2659) += ov2659.o obj-$(CONFIG_VIDEO_OV2659) += ov2659.o
obj-$(CONFIG_VIDEO_TC358743) += tc358743.o obj-$(CONFIG_VIDEO_TC358743) += tc358743.o
obj-$(CONFIG_VIDEO_HI556) += hi556.o obj-$(CONFIG_VIDEO_HI556) += hi556.o
obj-$(CONFIG_VIDEO_IMX208) += imx208.o
obj-$(CONFIG_VIDEO_IMX214) += imx214.o obj-$(CONFIG_VIDEO_IMX214) += imx214.o
obj-$(CONFIG_VIDEO_IMX219) += imx219.o obj-$(CONFIG_VIDEO_IMX219) += imx219.o
obj-$(CONFIG_VIDEO_IMX258) += imx258.o obj-$(CONFIG_VIDEO_IMX258) += imx258.o

View File

@ -250,7 +250,7 @@ static int adv7170_s_routing(struct v4l2_subdev *sd,
} }
static int adv7170_enum_mbus_code(struct v4l2_subdev *sd, static int adv7170_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->pad || code->index >= ARRAY_SIZE(adv7170_codes)) if (code->pad || code->index >= ARRAY_SIZE(adv7170_codes))
@ -261,7 +261,7 @@ static int adv7170_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int adv7170_get_fmt(struct v4l2_subdev *sd, static int adv7170_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct v4l2_mbus_framefmt *mf = &format->format; struct v4l2_mbus_framefmt *mf = &format->format;
@ -284,7 +284,7 @@ static int adv7170_get_fmt(struct v4l2_subdev *sd,
} }
static int adv7170_set_fmt(struct v4l2_subdev *sd, static int adv7170_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct v4l2_mbus_framefmt *mf = &format->format; struct v4l2_mbus_framefmt *mf = &format->format;

View File

@ -288,7 +288,7 @@ static int adv7175_s_routing(struct v4l2_subdev *sd,
} }
static int adv7175_enum_mbus_code(struct v4l2_subdev *sd, static int adv7175_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->pad || code->index >= ARRAY_SIZE(adv7175_codes)) if (code->pad || code->index >= ARRAY_SIZE(adv7175_codes))
@ -299,7 +299,7 @@ static int adv7175_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int adv7175_get_fmt(struct v4l2_subdev *sd, static int adv7175_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct v4l2_mbus_framefmt *mf = &format->format; struct v4l2_mbus_framefmt *mf = &format->format;
@ -322,7 +322,7 @@ static int adv7175_get_fmt(struct v4l2_subdev *sd,
} }
static int adv7175_set_fmt(struct v4l2_subdev *sd, static int adv7175_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct v4l2_mbus_framefmt *mf = &format->format; struct v4l2_mbus_framefmt *mf = &format->format;

View File

@ -633,7 +633,7 @@ static void adv7180_exit_controls(struct adv7180_state *state)
} }
static int adv7180_enum_mbus_code(struct v4l2_subdev *sd, static int adv7180_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->index != 0) if (code->index != 0)
@ -699,13 +699,13 @@ static int adv7180_set_field_mode(struct adv7180_state *state)
} }
static int adv7180_get_pad_format(struct v4l2_subdev *sd, static int adv7180_get_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv7180_state *state = to_state(sd); struct adv7180_state *state = to_state(sd);
if (format->which == V4L2_SUBDEV_FORMAT_TRY) { if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
format->format = *v4l2_subdev_get_try_format(sd, cfg, 0); format->format = *v4l2_subdev_get_try_format(sd, sd_state, 0);
} else { } else {
adv7180_mbus_fmt(sd, &format->format); adv7180_mbus_fmt(sd, &format->format);
format->format.field = state->field; format->format.field = state->field;
@ -715,7 +715,7 @@ static int adv7180_get_pad_format(struct v4l2_subdev *sd,
} }
static int adv7180_set_pad_format(struct v4l2_subdev *sd, static int adv7180_set_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv7180_state *state = to_state(sd); struct adv7180_state *state = to_state(sd);
@ -742,7 +742,7 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
adv7180_set_power(state, true); adv7180_set_power(state, true);
} }
} else { } else {
framefmt = v4l2_subdev_get_try_format(sd, cfg, 0); framefmt = v4l2_subdev_get_try_format(sd, sd_state, 0);
*framefmt = format->format; *framefmt = format->format;
} }
@ -750,14 +750,14 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
} }
static int adv7180_init_cfg(struct v4l2_subdev *sd, static int adv7180_init_cfg(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg) struct v4l2_subdev_state *sd_state)
{ {
struct v4l2_subdev_format fmt = { struct v4l2_subdev_format fmt = {
.which = cfg ? V4L2_SUBDEV_FORMAT_TRY .which = sd_state ? V4L2_SUBDEV_FORMAT_TRY
: V4L2_SUBDEV_FORMAT_ACTIVE, : V4L2_SUBDEV_FORMAT_ACTIVE,
}; };
return adv7180_set_pad_format(sd, cfg, &fmt); return adv7180_set_pad_format(sd, sd_state, &fmt);
} }
static int adv7180_get_mbus_config(struct v4l2_subdev *sd, static int adv7180_get_mbus_config(struct v4l2_subdev *sd,

View File

@ -409,7 +409,7 @@ static int adv7183_g_input_status(struct v4l2_subdev *sd, u32 *status)
} }
static int adv7183_enum_mbus_code(struct v4l2_subdev *sd, static int adv7183_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->pad || code->index > 0) if (code->pad || code->index > 0)
@ -420,7 +420,7 @@ static int adv7183_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int adv7183_set_fmt(struct v4l2_subdev *sd, static int adv7183_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv7183 *decoder = to_adv7183(sd); struct adv7183 *decoder = to_adv7183(sd);
@ -443,12 +443,12 @@ static int adv7183_set_fmt(struct v4l2_subdev *sd,
if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE)
decoder->fmt = *fmt; decoder->fmt = *fmt;
else else
cfg->try_fmt = *fmt; sd_state->pads->try_fmt = *fmt;
return 0; return 0;
} }
static int adv7183_get_fmt(struct v4l2_subdev *sd, static int adv7183_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv7183 *decoder = to_adv7183(sd); struct adv7183 *decoder = to_adv7183(sd);

View File

@ -331,7 +331,7 @@ static int adv748x_afe_propagate_pixelrate(struct adv748x_afe *afe)
} }
static int adv748x_afe_enum_mbus_code(struct v4l2_subdev *sd, static int adv748x_afe_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->index != 0) if (code->index != 0)
@ -343,7 +343,7 @@ static int adv748x_afe_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int adv748x_afe_get_format(struct v4l2_subdev *sd, static int adv748x_afe_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *sdformat) struct v4l2_subdev_format *sdformat)
{ {
struct adv748x_afe *afe = adv748x_sd_to_afe(sd); struct adv748x_afe *afe = adv748x_sd_to_afe(sd);
@ -354,7 +354,8 @@ static int adv748x_afe_get_format(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
if (sdformat->which == V4L2_SUBDEV_FORMAT_TRY) { if (sdformat->which == V4L2_SUBDEV_FORMAT_TRY) {
mbusformat = v4l2_subdev_get_try_format(sd, cfg, sdformat->pad); mbusformat = v4l2_subdev_get_try_format(sd, sd_state,
sdformat->pad);
sdformat->format = *mbusformat; sdformat->format = *mbusformat;
} else { } else {
adv748x_afe_fill_format(afe, &sdformat->format); adv748x_afe_fill_format(afe, &sdformat->format);
@ -365,7 +366,7 @@ static int adv748x_afe_get_format(struct v4l2_subdev *sd,
} }
static int adv748x_afe_set_format(struct v4l2_subdev *sd, static int adv748x_afe_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *sdformat) struct v4l2_subdev_format *sdformat)
{ {
struct v4l2_mbus_framefmt *mbusformat; struct v4l2_mbus_framefmt *mbusformat;
@ -375,9 +376,9 @@ static int adv748x_afe_set_format(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
if (sdformat->which == V4L2_SUBDEV_FORMAT_ACTIVE) if (sdformat->which == V4L2_SUBDEV_FORMAT_ACTIVE)
return adv748x_afe_get_format(sd, cfg, sdformat); return adv748x_afe_get_format(sd, sd_state, sdformat);
mbusformat = v4l2_subdev_get_try_format(sd, cfg, sdformat->pad); mbusformat = v4l2_subdev_get_try_format(sd, sd_state, sdformat->pad);
*mbusformat = sdformat->format; *mbusformat = sdformat->format;
return 0; return 0;

View File

@ -141,26 +141,26 @@ static const struct v4l2_subdev_video_ops adv748x_csi2_video_ops = {
static struct v4l2_mbus_framefmt * static struct v4l2_mbus_framefmt *
adv748x_csi2_get_pad_format(struct v4l2_subdev *sd, adv748x_csi2_get_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
unsigned int pad, u32 which) unsigned int pad, u32 which)
{ {
struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
if (which == V4L2_SUBDEV_FORMAT_TRY) if (which == V4L2_SUBDEV_FORMAT_TRY)
return v4l2_subdev_get_try_format(sd, cfg, pad); return v4l2_subdev_get_try_format(sd, sd_state, pad);
return &tx->format; return &tx->format;
} }
static int adv748x_csi2_get_format(struct v4l2_subdev *sd, static int adv748x_csi2_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *sdformat) struct v4l2_subdev_format *sdformat)
{ {
struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
struct adv748x_state *state = tx->state; struct adv748x_state *state = tx->state;
struct v4l2_mbus_framefmt *mbusformat; struct v4l2_mbus_framefmt *mbusformat;
mbusformat = adv748x_csi2_get_pad_format(sd, cfg, sdformat->pad, mbusformat = adv748x_csi2_get_pad_format(sd, sd_state, sdformat->pad,
sdformat->which); sdformat->which);
if (!mbusformat) if (!mbusformat)
return -EINVAL; return -EINVAL;
@ -175,7 +175,7 @@ static int adv748x_csi2_get_format(struct v4l2_subdev *sd,
} }
static int adv748x_csi2_set_format(struct v4l2_subdev *sd, static int adv748x_csi2_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *sdformat) struct v4l2_subdev_format *sdformat)
{ {
struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd); struct adv748x_csi2 *tx = adv748x_sd_to_csi2(sd);
@ -183,7 +183,7 @@ static int adv748x_csi2_set_format(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *mbusformat; struct v4l2_mbus_framefmt *mbusformat;
int ret = 0; int ret = 0;
mbusformat = adv748x_csi2_get_pad_format(sd, cfg, sdformat->pad, mbusformat = adv748x_csi2_get_pad_format(sd, sd_state, sdformat->pad,
sdformat->which); sdformat->which);
if (!mbusformat) if (!mbusformat)
return -EINVAL; return -EINVAL;
@ -193,7 +193,7 @@ static int adv748x_csi2_set_format(struct v4l2_subdev *sd,
if (sdformat->pad == ADV748X_CSI2_SOURCE) { if (sdformat->pad == ADV748X_CSI2_SOURCE) {
const struct v4l2_mbus_framefmt *sink_fmt; const struct v4l2_mbus_framefmt *sink_fmt;
sink_fmt = adv748x_csi2_get_pad_format(sd, cfg, sink_fmt = adv748x_csi2_get_pad_format(sd, sd_state,
ADV748X_CSI2_SINK, ADV748X_CSI2_SINK,
sdformat->which); sdformat->which);

View File

@ -409,7 +409,7 @@ static int adv748x_hdmi_propagate_pixelrate(struct adv748x_hdmi *hdmi)
} }
static int adv748x_hdmi_enum_mbus_code(struct v4l2_subdev *sd, static int adv748x_hdmi_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->index != 0) if (code->index != 0)
@ -421,7 +421,7 @@ static int adv748x_hdmi_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int adv748x_hdmi_get_format(struct v4l2_subdev *sd, static int adv748x_hdmi_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *sdformat) struct v4l2_subdev_format *sdformat)
{ {
struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd); struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd);
@ -431,7 +431,8 @@ static int adv748x_hdmi_get_format(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
if (sdformat->which == V4L2_SUBDEV_FORMAT_TRY) { if (sdformat->which == V4L2_SUBDEV_FORMAT_TRY) {
mbusformat = v4l2_subdev_get_try_format(sd, cfg, sdformat->pad); mbusformat = v4l2_subdev_get_try_format(sd, sd_state,
sdformat->pad);
sdformat->format = *mbusformat; sdformat->format = *mbusformat;
} else { } else {
adv748x_hdmi_fill_format(hdmi, &sdformat->format); adv748x_hdmi_fill_format(hdmi, &sdformat->format);
@ -442,7 +443,7 @@ static int adv748x_hdmi_get_format(struct v4l2_subdev *sd,
} }
static int adv748x_hdmi_set_format(struct v4l2_subdev *sd, static int adv748x_hdmi_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *sdformat) struct v4l2_subdev_format *sdformat)
{ {
struct v4l2_mbus_framefmt *mbusformat; struct v4l2_mbus_framefmt *mbusformat;
@ -451,9 +452,9 @@ static int adv748x_hdmi_set_format(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
if (sdformat->which == V4L2_SUBDEV_FORMAT_ACTIVE) if (sdformat->which == V4L2_SUBDEV_FORMAT_ACTIVE)
return adv748x_hdmi_get_format(sd, cfg, sdformat); return adv748x_hdmi_get_format(sd, sd_state, sdformat);
mbusformat = v4l2_subdev_get_try_format(sd, cfg, sdformat->pad); mbusformat = v4l2_subdev_get_try_format(sd, sd_state, sdformat->pad);
*mbusformat = sdformat->format; *mbusformat = sdformat->format;
return 0; return 0;

View File

@ -1216,7 +1216,7 @@ static int adv7511_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
} }
static int adv7511_enum_mbus_code(struct v4l2_subdev *sd, static int adv7511_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->pad != 0) if (code->pad != 0)
@ -1247,7 +1247,7 @@ static void adv7511_fill_format(struct adv7511_state *state,
} }
static int adv7511_get_fmt(struct v4l2_subdev *sd, static int adv7511_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv7511_state *state = get_adv7511_state(sd); struct adv7511_state *state = get_adv7511_state(sd);
@ -1261,7 +1261,7 @@ static int adv7511_get_fmt(struct v4l2_subdev *sd,
if (format->which == V4L2_SUBDEV_FORMAT_TRY) { if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *fmt; struct v4l2_mbus_framefmt *fmt;
fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); fmt = v4l2_subdev_get_try_format(sd, sd_state, format->pad);
format->format.code = fmt->code; format->format.code = fmt->code;
format->format.colorspace = fmt->colorspace; format->format.colorspace = fmt->colorspace;
format->format.ycbcr_enc = fmt->ycbcr_enc; format->format.ycbcr_enc = fmt->ycbcr_enc;
@ -1279,7 +1279,7 @@ static int adv7511_get_fmt(struct v4l2_subdev *sd,
} }
static int adv7511_set_fmt(struct v4l2_subdev *sd, static int adv7511_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv7511_state *state = get_adv7511_state(sd); struct adv7511_state *state = get_adv7511_state(sd);
@ -1316,7 +1316,7 @@ static int adv7511_set_fmt(struct v4l2_subdev *sd,
if (format->which == V4L2_SUBDEV_FORMAT_TRY) { if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *fmt; struct v4l2_mbus_framefmt *fmt;
fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); fmt = v4l2_subdev_get_try_format(sd, sd_state, format->pad);
fmt->code = format->format.code; fmt->code = format->format.code;
fmt->colorspace = format->format.colorspace; fmt->colorspace = format->format.colorspace;
fmt->ycbcr_enc = format->format.ycbcr_enc; fmt->ycbcr_enc = format->format.ycbcr_enc;

View File

@ -1833,7 +1833,7 @@ static int adv76xx_s_routing(struct v4l2_subdev *sd,
} }
static int adv76xx_enum_mbus_code(struct v4l2_subdev *sd, static int adv76xx_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
struct adv76xx_state *state = to_state(sd); struct adv76xx_state *state = to_state(sd);
@ -1913,7 +1913,7 @@ static void adv76xx_setup_format(struct adv76xx_state *state)
} }
static int adv76xx_get_format(struct v4l2_subdev *sd, static int adv76xx_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv76xx_state *state = to_state(sd); struct adv76xx_state *state = to_state(sd);
@ -1926,7 +1926,7 @@ static int adv76xx_get_format(struct v4l2_subdev *sd,
if (format->which == V4L2_SUBDEV_FORMAT_TRY) { if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *fmt; struct v4l2_mbus_framefmt *fmt;
fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); fmt = v4l2_subdev_get_try_format(sd, sd_state, format->pad);
format->format.code = fmt->code; format->format.code = fmt->code;
} else { } else {
format->format.code = state->format->code; format->format.code = state->format->code;
@ -1936,7 +1936,7 @@ static int adv76xx_get_format(struct v4l2_subdev *sd,
} }
static int adv76xx_get_selection(struct v4l2_subdev *sd, static int adv76xx_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct adv76xx_state *state = to_state(sd); struct adv76xx_state *state = to_state(sd);
@ -1956,7 +1956,7 @@ static int adv76xx_get_selection(struct v4l2_subdev *sd,
} }
static int adv76xx_set_format(struct v4l2_subdev *sd, static int adv76xx_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv76xx_state *state = to_state(sd); struct adv76xx_state *state = to_state(sd);
@ -1975,7 +1975,7 @@ static int adv76xx_set_format(struct v4l2_subdev *sd,
if (format->which == V4L2_SUBDEV_FORMAT_TRY) { if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *fmt; struct v4l2_mbus_framefmt *fmt;
fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); fmt = v4l2_subdev_get_try_format(sd, sd_state, format->pad);
fmt->code = format->format.code; fmt->code = format->format.code;
} else { } else {
state->format = info; state->format = info;

View File

@ -98,12 +98,12 @@ struct adv7842_state {
v4l2_std_id norm; v4l2_std_id norm;
struct { struct {
u8 edid[256]; u8 edid[512];
u32 blocks; u32 blocks;
u32 present; u32 present;
} hdmi_edid; } hdmi_edid;
struct { struct {
u8 edid[256]; u8 edid[128];
u32 blocks; u32 blocks;
u32 present; u32 present;
} vga_edid; } vga_edid;
@ -720,6 +720,9 @@ static int edid_write_vga_segment(struct v4l2_subdev *sd)
v4l2_dbg(2, debug, sd, "%s: write EDID on VGA port\n", __func__); v4l2_dbg(2, debug, sd, "%s: write EDID on VGA port\n", __func__);
if (!state->vga_edid.present)
return 0;
/* HPA disable on port A and B */ /* HPA disable on port A and B */
io_write_and_or(sd, 0x20, 0xcf, 0x00); io_write_and_or(sd, 0x20, 0xcf, 0x00);
@ -763,7 +766,7 @@ static int edid_write_hdmi_segment(struct v4l2_subdev *sd, u8 port)
struct adv7842_state *state = to_state(sd); struct adv7842_state *state = to_state(sd);
const u8 *edid = state->hdmi_edid.edid; const u8 *edid = state->hdmi_edid.edid;
u32 blocks = state->hdmi_edid.blocks; u32 blocks = state->hdmi_edid.blocks;
int spa_loc; unsigned int spa_loc;
u16 pa, parent_pa; u16 pa, parent_pa;
int err = 0; int err = 0;
int i; int i;
@ -796,12 +799,14 @@ static int edid_write_hdmi_segment(struct v4l2_subdev *sd, u8 port)
pa = (edid[spa_loc] << 8) | edid[spa_loc + 1]; pa = (edid[spa_loc] << 8) | edid[spa_loc + 1];
} }
/* edid segment pointer '0' for HDMI ports */
rep_write_and_or(sd, 0x77, 0xef, 0x00);
for (i = 0; !err && i < blocks * 128; i += I2C_SMBUS_BLOCK_MAX) for (i = 0; !err && i < blocks * 128; i += I2C_SMBUS_BLOCK_MAX) {
/* set edid segment pointer for HDMI ports */
if (i % 256 == 0)
rep_write_and_or(sd, 0x77, 0xef, i >= 256 ? 0x10 : 0x00);
err = i2c_smbus_write_i2c_block_data(state->i2c_edid, i, err = i2c_smbus_write_i2c_block_data(state->i2c_edid, i,
I2C_SMBUS_BLOCK_MAX, edid + i); I2C_SMBUS_BLOCK_MAX, edid + i);
}
if (err) if (err)
return err; return err;
@ -1988,7 +1993,7 @@ static int adv7842_s_routing(struct v4l2_subdev *sd,
} }
static int adv7842_enum_mbus_code(struct v4l2_subdev *sd, static int adv7842_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->index >= ARRAY_SIZE(adv7842_formats)) if (code->index >= ARRAY_SIZE(adv7842_formats))
@ -2064,7 +2069,7 @@ static void adv7842_setup_format(struct adv7842_state *state)
} }
static int adv7842_get_format(struct v4l2_subdev *sd, static int adv7842_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv7842_state *state = to_state(sd); struct adv7842_state *state = to_state(sd);
@ -2092,7 +2097,7 @@ static int adv7842_get_format(struct v4l2_subdev *sd,
if (format->which == V4L2_SUBDEV_FORMAT_TRY) { if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *fmt; struct v4l2_mbus_framefmt *fmt;
fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); fmt = v4l2_subdev_get_try_format(sd, sd_state, format->pad);
format->format.code = fmt->code; format->format.code = fmt->code;
} else { } else {
format->format.code = state->format->code; format->format.code = state->format->code;
@ -2102,7 +2107,7 @@ static int adv7842_get_format(struct v4l2_subdev *sd,
} }
static int adv7842_set_format(struct v4l2_subdev *sd, static int adv7842_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct adv7842_state *state = to_state(sd); struct adv7842_state *state = to_state(sd);
@ -2112,7 +2117,7 @@ static int adv7842_set_format(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
if (state->mode == ADV7842_MODE_SDP) if (state->mode == ADV7842_MODE_SDP)
return adv7842_get_format(sd, cfg, format); return adv7842_get_format(sd, sd_state, format);
info = adv7842_format_info(state, format->format.code); info = adv7842_format_info(state, format->format.code);
if (info == NULL) if (info == NULL)
@ -2124,7 +2129,7 @@ static int adv7842_set_format(struct v4l2_subdev *sd,
if (format->which == V4L2_SUBDEV_FORMAT_TRY) { if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *fmt; struct v4l2_mbus_framefmt *fmt;
fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); fmt = v4l2_subdev_get_try_format(sd, sd_state, format->pad);
fmt->code = format->format.code; fmt->code = format->format.code;
} else { } else {
state->format = info; state->format = info;
@ -2491,9 +2496,17 @@ static int adv7842_get_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
return 0; return 0;
} }
/*
* If the VGA_EDID_ENABLE bit is set (Repeater Map 0x7f, bit 7), then
* the first two blocks of the EDID are for the HDMI, and the first block
* of segment 1 (i.e. the third block of the EDID) is for VGA.
* So if a VGA EDID is installed, then the maximum size of the HDMI EDID
* is 2 blocks.
*/
static int adv7842_set_edid(struct v4l2_subdev *sd, struct v4l2_edid *e) static int adv7842_set_edid(struct v4l2_subdev *sd, struct v4l2_edid *e)
{ {
struct adv7842_state *state = to_state(sd); struct adv7842_state *state = to_state(sd);
unsigned int max_blocks = e->pad == ADV7842_EDID_PORT_VGA ? 1 : 4;
int err = 0; int err = 0;
memset(e->reserved, 0, sizeof(e->reserved)); memset(e->reserved, 0, sizeof(e->reserved));
@ -2502,8 +2515,12 @@ static int adv7842_set_edid(struct v4l2_subdev *sd, struct v4l2_edid *e)
return -EINVAL; return -EINVAL;
if (e->start_block != 0) if (e->start_block != 0)
return -EINVAL; return -EINVAL;
if (e->blocks > 2) { if (e->pad < ADV7842_EDID_PORT_VGA && state->vga_edid.blocks)
e->blocks = 2; max_blocks = 2;
if (e->pad == ADV7842_EDID_PORT_VGA && state->hdmi_edid.blocks > 2)
return -EBUSY;
if (e->blocks > max_blocks) {
e->blocks = max_blocks;
return -E2BIG; return -E2BIG;
} }
@ -2514,20 +2531,20 @@ static int adv7842_set_edid(struct v4l2_subdev *sd, struct v4l2_edid *e)
switch (e->pad) { switch (e->pad) {
case ADV7842_EDID_PORT_VGA: case ADV7842_EDID_PORT_VGA:
memset(&state->vga_edid.edid, 0, 256); memset(state->vga_edid.edid, 0, sizeof(state->vga_edid.edid));
state->vga_edid.blocks = e->blocks; state->vga_edid.blocks = e->blocks;
state->vga_edid.present = e->blocks ? 0x1 : 0x0; state->vga_edid.present = e->blocks ? 0x1 : 0x0;
if (e->blocks) if (e->blocks)
memcpy(&state->vga_edid.edid, e->edid, 128 * e->blocks); memcpy(state->vga_edid.edid, e->edid, 128);
err = edid_write_vga_segment(sd); err = edid_write_vga_segment(sd);
break; break;
case ADV7842_EDID_PORT_A: case ADV7842_EDID_PORT_A:
case ADV7842_EDID_PORT_B: case ADV7842_EDID_PORT_B:
memset(&state->hdmi_edid.edid, 0, 256); memset(state->hdmi_edid.edid, 0, sizeof(state->hdmi_edid.edid));
state->hdmi_edid.blocks = e->blocks; state->hdmi_edid.blocks = e->blocks;
if (e->blocks) { if (e->blocks) {
state->hdmi_edid.present |= 0x04 << e->pad; state->hdmi_edid.present |= 0x04 << e->pad;
memcpy(&state->hdmi_edid.edid, e->edid, 128 * e->blocks); memcpy(state->hdmi_edid.edid, e->edid, 128 * e->blocks);
} else { } else {
state->hdmi_edid.present &= ~(0x04 << e->pad); state->hdmi_edid.present &= ~(0x04 << e->pad);
adv7842_s_detect_tx_5v_ctrl(sd); adv7842_s_detect_tx_5v_ctrl(sd);

View File

@ -87,15 +87,7 @@ static const struct v4l2_ctrl_ops ak7375_vcm_ctrl_ops = {
static int ak7375_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int ak7375_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
int ret; return pm_runtime_resume_and_get(sd->dev);
ret = pm_runtime_get_sync(sd->dev);
if (ret < 0) {
pm_runtime_put_noidle(sd->dev);
return ret;
}
return 0;
} }
static int ak7375_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int ak7375_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)

View File

@ -91,7 +91,7 @@ static int ak881x_s_register(struct v4l2_subdev *sd,
#endif #endif
static int ak881x_fill_fmt(struct v4l2_subdev *sd, static int ak881x_fill_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct v4l2_mbus_framefmt *mf = &format->format; struct v4l2_mbus_framefmt *mf = &format->format;
@ -111,7 +111,7 @@ static int ak881x_fill_fmt(struct v4l2_subdev *sd,
} }
static int ak881x_enum_mbus_code(struct v4l2_subdev *sd, static int ak881x_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->pad || code->index) if (code->pad || code->index)
@ -122,7 +122,7 @@ static int ak881x_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int ak881x_get_selection(struct v4l2_subdev *sd, static int ak881x_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct i2c_client *client = v4l2_get_subdevdata(sd); struct i2c_client *client = v4l2_get_subdevdata(sd);

View File

@ -1880,21 +1880,33 @@ static int ccs_pm_get_init(struct ccs_sensor *sensor)
struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd);
int rval; int rval;
/*
* It can't use pm_runtime_resume_and_get() here, as the driver
* relies at the returned value to detect if the device was already
* active or not.
*/
rval = pm_runtime_get_sync(&client->dev); rval = pm_runtime_get_sync(&client->dev);
if (rval < 0) { if (rval < 0)
pm_runtime_put_noidle(&client->dev); goto error;
return rval; /* Device was already active, so don't set controls */
} else if (!rval) { if (rval == 1)
rval = v4l2_ctrl_handler_setup(&sensor->pixel_array-> return 0;
ctrl_handler);
if (rval)
return rval;
return v4l2_ctrl_handler_setup(&sensor->src->ctrl_handler); /* Restore V4L2 controls to the previously suspended device */
} rval = v4l2_ctrl_handler_setup(&sensor->pixel_array->ctrl_handler);
if (rval)
goto error;
rval = v4l2_ctrl_handler_setup(&sensor->src->ctrl_handler);
if (rval)
goto error;
/* Keep PM runtime usage_count incremented on success */
return 0; return 0;
error:
pm_runtime_put(&client->dev);
return rval;
} }
static int ccs_set_stream(struct v4l2_subdev *subdev, int enable) static int ccs_set_stream(struct v4l2_subdev *subdev, int enable)
@ -1932,7 +1944,7 @@ static int ccs_set_stream(struct v4l2_subdev *subdev, int enable)
} }
static int ccs_enum_mbus_code(struct v4l2_subdev *subdev, static int ccs_enum_mbus_code(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
struct i2c_client *client = v4l2_get_subdevdata(subdev); struct i2c_client *client = v4l2_get_subdevdata(subdev);
@ -1985,13 +1997,13 @@ static u32 __ccs_get_mbus_code(struct v4l2_subdev *subdev, unsigned int pad)
} }
static int __ccs_get_format(struct v4l2_subdev *subdev, static int __ccs_get_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct ccs_subdev *ssd = to_ccs_subdev(subdev); struct ccs_subdev *ssd = to_ccs_subdev(subdev);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
fmt->format = *v4l2_subdev_get_try_format(subdev, cfg, fmt->format = *v4l2_subdev_get_try_format(subdev, sd_state,
fmt->pad); fmt->pad);
} else { } else {
struct v4l2_rect *r; struct v4l2_rect *r;
@ -2011,21 +2023,21 @@ static int __ccs_get_format(struct v4l2_subdev *subdev,
} }
static int ccs_get_format(struct v4l2_subdev *subdev, static int ccs_get_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
int rval; int rval;
mutex_lock(&sensor->mutex); mutex_lock(&sensor->mutex);
rval = __ccs_get_format(subdev, cfg, fmt); rval = __ccs_get_format(subdev, sd_state, fmt);
mutex_unlock(&sensor->mutex); mutex_unlock(&sensor->mutex);
return rval; return rval;
} }
static void ccs_get_crop_compose(struct v4l2_subdev *subdev, static void ccs_get_crop_compose(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_rect **crops, struct v4l2_rect **crops,
struct v4l2_rect **comps, int which) struct v4l2_rect **comps, int which)
{ {
@ -2042,24 +2054,25 @@ static void ccs_get_crop_compose(struct v4l2_subdev *subdev,
if (crops) { if (crops) {
for (i = 0; i < subdev->entity.num_pads; i++) for (i = 0; i < subdev->entity.num_pads; i++)
crops[i] = v4l2_subdev_get_try_crop(subdev, crops[i] = v4l2_subdev_get_try_crop(subdev,
cfg, i); sd_state,
i);
} }
if (comps) if (comps)
*comps = v4l2_subdev_get_try_compose(subdev, cfg, *comps = v4l2_subdev_get_try_compose(subdev, sd_state,
CCS_PAD_SINK); CCS_PAD_SINK);
} }
} }
/* Changes require propagation only on sink pad. */ /* Changes require propagation only on sink pad. */
static void ccs_propagate(struct v4l2_subdev *subdev, static void ccs_propagate(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, int which, struct v4l2_subdev_state *sd_state, int which,
int target) int target)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
struct ccs_subdev *ssd = to_ccs_subdev(subdev); struct ccs_subdev *ssd = to_ccs_subdev(subdev);
struct v4l2_rect *comp, *crops[CCS_PADS]; struct v4l2_rect *comp, *crops[CCS_PADS];
ccs_get_crop_compose(subdev, cfg, crops, &comp, which); ccs_get_crop_compose(subdev, sd_state, crops, &comp, which);
switch (target) { switch (target) {
case V4L2_SEL_TGT_CROP: case V4L2_SEL_TGT_CROP:
@ -2099,7 +2112,7 @@ static const struct ccs_csi_data_format
} }
static int ccs_set_format_source(struct v4l2_subdev *subdev, static int ccs_set_format_source(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
@ -2110,7 +2123,7 @@ static int ccs_set_format_source(struct v4l2_subdev *subdev,
unsigned int i; unsigned int i;
int rval; int rval;
rval = __ccs_get_format(subdev, cfg, fmt); rval = __ccs_get_format(subdev, sd_state, fmt);
if (rval) if (rval)
return rval; return rval;
@ -2152,7 +2165,7 @@ static int ccs_set_format_source(struct v4l2_subdev *subdev,
} }
static int ccs_set_format(struct v4l2_subdev *subdev, static int ccs_set_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
@ -2164,7 +2177,7 @@ static int ccs_set_format(struct v4l2_subdev *subdev,
if (fmt->pad == ssd->source_pad) { if (fmt->pad == ssd->source_pad) {
int rval; int rval;
rval = ccs_set_format_source(subdev, cfg, fmt); rval = ccs_set_format_source(subdev, sd_state, fmt);
mutex_unlock(&sensor->mutex); mutex_unlock(&sensor->mutex);
@ -2186,7 +2199,7 @@ static int ccs_set_format(struct v4l2_subdev *subdev,
CCS_LIM(sensor, MIN_Y_OUTPUT_SIZE), CCS_LIM(sensor, MIN_Y_OUTPUT_SIZE),
CCS_LIM(sensor, MAX_Y_OUTPUT_SIZE)); CCS_LIM(sensor, MAX_Y_OUTPUT_SIZE));
ccs_get_crop_compose(subdev, cfg, crops, NULL, fmt->which); ccs_get_crop_compose(subdev, sd_state, crops, NULL, fmt->which);
crops[ssd->sink_pad]->left = 0; crops[ssd->sink_pad]->left = 0;
crops[ssd->sink_pad]->top = 0; crops[ssd->sink_pad]->top = 0;
@ -2194,7 +2207,7 @@ static int ccs_set_format(struct v4l2_subdev *subdev,
crops[ssd->sink_pad]->height = fmt->format.height; crops[ssd->sink_pad]->height = fmt->format.height;
if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
ssd->sink_fmt = *crops[ssd->sink_pad]; ssd->sink_fmt = *crops[ssd->sink_pad];
ccs_propagate(subdev, cfg, fmt->which, V4L2_SEL_TGT_CROP); ccs_propagate(subdev, sd_state, fmt->which, V4L2_SEL_TGT_CROP);
mutex_unlock(&sensor->mutex); mutex_unlock(&sensor->mutex);
@ -2246,7 +2259,7 @@ static int scaling_goodness(struct v4l2_subdev *subdev, int w, int ask_w,
} }
static void ccs_set_compose_binner(struct v4l2_subdev *subdev, static void ccs_set_compose_binner(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel, struct v4l2_subdev_selection *sel,
struct v4l2_rect **crops, struct v4l2_rect **crops,
struct v4l2_rect *comp) struct v4l2_rect *comp)
@ -2294,7 +2307,7 @@ static void ccs_set_compose_binner(struct v4l2_subdev *subdev,
* result. * result.
*/ */
static void ccs_set_compose_scaler(struct v4l2_subdev *subdev, static void ccs_set_compose_scaler(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel, struct v4l2_subdev_selection *sel,
struct v4l2_rect **crops, struct v4l2_rect **crops,
struct v4l2_rect *comp) struct v4l2_rect *comp)
@ -2409,25 +2422,25 @@ static void ccs_set_compose_scaler(struct v4l2_subdev *subdev,
} }
/* We're only called on source pads. This function sets scaling. */ /* We're only called on source pads. This function sets scaling. */
static int ccs_set_compose(struct v4l2_subdev *subdev, static int ccs_set_compose(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
struct ccs_subdev *ssd = to_ccs_subdev(subdev); struct ccs_subdev *ssd = to_ccs_subdev(subdev);
struct v4l2_rect *comp, *crops[CCS_PADS]; struct v4l2_rect *comp, *crops[CCS_PADS];
ccs_get_crop_compose(subdev, cfg, crops, &comp, sel->which); ccs_get_crop_compose(subdev, sd_state, crops, &comp, sel->which);
sel->r.top = 0; sel->r.top = 0;
sel->r.left = 0; sel->r.left = 0;
if (ssd == sensor->binner) if (ssd == sensor->binner)
ccs_set_compose_binner(subdev, cfg, sel, crops, comp); ccs_set_compose_binner(subdev, sd_state, sel, crops, comp);
else else
ccs_set_compose_scaler(subdev, cfg, sel, crops, comp); ccs_set_compose_scaler(subdev, sd_state, sel, crops, comp);
*comp = sel->r; *comp = sel->r;
ccs_propagate(subdev, cfg, sel->which, V4L2_SEL_TGT_COMPOSE); ccs_propagate(subdev, sd_state, sel->which, V4L2_SEL_TGT_COMPOSE);
if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE)
return ccs_pll_blanking_update(sensor); return ccs_pll_blanking_update(sensor);
@ -2474,7 +2487,7 @@ static int __ccs_sel_supported(struct v4l2_subdev *subdev,
} }
static int ccs_set_crop(struct v4l2_subdev *subdev, static int ccs_set_crop(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
@ -2482,7 +2495,7 @@ static int ccs_set_crop(struct v4l2_subdev *subdev,
struct v4l2_rect *src_size, *crops[CCS_PADS]; struct v4l2_rect *src_size, *crops[CCS_PADS];
struct v4l2_rect _r; struct v4l2_rect _r;
ccs_get_crop_compose(subdev, cfg, crops, NULL, sel->which); ccs_get_crop_compose(subdev, sd_state, crops, NULL, sel->which);
if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) { if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
if (sel->pad == ssd->sink_pad) if (sel->pad == ssd->sink_pad)
@ -2493,16 +2506,18 @@ static int ccs_set_crop(struct v4l2_subdev *subdev,
if (sel->pad == ssd->sink_pad) { if (sel->pad == ssd->sink_pad) {
_r.left = 0; _r.left = 0;
_r.top = 0; _r.top = 0;
_r.width = v4l2_subdev_get_try_format(subdev, cfg, _r.width = v4l2_subdev_get_try_format(subdev,
sd_state,
sel->pad) sel->pad)
->width; ->width;
_r.height = v4l2_subdev_get_try_format(subdev, cfg, _r.height = v4l2_subdev_get_try_format(subdev,
sd_state,
sel->pad) sel->pad)
->height; ->height;
src_size = &_r; src_size = &_r;
} else { } else {
src_size = v4l2_subdev_get_try_compose( src_size = v4l2_subdev_get_try_compose(
subdev, cfg, ssd->sink_pad); subdev, sd_state, ssd->sink_pad);
} }
} }
@ -2520,7 +2535,7 @@ static int ccs_set_crop(struct v4l2_subdev *subdev,
*crops[sel->pad] = sel->r; *crops[sel->pad] = sel->r;
if (ssd != sensor->pixel_array && sel->pad == CCS_PAD_SINK) if (ssd != sensor->pixel_array && sel->pad == CCS_PAD_SINK)
ccs_propagate(subdev, cfg, sel->which, V4L2_SEL_TGT_CROP); ccs_propagate(subdev, sd_state, sel->which, V4L2_SEL_TGT_CROP);
return 0; return 0;
} }
@ -2534,7 +2549,7 @@ static void ccs_get_native_size(struct ccs_subdev *ssd, struct v4l2_rect *r)
} }
static int __ccs_get_selection(struct v4l2_subdev *subdev, static int __ccs_get_selection(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
@ -2547,13 +2562,14 @@ static int __ccs_get_selection(struct v4l2_subdev *subdev,
if (ret) if (ret)
return ret; return ret;
ccs_get_crop_compose(subdev, cfg, crops, &comp, sel->which); ccs_get_crop_compose(subdev, sd_state, crops, &comp, sel->which);
if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) { if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
sink_fmt = ssd->sink_fmt; sink_fmt = ssd->sink_fmt;
} else { } else {
struct v4l2_mbus_framefmt *fmt = struct v4l2_mbus_framefmt *fmt =
v4l2_subdev_get_try_format(subdev, cfg, ssd->sink_pad); v4l2_subdev_get_try_format(subdev, sd_state,
ssd->sink_pad);
sink_fmt.left = 0; sink_fmt.left = 0;
sink_fmt.top = 0; sink_fmt.top = 0;
@ -2584,21 +2600,21 @@ static int __ccs_get_selection(struct v4l2_subdev *subdev,
} }
static int ccs_get_selection(struct v4l2_subdev *subdev, static int ccs_get_selection(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
int rval; int rval;
mutex_lock(&sensor->mutex); mutex_lock(&sensor->mutex);
rval = __ccs_get_selection(subdev, cfg, sel); rval = __ccs_get_selection(subdev, sd_state, sel);
mutex_unlock(&sensor->mutex); mutex_unlock(&sensor->mutex);
return rval; return rval;
} }
static int ccs_set_selection(struct v4l2_subdev *subdev, static int ccs_set_selection(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct ccs_sensor *sensor = to_ccs_sensor(subdev); struct ccs_sensor *sensor = to_ccs_sensor(subdev);
@ -2622,10 +2638,10 @@ static int ccs_set_selection(struct v4l2_subdev *subdev,
switch (sel->target) { switch (sel->target) {
case V4L2_SEL_TGT_CROP: case V4L2_SEL_TGT_CROP:
ret = ccs_set_crop(subdev, cfg, sel); ret = ccs_set_crop(subdev, sd_state, sel);
break; break;
case V4L2_SEL_TGT_COMPOSE: case V4L2_SEL_TGT_COMPOSE:
ret = ccs_set_compose(subdev, cfg, sel); ret = ccs_set_compose(subdev, sd_state, sel);
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
@ -3016,9 +3032,9 @@ static int ccs_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
for (i = 0; i < ssd->npads; i++) { for (i = 0; i < ssd->npads; i++) {
struct v4l2_mbus_framefmt *try_fmt = struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->pad, i); v4l2_subdev_get_try_format(sd, fh->state, i);
struct v4l2_rect *try_crop = struct v4l2_rect *try_crop =
v4l2_subdev_get_try_crop(sd, fh->pad, i); v4l2_subdev_get_try_crop(sd, fh->state, i);
struct v4l2_rect *try_comp; struct v4l2_rect *try_comp;
ccs_get_native_size(ssd, try_crop); ccs_get_native_size(ssd, try_crop);
@ -3031,7 +3047,7 @@ static int ccs_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
if (ssd != sensor->pixel_array) if (ssd != sensor->pixel_array)
continue; continue;
try_comp = v4l2_subdev_get_try_compose(sd, fh->pad, i); try_comp = v4l2_subdev_get_try_compose(sd, fh->state, i);
*try_comp = *try_crop; *try_comp = *try_crop;
} }
@ -3089,12 +3105,9 @@ static int __maybe_unused ccs_suspend(struct device *dev)
bool streaming = sensor->streaming; bool streaming = sensor->streaming;
int rval; int rval;
rval = pm_runtime_get_sync(dev); rval = pm_runtime_resume_and_get(dev);
if (rval < 0) { if (rval < 0)
pm_runtime_put_noidle(dev); return rval;
return -EAGAIN;
}
if (sensor->streaming) if (sensor->streaming)
ccs_stop_streaming(sensor); ccs_stop_streaming(sensor);

View File

@ -1,5 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause // SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
/* Copyright (C) 2019--2020 Intel Corporation */ /* Copyright (C) 2019--2020 Intel Corporation */
/*
* Generated by Documentation/driver-api/media/drivers/ccs/mk-ccs-regs;
* do not modify.
*/
#include "ccs-limits.h" #include "ccs-limits.h"
#include "ccs-regs.h" #include "ccs-regs.h"

View File

@ -1,5 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */ /* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
/* Copyright (C) 2019--2020 Intel Corporation */ /* Copyright (C) 2019--2020 Intel Corporation */
/*
* Generated by Documentation/driver-api/media/drivers/ccs/mk-ccs-regs;
* do not modify.
*/
#ifndef __CCS_LIMITS_H__ #ifndef __CCS_LIMITS_H__
#define __CCS_LIMITS_H__ #define __CCS_LIMITS_H__

View File

@ -1,5 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */ /* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
/* Copyright (C) 2019--2020 Intel Corporation */ /* Copyright (C) 2019--2020 Intel Corporation */
/*
* Generated by Documentation/driver-api/media/drivers/ccs/mk-ccs-regs;
* do not modify.
*/
#ifndef __CCS_REGS_H__ #ifndef __CCS_REGS_H__
#define __CCS_REGS_H__ #define __CCS_REGS_H__
@ -202,7 +206,7 @@
#define CCS_R_OP_PIX_CLK_DIV (0x0308 | CCS_FL_16BIT) #define CCS_R_OP_PIX_CLK_DIV (0x0308 | CCS_FL_16BIT)
#define CCS_R_OP_SYS_CLK_DIV (0x030a | CCS_FL_16BIT) #define CCS_R_OP_SYS_CLK_DIV (0x030a | CCS_FL_16BIT)
#define CCS_R_OP_PRE_PLL_CLK_DIV (0x030c | CCS_FL_16BIT) #define CCS_R_OP_PRE_PLL_CLK_DIV (0x030c | CCS_FL_16BIT)
#define CCS_R_OP_PLL_MULTIPLIER (0x031e | CCS_FL_16BIT) #define CCS_R_OP_PLL_MULTIPLIER (0x030e | CCS_FL_16BIT)
#define CCS_R_PLL_MODE 0x0310 #define CCS_R_PLL_MODE 0x0310
#define CCS_PLL_MODE_SHIFT 0U #define CCS_PLL_MODE_SHIFT 0U
#define CCS_PLL_MODE_MASK 0x1 #define CCS_PLL_MODE_MASK 0x1

View File

@ -1746,7 +1746,7 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static int cx25840_set_fmt(struct v4l2_subdev *sd, static int cx25840_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct v4l2_mbus_framefmt *fmt = &format->format; struct v4l2_mbus_framefmt *fmt = &format->format;

View File

@ -85,15 +85,7 @@ static const struct v4l2_ctrl_ops dw9714_vcm_ctrl_ops = {
static int dw9714_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int dw9714_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
int rval; return pm_runtime_resume_and_get(sd->dev);
rval = pm_runtime_get_sync(sd->dev);
if (rval < 0) {
pm_runtime_put_noidle(sd->dev);
return rval;
}
return 0;
} }
static int dw9714_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int dw9714_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)

View File

@ -374,15 +374,7 @@ static const struct v4l2_ctrl_ops dw9768_ctrl_ops = {
static int dw9768_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int dw9768_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
int ret; return pm_runtime_resume_and_get(sd->dev);
ret = pm_runtime_get_sync(sd->dev);
if (ret < 0) {
pm_runtime_put_noidle(sd->dev);
return ret;
}
return 0;
} }
static int dw9768_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int dw9768_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)

View File

@ -130,15 +130,7 @@ static const struct v4l2_ctrl_ops dw9807_vcm_ctrl_ops = {
static int dw9807_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int dw9807_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
int rval; return pm_runtime_resume_and_get(sd->dev);
rval = pm_runtime_get_sync(sd->dev);
if (rval < 0) {
pm_runtime_put_noidle(sd->dev);
return rval;
}
return 0;
} }
static int dw9807_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int dw9807_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)

View File

@ -882,7 +882,7 @@ out:
*/ */
#define MAX_FMTS 4 #define MAX_FMTS 4
static int et8ek8_enum_mbus_code(struct v4l2_subdev *subdev, static int et8ek8_enum_mbus_code(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
struct et8ek8_reglist **list = struct et8ek8_reglist **list =
@ -920,7 +920,7 @@ static int et8ek8_enum_mbus_code(struct v4l2_subdev *subdev,
} }
static int et8ek8_enum_frame_size(struct v4l2_subdev *subdev, static int et8ek8_enum_frame_size(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
struct et8ek8_reglist **list = struct et8ek8_reglist **list =
@ -958,7 +958,7 @@ static int et8ek8_enum_frame_size(struct v4l2_subdev *subdev,
} }
static int et8ek8_enum_frame_ival(struct v4l2_subdev *subdev, static int et8ek8_enum_frame_ival(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie) struct v4l2_subdev_frame_interval_enum *fie)
{ {
struct et8ek8_reglist **list = struct et8ek8_reglist **list =
@ -990,12 +990,13 @@ static int et8ek8_enum_frame_ival(struct v4l2_subdev *subdev,
static struct v4l2_mbus_framefmt * static struct v4l2_mbus_framefmt *
__et8ek8_get_pad_format(struct et8ek8_sensor *sensor, __et8ek8_get_pad_format(struct et8ek8_sensor *sensor,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
unsigned int pad, enum v4l2_subdev_format_whence which) unsigned int pad, enum v4l2_subdev_format_whence which)
{ {
switch (which) { switch (which) {
case V4L2_SUBDEV_FORMAT_TRY: case V4L2_SUBDEV_FORMAT_TRY:
return v4l2_subdev_get_try_format(&sensor->subdev, cfg, pad); return v4l2_subdev_get_try_format(&sensor->subdev, sd_state,
pad);
case V4L2_SUBDEV_FORMAT_ACTIVE: case V4L2_SUBDEV_FORMAT_ACTIVE:
return &sensor->format; return &sensor->format;
default: default:
@ -1004,13 +1005,14 @@ __et8ek8_get_pad_format(struct et8ek8_sensor *sensor,
} }
static int et8ek8_get_pad_format(struct v4l2_subdev *subdev, static int et8ek8_get_pad_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev); struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev);
struct v4l2_mbus_framefmt *format; struct v4l2_mbus_framefmt *format;
format = __et8ek8_get_pad_format(sensor, cfg, fmt->pad, fmt->which); format = __et8ek8_get_pad_format(sensor, sd_state, fmt->pad,
fmt->which);
if (!format) if (!format)
return -EINVAL; return -EINVAL;
@ -1020,14 +1022,15 @@ static int et8ek8_get_pad_format(struct v4l2_subdev *subdev,
} }
static int et8ek8_set_pad_format(struct v4l2_subdev *subdev, static int et8ek8_set_pad_format(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev); struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev);
struct v4l2_mbus_framefmt *format; struct v4l2_mbus_framefmt *format;
struct et8ek8_reglist *reglist; struct et8ek8_reglist *reglist;
format = __et8ek8_get_pad_format(sensor, cfg, fmt->pad, fmt->which); format = __et8ek8_get_pad_format(sensor, sd_state, fmt->pad,
fmt->which);
if (!format) if (!format)
return -EINVAL; return -EINVAL;
@ -1327,7 +1330,7 @@ static int et8ek8_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
struct et8ek8_reglist *reglist; struct et8ek8_reglist *reglist;
reglist = et8ek8_reglist_find_type(&meta_reglist, ET8EK8_REGLIST_MODE); reglist = et8ek8_reglist_find_type(&meta_reglist, ET8EK8_REGLIST_MODE);
format = __et8ek8_get_pad_format(sensor, fh->pad, 0, format = __et8ek8_get_pad_format(sensor, fh->state, 0,
V4L2_SUBDEV_FORMAT_TRY); V4L2_SUBDEV_FORMAT_TRY);
et8ek8_reglist_to_mbus(reglist, format); et8ek8_reglist_to_mbus(reglist, format);

View File

@ -813,9 +813,8 @@ static int hi556_set_stream(struct v4l2_subdev *sd, int enable)
mutex_lock(&hi556->mutex); mutex_lock(&hi556->mutex);
if (enable) { if (enable) {
ret = pm_runtime_get_sync(&client->dev); ret = pm_runtime_resume_and_get(&client->dev);
if (ret < 0) { if (ret < 0) {
pm_runtime_put_noidle(&client->dev);
mutex_unlock(&hi556->mutex); mutex_unlock(&hi556->mutex);
return ret; return ret;
} }
@ -876,7 +875,7 @@ error:
} }
static int hi556_set_format(struct v4l2_subdev *sd, static int hi556_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct hi556 *hi556 = to_hi556(sd); struct hi556 *hi556 = to_hi556(sd);
@ -891,7 +890,7 @@ static int hi556_set_format(struct v4l2_subdev *sd,
mutex_lock(&hi556->mutex); mutex_lock(&hi556->mutex);
hi556_assign_pad_format(mode, &fmt->format); hi556_assign_pad_format(mode, &fmt->format);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
*v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format; *v4l2_subdev_get_try_format(sd, sd_state, fmt->pad) = fmt->format;
} else { } else {
hi556->cur_mode = mode; hi556->cur_mode = mode;
__v4l2_ctrl_s_ctrl(hi556->link_freq, mode->link_freq_index); __v4l2_ctrl_s_ctrl(hi556->link_freq, mode->link_freq_index);
@ -918,14 +917,15 @@ static int hi556_set_format(struct v4l2_subdev *sd,
} }
static int hi556_get_format(struct v4l2_subdev *sd, static int hi556_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct hi556 *hi556 = to_hi556(sd); struct hi556 *hi556 = to_hi556(sd);
mutex_lock(&hi556->mutex); mutex_lock(&hi556->mutex);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) if (fmt->which == V4L2_SUBDEV_FORMAT_TRY)
fmt->format = *v4l2_subdev_get_try_format(&hi556->sd, cfg, fmt->format = *v4l2_subdev_get_try_format(&hi556->sd,
sd_state,
fmt->pad); fmt->pad);
else else
hi556_assign_pad_format(hi556->cur_mode, &fmt->format); hi556_assign_pad_format(hi556->cur_mode, &fmt->format);
@ -936,7 +936,7 @@ static int hi556_get_format(struct v4l2_subdev *sd,
} }
static int hi556_enum_mbus_code(struct v4l2_subdev *sd, static int hi556_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->index > 0) if (code->index > 0)
@ -948,7 +948,7 @@ static int hi556_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int hi556_enum_frame_size(struct v4l2_subdev *sd, static int hi556_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
if (fse->index >= ARRAY_SIZE(supported_modes)) if (fse->index >= ARRAY_SIZE(supported_modes))
@ -971,7 +971,7 @@ static int hi556_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
mutex_lock(&hi556->mutex); mutex_lock(&hi556->mutex);
hi556_assign_pad_format(&supported_modes[0], hi556_assign_pad_format(&supported_modes[0],
v4l2_subdev_get_try_format(sd, fh->pad, 0)); v4l2_subdev_get_try_format(sd, fh->state, 0));
mutex_unlock(&hi556->mutex); mutex_unlock(&hi556->mutex);
return 0; return 0;

1088
drivers/media/i2c/imx208.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -474,7 +474,7 @@ static int __maybe_unused imx214_power_off(struct device *dev)
} }
static int imx214_enum_mbus_code(struct v4l2_subdev *sd, static int imx214_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->index > 0) if (code->index > 0)
@ -486,7 +486,7 @@ static int imx214_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int imx214_enum_frame_size(struct v4l2_subdev *subdev, static int imx214_enum_frame_size(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
if (fse->code != IMX214_MBUS_CODE) if (fse->code != IMX214_MBUS_CODE)
@ -534,13 +534,13 @@ static const struct v4l2_subdev_core_ops imx214_core_ops = {
static struct v4l2_mbus_framefmt * static struct v4l2_mbus_framefmt *
__imx214_get_pad_format(struct imx214 *imx214, __imx214_get_pad_format(struct imx214 *imx214,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
unsigned int pad, unsigned int pad,
enum v4l2_subdev_format_whence which) enum v4l2_subdev_format_whence which)
{ {
switch (which) { switch (which) {
case V4L2_SUBDEV_FORMAT_TRY: case V4L2_SUBDEV_FORMAT_TRY:
return v4l2_subdev_get_try_format(&imx214->sd, cfg, pad); return v4l2_subdev_get_try_format(&imx214->sd, sd_state, pad);
case V4L2_SUBDEV_FORMAT_ACTIVE: case V4L2_SUBDEV_FORMAT_ACTIVE:
return &imx214->fmt; return &imx214->fmt;
default: default:
@ -549,13 +549,14 @@ __imx214_get_pad_format(struct imx214 *imx214,
} }
static int imx214_get_format(struct v4l2_subdev *sd, static int imx214_get_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct imx214 *imx214 = to_imx214(sd); struct imx214 *imx214 = to_imx214(sd);
mutex_lock(&imx214->mutex); mutex_lock(&imx214->mutex);
format->format = *__imx214_get_pad_format(imx214, cfg, format->pad, format->format = *__imx214_get_pad_format(imx214, sd_state,
format->pad,
format->which); format->which);
mutex_unlock(&imx214->mutex); mutex_unlock(&imx214->mutex);
@ -563,12 +564,13 @@ static int imx214_get_format(struct v4l2_subdev *sd,
} }
static struct v4l2_rect * static struct v4l2_rect *
__imx214_get_pad_crop(struct imx214 *imx214, struct v4l2_subdev_pad_config *cfg, __imx214_get_pad_crop(struct imx214 *imx214,
struct v4l2_subdev_state *sd_state,
unsigned int pad, enum v4l2_subdev_format_whence which) unsigned int pad, enum v4l2_subdev_format_whence which)
{ {
switch (which) { switch (which) {
case V4L2_SUBDEV_FORMAT_TRY: case V4L2_SUBDEV_FORMAT_TRY:
return v4l2_subdev_get_try_crop(&imx214->sd, cfg, pad); return v4l2_subdev_get_try_crop(&imx214->sd, sd_state, pad);
case V4L2_SUBDEV_FORMAT_ACTIVE: case V4L2_SUBDEV_FORMAT_ACTIVE:
return &imx214->crop; return &imx214->crop;
default: default:
@ -577,7 +579,7 @@ __imx214_get_pad_crop(struct imx214 *imx214, struct v4l2_subdev_pad_config *cfg,
} }
static int imx214_set_format(struct v4l2_subdev *sd, static int imx214_set_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct imx214 *imx214 = to_imx214(sd); struct imx214 *imx214 = to_imx214(sd);
@ -587,7 +589,8 @@ static int imx214_set_format(struct v4l2_subdev *sd,
mutex_lock(&imx214->mutex); mutex_lock(&imx214->mutex);
__crop = __imx214_get_pad_crop(imx214, cfg, format->pad, format->which); __crop = __imx214_get_pad_crop(imx214, sd_state, format->pad,
format->which);
mode = v4l2_find_nearest_size(imx214_modes, mode = v4l2_find_nearest_size(imx214_modes,
ARRAY_SIZE(imx214_modes), width, height, ARRAY_SIZE(imx214_modes), width, height,
@ -597,7 +600,7 @@ static int imx214_set_format(struct v4l2_subdev *sd,
__crop->width = mode->width; __crop->width = mode->width;
__crop->height = mode->height; __crop->height = mode->height;
__format = __imx214_get_pad_format(imx214, cfg, format->pad, __format = __imx214_get_pad_format(imx214, sd_state, format->pad,
format->which); format->which);
__format->width = __crop->width; __format->width = __crop->width;
__format->height = __crop->height; __format->height = __crop->height;
@ -617,7 +620,7 @@ static int imx214_set_format(struct v4l2_subdev *sd,
} }
static int imx214_get_selection(struct v4l2_subdev *sd, static int imx214_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct imx214 *imx214 = to_imx214(sd); struct imx214 *imx214 = to_imx214(sd);
@ -626,22 +629,22 @@ static int imx214_get_selection(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
mutex_lock(&imx214->mutex); mutex_lock(&imx214->mutex);
sel->r = *__imx214_get_pad_crop(imx214, cfg, sel->pad, sel->r = *__imx214_get_pad_crop(imx214, sd_state, sel->pad,
sel->which); sel->which);
mutex_unlock(&imx214->mutex); mutex_unlock(&imx214->mutex);
return 0; return 0;
} }
static int imx214_entity_init_cfg(struct v4l2_subdev *subdev, static int imx214_entity_init_cfg(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg) struct v4l2_subdev_state *sd_state)
{ {
struct v4l2_subdev_format fmt = { }; struct v4l2_subdev_format fmt = { };
fmt.which = cfg ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; fmt.which = sd_state ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
fmt.format.width = imx214_modes[0].width; fmt.format.width = imx214_modes[0].width;
fmt.format.height = imx214_modes[0].height; fmt.format.height = imx214_modes[0].height;
imx214_set_format(subdev, cfg, &fmt); imx214_set_format(subdev, sd_state, &fmt);
return 0; return 0;
} }
@ -776,11 +779,9 @@ static int imx214_s_stream(struct v4l2_subdev *subdev, int enable)
return 0; return 0;
if (enable) { if (enable) {
ret = pm_runtime_get_sync(imx214->dev); ret = pm_runtime_resume_and_get(imx214->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(imx214->dev);
return ret; return ret;
}
ret = imx214_start_streaming(imx214); ret = imx214_start_streaming(imx214);
if (ret < 0) if (ret < 0)
@ -810,7 +811,7 @@ static int imx214_g_frame_interval(struct v4l2_subdev *subdev,
} }
static int imx214_enum_frame_interval(struct v4l2_subdev *subdev, static int imx214_enum_frame_interval(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie) struct v4l2_subdev_frame_interval_enum *fie)
{ {
const struct imx214_mode *mode; const struct imx214_mode *mode;

View File

@ -689,7 +689,7 @@ static int imx219_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
struct imx219 *imx219 = to_imx219(sd); struct imx219 *imx219 = to_imx219(sd);
struct v4l2_mbus_framefmt *try_fmt = struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->pad, 0); v4l2_subdev_get_try_format(sd, fh->state, 0);
struct v4l2_rect *try_crop; struct v4l2_rect *try_crop;
mutex_lock(&imx219->mutex); mutex_lock(&imx219->mutex);
@ -702,7 +702,7 @@ static int imx219_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
try_fmt->field = V4L2_FIELD_NONE; try_fmt->field = V4L2_FIELD_NONE;
/* Initialize try_crop rectangle. */ /* Initialize try_crop rectangle. */
try_crop = v4l2_subdev_get_try_crop(sd, fh->pad, 0); try_crop = v4l2_subdev_get_try_crop(sd, fh->state, 0);
try_crop->top = IMX219_PIXEL_ARRAY_TOP; try_crop->top = IMX219_PIXEL_ARRAY_TOP;
try_crop->left = IMX219_PIXEL_ARRAY_LEFT; try_crop->left = IMX219_PIXEL_ARRAY_LEFT;
try_crop->width = IMX219_PIXEL_ARRAY_WIDTH; try_crop->width = IMX219_PIXEL_ARRAY_WIDTH;
@ -803,7 +803,7 @@ static const struct v4l2_ctrl_ops imx219_ctrl_ops = {
}; };
static int imx219_enum_mbus_code(struct v4l2_subdev *sd, static int imx219_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
struct imx219 *imx219 = to_imx219(sd); struct imx219 *imx219 = to_imx219(sd);
@ -819,7 +819,7 @@ static int imx219_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int imx219_enum_frame_size(struct v4l2_subdev *sd, static int imx219_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
struct imx219 *imx219 = to_imx219(sd); struct imx219 *imx219 = to_imx219(sd);
@ -863,12 +863,13 @@ static void imx219_update_pad_format(struct imx219 *imx219,
} }
static int __imx219_get_pad_format(struct imx219 *imx219, static int __imx219_get_pad_format(struct imx219 *imx219,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *try_fmt = struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(&imx219->sd, cfg, fmt->pad); v4l2_subdev_get_try_format(&imx219->sd, sd_state,
fmt->pad);
/* update the code which could change due to vflip or hflip: */ /* update the code which could change due to vflip or hflip: */
try_fmt->code = imx219_get_format_code(imx219, try_fmt->code); try_fmt->code = imx219_get_format_code(imx219, try_fmt->code);
fmt->format = *try_fmt; fmt->format = *try_fmt;
@ -882,21 +883,21 @@ static int __imx219_get_pad_format(struct imx219 *imx219,
} }
static int imx219_get_pad_format(struct v4l2_subdev *sd, static int imx219_get_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx219 *imx219 = to_imx219(sd); struct imx219 *imx219 = to_imx219(sd);
int ret; int ret;
mutex_lock(&imx219->mutex); mutex_lock(&imx219->mutex);
ret = __imx219_get_pad_format(imx219, cfg, fmt); ret = __imx219_get_pad_format(imx219, sd_state, fmt);
mutex_unlock(&imx219->mutex); mutex_unlock(&imx219->mutex);
return ret; return ret;
} }
static int imx219_set_pad_format(struct v4l2_subdev *sd, static int imx219_set_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx219 *imx219 = to_imx219(sd); struct imx219 *imx219 = to_imx219(sd);
@ -922,7 +923,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
fmt->format.width, fmt->format.height); fmt->format.width, fmt->format.height);
imx219_update_pad_format(imx219, mode, fmt); imx219_update_pad_format(imx219, mode, fmt);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
*framefmt = fmt->format; *framefmt = fmt->format;
} else if (imx219->mode != mode || } else if (imx219->mode != mode ||
imx219->fmt.code != fmt->format.code) { imx219->fmt.code != fmt->format.code) {
@ -979,12 +980,13 @@ static int imx219_set_framefmt(struct imx219 *imx219)
} }
static const struct v4l2_rect * static const struct v4l2_rect *
__imx219_get_pad_crop(struct imx219 *imx219, struct v4l2_subdev_pad_config *cfg, __imx219_get_pad_crop(struct imx219 *imx219,
struct v4l2_subdev_state *sd_state,
unsigned int pad, enum v4l2_subdev_format_whence which) unsigned int pad, enum v4l2_subdev_format_whence which)
{ {
switch (which) { switch (which) {
case V4L2_SUBDEV_FORMAT_TRY: case V4L2_SUBDEV_FORMAT_TRY:
return v4l2_subdev_get_try_crop(&imx219->sd, cfg, pad); return v4l2_subdev_get_try_crop(&imx219->sd, sd_state, pad);
case V4L2_SUBDEV_FORMAT_ACTIVE: case V4L2_SUBDEV_FORMAT_ACTIVE:
return &imx219->mode->crop; return &imx219->mode->crop;
} }
@ -993,7 +995,7 @@ __imx219_get_pad_crop(struct imx219 *imx219, struct v4l2_subdev_pad_config *cfg,
} }
static int imx219_get_selection(struct v4l2_subdev *sd, static int imx219_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
switch (sel->target) { switch (sel->target) {
@ -1001,7 +1003,7 @@ static int imx219_get_selection(struct v4l2_subdev *sd,
struct imx219 *imx219 = to_imx219(sd); struct imx219 *imx219 = to_imx219(sd);
mutex_lock(&imx219->mutex); mutex_lock(&imx219->mutex);
sel->r = *__imx219_get_pad_crop(imx219, cfg, sel->pad, sel->r = *__imx219_get_pad_crop(imx219, sd_state, sel->pad,
sel->which); sel->which);
mutex_unlock(&imx219->mutex); mutex_unlock(&imx219->mutex);
@ -1035,11 +1037,9 @@ static int imx219_start_streaming(struct imx219 *imx219)
const struct imx219_reg_list *reg_list; const struct imx219_reg_list *reg_list;
int ret; int ret;
ret = pm_runtime_get_sync(&client->dev); ret = pm_runtime_resume_and_get(&client->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(&client->dev);
return ret; return ret;
}
/* Apply default values of current mode */ /* Apply default values of current mode */
reg_list = &imx219->mode->reg_list; reg_list = &imx219->mode->reg_list;

View File

@ -710,7 +710,7 @@ static int imx258_write_regs(struct imx258 *imx258,
static int imx258_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int imx258_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
struct v4l2_mbus_framefmt *try_fmt = struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->pad, 0); v4l2_subdev_get_try_format(sd, fh->state, 0);
/* Initialize try_fmt */ /* Initialize try_fmt */
try_fmt->width = supported_modes[0].width; try_fmt->width = supported_modes[0].width;
@ -820,7 +820,7 @@ static const struct v4l2_ctrl_ops imx258_ctrl_ops = {
}; };
static int imx258_enum_mbus_code(struct v4l2_subdev *sd, static int imx258_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
/* Only one bayer order(GRBG) is supported */ /* Only one bayer order(GRBG) is supported */
@ -833,7 +833,7 @@ static int imx258_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int imx258_enum_frame_size(struct v4l2_subdev *sd, static int imx258_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
if (fse->index >= ARRAY_SIZE(supported_modes)) if (fse->index >= ARRAY_SIZE(supported_modes))
@ -860,11 +860,12 @@ static void imx258_update_pad_format(const struct imx258_mode *mode,
} }
static int __imx258_get_pad_format(struct imx258 *imx258, static int __imx258_get_pad_format(struct imx258 *imx258,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) if (fmt->which == V4L2_SUBDEV_FORMAT_TRY)
fmt->format = *v4l2_subdev_get_try_format(&imx258->sd, cfg, fmt->format = *v4l2_subdev_get_try_format(&imx258->sd,
sd_state,
fmt->pad); fmt->pad);
else else
imx258_update_pad_format(imx258->cur_mode, fmt); imx258_update_pad_format(imx258->cur_mode, fmt);
@ -873,21 +874,21 @@ static int __imx258_get_pad_format(struct imx258 *imx258,
} }
static int imx258_get_pad_format(struct v4l2_subdev *sd, static int imx258_get_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx258 *imx258 = to_imx258(sd); struct imx258 *imx258 = to_imx258(sd);
int ret; int ret;
mutex_lock(&imx258->mutex); mutex_lock(&imx258->mutex);
ret = __imx258_get_pad_format(imx258, cfg, fmt); ret = __imx258_get_pad_format(imx258, sd_state, fmt);
mutex_unlock(&imx258->mutex); mutex_unlock(&imx258->mutex);
return ret; return ret;
} }
static int imx258_set_pad_format(struct v4l2_subdev *sd, static int imx258_set_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx258 *imx258 = to_imx258(sd); struct imx258 *imx258 = to_imx258(sd);
@ -909,7 +910,7 @@ static int imx258_set_pad_format(struct v4l2_subdev *sd,
fmt->format.width, fmt->format.height); fmt->format.width, fmt->format.height);
imx258_update_pad_format(mode, fmt); imx258_update_pad_format(mode, fmt);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
*framefmt = fmt->format; *framefmt = fmt->format;
} else { } else {
imx258->cur_mode = mode; imx258->cur_mode = mode;
@ -1039,11 +1040,9 @@ static int imx258_set_stream(struct v4l2_subdev *sd, int enable)
} }
if (enable) { if (enable) {
ret = pm_runtime_get_sync(&client->dev); ret = pm_runtime_resume_and_get(&client->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(&client->dev);
goto err_unlock; goto err_unlock;
}
/* /*
* Apply default & customized values * Apply default & customized values

View File

@ -996,7 +996,7 @@ static int imx274_binning_goodness(struct stimx274 *imx274,
* Must be called with imx274->lock locked. * Must be called with imx274->lock locked.
* *
* @imx274: The device object * @imx274: The device object
* @cfg: The pad config we are editing for TRY requests * @sd_state: The subdev state we are editing for TRY requests
* @which: V4L2_SUBDEV_FORMAT_ACTIVE or V4L2_SUBDEV_FORMAT_TRY from the caller * @which: V4L2_SUBDEV_FORMAT_ACTIVE or V4L2_SUBDEV_FORMAT_TRY from the caller
* @width: Input-output parameter: set to the desired width before * @width: Input-output parameter: set to the desired width before
* the call, contains the chosen value after returning successfully * the call, contains the chosen value after returning successfully
@ -1005,7 +1005,7 @@ static int imx274_binning_goodness(struct stimx274 *imx274,
* available (when called from set_fmt) * available (when called from set_fmt)
*/ */
static int __imx274_change_compose(struct stimx274 *imx274, static int __imx274_change_compose(struct stimx274 *imx274,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
u32 which, u32 which,
u32 *width, u32 *width,
u32 *height, u32 *height,
@ -1019,8 +1019,8 @@ static int __imx274_change_compose(struct stimx274 *imx274,
int best_goodness = INT_MIN; int best_goodness = INT_MIN;
if (which == V4L2_SUBDEV_FORMAT_TRY) { if (which == V4L2_SUBDEV_FORMAT_TRY) {
cur_crop = &cfg->try_crop; cur_crop = &sd_state->pads->try_crop;
tgt_fmt = &cfg->try_fmt; tgt_fmt = &sd_state->pads->try_fmt;
} else { } else {
cur_crop = &imx274->crop; cur_crop = &imx274->crop;
tgt_fmt = &imx274->format; tgt_fmt = &imx274->format;
@ -1061,7 +1061,7 @@ static int __imx274_change_compose(struct stimx274 *imx274,
/** /**
* imx274_get_fmt - Get the pad format * imx274_get_fmt - Get the pad format
* @sd: Pointer to V4L2 Sub device structure * @sd: Pointer to V4L2 Sub device structure
* @cfg: Pointer to sub device pad information structure * @sd_state: Pointer to sub device state structure
* @fmt: Pointer to pad level media bus format * @fmt: Pointer to pad level media bus format
* *
* This function is used to get the pad format information. * This function is used to get the pad format information.
@ -1069,7 +1069,7 @@ static int __imx274_change_compose(struct stimx274 *imx274,
* Return: 0 on success * Return: 0 on success
*/ */
static int imx274_get_fmt(struct v4l2_subdev *sd, static int imx274_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct stimx274 *imx274 = to_imx274(sd); struct stimx274 *imx274 = to_imx274(sd);
@ -1083,7 +1083,7 @@ static int imx274_get_fmt(struct v4l2_subdev *sd,
/** /**
* imx274_set_fmt - This is used to set the pad format * imx274_set_fmt - This is used to set the pad format
* @sd: Pointer to V4L2 Sub device structure * @sd: Pointer to V4L2 Sub device structure
* @cfg: Pointer to sub device pad information structure * @sd_state: Pointer to sub device state information structure
* @format: Pointer to pad level media bus format * @format: Pointer to pad level media bus format
* *
* This function is used to set the pad format. * This function is used to set the pad format.
@ -1091,7 +1091,7 @@ static int imx274_get_fmt(struct v4l2_subdev *sd,
* Return: 0 on success * Return: 0 on success
*/ */
static int imx274_set_fmt(struct v4l2_subdev *sd, static int imx274_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *format) struct v4l2_subdev_format *format)
{ {
struct v4l2_mbus_framefmt *fmt = &format->format; struct v4l2_mbus_framefmt *fmt = &format->format;
@ -1100,7 +1100,7 @@ static int imx274_set_fmt(struct v4l2_subdev *sd,
mutex_lock(&imx274->lock); mutex_lock(&imx274->lock);
err = __imx274_change_compose(imx274, cfg, format->which, err = __imx274_change_compose(imx274, sd_state, format->which,
&fmt->width, &fmt->height, 0); &fmt->width, &fmt->height, 0);
if (err) if (err)
@ -1113,7 +1113,7 @@ static int imx274_set_fmt(struct v4l2_subdev *sd,
*/ */
fmt->field = V4L2_FIELD_NONE; fmt->field = V4L2_FIELD_NONE;
if (format->which == V4L2_SUBDEV_FORMAT_TRY) if (format->which == V4L2_SUBDEV_FORMAT_TRY)
cfg->try_fmt = *fmt; sd_state->pads->try_fmt = *fmt;
else else
imx274->format = *fmt; imx274->format = *fmt;
@ -1124,7 +1124,7 @@ out:
} }
static int imx274_get_selection(struct v4l2_subdev *sd, static int imx274_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct stimx274 *imx274 = to_imx274(sd); struct stimx274 *imx274 = to_imx274(sd);
@ -1144,8 +1144,8 @@ static int imx274_get_selection(struct v4l2_subdev *sd,
} }
if (sel->which == V4L2_SUBDEV_FORMAT_TRY) { if (sel->which == V4L2_SUBDEV_FORMAT_TRY) {
src_crop = &cfg->try_crop; src_crop = &sd_state->pads->try_crop;
src_fmt = &cfg->try_fmt; src_fmt = &sd_state->pads->try_fmt;
} else { } else {
src_crop = &imx274->crop; src_crop = &imx274->crop;
src_fmt = &imx274->format; src_fmt = &imx274->format;
@ -1179,7 +1179,7 @@ static int imx274_get_selection(struct v4l2_subdev *sd,
} }
static int imx274_set_selection_crop(struct stimx274 *imx274, static int imx274_set_selection_crop(struct stimx274 *imx274,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct v4l2_rect *tgt_crop; struct v4l2_rect *tgt_crop;
@ -1216,7 +1216,7 @@ static int imx274_set_selection_crop(struct stimx274 *imx274,
sel->r = new_crop; sel->r = new_crop;
if (sel->which == V4L2_SUBDEV_FORMAT_TRY) if (sel->which == V4L2_SUBDEV_FORMAT_TRY)
tgt_crop = &cfg->try_crop; tgt_crop = &sd_state->pads->try_crop;
else else
tgt_crop = &imx274->crop; tgt_crop = &imx274->crop;
@ -1230,7 +1230,7 @@ static int imx274_set_selection_crop(struct stimx274 *imx274,
/* if crop size changed then reset the output image size */ /* if crop size changed then reset the output image size */
if (size_changed) if (size_changed)
__imx274_change_compose(imx274, cfg, sel->which, __imx274_change_compose(imx274, sd_state, sel->which,
&new_crop.width, &new_crop.height, &new_crop.width, &new_crop.height,
sel->flags); sel->flags);
@ -1240,7 +1240,7 @@ static int imx274_set_selection_crop(struct stimx274 *imx274,
} }
static int imx274_set_selection(struct v4l2_subdev *sd, static int imx274_set_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel) struct v4l2_subdev_selection *sel)
{ {
struct stimx274 *imx274 = to_imx274(sd); struct stimx274 *imx274 = to_imx274(sd);
@ -1249,13 +1249,13 @@ static int imx274_set_selection(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
if (sel->target == V4L2_SEL_TGT_CROP) if (sel->target == V4L2_SEL_TGT_CROP)
return imx274_set_selection_crop(imx274, cfg, sel); return imx274_set_selection_crop(imx274, sd_state, sel);
if (sel->target == V4L2_SEL_TGT_COMPOSE) { if (sel->target == V4L2_SEL_TGT_COMPOSE) {
int err; int err;
mutex_lock(&imx274->lock); mutex_lock(&imx274->lock);
err = __imx274_change_compose(imx274, cfg, sel->which, err = __imx274_change_compose(imx274, sd_state, sel->which,
&sel->r.width, &sel->r.height, &sel->r.width, &sel->r.height,
sel->flags); sel->flags);
mutex_unlock(&imx274->lock); mutex_unlock(&imx274->lock);
@ -1441,9 +1441,8 @@ static int imx274_s_stream(struct v4l2_subdev *sd, int on)
mutex_lock(&imx274->lock); mutex_lock(&imx274->lock);
if (on) { if (on) {
ret = pm_runtime_get_sync(&imx274->client->dev); ret = pm_runtime_resume_and_get(&imx274->client->dev);
if (ret < 0) { if (ret < 0) {
pm_runtime_put_noidle(&imx274->client->dev);
mutex_unlock(&imx274->lock); mutex_unlock(&imx274->lock);
return ret; return ret;
} }

View File

@ -516,7 +516,7 @@ static const struct v4l2_ctrl_ops imx290_ctrl_ops = {
}; };
static int imx290_enum_mbus_code(struct v4l2_subdev *sd, static int imx290_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->index >= ARRAY_SIZE(imx290_formats)) if (code->index >= ARRAY_SIZE(imx290_formats))
@ -528,7 +528,7 @@ static int imx290_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int imx290_enum_frame_size(struct v4l2_subdev *sd, static int imx290_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
const struct imx290 *imx290 = to_imx290(sd); const struct imx290 *imx290 = to_imx290(sd);
@ -550,7 +550,7 @@ static int imx290_enum_frame_size(struct v4l2_subdev *sd,
} }
static int imx290_get_fmt(struct v4l2_subdev *sd, static int imx290_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx290 *imx290 = to_imx290(sd); struct imx290 *imx290 = to_imx290(sd);
@ -559,7 +559,7 @@ static int imx290_get_fmt(struct v4l2_subdev *sd,
mutex_lock(&imx290->lock); mutex_lock(&imx290->lock);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) if (fmt->which == V4L2_SUBDEV_FORMAT_TRY)
framefmt = v4l2_subdev_get_try_format(&imx290->sd, cfg, framefmt = v4l2_subdev_get_try_format(&imx290->sd, sd_state,
fmt->pad); fmt->pad);
else else
framefmt = &imx290->current_format; framefmt = &imx290->current_format;
@ -596,8 +596,8 @@ static u64 imx290_calc_pixel_rate(struct imx290 *imx290)
} }
static int imx290_set_fmt(struct v4l2_subdev *sd, static int imx290_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx290 *imx290 = to_imx290(sd); struct imx290 *imx290 = to_imx290(sd);
const struct imx290_mode *mode; const struct imx290_mode *mode;
@ -624,7 +624,7 @@ static int imx290_set_fmt(struct v4l2_subdev *sd,
fmt->format.field = V4L2_FIELD_NONE; fmt->format.field = V4L2_FIELD_NONE;
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
format = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); format = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
} else { } else {
format = &imx290->current_format; format = &imx290->current_format;
imx290->current_mode = mode; imx290->current_mode = mode;
@ -646,15 +646,15 @@ static int imx290_set_fmt(struct v4l2_subdev *sd,
} }
static int imx290_entity_init_cfg(struct v4l2_subdev *subdev, static int imx290_entity_init_cfg(struct v4l2_subdev *subdev,
struct v4l2_subdev_pad_config *cfg) struct v4l2_subdev_state *sd_state)
{ {
struct v4l2_subdev_format fmt = { 0 }; struct v4l2_subdev_format fmt = { 0 };
fmt.which = cfg ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; fmt.which = sd_state ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
fmt.format.width = 1920; fmt.format.width = 1920;
fmt.format.height = 1080; fmt.format.height = 1080;
imx290_set_fmt(subdev, cfg, &fmt); imx290_set_fmt(subdev, sd_state, &fmt);
return 0; return 0;
} }
@ -764,11 +764,9 @@ static int imx290_set_stream(struct v4l2_subdev *sd, int enable)
int ret = 0; int ret = 0;
if (enable) { if (enable) {
ret = pm_runtime_get_sync(imx290->dev); ret = pm_runtime_resume_and_get(imx290->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(imx290->dev);
goto unlock_and_return; goto unlock_and_return;
}
ret = imx290_start_streaming(imx290); ret = imx290_start_streaming(imx290);
if (ret) { if (ret) {

View File

@ -1860,7 +1860,7 @@ static int imx319_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
struct imx319 *imx319 = to_imx319(sd); struct imx319 *imx319 = to_imx319(sd);
struct v4l2_mbus_framefmt *try_fmt = struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->pad, 0); v4l2_subdev_get_try_format(sd, fh->state, 0);
mutex_lock(&imx319->mutex); mutex_lock(&imx319->mutex);
@ -1947,7 +1947,7 @@ static const struct v4l2_ctrl_ops imx319_ctrl_ops = {
}; };
static int imx319_enum_mbus_code(struct v4l2_subdev *sd, static int imx319_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
struct imx319 *imx319 = to_imx319(sd); struct imx319 *imx319 = to_imx319(sd);
@ -1963,7 +1963,7 @@ static int imx319_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int imx319_enum_frame_size(struct v4l2_subdev *sd, static int imx319_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
struct imx319 *imx319 = to_imx319(sd); struct imx319 *imx319 = to_imx319(sd);
@ -1997,14 +1997,14 @@ static void imx319_update_pad_format(struct imx319 *imx319,
} }
static int imx319_do_get_pad_format(struct imx319 *imx319, static int imx319_do_get_pad_format(struct imx319 *imx319,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct v4l2_mbus_framefmt *framefmt; struct v4l2_mbus_framefmt *framefmt;
struct v4l2_subdev *sd = &imx319->sd; struct v4l2_subdev *sd = &imx319->sd;
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
fmt->format = *framefmt; fmt->format = *framefmt;
} else { } else {
imx319_update_pad_format(imx319, imx319->cur_mode, fmt); imx319_update_pad_format(imx319, imx319->cur_mode, fmt);
@ -2014,14 +2014,14 @@ static int imx319_do_get_pad_format(struct imx319 *imx319,
} }
static int imx319_get_pad_format(struct v4l2_subdev *sd, static int imx319_get_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx319 *imx319 = to_imx319(sd); struct imx319 *imx319 = to_imx319(sd);
int ret; int ret;
mutex_lock(&imx319->mutex); mutex_lock(&imx319->mutex);
ret = imx319_do_get_pad_format(imx319, cfg, fmt); ret = imx319_do_get_pad_format(imx319, sd_state, fmt);
mutex_unlock(&imx319->mutex); mutex_unlock(&imx319->mutex);
return ret; return ret;
@ -2029,7 +2029,7 @@ static int imx319_get_pad_format(struct v4l2_subdev *sd,
static int static int
imx319_set_pad_format(struct v4l2_subdev *sd, imx319_set_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx319 *imx319 = to_imx319(sd); struct imx319 *imx319 = to_imx319(sd);
@ -2055,7 +2055,7 @@ imx319_set_pad_format(struct v4l2_subdev *sd,
fmt->format.width, fmt->format.height); fmt->format.width, fmt->format.height);
imx319_update_pad_format(imx319, mode, fmt); imx319_update_pad_format(imx319, mode, fmt);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
*framefmt = fmt->format; *framefmt = fmt->format;
} else { } else {
imx319->cur_mode = mode; imx319->cur_mode = mode;
@ -2141,11 +2141,9 @@ static int imx319_set_stream(struct v4l2_subdev *sd, int enable)
} }
if (enable) { if (enable) {
ret = pm_runtime_get_sync(&client->dev); ret = pm_runtime_resume_and_get(&client->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(&client->dev);
goto err_unlock; goto err_unlock;
}
/* /*
* Apply default & customized values * Apply default & customized values

View File

@ -497,13 +497,13 @@ static const struct v4l2_ctrl_ops imx334_ctrl_ops = {
/** /**
* imx334_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes * imx334_enum_mbus_code() - Enumerate V4L2 sub-device mbus codes
* @sd: pointer to imx334 V4L2 sub-device structure * @sd: pointer to imx334 V4L2 sub-device structure
* @cfg: V4L2 sub-device pad configuration * @sd_state: V4L2 sub-device state
* @code: V4L2 sub-device code enumeration need to be filled * @code: V4L2 sub-device code enumeration need to be filled
* *
* Return: 0 if successful, error code otherwise. * Return: 0 if successful, error code otherwise.
*/ */
static int imx334_enum_mbus_code(struct v4l2_subdev *sd, static int imx334_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
if (code->index > 0) if (code->index > 0)
@ -517,13 +517,13 @@ static int imx334_enum_mbus_code(struct v4l2_subdev *sd,
/** /**
* imx334_enum_frame_size() - Enumerate V4L2 sub-device frame sizes * imx334_enum_frame_size() - Enumerate V4L2 sub-device frame sizes
* @sd: pointer to imx334 V4L2 sub-device structure * @sd: pointer to imx334 V4L2 sub-device structure
* @cfg: V4L2 sub-device pad configuration * @sd_state: V4L2 sub-device state
* @fsize: V4L2 sub-device size enumeration need to be filled * @fsize: V4L2 sub-device size enumeration need to be filled
* *
* Return: 0 if successful, error code otherwise. * Return: 0 if successful, error code otherwise.
*/ */
static int imx334_enum_frame_size(struct v4l2_subdev *sd, static int imx334_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fsize) struct v4l2_subdev_frame_size_enum *fsize)
{ {
if (fsize->index > 0) if (fsize->index > 0)
@ -564,13 +564,13 @@ static void imx334_fill_pad_format(struct imx334 *imx334,
/** /**
* imx334_get_pad_format() - Get subdevice pad format * imx334_get_pad_format() - Get subdevice pad format
* @sd: pointer to imx334 V4L2 sub-device structure * @sd: pointer to imx334 V4L2 sub-device structure
* @cfg: V4L2 sub-device pad configuration * @sd_state: V4L2 sub-device state
* @fmt: V4L2 sub-device format need to be set * @fmt: V4L2 sub-device format need to be set
* *
* Return: 0 if successful, error code otherwise. * Return: 0 if successful, error code otherwise.
*/ */
static int imx334_get_pad_format(struct v4l2_subdev *sd, static int imx334_get_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx334 *imx334 = to_imx334(sd); struct imx334 *imx334 = to_imx334(sd);
@ -580,7 +580,7 @@ static int imx334_get_pad_format(struct v4l2_subdev *sd,
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *framefmt; struct v4l2_mbus_framefmt *framefmt;
framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
fmt->format = *framefmt; fmt->format = *framefmt;
} else { } else {
imx334_fill_pad_format(imx334, imx334->cur_mode, fmt); imx334_fill_pad_format(imx334, imx334->cur_mode, fmt);
@ -594,13 +594,13 @@ static int imx334_get_pad_format(struct v4l2_subdev *sd,
/** /**
* imx334_set_pad_format() - Set subdevice pad format * imx334_set_pad_format() - Set subdevice pad format
* @sd: pointer to imx334 V4L2 sub-device structure * @sd: pointer to imx334 V4L2 sub-device structure
* @cfg: V4L2 sub-device pad configuration * @sd_state: V4L2 sub-device state
* @fmt: V4L2 sub-device format need to be set * @fmt: V4L2 sub-device format need to be set
* *
* Return: 0 if successful, error code otherwise. * Return: 0 if successful, error code otherwise.
*/ */
static int imx334_set_pad_format(struct v4l2_subdev *sd, static int imx334_set_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx334 *imx334 = to_imx334(sd); struct imx334 *imx334 = to_imx334(sd);
@ -615,7 +615,7 @@ static int imx334_set_pad_format(struct v4l2_subdev *sd,
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
struct v4l2_mbus_framefmt *framefmt; struct v4l2_mbus_framefmt *framefmt;
framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
*framefmt = fmt->format; *framefmt = fmt->format;
} else { } else {
ret = imx334_update_controls(imx334, mode); ret = imx334_update_controls(imx334, mode);
@ -631,20 +631,20 @@ static int imx334_set_pad_format(struct v4l2_subdev *sd,
/** /**
* imx334_init_pad_cfg() - Initialize sub-device pad configuration * imx334_init_pad_cfg() - Initialize sub-device pad configuration
* @sd: pointer to imx334 V4L2 sub-device structure * @sd: pointer to imx334 V4L2 sub-device structure
* @cfg: V4L2 sub-device pad configuration * @sd_state: V4L2 sub-device state
* *
* Return: 0 if successful, error code otherwise. * Return: 0 if successful, error code otherwise.
*/ */
static int imx334_init_pad_cfg(struct v4l2_subdev *sd, static int imx334_init_pad_cfg(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg) struct v4l2_subdev_state *sd_state)
{ {
struct imx334 *imx334 = to_imx334(sd); struct imx334 *imx334 = to_imx334(sd);
struct v4l2_subdev_format fmt = { 0 }; struct v4l2_subdev_format fmt = { 0 };
fmt.which = cfg ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE; fmt.which = sd_state ? V4L2_SUBDEV_FORMAT_TRY : V4L2_SUBDEV_FORMAT_ACTIVE;
imx334_fill_pad_format(imx334, &supported_mode, &fmt); imx334_fill_pad_format(imx334, &supported_mode, &fmt);
return imx334_set_pad_format(sd, cfg, &fmt); return imx334_set_pad_format(sd, sd_state, &fmt);
} }
/** /**
@ -717,9 +717,9 @@ static int imx334_set_stream(struct v4l2_subdev *sd, int enable)
} }
if (enable) { if (enable) {
ret = pm_runtime_get_sync(imx334->dev); ret = pm_runtime_resume_and_get(imx334->dev);
if (ret) if (ret < 0)
goto error_power_off; goto error_unlock;
ret = imx334_start_streaming(imx334); ret = imx334_start_streaming(imx334);
if (ret) if (ret)
@ -737,6 +737,7 @@ static int imx334_set_stream(struct v4l2_subdev *sd, int enable)
error_power_off: error_power_off:
pm_runtime_put(imx334->dev); pm_runtime_put(imx334->dev);
error_unlock:
mutex_unlock(&imx334->mutex); mutex_unlock(&imx334->mutex);
return ret; return ret;

View File

@ -1161,7 +1161,7 @@ static int imx355_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ {
struct imx355 *imx355 = to_imx355(sd); struct imx355 *imx355 = to_imx355(sd);
struct v4l2_mbus_framefmt *try_fmt = struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->pad, 0); v4l2_subdev_get_try_format(sd, fh->state, 0);
mutex_lock(&imx355->mutex); mutex_lock(&imx355->mutex);
@ -1248,7 +1248,7 @@ static const struct v4l2_ctrl_ops imx355_ctrl_ops = {
}; };
static int imx355_enum_mbus_code(struct v4l2_subdev *sd, static int imx355_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code) struct v4l2_subdev_mbus_code_enum *code)
{ {
struct imx355 *imx355 = to_imx355(sd); struct imx355 *imx355 = to_imx355(sd);
@ -1264,7 +1264,7 @@ static int imx355_enum_mbus_code(struct v4l2_subdev *sd,
} }
static int imx355_enum_frame_size(struct v4l2_subdev *sd, static int imx355_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse) struct v4l2_subdev_frame_size_enum *fse)
{ {
struct imx355 *imx355 = to_imx355(sd); struct imx355 *imx355 = to_imx355(sd);
@ -1298,14 +1298,14 @@ static void imx355_update_pad_format(struct imx355 *imx355,
} }
static int imx355_do_get_pad_format(struct imx355 *imx355, static int imx355_do_get_pad_format(struct imx355 *imx355,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct v4l2_mbus_framefmt *framefmt; struct v4l2_mbus_framefmt *framefmt;
struct v4l2_subdev *sd = &imx355->sd; struct v4l2_subdev *sd = &imx355->sd;
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
fmt->format = *framefmt; fmt->format = *framefmt;
} else { } else {
imx355_update_pad_format(imx355, imx355->cur_mode, fmt); imx355_update_pad_format(imx355, imx355->cur_mode, fmt);
@ -1315,14 +1315,14 @@ static int imx355_do_get_pad_format(struct imx355 *imx355,
} }
static int imx355_get_pad_format(struct v4l2_subdev *sd, static int imx355_get_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx355 *imx355 = to_imx355(sd); struct imx355 *imx355 = to_imx355(sd);
int ret; int ret;
mutex_lock(&imx355->mutex); mutex_lock(&imx355->mutex);
ret = imx355_do_get_pad_format(imx355, cfg, fmt); ret = imx355_do_get_pad_format(imx355, sd_state, fmt);
mutex_unlock(&imx355->mutex); mutex_unlock(&imx355->mutex);
return ret; return ret;
@ -1330,7 +1330,7 @@ static int imx355_get_pad_format(struct v4l2_subdev *sd,
static int static int
imx355_set_pad_format(struct v4l2_subdev *sd, imx355_set_pad_format(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
struct imx355 *imx355 = to_imx355(sd); struct imx355 *imx355 = to_imx355(sd);
@ -1356,7 +1356,7 @@ imx355_set_pad_format(struct v4l2_subdev *sd,
fmt->format.width, fmt->format.height); fmt->format.width, fmt->format.height);
imx355_update_pad_format(imx355, mode, fmt); imx355_update_pad_format(imx355, mode, fmt);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
*framefmt = fmt->format; *framefmt = fmt->format;
} else { } else {
imx355->cur_mode = mode; imx355->cur_mode = mode;
@ -1442,11 +1442,9 @@ static int imx355_set_stream(struct v4l2_subdev *sd, int enable)
} }
if (enable) { if (enable) {
ret = pm_runtime_get_sync(&client->dev); ret = pm_runtime_resume_and_get(&client->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(&client->dev);
goto err_unlock; goto err_unlock;
}
/* /*
* Apply default & customized values * Apply default & customized values

View File

@ -678,8 +678,8 @@ static int zilog_tx(struct rc_dev *rcdev, unsigned int *txbuf,
goto out_unlock; goto out_unlock;
} }
i = i2c_master_recv(ir->tx_c, buf, 1); ret = i2c_master_recv(ir->tx_c, buf, 1);
if (i != 1) { if (ret != 1) {
dev_err(&ir->rc->dev, "i2c_master_recv failed with %d\n", ret); dev_err(&ir->rc->dev, "i2c_master_recv failed with %d\n", ret);
ret = -EIO; ret = -EIO;
goto out_unlock; goto out_unlock;

Some files were not shown because too many files have changed in this diff Show More