1
0
Fork 0

media updates for v5.4-rc1

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+QmuaPwR3wnBdVwACF8+vY7k4RUFAl1/essACgkQCF8+vY7k
 4RV4YQ/+IILxwEuXn6cU2H/ss2+6QmOdOYISGDniWRQGTE9NN4AuvF7jv3qxek5o
 FqisJXFJWCzpO7+LpKomAQXweWmVGaSV99QSJhRUyM0lNIrXD+rACO77yYL5ZwSX
 r5REvk+ykozgRrQrWpiHCGOyH08Kt/LO/jA29VaJokX6yX4w0xvRc0rUBe2OlL+K
 rcaXDnVw8SloVpyDaMY0DDqP8v0iGsUufTxFwAoskL36+qudXgunrg1yoNwmvTL+
 spxLFs/I2LBIuBdvSg5W+FmwC3YnMdE/BDiaor9jKvhqUT9hOIozZ+pNmVTEsfvk
 1FdTobf2mhvzmJrn4bdQSfFb7BiDNgMuf6/IpeRJqQSpQHzyHQhVGBG8h3axSOhM
 5QWHBqrA0MAhcwVsKBUKj+mcfg7uNxtGPqmoeSVlMz+LH1hhokNWTAq5p2FgiDh8
 wrSsZyJItHg2hbXPkWP9EgA40Q/xzwsvUCvoz0/+dCd08DwIeSi2HIQbNddxg7y8
 NllZY0o4h6ETeDIfQb6k3zrRnAqOwlxxvXIMlaGanYegZBXMltiBIqiWrUG1qQh5
 CrBTAE28vBCNNTxQJyEjut6H5/RpWEFwebcUkn1BkeUAPZ1w72+LTJ/obekiC0/6
 Dxv7VvoTG+UFO14Fz7L3lYYTK2+OGvAsuXHAhQgrW5bWfmm8Cog=
 =QTT+
 -----END PGP SIGNATURE-----

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

Pull media updates from Mauro Carvalho Chehab:

 - a new sensor driver for ov5675

 - a new platform driver for Allwinner A10 sensor interface

 - some new remote controller keymaps

 - some cosmetic changes at V4L2 core in order to avoid #ifdefs and to
   merge two core modules into one

 - removal of bcm2048 radio driver from staging

 - removal of davinci_vpfe video driver from staging

 - regression fix since Kernel 5.1 at the legacy VideoBuffer version 1
   core

 - added some documentation for remote controller protocols

 - pixel format documentation was split on two files

 - lots of other driver improvements and cleanups

* tag 'media/v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (321 commits)
  media: videobuf-core.c: poll_wait needs a non-NULL buf pointer
  media: sun4i: Make sun4i_csi_formats static
  media: imx: remove unused including <linux/version.h>
  media: stm32-dcmi: Delete an unnecessary of_node_put() call in dcmi_probe()
  media: pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code
  media: em28xx: Fix exception handling in em28xx_alloc_urbs()
  media: don't do a 31 bit shift on a signed int
  media: use the BIT() macro
  media: ov9650: add a sanity check
  media: aspeed-video: address a protential usage of an unitialized var
  media: vicodec: make life easier for static analyzers
  media: remove include stdarg.h from some drivers
  v4l2-core: fix coding style for the two new c files
  media: v4l2-core: Remove BUG() from i2c and spi helpers
  media: v4l2-core: introduce a helper to unregister a i2c subdev
  media: v4l2-core: introduce a helper to unregister a spi subdev
  media: v4l2-core: move i2c helpers out of v4l2-common.c
  media: v4l2-core: move spi helpers out of v4l2-common.c
  media: v4l2-core: Module re-organization
  media: usbvision: Remove dead code
  ...
alistair/sunxi64-5.4-dsi
Linus Torvalds 2019-09-17 17:55:23 -07:00
commit e7345f92c2
476 changed files with 16792 additions and 24190 deletions

View File

@ -0,0 +1,109 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/allwinner,sun4i-a10-csi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Allwinner A10 CMOS Sensor Interface (CSI) Device Tree Bindings
maintainers:
- Chen-Yu Tsai <wens@csie.org>
- Maxime Ripard <maxime.ripard@bootlin.com>
description: |-
The Allwinner A10 and later has a CMOS Sensor Interface to retrieve
frames from a parallel or BT656 sensor.
properties:
compatible:
const: allwinner,sun7i-a20-csi0
reg:
maxItems: 1
interrupts:
maxItems: 1
clocks:
items:
- description: The CSI interface clock
- description: The CSI module clock
- description: The CSI ISP clock
- description: The CSI DRAM clock
clock-names:
items:
- const: bus
- const: mod
- const: isp
- const: ram
resets:
maxItems: 1
# See ./video-interfaces.txt for details
port:
type: object
additionalProperties: false
properties:
endpoint:
type: object
properties:
bus-width:
enum: [8, 16]
data-active: true
hsync-active: true
pclk-sample: true
remote-endpoint: true
vsync-active: true
required:
- bus-width
- data-active
- hsync-active
- pclk-sample
- remote-endpoint
- vsync-active
required:
- endpoint
required:
- compatible
- reg
- interrupts
- clocks
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/sun7i-a20-ccu.h>
#include <dt-bindings/reset/sun4i-a10-ccu.h>
csi0: csi@1c09000 {
compatible = "allwinner,sun7i-a20-csi0";
reg = <0x01c09000 0x1000>;
interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&ccu CLK_AHB_CSI0>, <&ccu CLK_CSI0>,
<&ccu CLK_CSI_SCLK>, <&ccu CLK_DRAM_CSI0>;
clock-names = "bus", "mod", "isp", "ram";
resets = <&ccu RST_CSI0>;
port {
csi_from_ov5640: endpoint {
remote-endpoint = <&ov5640_to_csi>;
bus-width = <8>;
hsync-active = <1>; /* Active high */
vsync-active = <0>; /* Active low */
data-active = <1>; /* Active high */
pclk-sample = <1>; /* Rising */
};
};
};
...

View File

@ -0,0 +1,80 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/allwinner,sun4i-a10-ir.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Allwinner A10 Infrared Controller Device Tree Bindings
maintainers:
- Chen-Yu Tsai <wens@csie.org>
- Maxime Ripard <maxime.ripard@bootlin.com>
allOf:
- $ref: "rc.yaml#"
properties:
compatible:
oneOf:
- const: allwinner,sun4i-a10-ir
- const: allwinner,sun5i-a13-ir
- items:
- const: allwinner,sun8i-a83t-ir
- const: allwinner,sun6i-a31-ir
- const: allwinner,sun6i-a31-ir
- items:
- const: allwinner,sun50i-a64-ir
- const: allwinner,sun6i-a31-ir
- items:
- const: allwinner,sun50i-h6-ir
- const: allwinner,sun6i-a31-ir
reg:
maxItems: 1
interrupts:
maxItems: 1
clocks:
items:
- description: Bus Clock
- description: Module Clock
clock-names:
items:
- const: apb
- const: ir
resets:
maxItems: 1
clock-frequency:
default: 8000000
description:
IR Receiver clock frequency, in Hertz.
required:
- compatible
- reg
- interrupts
- clocks
- clock-names
# FIXME: We should set it, but it would report all the generic
# properties as additional properties.
# additionalProperties: false
examples:
- |
ir0: ir@1c21800 {
compatible = "allwinner,sun4i-a10-ir";
clocks = <&apb0_gates 6>, <&ir0_clk>;
clock-names = "apb", "ir";
clock-frequency = <3000000>;
resets = <&apb0_rst 1>;
interrupts = <0 5 1>;
reg = <0x01C21800 0x40>;
linux,rc-map-name = "rc-rc6-mce";
};
...

View File

@ -5,7 +5,8 @@ The Cadence MIPI-CSI2 TX controller is a CSI-2 bridge supporting up to
4 CSI lanes in output, and up to 4 different pixel streams in input.
Required properties:
- compatible: must be set to "cdns,csi2tx"
- compatible: must be set to "cdns,csi2tx" or "cdns,csi2tx-1.3"
for version 1.3 of the controller, "cdns,csi2tx-2.1" for v2.1
- reg: base address and size of the memory mapped region
- clocks: phandles to the clocks driving the controller
- clock-names: must contain:

View File

@ -9,7 +9,7 @@ to connect directly to external CMOS image sensors.
Required properties:
- compatible : "fsl,imx7-csi";
- compatible : "fsl,imx7-csi" or "fsl,imx6ul-csi";
- reg : base address and length of the register set for the device;
- interrupts : should contain CSI interrupt;
- clocks : list of clock specifiers, see

View File

@ -5,10 +5,12 @@ to handle communication between HDMI connected devices over the CEC bus.
Required properties:
- compatible : value should be following depending on the SoC :
For GXBB, GXL, GXM and G12A (AO_CEC_A module) :
For GXBB, GXL, GXM, G12A and SM1 (AO_CEC_A module) :
"amlogic,meson-gx-ao-cec"
For G12A (AO_CEC_B module) :
"amlogic,meson-g12a-ao-cec"
For SM1 (AO_CEC_B module) :
"amlogic,meson-sm1-ao-cec"
- reg : Physical base address of the IP registers and length of memory
mapped region.
@ -16,9 +18,9 @@ Required properties:
- interrupts : AO-CEC interrupt number to the CPU.
- clocks : from common clock binding: handle to AO-CEC clock.
- clock-names : from common clock binding, must contain :
For GXBB, GXL, GXM and G12A (AO_CEC_A module) :
For GXBB, GXL, GXM, G12A and SM1 (AO_CEC_A module) :
- "core"
For G12A (AO_CEC_B module) :
For G12A, SM1 (AO_CEC_B module) :
- "oscin"
corresponding to entry in the clocks property.
- hdmi-phandle: phandle to the HDMI controller

View File

@ -35,6 +35,7 @@ Optional properties:
- resets : Must contain an entry for each entry in reset-names.
- reset-names : Must include the following entries:
- mc
- iommus: Must contain phandle to the IOMMU device node.
Example:
@ -59,4 +60,5 @@ video-codec@6001a000 {
clocks = <&tegra_car TEGRA20_CLK_VDE>;
reset-names = "vde", "mc";
resets = <&tegra_car 61>, <&mc TEGRA20_MC_RESET_VDE>;
iommus = <&mc TEGRA_SWGROUP_VDE>;
};

View File

@ -1,117 +1 @@
The following properties are common to the infrared remote controllers:
- linux,rc-map-name: string, specifies the scancode/key mapping table
defined in-kernel for the remote controller. Support values are:
* "rc-adstech-dvb-t-pci"
* "rc-alink-dtu-m"
* "rc-anysee"
* "rc-apac-viewcomp"
* "rc-asus-pc39"
* "rc-asus-ps3-100"
* "rc-ati-tv-wonder-hd-600"
* "rc-ati-x10"
* "rc-avermedia-a16d"
* "rc-avermedia-cardbus"
* "rc-avermedia-dvbt"
* "rc-avermedia-m135a"
* "rc-avermedia-m733a-rm-k6"
* "rc-avermedia-rm-ks"
* "rc-avermedia"
* "rc-avertv-303"
* "rc-azurewave-ad-tu700"
* "rc-behold-columbus"
* "rc-behold"
* "rc-budget-ci-old"
* "rc-cec"
* "rc-cinergy-1400"
* "rc-cinergy"
* "rc-delock-61959"
* "rc-dib0700-nec"
* "rc-dib0700-rc5"
* "rc-digitalnow-tinytwin"
* "rc-digittrade"
* "rc-dm1105-nec"
* "rc-dntv-live-dvbt-pro"
* "rc-dntv-live-dvb-t"
* "rc-dtt200u"
* "rc-dvbsky"
* "rc-empty"
* "rc-em-terratec"
* "rc-encore-enltv2"
* "rc-encore-enltv-fm53"
* "rc-encore-enltv"
* "rc-evga-indtube"
* "rc-eztv"
* "rc-flydvb"
* "rc-flyvideo"
* "rc-fusionhdtv-mce"
* "rc-gadmei-rm008z"
* "rc-geekbox"
* "rc-genius-tvgo-a11mce"
* "rc-gotview7135"
* "rc-hauppauge"
* "rc-imon-mce"
* "rc-imon-pad"
* "rc-iodata-bctv7e"
* "rc-it913x-v1"
* "rc-it913x-v2"
* "rc-kaiomy"
* "rc-kworld-315u"
* "rc-kworld-pc150u"
* "rc-kworld-plus-tv-analog"
* "rc-leadtek-y04g0051"
* "rc-lirc"
* "rc-lme2510"
* "rc-manli"
* "rc-medion-x10"
* "rc-medion-x10-digitainer"
* "rc-medion-x10-or2x"
* "rc-msi-digivox-ii"
* "rc-msi-digivox-iii"
* "rc-msi-tvanywhere-plus"
* "rc-msi-tvanywhere"
* "rc-nebula"
* "rc-nec-terratec-cinergy-xs"
* "rc-norwood"
* "rc-npgtech"
* "rc-pctv-sedna"
* "rc-pinnacle-color"
* "rc-pinnacle-grey"
* "rc-pinnacle-pctv-hd"
* "rc-pixelview-new"
* "rc-pixelview"
* "rc-pixelview-002t"
* "rc-pixelview-mk12"
* "rc-powercolor-real-angel"
* "rc-proteus-2309"
* "rc-purpletv"
* "rc-pv951"
* "rc-hauppauge"
* "rc-rc5-tv"
* "rc-rc6-mce"
* "rc-real-audio-220-32-keys"
* "rc-reddo"
* "rc-snapstream-firefly"
* "rc-streamzap"
* "rc-tbs-nec"
* "rc-technisat-ts35"
* "rc-technisat-usb2"
* "rc-terratec-cinergy-c-pci"
* "rc-terratec-cinergy-s2-hd"
* "rc-terratec-cinergy-xs"
* "rc-terratec-slim"
* "rc-terratec-slim-2"
* "rc-tevii-nec"
* "rc-tivo"
* "rc-total-media-in-hand"
* "rc-total-media-in-hand-02"
* "rc-trekstor"
* "rc-tt-1500"
* "rc-twinhan-dtv-cab-ci"
* "rc-twinhan1027"
* "rc-videomate-k100"
* "rc-videomate-s350"
* "rc-videomate-tv-pvr"
* "rc-winfast"
* "rc-winfast-usbii-deluxe"
* "rc-su3000"
This file has been moved to rc.yaml.

View File

@ -0,0 +1,145 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/rc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Generic Infrared Remote Controller Device Tree Bindings
maintainers:
- Mauro Carvalho Chehab <mchehab@kernel.org>
- Sean Young <sean@mess.org>
properties:
$nodename:
pattern: "^ir(@[a-f0-9]+)?$"
linux,rc-map-name:
description:
Specifies the scancode/key mapping table defined in-kernel for
the remote controller.
allOf:
- $ref: '/schemas/types.yaml#/definitions/string'
- enum:
- rc-adstech-dvb-t-pci
- rc-alink-dtu-m
- rc-anysee
- rc-apac-viewcomp
- rc-astrometa-t2hybrid
- rc-asus-pc39
- rc-asus-ps3-100
- rc-ati-tv-wonder-hd-600
- rc-ati-x10
- rc-avermedia
- rc-avermedia-a16d
- rc-avermedia-cardbus
- rc-avermedia-dvbt
- rc-avermedia-m135a
- rc-avermedia-m733a-rm-k6
- rc-avermedia-rm-ks
- rc-avertv-303
- rc-azurewave-ad-tu700
- rc-behold
- rc-behold-columbus
- rc-budget-ci-old
- rc-cec
- rc-cinergy
- rc-cinergy-1400
- rc-d680-dmb
- rc-delock-61959
- rc-dib0700-nec
- rc-dib0700-rc5
- rc-digitalnow-tinytwin
- rc-digittrade
- rc-dm1105-nec
- rc-dntv-live-dvb-t
- rc-dntv-live-dvbt-pro
- rc-dtt200u
- rc-dvbsky
- rc-dvico-mce
- rc-dvico-portable
- rc-em-terratec
- rc-empty
- rc-encore-enltv
- rc-encore-enltv-fm53
- rc-encore-enltv2
- rc-evga-indtube
- rc-eztv
- rc-flydvb
- rc-flyvideo
- rc-fusionhdtv-mce
- rc-gadmei-rm008z
- rc-geekbox
- rc-genius-tvgo-a11mce
- rc-gotview7135
- rc-hauppauge
- rc-hauppauge
- rc-hisi-poplar
- rc-hisi-tv-demo
- rc-imon-mce
- rc-imon-pad
- rc-imon-rsc
- rc-iodata-bctv7e
- rc-it913x-v1
- rc-it913x-v2
- rc-kaiomy
- rc-kworld-315u
- rc-kworld-pc150u
- rc-kworld-plus-tv-analog
- rc-leadtek-y04g0051
- rc-lme2510
- rc-manli
- rc-medion-x10
- rc-medion-x10-digitainer
- rc-medion-x10-or2x
- rc-msi-digivox-ii
- rc-msi-digivox-iii
- rc-msi-tvanywhere
- rc-msi-tvanywhere-plus
- rc-nebula
- rc-nec-terratec-cinergy-xs
- rc-norwood
- rc-npgtech
- rc-pctv-sedna
- rc-pinnacle-color
- rc-pinnacle-grey
- rc-pinnacle-pctv-hd
- rc-pixelview
- rc-pixelview-002t
- rc-pixelview-mk12
- rc-pixelview-new
- rc-powercolor-real-angel
- rc-proteus-2309
- rc-purpletv
- rc-pv951
- rc-rc5-tv
- rc-rc6-mce
- rc-real-audio-220-32-keys
- rc-reddo
- rc-snapstream-firefly
- rc-streamzap
- rc-su3000
- rc-tango
- rc-tbs-nec
- rc-technisat-ts35
- rc-technisat-usb2
- rc-terratec-cinergy-c-pci
- rc-terratec-cinergy-s2-hd
- rc-terratec-cinergy-xs
- rc-terratec-slim
- rc-terratec-slim-2
- rc-tevii-nec
- rc-tivo
- rc-total-media-in-hand
- rc-total-media-in-hand-02
- rc-trekstor
- rc-tt-1500
- rc-twinhan-dtv-cab-ci
- rc-twinhan1027
- rc-videomate-k100
- rc-videomate-s350
- rc-videomate-tv-pvr
- rc-winfast
- rc-winfast-usbii-deluxe
- rc-xbox-dvd
- rc-zx-irdec

View File

@ -1,14 +1,17 @@
device-tree bindings for rockchip VPU codec
Rockchip (Video Processing Unit) present in various Rockchip platforms,
such as RK3288 and RK3399.
such as RK3288, RK3328 and RK3399.
Required properties:
- compatible: value should be one of the following
"rockchip,rk3288-vpu";
"rockchip,rk3328-vpu";
"rockchip,rk3399-vpu";
- interrupts: encoding and decoding interrupt specifiers
- interrupt-names: should be "vepu" and "vdpu"
- interrupt-names: should be
"vepu", "vdpu" on RK3288 and RK3399,
"vdpu" on RK3328.
- clocks: phandle to VPU aclk, hclk clocks
- clock-names: should be "aclk" and "hclk"
- power-domains: phandle to power domain node
@ -27,3 +30,14 @@ SoC-specific DT entry:
power-domains = <&power RK3288_PD_VIDEO>;
iommus = <&vpu_mmu>;
};
vpu: video-codec@ff350000 {
compatible = "rockchip,rk3328-vpu";
reg = <0x0 0xff350000 0x0 0x800>;
interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "vdpu";
clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
clock-names = "aclk", "hclk";
power-domains = <&power RK3328_PD_VPU>;
iommus = <&vpu_mmu>;
};

View File

@ -1,28 +0,0 @@
Device-Tree bindings for SUNXI IR controller found in sunXi SoC family
Required properties:
- compatible : "allwinner,sun4i-a10-ir" or "allwinner,sun5i-a13-ir"
- clocks : list of clock specifiers, corresponding to
entries in clock-names property;
- clock-names : should contain "apb" and "ir" entries;
- interrupts : should contain IR IRQ number;
- reg : should contain IO map address for IR.
Optional properties:
- linux,rc-map-name: see rc.txt file in the same directory.
- resets : phandle + reset specifier pair
- clock-frequency : IR Receiver clock frequency, in Hertz. Defaults to 8 MHz
if missing.
Example:
ir0: ir@1c21800 {
compatible = "allwinner,sun4i-a10-ir";
clocks = <&apb0_gates 6>, <&ir0_clk>;
clock-names = "apb", "ir";
clock-frequency = <3000000>;
resets = <&apb0_rst 1>;
interrupts = <0 5 1>;
reg = <0x01C21800 0x40>;
linux,rc-map-name = "rc-rc6-mce";
};

View File

@ -49,9 +49,13 @@ where
The transmitter drivers must, if possible, configure the CSI-2
transmitter to *LP-11 mode* whenever the transmitter is powered on but
not active. Some transmitters do this automatically but some have to
be explicitly programmed to do so, and some are unable to do so
altogether due to hardware constraints.
not active, and maintain *LP-11 mode* until stream on. Only at stream
on should the transmitter activate the clock on the clock lane and
transition to *HS mode*.
Some transmitters do this automatically but some have to be explicitly
programmed to do so, and some are unable to do so altogether due to
hardware constraints.
Stopping the transmitter
^^^^^^^^^^^^^^^^^^^^^^^^
@ -72,3 +76,10 @@ the transmitter up by using the
:c:type:`v4l2_subdev_core_ops`->s_power() callback. This may take
place either indirectly by using :c:func:`v4l2_pipeline_pm_use` or
directly.
Formats
-------
The media bus pixel codes document parallel formats. Should the pixel data be
transported over a serial bus, the media bus pixel code that describes a
parallel format that transfers a sample on a single clock cycle is used.

View File

@ -288,6 +288,7 @@ Mask Description
0x08 Log the read and write file operations and the VIDIOC_QBUF and
VIDIOC_DQBUF ioctls.
0x10 Log the poll file operation.
0x20 Log error and messages in the control operations.
===== ================================================================
Video device cleanup

View File

@ -20,6 +20,9 @@ data between userspace and kernelspace. Fundamentally, it is just a chardev
file_operations defined on it. With respect to transporting raw IR and
decoded scancodes to and fro, the essential fops are read, write and ioctl.
It is also possible to attach a BPF program to a LIRC device for decoding
raw IR into scancodes.
Example dmesg output upon a driver registering w/LIRC:
.. code-block:: none
@ -34,6 +37,16 @@ What you should see for a chardev:
$ ls -l /dev/lirc*
crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0
Note that the package `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_
contains tools for working with LIRC devices:
- ir-ctl: can receive raw IR and transmit IR, as well as query LIRC
device features.
- ir-keytable: can load keymaps; allows you to set IR kernel protocols; load
BPF IR decoders and test IR decoding. Some BPF IR decoders are also
provided.
.. _lirc_modes:
**********
@ -53,11 +66,12 @@ on the following table.
For transmitting (aka sending), create a ``struct lirc_scancode`` with
the desired scancode set in the ``scancode`` member, :c:type:`rc_proto`
set the IR protocol, and all other members set to 0. Write this struct to
the lirc device.
set to the :ref:`IR protocol <Remote_controllers_Protocols>`, and all other
members set to 0. Write this struct to the lirc device.
For receiving, you read ``struct lirc_scancode`` from the lirc device,
with ``scancode`` set to the received scancode and the IR protocol
For receiving, you read ``struct lirc_scancode`` from the LIRC device.
The ``scancode`` field is set to the received scancode and the
:ref:`IR protocol <Remote_controllers_Protocols>` is set in
:c:type:`rc_proto`. If the scancode maps to a valid key code, this is set
in the ``keycode`` field, else it is set to ``KEY_RESERVED``.
@ -129,12 +143,29 @@ on the following table.
This mode is used only for IR send.
********************
BPF based IR decoder
********************
**************************
Remote Controller protocol
**************************
The kernel has support for decoding the most common
:ref:`IR protocols <Remote_controllers_Protocols>`, but there
are many protocols which are not supported. To support these, it is possible
to load an BPF program which does the decoding. This can only be done on
LIRC devices which support reading raw IR.
An enum :c:type:`rc_proto` in the :ref:`lirc_header` lists all the
supported IR protocols:
First, using the `bpf(2)`_ syscall with the ``BPF_LOAD_PROG`` argument,
program must be loaded of type ``BPF_PROG_TYPE_LIRC_MODE2``. Once attached
to the LIRC device, this program will be called for each pulse, space or
timeout event on the LIRC device. The context for the BPF program is a
pointer to a unsigned int, which is a :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`
value. When the program has decoded the scancode, it can be submitted using
the BPF functions ``bpf_rc_keydown()`` or ``bpf_rc_repeat()``. Mouse or pointer
movements can be reported using ``bpf_rc_pointer_rel()``.
.. kernel-doc:: include/uapi/linux/lirc.h
Once you have the file descriptor for the ``BPF_PROG_TYPE_LIRC_MODE2`` BPF
program, it can be attached to the LIRC device using the `bpf(2)`_ syscall.
The target must be the file descriptor for the LIRC device, and the
attach type must be ``BPF_LIRC_MODE2``. No more than 64 BPF programs can be
attached to a single LIRC device at a time.
.. _bpf(2): http://man7.org/linux/man-pages/man2/bpf.2.html

View File

@ -62,7 +62,8 @@ read from the chardev.
Alternatively, :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` can be available,
in this mode scancodes which are either decoded by software decoders, or
by hardware decoders. The :c:type:`rc_proto` member is set to the
protocol used for transmission, and ``scancode`` to the decoded scancode,
:ref:`IR protocol <Remote_controllers_Protocols>`
used for transmission, and ``scancode`` to the decoded scancode,
and the ``keycode`` set to the keycode or ``KEY_RESERVED``.

View File

@ -64,7 +64,8 @@ driver returns ``EINVAL``.
When in :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` mode, one
``struct lirc_scancode`` must be written to the chardev at a time, else
``EINVAL`` is returned. Set the desired scancode in the ``scancode`` member,
and the protocol in the :c:type:`rc_proto`: member. All other members must be
and the :ref:`IR protocol <Remote_controllers_Protocols>` in the
:c:type:`rc_proto`: member. All other members must be
set to 0, else ``EINVAL`` is returned. If there is no protocol encoder
for the protocol or the scancode is not valid for the specified protocol,
``EINVAL`` is returned. The write function blocks until the scancode

View File

@ -0,0 +1,456 @@
.. SPDX-License-Identifier: GPL-2.0
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _Remote_controllers_Protocols:
*****************************************
Remote Controller Protocols and Scancodes
*****************************************
IR is encoded as a series of pulses and spaces, using a protocol. These
protocols can encode e.g. an address (which device should respond) and a
command: what it should do. The values for these are not always consistent
across different devices for a given protocol.
Therefore out the output of the IR decoder is a scancode; a single u32
value. Using keymap tables this can be mapped to linux key codes.
Other things can be encoded too. Some IR protocols encode a toggle bit; this
is to distinguish whether the same button is being held down, or has been
released and pressed again. If has been released and pressed again, the
toggle bit will invert from one IR message to the next.
Some remotes have a pointer-type device which can used to control the
mouse; some air conditioning systems can have their target temperature
target set in IR.
The following are the protocols the kernel knows about and also lists
how scancodes are encoded for each protocol.
rc-5 (RC_PROTO_RC5)
-------------------
This IR protocol uses manchester encoding to encode 14 bits. There is a
detailed description here https://www.sbprojects.net/knowledge/ir/rc5.php.
The scancode encoding is *not* consistent with the lirc daemon (lircd) rc5
protocol, or the manchester BPF decoder.
.. flat-table:: rc5 bits scancode mapping
:widths: 1 1 2
* - rc-5 bit
- scancode bit
- description
* - 1
- none
- Start bit, always set
* - 1
- 6 (inverted)
- 2nd start bit in rc5, re-used as 6th command bit
* - 1
- none
- Toggle bit
* - 5
- 8 to 13
- Address
* - 6
- 0 to 5
- Command
There is a variant of rc5 called either rc5x or extended rc5
where there the second stop bit is the 6th commmand bit, but inverted.
This is done so it the scancodes and encoding is compatible with existing
schemes. This bit is stored in bit 6 of the scancode, inverted. This is
done to keep it compatible with plain rc-5 where there are two start bits.
rc-5-sz (RC_PROTO_RC5_SZ)
-------------------------
This is much like rc-5 but one bit longer. The scancode is encoded
differently.
.. flat-table:: rc-5-sz bits scancode mapping
:widths: 1 1 2
* - rc-5-sz bits
- scancode bit
- description
* - 1
- none
- Start bit, always set
* - 1
- 13
- Address bit
* - 1
- none
- Toggle bit
* - 6
- 6 to 11
- Address
* - 6
- 0 to 5
- Command
rc-5x-20 (RC_PROTO_RC5X_20)
---------------------------
This rc-5 extended to encoded 20 bits. The is a 3555 microseconds space
after the 8th bit.
.. flat-table:: rc-5x-20 bits scancode mapping
:widths: 1 1 2
* - rc-5-sz bits
- scancode bit
- description
* - 1
- none
- Start bit, always set
* - 1
- 14
- Address bit
* - 1
- none
- Toggle bit
* - 5
- 16 to 20
- Address
* - 6
- 8 to 13
- Address
* - 6
- 0 to 5
- Command
jvc (RC_PROTO_JVC)
------------------
The jvc protocol is much like nec, without the inverted values. It is
described here https://www.sbprojects.net/knowledge/ir/jvc.php.
The scancode is a 16 bits value, where the address is the lower 8 bits
and the command the higher 8 bits; this is reversed from IR order.
sony-12 (RC_PROTO_SONY12)
-------------------------
The sony protocol is a pulse-width encoding. There are three variants,
which just differ in number of bits and scancode encoding.
.. flat-table:: sony-12 bits scancode mapping
:widths: 1 1 2
* - sony-12 bits
- scancode bit
- description
* - 5
- 16 to 20
- device
* - 7
- 0 to 6
- function
sony-15 (RC_PROTO_SONY15)
-------------------------
The sony protocol is a pulse-width encoding. There are three variants,
which just differ in number of bits and scancode encoding.
.. flat-table:: sony-12 bits scancode mapping
:widths: 1 1 2
* - sony-12 bits
- scancode bit
- description
* - 8
- 16 to 23
- device
* - 7
- 0 to 6
- function
sony-20 (RC_PROTO_SONY20)
-------------------------
The sony protocol is a pulse-width encoding. There are three variants,
which just differ in number of bits and scancode encoding.
.. flat-table:: sony-20 bits scancode mapping
:widths: 1 1 2
* - sony-20 bits
- scancode bit
- description
* - 5
- 16 to 20
- device
* - 7
- 0 to 7
- device
* - 8
- 8 to 15
- extended bits
nec (RC_PROTO_NEC)
------------------
The nec protocol encodes an 8 bit address and an 8 bit command. It is
described here https://www.sbprojects.net/knowledge/ir/nec.php. Note
that the protocol sends least significant bit first.
As a check, the nec protocol sends the address and command twice; the
second time it is inverted. This is done for verification.
A plain nec IR message has 16 bits; the high 8 bits are the address
and the low 8 bits are the command.
nec-x (RC_PROTO_NECX)
---------------------
Extended nec has a 16 bit address and a 8 bit command. This is encoded
as a 24 bit value as you would expect, with the lower 8 bits the command
and the upper 16 bits the address.
nec-32 (RC_PROTO_NEC32)
-----------------------
nec-32 does not send an inverted address or an inverted command; the
entire message, all 32 bits, are used.
For this to be decoded correctly, the second 8 bits must not be the
inverted value of the first, and also the last 8 bits must not be the
inverted value of the third 8 bit value.
The scancode has a somewhat unusual encoding.
.. flat-table:: nec-32 bits scancode mapping
* - nec-32 bits
- scancode bit
* - First 8 bits
- 16 to 23
* - Second 8 bits
- 24 to 31
* - Third 8 bits
- 0 to 7
* - Fourth 8 bits
- 8 to 15
sanyo (RC_PROTO_SANYO)
----------------------
The sanyo protocol is like the nec protocol, but with 13 bits address
rather than 8 bits. Both the address and the command are followed by
their inverted versions, but these are not present in the scancodes.
Bis 8 to 20 of the scancode is the 13 bits address, and the lower 8
bits are the command.
mcir2-kbd (RC_PROTO_MCIR2_KBD)
------------------------------
This protocol is generated by the Microsoft MCE keyboard for keyboard
events. Refer to the ir-mce_kbd-decoder.c to see how it is encoded.
mcir2-mse (RC_PROTO_MCIR2_MSE)
------------------------------
This protocol is generated by the Microsoft MCE keyboard for pointer
events. Refer to the ir-mce_kbd-decoder.c to see how it is encoded.
rc-6-0 (RC_PROTO_RC6_0)
-----------------------
This is the rc-6 in mode 0. rc-6 is described here
https://www.sbprojects.net/knowledge/ir/rc6.php.
The scancode is the exact 16 bits as in the protocol. There is also a
toggle bit.
rc-6-6a-20 (RC_PROTO_RC6_6A_20)
-------------------------------
This is the rc-6 in mode 6a, 20 bits. rc-6 is described here
https://www.sbprojects.net/knowledge/ir/rc6.php.
The scancode is the exact 20 bits
as in the protocol. There is also a toggle bit.
rc-6-6a-24 (RC_PROTO_RC6_6A_24)
-------------------------------
This is the rc-6 in mode 6a, 24 bits. rc-6 is described here
https://www.sbprojects.net/knowledge/ir/rc6.php.
The scancode is the exact 24 bits
as in the protocol. There is also a toggle bit.
rc-6-6a-32 (RC_PROTO_RC6_6A_32)
-------------------------------
This is the rc-6 in mode 6a, 32 bits. rc-6 is described here
https://www.sbprojects.net/knowledge/ir/rc6.php.
The upper 16 bits are the vendor,
and the lower 16 bits are the vendor-specific bits. This protocol is
for the non-Microsoft MCE variant (vendor != 0x800f).
rc-6-mce (RC_PROTO_RC6_MCE)
---------------------------
This is the rc-6 in mode 6a, 32 bits. The upper 16 bits are the vendor,
and the lower 16 bits are the vendor-specific bits. This protocol is
for the Microsoft MCE variant (vendor = 0x800f). The toggle bit in the
protocol itself is ignored, and the 16th bit should be takes as the toggle
bit.
sharp (RC_PROTO_SHARP)
----------------------
This is a protocol used by Sharp VCRs, is described here
https://www.sbprojects.net/knowledge/ir/sharp.php. There is a very long
(40ms) space between the normal and inverted values, and some IR receivers
cannot decode this.
There is a 5 bit address and a 8 bit command. In the scancode the address is
in bits 8 to 12, and the command in bits 0 to 7.
xmp (RC_PROTO_XMP)
------------------
This protocol has several versions and only version 1 is supported. Refer
to the decoder (ir-xmp-decoder.c) to see how it is encoded.
cec (RC_PROTO_CEC)
------------------
This is not an IR protocol, this is a protocol over CEC. The CEC
infrastructure uses rc-core for handling CEC commands, so that they
can easily be remapped.
imon (RC_PROTO_IMON)
--------------------
This protocol is used by Antec Veris/SoundGraph iMON remotes.
The protocol
describes both button presses and pointer movements. The protocol encodes
31 bits, and the scancode is simply the 31 bits with the top bit always 0.
rc-mm-12 (RC_PROTO_RCMM12)
--------------------------
The rc-mm protocol is described here
https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
the 12 bits.
rc-mm-24 (RC_PROTO_RCMM24)
--------------------------
The rc-mm protocol is described here
https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
the 24 bits.
rc-mm-32 (RC_PROTO_RCMM32)
--------------------------
The rc-mm protocol is described here
https://www.sbprojects.net/knowledge/ir/rcmm.php. The scancode is simply
the 32 bits.
xbox-dvd (RC_PROTO_XBOX_DVD)
----------------------------
This protocol is used by XBox DVD Remote, which was made for the original
XBox. There is no in-kernel decoder or encoder for this protocol. The usb
device decodes the protocol. There is a BPF decoder available in v4l-utils.

View File

@ -27,6 +27,7 @@ Part III - Remote Controller API
rc-intro
rc-sysfs-nodes
rc-protos
rc-tables
rc-table-change
lirc-dev

View File

@ -395,3 +395,13 @@ colimg
:title: Color Imaging: Fundamentals and Applications
:author: Erik Reinhard et al.
.. _vp8:
VP8
===
:title: RFC 6386: "VP8 Data Format and Decoding Guide"
:author: J. Bankoski et al.

View File

@ -295,7 +295,7 @@ Control IDs
Sets the alpha color component. When a capture device (or capture
queue of a mem-to-mem device) produces a frame format that includes
an alpha component (e.g.
:ref:`packed RGB image formats <rgb-formats>`) and the alpha value
:ref:`packed RGB image formats <pixfmt-rgb>`) and the alpha value
is not defined by the device or the mem-to-mem input data this
control lets you select the alpha component value of all pixels.
When an output device (or output queue of a mem-to-mem device)

File diff suppressed because it is too large Load Diff

View File

@ -39,4 +39,10 @@ file handle is visible through another file handle).
One of the most common memory-to-memory device is the codec. Codecs
are more complicated than most and require additional setup for
their codec parameters. This is done through codec controls.
See :ref:`mpeg-controls`.
See :ref:`mpeg-controls`. More details on how to use codec memory-to-memory
devices are given in the following sections.
.. toctree::
:maxdepth: 1
dev-decoder

View File

@ -1747,6 +1747,14 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
* - __u32
- ``size``
-
* - __u32
- ``start_byte_offset``
Offset (in bytes) from the beginning of the OUTPUT buffer to the start
of the slice. If the slice starts with a start code, then this is the
offset to such start code. When operating in slice-based decoding mode
(see :c:type:`v4l2_mpeg_video_h264_decode_mode`), this field should
be set to 0. When operating in frame-based decoding mode, this field
should be 0 for the first slice.
* - __u32
- ``header_bit_size``
-
@ -1930,19 +1938,13 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
-
* - __u16
- ``num_slices``
- Number of slices needed to decode the current frame
- Number of slices needed to decode the current frame/field. When
operating in slice-based decoding mode (see
:c:type:`v4l2_mpeg_video_h264_decode_mode`), this field
should always be set to one.
* - __u16
- ``nal_ref_idc``
- NAL reference ID value coming from the NAL Unit header
* - __u8
- ``ref_pic_list_p0[32]``
- Backward reference list used by P-frames in the original bitstream order
* - __u8
- ``ref_pic_list_b0[32]``
- Backward reference list used by B-frames in the original bitstream order
* - __u8
- ``ref_pic_list_b1[32]``
- Forward reference list used by B-frames in the original bitstream order
* - __s32
- ``top_field_order_cnt``
- Picture Order Count for the coded top field
@ -2021,6 +2023,83 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
- 0x00000004
- The DPB entry is a long term reference frame
``V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE (enum)``
Specifies the decoding mode to use. Currently exposes slice-based and
frame-based decoding but new modes might be added later on.
This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
are required to set this control in order to specify the decoding mode
that is expected for the buffer.
Drivers may expose a single or multiple decoding modes, depending
on what they can support.
.. note::
This menu control is not yet part of the public kernel API and
it is expected to change.
.. c:type:: v4l2_mpeg_video_h264_decode_mode
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - ``V4L2_MPEG_VIDEO_H264_DECODE_MODE_SLICE_BASED``
- 0
- Decoding is done at the slice granularity.
In this mode, ``num_slices`` field in struct
:c:type:`v4l2_ctrl_h264_decode_params` should be set to 1,
and ``start_byte_offset`` in struct
:c:type:`v4l2_ctrl_h264_slice_params` should be set to 0.
The OUTPUT buffer must contain a single slice.
* - ``V4L2_MPEG_VIDEO_H264_DECODE_MODE_FRAME_BASED``
- 1
- Decoding is done at the frame granularity.
In this mode, ``num_slices`` field in struct
:c:type:`v4l2_ctrl_h264_decode_params` should be set to the number
of slices in the frame, and ``start_byte_offset`` in struct
:c:type:`v4l2_ctrl_h264_slice_params` should be set accordingly
for each slice. For the first slice, ``start_byte_offset`` should
be zero.
The OUTPUT buffer must contain all slices needed to decode the
frame. The OUTPUT buffer must also contain both fields.
``V4L2_CID_MPEG_VIDEO_H264_START_CODE (enum)``
Specifies the H264 slice start code expected for each slice.
This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
are required to set this control in order to specify the start code
that is expected for the buffer.
Drivers may expose a single or multiple start codes, depending
on what they can support.
.. note::
This menu control is not yet part of the public kernel API and
it is expected to change.
.. c:type:: v4l2_mpeg_video_h264_start_code
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - ``V4L2_MPEG_VIDEO_H264_START_CODE_NONE``
- 0
- Selecting this value specifies that H264 slices are passed
to the driver without any start code.
* - ``V4L2_MPEG_VIDEO_H264_START_CODE_ANNEX_B``
- 1
- Selecting this value specifies that H264 slices are expected
to be prefixed by Annex B start codes. According to :ref:`h264`
valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001.
.. _v4l2-mpeg-mpeg2:
``V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (struct)``
@ -2234,6 +2313,329 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
Quantization parameter for a P frame for FWHT. Valid range: from 1
to 31.
.. _v4l2-mpeg-vp8:
``V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER (struct)``
Specifies the frame parameters for the associated VP8 parsed frame data.
This includes the necessary parameters for
configuring a stateless hardware decoding pipeline for VP8.
The bitstream parameters are defined according to :ref:`vp8`.
.. note::
This compound control is not yet part of the public kernel API and
it is expected to change.
.. c:type:: v4l2_ctrl_vp8_frame_header
.. cssclass:: longtable
.. tabularcolumns:: |p{5.8cm}|p{4.8cm}|p{6.6cm}|
.. flat-table:: struct v4l2_ctrl_vp8_frame_header
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - struct :c:type:`v4l2_vp8_segment_header`
- ``segment_header``
- Structure with segment-based adjustments metadata.
* - struct :c:type:`v4l2_vp8_loopfilter_header`
- ``loopfilter_header``
- Structure with loop filter level adjustments metadata.
* - struct :c:type:`v4l2_vp8_quantization_header`
- ``quant_header``
- Structure with VP8 dequantization indices metadata.
* - struct :c:type:`v4l2_vp8_entropy_header`
- ``entropy_header``
- Structure with VP8 entropy coder probabilities metadata.
* - struct :c:type:`v4l2_vp8_entropy_coder_state`
- ``coder_state``
- Structure with VP8 entropy coder state.
* - __u16
- ``width``
- The width of the frame. Must be set for all frames.
* - __u16
- ``height``
- The height of the frame. Must be set for all frames.
* - __u8
- ``horizontal_scale``
- Horizontal scaling factor.
* - __u8
- ``vertical_scaling factor``
- Vertical scale.
* - __u8
- ``version``
- Bitstream version.
* - __u8
- ``prob_skip_false``
- Indicates the probability that the macroblock is not skipped.
* - __u8
- ``prob_intra``
- Indicates the probability that a macroblock is intra-predicted.
* - __u8
- ``prob_last``
- Indicates the probability that the last reference frame is used
for inter-prediction
* - __u8
- ``prob_gf``
- Indicates the probability that the golden reference frame is used
for inter-prediction
* - __u8
- ``num_dct_parts``
- Number of DCT coefficients partitions. Must be one of: 1, 2, 4, or 8.
* - __u32
- ``first_part_size``
- Size of the first partition, i.e. the control partition.
* - __u32
- ``first_part_header_bits``
- Size in bits of the first partition header portion.
* - __u32
- ``dct_part_sizes[8]``
- DCT coefficients sizes.
* - __u64
- ``last_frame_ts``
- Timestamp for the V4L2 capture buffer to use as last reference frame, used
with inter-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
- ``golden_frame_ts``
- Timestamp for the V4L2 capture buffer to use as last reference frame, used
with inter-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
- ``alt_frame_ts``
- Timestamp for the V4L2 capture buffer to use as alternate reference frame, used
with inter-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
- ``flags``
- See :ref:`Frame Header Flags <vp8_frame_header_flags>`
.. _vp8_frame_header_flags:
``Frame Header Flags``
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - ``V4L2_VP8_FRAME_HEADER_FLAG_KEY_FRAME``
- 0x01
- Indicates if the frame is a key frame.
* - ``V4L2_VP8_FRAME_HEADER_FLAG_EXPERIMENTAL``
- 0x02
- Experimental bitstream.
* - ``V4L2_VP8_FRAME_HEADER_FLAG_SHOW_FRAME``
- 0x04
- Show frame flag, indicates if the frame is for display.
* - ``V4L2_VP8_FRAME_HEADER_FLAG_MB_NO_SKIP_COEFF``
- 0x08
- Enable/disable skipping of macroblocks with no non-zero coefficients.
* - ``V4L2_VP8_FRAME_HEADER_FLAG_SIGN_BIAS_GOLDEN``
- 0x10
- Sign of motion vectors when the golden frame is referenced.
* - ``V4L2_VP8_FRAME_HEADER_FLAG_SIGN_BIAS_ALT``
- 0x20
- Sign of motion vectors when the alt frame is referenced.
.. c:type:: v4l2_vp8_entropy_coder_state
.. cssclass:: longtable
.. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
.. flat-table:: struct v4l2_vp8_entropy_coder_state
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u8
- ``range``
-
* - __u8
- ``value``
-
* - __u8
- ``bit_count``
-
* - __u8
- ``padding``
- Applications and drivers must set this to zero.
.. c:type:: v4l2_vp8_segment_header
.. cssclass:: longtable
.. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
.. flat-table:: struct v4l2_vp8_segment_header
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __s8
- ``quant_update[4]``
- Signed quantizer value update.
* - __s8
- ``lf_update[4]``
- Signed loop filter level value update.
* - __u8
- ``segment_probs[3]``
- Segment probabilities.
* - __u8
- ``padding``
- Applications and drivers must set this to zero.
* - __u32
- ``flags``
- See :ref:`Segment Header Flags <vp8_segment_header_flags>`
.. _vp8_segment_header_flags:
``Segment Header Flags``
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - ``V4L2_VP8_SEGMENT_HEADER_FLAG_ENABLED``
- 0x01
- Enable/disable segment-based adjustments.
* - ``V4L2_VP8_SEGMENT_HEADER_FLAG_UPDATE_MAP``
- 0x02
- Indicates if the macroblock segmentation map is updated in this frame.
* - ``V4L2_VP8_SEGMENT_HEADER_FLAG_UPDATE_FEATURE_DATA``
- 0x04
- Indicates if the segment feature data is updated in this frame.
* - ``V4L2_VP8_SEGMENT_HEADER_FLAG_DELTA_VALUE_MODE``
- 0x08
- If is set, the segment feature data mode is delta-value.
If cleared, it's absolute-value.
.. c:type:: v4l2_vp8_loopfilter_header
.. cssclass:: longtable
.. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
.. flat-table:: struct v4l2_vp8_loopfilter_header
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __s8
- ``ref_frm_delta[4]``
- Reference adjustment (signed) delta value.
* - __s8
- ``mb_mode_delta[4]``
- Macroblock prediction mode adjustment (signed) delta value.
* - __u8
- ``sharpness_level``
- Sharpness level
* - __u8
- ``level``
- Filter level
* - __u16
- ``padding``
- Applications and drivers must set this to zero.
* - __u32
- ``flags``
- See :ref:`Loopfilter Header Flags <vp8_loopfilter_header_flags>`
.. _vp8_loopfilter_header_flags:
``Loopfilter Header Flags``
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - ``V4L2_VP8_LF_HEADER_ADJ_ENABLE``
- 0x01
- Enable/disable macroblock-level loop filter adjustment.
* - ``V4L2_VP8_LF_HEADER_DELTA_UPDATE``
- 0x02
- Indicates if the delta values used in an adjustment are updated.
* - ``V4L2_VP8_LF_FILTER_TYPE_SIMPLE``
- 0x04
- If set, indicates the filter type is simple.
If cleared, the filter type is normal.
.. c:type:: v4l2_vp8_quantization_header
.. cssclass:: longtable
.. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
.. flat-table:: struct v4l2_vp8_quantization_header
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u8
- ``y_ac_qi``
- Luma AC coefficient table index.
* - __s8
- ``y_dc_delta``
- Luma DC delta vaue.
* - __s8
- ``y2_dc_delta``
- Y2 block DC delta value.
* - __s8
- ``y2_ac_delta``
- Y2 block AC delta value.
* - __s8
- ``uv_dc_delta``
- Chroma DC delta value.
* - __s8
- ``uv_ac_delta``
- Chroma AC delta value.
* - __u16
- ``padding``
- Applications and drivers must set this to zero.
.. c:type:: v4l2_vp8_entropy_header
.. cssclass:: longtable
.. tabularcolumns:: |p{1.5cm}|p{6.3cm}|p{9.4cm}|
.. flat-table:: struct v4l2_vp8_entropy_header
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u8
- ``coeff_probs[4][8][3][11]``
- Coefficient update probabilities.
* - __u8
- ``y_mode_probs[4]``
- Luma mode update probabilities.
* - __u8
- ``uv_mode_probs[3]``
- Chroma mode update probabilities.
* - __u8
- ``mv_probs[2][19]``
- MV decoding update probabilities.
* - __u8
- ``padding[3]``
- Applications and drivers must set this to zero.
.. raw:: latex
\normalsize

View File

@ -900,7 +900,7 @@ V4L2 in Linux 2.6.19
:ref:`VIDIOC_ENUM_FRAMEINTERVALS`
were added.
3. A new pixel format ``V4L2_PIX_FMT_RGB444`` (:ref:`rgb-formats`) was
3. A new pixel format ``V4L2_PIX_FMT_RGB444`` (:ref:`pixfmt-rgb`) was
added.

View File

@ -0,0 +1,38 @@
.. Permission is granted to copy, distribute and/or modify this
.. document under the terms of the GNU Free Documentation License,
.. Version 1.1 or any later version published by the Free Software
.. Foundation, with no Invariant Sections, no Front-Cover Texts
.. and no Back-Cover Texts. A copy of the license is included at
.. Documentation/media/uapi/fdl-appendix.rst.
..
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
.. _pixfmt-bayer:
*****************
Raw Bayer Formats
*****************
Description
===========
The raw Bayer formats are used by image sensors before much if any processing is
performed on the image. The formats contain green, red and blue components, with
alternating lines of red and green, and blue and green pixels in different
orders. See also `the Wikipedia article on Bayer filter
<https://en.wikipedia.org/wiki/Bayer_filter>`__.
.. toctree::
:maxdepth: 1
pixfmt-srggb8
pixfmt-srggb10
pixfmt-srggb10p
pixfmt-srggb10alaw8
pixfmt-srggb10dpcm8
pixfmt-srggb10-ipu3
pixfmt-srggb12
pixfmt-srggb12p
pixfmt-srggb14p
pixfmt-srggb16

View File

@ -41,7 +41,12 @@ Compressed Formats
- ``V4L2_PIX_FMT_H264``
- 'H264'
- H264 video elementary stream with start codes.
- H264 Access Unit.
The decoder expects one Access Unit per buffer.
The encoder generates one Access Unit per buffer.
If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
then the decoder has no requirements since it can parse all the
information from the raw bytestream.
* .. _V4L2-PIX-FMT-H264-NO-SC:
- ``V4L2_PIX_FMT_H264_NO_SC``
@ -52,16 +57,19 @@ Compressed Formats
- ``V4L2_PIX_FMT_H264_MVC``
- 'M264'
- H264 MVC video elementary stream.
* .. _V4L2-PIX-FMT-H264-SLICE-RAW:
* .. _V4L2-PIX-FMT-H264-SLICE:
- ``V4L2_PIX_FMT_H264_SLICE_RAW``
- ``V4L2_PIX_FMT_H264_SLICE``
- 'S264'
- H264 parsed slice data, without the start code and as
extracted from the H264 bitstream. This format is adapted for
stateless video decoders that implement an H264 pipeline
(using the :ref:`mem2mem` and :ref:`media-request-api`).
Metadata associated with the frame to decode are required to
be passed through the ``V4L2_CID_MPEG_VIDEO_H264_SPS``,
This pixelformat has two modifiers that must be set at least once
through the ``V4L2_CID_MPEG_VIDEO_H264_DECODE_MODE``
and ``V4L2_CID_MPEG_VIDEO_H264_START_CODE`` controls.
In addition, metadata associated with the frame to decode are
required to be passed through the ``V4L2_CID_MPEG_VIDEO_H264_SPS``,
``V4L2_CID_MPEG_VIDEO_H264_PPS``,
``V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX``,
``V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS`` and
@ -86,12 +94,20 @@ Compressed Formats
- ``V4L2_PIX_FMT_MPEG1``
- 'MPG1'
- MPEG1 video elementary stream.
- MPEG1 Picture. Each buffer starts with a Picture header, followed
by other headers as needed and ending with the Picture data.
If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
then the decoder has no requirements since it can parse all the
information from the raw bytestream.
* .. _V4L2-PIX-FMT-MPEG2:
- ``V4L2_PIX_FMT_MPEG2``
- 'MPG2'
- MPEG2 video elementary stream.
- MPEG2 Picture. Each buffer starts with a Picture header, followed
by other headers as needed and ending with the Picture data.
If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
then the decoder has no requirements since it can parse all the
information from the raw bytestream.
* .. _V4L2-PIX-FMT-MPEG2-SLICE:
- ``V4L2_PIX_FMT_MPEG2_SLICE``
@ -132,17 +148,46 @@ Compressed Formats
- ``V4L2_PIX_FMT_VP8``
- 'VP80'
- VP8 video elementary stream.
- VP8 compressed video frame. The encoder generates one
compressed frame per buffer, and the decoder requires one
compressed frame per buffer.
* .. _V4L2-PIX-FMT-VP8-FRAME:
- ``V4L2_PIX_FMT_VP8_FRAME``
- 'VP8F'
- VP8 parsed frame, as extracted from the container.
This format is adapted for stateless video decoders that implement a
VP8 pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
Metadata associated with the frame to decode is required to be passed
through the ``V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER`` control.
See the :ref:`associated Codec Control IDs <v4l2-mpeg-vp8>`.
Exactly one output and one capture buffer must be provided for use with
this pixel format. The output buffer must contain the appropriate number
of macroblocks to decode a full corresponding frame to the matching
capture buffer.
.. note::
This format is not yet part of the public kernel API and it
is expected to change.
* .. _V4L2-PIX-FMT-VP9:
- ``V4L2_PIX_FMT_VP9``
- 'VP90'
- VP9 video elementary stream.
- VP9 compressed video frame. The encoder generates one
compressed frame per buffer, and the decoder requires one
compressed frame per buffer.
* .. _V4L2-PIX-FMT-HEVC:
- ``V4L2_PIX_FMT_HEVC``
- 'HEVC'
- HEVC/H.265 video elementary stream.
- HEVC/H.265 Access Unit.
The decoder expects one Access Unit per buffer.
The encoder generates one Access Unit per buffer.
If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
then the decoder has no requirements since it can parse all the
information from the raw bytestream.
* .. _V4L2-PIX-FMT-FWHT:
- ``V4L2_PIX_FMT_FWHT``
@ -150,6 +195,8 @@ Compressed Formats
- Video elementary stream using a codec based on the Fast Walsh Hadamard
Transform. This codec is implemented by the vicodec ('Virtual Codec')
driver. See the codec-fwht.h header for more details.
:ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
since the decoder can parse all the information from the raw bytestream.
* .. _V4L2-PIX-FMT-FWHT-STATELESS:
- ``V4L2_PIX_FMT_FWHT_STATELESS``

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -39,12 +39,17 @@ Single-planar format structure
to a multiple of the scale factor of any smaller planes. For
example when the image format is YUV 4:2:0, ``width`` and
``height`` must be multiples of two.
For compressed formats that contain the resolution information encoded
inside the stream, when fed to a stateful mem2mem decoder, the fields
may be zero to rely on the decoder to detect the right values. For more
details see :ref:`decoder` and format descriptions.
* - __u32
- ``pixelformat``
- The pixel format or type of compression, set by the application.
This is a little endian
:ref:`four character code <v4l2-fourcc>`. V4L2 defines standard
RGB formats in :ref:`rgb-formats`, YUV formats in
RGB formats in :ref:`pixfmt-rgb`, YUV formats in
:ref:`yuv-formats`, and reserved codes in
:ref:`reserved-formats`
* - __u32

View File

@ -31,6 +31,7 @@ see also :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>`.)
pixfmt-intro
pixfmt-indexed
pixfmt-rgb
pixfmt-bayer
yuv-formats
hsv-formats
depth-formats

View File

@ -85,6 +85,14 @@ formats in memory (a raw Bayer image won't be magically converted to
JPEG just by storing it to memory), there is no one-to-one
correspondence between them.
The media bus pixel codes document parallel formats. Should the pixel data be
transported over a serial bus, the media bus pixel code that describes a
parallel format that transfers a sample on a single clock cycle is used. For
instance, both MEDIA_BUS_FMT_BGR888_1X24 and MEDIA_BUS_FMT_BGR888_3X8 are used
on parallel busses for transferring an 8 bits per sample BGR data, whereas on
serial busses the data in this format is only referred to using
MEDIA_BUS_FMT_BGR888_1X24. This is because there is effectively only a single
way to transport that format on the serial busses.
Packed RGB Formats
^^^^^^^^^^^^^^^^^^

View File

@ -60,6 +60,10 @@ Authors, in alphabetical order:
- Original author of the V4L2 API and documentation.
- Figa, Tomasz <tfiga@chromium.org>
- Documented the memory-to-memory decoder interface.
- H Schimek, Michael <mschimek@gmx.at>
- Original author of the V4L2 API and documentation.
@ -68,6 +72,10 @@ Authors, in alphabetical order:
- Documented the Digital Video timings API.
- Osciak, Pawel <posciak@chromium.org>
- Documented the memory-to-memory decoder interface.
- Osciak, Pawel <pawel@osciak.com>
- Designed and documented the multi-planar API.
@ -92,7 +100,7 @@ Authors, in alphabetical order:
- Designed and documented the VIDIOC_LOG_STATUS ioctl, the extended control ioctls, major parts of the sliced VBI API, the MPEG encoder and decoder APIs and the DV Timings API.
**Copyright** |copy| 1999-2016: Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, Pawel Osciak, Sakari Ailus & Antti Palosaari.
**Copyright** |copy| 1999-2018: Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, Pawel Osciak, Sakari Ailus & Antti Palosaari, Tomasz Figa
Except when explicitly stated as GPL, programming examples within this
part can be used and distributed without restrictions.

View File

@ -56,14 +56,16 @@ The ``cmd`` field must contain the command code. Some commands use the
A :ref:`write() <func-write>` or :ref:`VIDIOC_STREAMON`
call sends an implicit START command to the decoder if it has not been
started yet.
started yet. Applies to both queues of mem2mem decoders.
A :ref:`close() <func-close>` or :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
call of a streaming file descriptor sends an implicit immediate STOP
command to the decoder, and all buffered data is discarded.
command to the decoder, and all buffered data is discarded. Applies to both
queues of mem2mem decoders.
These ioctls are optional, not all drivers may support them. They were
introduced in Linux 3.3.
In principle, these ioctls are optional, not all drivers may support them. They were
introduced in Linux 3.3. They are, however, mandatory for stateful mem2mem decoders
(as further documented in :ref:`decoder`).
.. tabularcolumns:: |p{1.1cm}|p{2.4cm}|p{1.2cm}|p{1.6cm}|p{10.6cm}|
@ -167,26 +169,32 @@ introduced in Linux 3.3.
``V4L2_DEC_CMD_RESUME`` for that. This command has one flag:
``V4L2_DEC_CMD_START_MUTE_AUDIO``. If set, then audio will be
muted when playing back at a non-standard speed.
For a device implementing the :ref:`decoder`, once the drain sequence
is initiated with the ``V4L2_DEC_CMD_STOP`` command, it must be driven
to completion before this command can be invoked. Any attempt to
invoke the command while the drain sequence is in progress will trigger
an ``EBUSY`` error code. The command may be also used to restart the
decoder in case of an implicit stop initiated by the decoder itself,
without the ``V4L2_DEC_CMD_STOP`` being called explicitly. See
:ref:`decoder` for more details.
* - ``V4L2_DEC_CMD_STOP``
- 1
- Stop the decoder. When the decoder is already stopped, this
command does nothing. This command has two flags: if
``V4L2_DEC_CMD_STOP_TO_BLACK`` is set, then the decoder will set
the picture to black after it stopped decoding. Otherwise the last
image will repeat. mem2mem decoders will stop producing new frames
altogether. They will send a ``V4L2_EVENT_EOS`` event when the
last frame has been decoded and all frames are ready to be
dequeued and will set the ``V4L2_BUF_FLAG_LAST`` buffer flag on
the last buffer of the capture queue to indicate there will be no
new buffers produced to dequeue. This buffer may be empty,
indicated by the driver setting the ``bytesused`` field to 0. Once
the ``V4L2_BUF_FLAG_LAST`` flag was set, the
:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl will not block anymore,
but return an ``EPIPE`` error code. If
image will repeat. If
``V4L2_DEC_CMD_STOP_IMMEDIATELY`` is set, then the decoder stops
immediately (ignoring the ``pts`` value), otherwise it will keep
decoding until timestamp >= pts or until the last of the pending
data from its internal buffers was decoded.
For a device implementing the :ref:`decoder`, the command will initiate
the drain sequence as documented in :ref:`decoder`. No flags or other
arguments are accepted in this case. Any attempt to invoke the command
again before the sequence completes will trigger an ``EBUSY`` error
code.
* - ``V4L2_DEC_CMD_PAUSE``
- 2
- Pause the decoder. When the decoder has not been started yet, the
@ -209,6 +217,11 @@ On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
EBUSY
A drain sequence of a device implementing the :ref:`decoder` is still in
progress. It is not allowed to issue another decoder command until it
completes.
EINVAL
The ``cmd`` field is invalid.

View File

@ -389,14 +389,19 @@ call.
decoder. Applications will have to query the new resolution (if
any, the signal may also have been lost).
For stateful decoders follow the guidelines in :ref:`decoder`.
Video Capture devices have to query the new timings using
:ref:`VIDIOC_QUERY_DV_TIMINGS` or
:ref:`VIDIOC_QUERYSTD <VIDIOC_QUERYSTD>`.
*Important*: even if the new video timings appear identical to the old
ones, receiving this event indicates that there was an issue with the
video signal and you must stop and restart streaming
(:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
followed by :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`). The reason is
that many devices are not able to recover from a temporary loss of
signal and so restarting streaming I/O is required in order for the
hardware to synchronize to the video signal.
that many Video Capture devices are not able to recover from a temporary
loss of signal and so restarting streaming I/O is required in order for
the hardware to synchronize to the video signal.
Return Value

View File

@ -127,6 +127,22 @@ one until ``EINVAL`` is returned.
- This format is not native to the device but emulated through
software (usually libv4l2), where possible try to use a native
format instead for better performance.
* - ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
- 0x0004
- The hardware decoder for this compressed bytestream format (aka coded
format) is capable of parsing a continuous bytestream. Applications do
not need to parse the bytestream themselves to find the boundaries
between frames/fields. This flag can only be used in combination with
the ``V4L2_FMT_FLAG_COMPRESSED`` flag, since this applies to compressed
formats only. This flag is valid for stateful decoders only.
* - ``V4L2_FMT_FLAG_DYN_RESOLUTION``
- 0x0008
- Dynamic resolution switching is supported by the device for this
compressed bytestream format (aka coded format). It will notify the user
via the event ``V4L2_EVENT_SOURCE_CHANGE`` when changes in the video
parameters are detected. This flag can only be used in combination
with the ``V4L2_FMT_FLAG_COMPRESSED`` flag, since this applies to
compressed formats only. It is also only applies to stateful codecs.
Return Value

View File

@ -39,8 +39,8 @@ Arguments
File descriptor returned by :ref:`open() <func-open>`.
``argp``
Pointer to struct :c:type:`v4l2_queryctl`, :c:type:`v4l2_query_ext_ctrl`
or :c:type`v4l2_querymenu` (depending on the ioctl).
Pointer to struct :c:type:`v4l2_queryctrl`, :c:type:`v4l2_query_ext_ctrl`
or :c:type:`v4l2_querymenu` (depending on the ioctl).
Description

View File

@ -41,7 +41,7 @@ data from MIPI CSI-2 camera sensor. It has one source pad, corresponding to the
virtual channel 0. This module is compliant to previous version of Samsung
D-phy, and supports two D-PHY Rx Data lanes.
csi_mux
csi-mux
-------
This is the video multiplexer. It has two sink pads to select from either camera
@ -56,7 +56,7 @@ can interface directly with Parallel and MIPI CSI-2 buses. It has 256 x 64 FIFO
to store received image pixel data and embedded DMA controllers to transfer data
from the FIFO through AHB bus.
This entity has one sink pad that receives from the csi_mux entity and a single
This entity has one sink pad that receives from the csi-mux entity and a single
source pad that routes video frames directly to memory buffers. This pad is
routed to a capture device node.
@ -81,14 +81,14 @@ an output of 800x600, and BGGR 10 bit bayer format:
# Setup links
media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]"
media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi_mux':1[1]"
media-ctl -l "'csi_mux':2 -> 'csi':0[1]"
media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi-mux':1[1]"
media-ctl -l "'csi-mux':2 -> 'csi':0[1]"
media-ctl -l "'csi':1 -> 'csi capture':0[1]"
# Configure pads for pipeline
media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]"
media-ctl -V "'csi_mux':1 [fmt:SBGGR10_1X10/800x600 field:none]"
media-ctl -V "'csi_mux':2 [fmt:SBGGR10_1X10/800x600 field:none]"
media-ctl -V "'csi-mux':1 [fmt:SBGGR10_1X10/800x600 field:none]"
media-ctl -V "'csi-mux':2 [fmt:SBGGR10_1X10/800x600 field:none]"
media-ctl -V "'imx7-mipi-csis.0':0 [fmt:SBGGR10_1X10/800x600 field:none]"
media-ctl -V "'csi':0 [fmt:SBGGR10_1X10/800x600 field:none]"
@ -97,64 +97,63 @@ the resolutions supported by the sensor.
.. code-block:: none
root@imx7s-warp:~# media-ctl -p
Media controller API version 4.17.0
# media-ctl -p
Media controller API version 5.2.0
Media device information
------------------------
driver imx-media
model imx-media
serial
bus info
hw revision 0x0
driver version 4.17.0
Media device information
------------------------
driver imx7-csi
model imx-media
serial
bus info
hw revision 0x0
driver version 5.2.0
Device topology
- entity 1: csi (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
[fmt:SBGGR10_1X10/800x600 field:none]
<- "csi_mux":2 [ENABLED]
pad1: Source
[fmt:SBGGR10_1X10/800x600 field:none]
-> "csi capture":0 [ENABLED]
Device topology
- entity 1: csi (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
pad0: Sink
[fmt:SBGGR10_1X10/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
<- "csi-mux":2 [ENABLED]
pad1: Source
[fmt:SBGGR10_1X10/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
-> "csi capture":0 [ENABLED]
- entity 4: csi capture (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "csi":1 [ENABLED]
- entity 4: csi capture (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video0
pad0: Sink
<- "csi":1 [ENABLED]
- entity 10: csi_mux (3 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
[fmt:unknown/0x0]
pad1: Sink
[fmt:unknown/800x600 field:none]
<- "imx7-mipi-csis.0":1 [ENABLED]
pad2: Source
[fmt:unknown/800x600 field:none]
-> "csi":0 [ENABLED]
- entity 10: csi-mux (3 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
pad0: Sink
[fmt:Y8_1X8/1x1 field:none]
pad1: Sink
[fmt:SBGGR10_1X10/800x600 field:none]
<- "imx7-mipi-csis.0":1 [ENABLED]
pad2: Source
[fmt:SBGGR10_1X10/800x600 field:none]
-> "csi":0 [ENABLED]
- entity 14: imx7-mipi-csis.0 (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev2
pad0: Sink
[fmt:SBGGR10_1X10/800x600 field:none]
<- "ov2680 1-0036":0 [ENABLED]
pad1: Source
[fmt:SBGGR10_1X10/800x600 field:none]
-> "csi_mux":1 [ENABLED]
- entity 17: ov2680 1-0036 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev3
pad0: Source
[fmt:SBGGR10_1X10/800x600 field:none]
-> "imx7-mipi-csis.0":0 [ENABLED]
- entity 14: imx7-mipi-csis.0 (2 pads, 2 links)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev2
pad0: Sink
[fmt:SBGGR10_1X10/800x600 field:none]
<- "ov2680 1-0036":0 [ENABLED]
pad1: Source
[fmt:SBGGR10_1X10/800x600 field:none]
-> "csi-mux":1 [ENABLED]
- entity 17: ov2680 1-0036 (1 pad, 1 link)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev3
pad0: Source
[fmt:SBGGR10_1X10/800x600@1/30 field:none colorspace:srgb]
-> "imx7-mipi-csis.0":0 [ENABLED]
References
----------

View File

@ -15,7 +15,7 @@ recompile the driver to achieve your own topology. This is the default topology:
.. _vimc_topology_graph:
.. kernel-figure:: vimc.dot
:alt: vimc.dot
:alt: Diagram of the default media pipeline topology
:align: center
Media pipeline graph on vimc
@ -96,3 +96,14 @@ those arguments to each subdevice, not to the vimc module. For example::
Window size to calculate the mean. Note: the window size needs to be an
odd number, as the main pixel stays in the center of the window,
otherwise the next odd number is considered (the default value is 3).
Source code documentation
-------------------------
vimc-streamer
~~~~~~~~~~~~~
.. kernel-doc:: drivers/media/platform/vimc/vimc-streamer.h
:internal:
.. kernel-doc:: drivers/media/platform/vimc/vimc-streamer.c

View File

@ -180,15 +180,17 @@ replace define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA reserved-formats
# V4L2 format flags
replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags
replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags
replace define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM fmtdesc-flags
replace define V4L2_FMT_FLAG_DYN_RESOLUTION fmtdesc-flags
# V4L2 tymecode types
# V4L2 timecode types
replace define V4L2_TC_TYPE_24FPS timecode-type
replace define V4L2_TC_TYPE_25FPS timecode-type
replace define V4L2_TC_TYPE_30FPS timecode-type
replace define V4L2_TC_TYPE_50FPS timecode-type
replace define V4L2_TC_TYPE_60FPS timecode-type
# V4L2 tymecode flags
# V4L2 timecode flags
replace define V4L2_TC_FLAG_DROPFRAME timecode-flags
replace define V4L2_TC_FLAG_COLORFRAME timecode-flags
replace define V4L2_TC_USERBITS_field timecode-flags

View File

@ -1412,6 +1412,14 @@ F: drivers/pinctrl/sunxi/
F: drivers/soc/sunxi/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git
Allwinner A10 CSI driver
M: Maxime Ripard <mripard@kernel.org>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
F: drivers/media/platform/sunxi/sun4i-csi/
F: Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml
S: Maintained
ARM/Amlogic Meson SoC CLOCK FRAMEWORK
M: Neil Armstrong <narmstrong@baylibre.com>
M: Jerome Brunet <jbrunet@baylibre.com>
@ -11846,6 +11854,21 @@ T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/ov5647.c
OMNIVISION OV5670 SENSOR DRIVER
M: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
M: Hyungwoo Yang <hyungwoo.yang@intel.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/ov5670.c
OMNIVISION OV5675 SENSOR DRIVER
M: Shawn Tu <shawnx.tu@intel.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/ov5675.c
OMNIVISION OV5695 SENSOR DRIVER
M: Shunqian Zheng <zhengsq@rock-chips.com>
L: linux-media@vger.kernel.org
@ -13747,7 +13770,8 @@ F: include/linux/hid-roccat*
F: Documentation/ABI/*/sysfs-driver-hid-roccat*
ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
M: Jacob chen <jacob2.chen@rock-chips.com>
M: Jacob Chen <jacob-chen@iotwrt.com>
M: Ezequiel Garcia <ezequiel@collabora.com>
L: linux-media@vger.kernel.org
S: Maintained
F: drivers/media/platform/rockchip/rga/
@ -13757,7 +13781,7 @@ HANTRO VPU CODEC DRIVER
M: Ezequiel Garcia <ezequiel@collabora.com>
L: linux-media@vger.kernel.org
S: Maintained
F: drivers/staging/media/platform/hantro/
F: drivers/staging/media/hantro/
F: Documentation/devicetree/bindings/media/rockchip-vpu.txt
ROCKER DRIVER
@ -17822,14 +17846,6 @@ S: Maintained
F: mm/zpool.c
F: include/linux/zpool.h
ZR36067 VIDEO FOR LINUX DRIVER
L: mjpeg-users@lists.sourceforge.net
L: linux-media@vger.kernel.org
W: http://mjpeg.sourceforge.net/driver-zoran/
T: hg https://linuxtv.org/hg/v4l-dvb
S: Odd Fixes
F: drivers/staging/media/zoran/
ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER
M: Minchan Kim <minchan@kernel.org>
M: Nitin Gupta <ngupta@vflare.org>

View File

@ -10,6 +10,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/of.h>
@ -43,11 +44,17 @@ static struct resource omap_vout_resource[2] = {
};
#endif
static u64 omap_vout_dma_mask = DMA_BIT_MASK(32);
static struct platform_device omap_vout_device = {
.name = "omap_vout",
.num_resources = ARRAY_SIZE(omap_vout_resource),
.resource = &omap_vout_resource[0],
.id = -1,
.dev = {
.dma_mask = &omap_vout_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
},
};
int __init omap_init_vout(void)

View File

@ -186,7 +186,7 @@ static const struct v4l2_pix_format sur40_pix_format[] = {
.width = SENSOR_RES_X / 2,
.height = SENSOR_RES_Y / 2,
.field = V4L2_FIELD_NONE,
.colorspace = V4L2_COLORSPACE_SRGB,
.colorspace = V4L2_COLORSPACE_RAW,
.bytesperline = SENSOR_RES_X / 2,
.sizeimage = (SENSOR_RES_X/2) * (SENSOR_RES_Y/2),
},
@ -195,7 +195,7 @@ static const struct v4l2_pix_format sur40_pix_format[] = {
.width = SENSOR_RES_X / 2,
.height = SENSOR_RES_Y / 2,
.field = V4L2_FIELD_NONE,
.colorspace = V4L2_COLORSPACE_SRGB,
.colorspace = V4L2_COLORSPACE_RAW,
.bytesperline = SENSOR_RES_X / 2,
.sizeimage = (SENSOR_RES_X/2) * (SENSOR_RES_Y/2),
}

View File

@ -190,7 +190,7 @@ config MEDIA_SUBDRV_AUTOSELECT
depends on HAS_IOMEM
select I2C
select I2C_MUX
default y
default y if !EMBEDDED
help
By default, a media driver auto-selects all possible ancillary
devices such as tuners, sensors, video encoders/decoders and
@ -207,6 +207,11 @@ config MEDIA_SUBDRV_AUTOSELECT
If unsure say Y.
config MEDIA_HIDE_ANCILLARY_SUBDRV
bool
depends on MEDIA_SUBDRV_AUTOSELECT && !COMPILE_TEST && !EXPERT
default y
config MEDIA_ATTACH
bool
depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT

View File

@ -1614,6 +1614,9 @@ EXPORT_SYMBOL_GPL(cec_s_phys_addr_from_edid);
void cec_s_conn_info(struct cec_adapter *adap,
const struct cec_connector_info *conn_info)
{
if (IS_ERR_OR_NULL(adap))
return;
if (!(adap->capabilities & CEC_CAP_CONNECTOR_INFO))
return;

View File

@ -218,6 +218,8 @@ void cec_notifier_unregister(struct cec_notifier *n)
mutex_lock(&n->lock);
n->callback = NULL;
n->cec_adap->notifier = NULL;
n->cec_adap = NULL;
mutex_unlock(&n->lock);
cec_notifier_put(n);
}

View File

@ -20,62 +20,52 @@ MODULE_PARM_DESC(max_memory, "maximum memory usage for capture buffers (default:
/* format descriptions for capture and preview */
static struct saa7146_format formats[] = {
{
.name = "RGB-8 (3-3-2)",
.pixelformat = V4L2_PIX_FMT_RGB332,
.trans = RGB08_COMPOSED,
.depth = 8,
.flags = 0,
}, {
.name = "RGB-16 (5/B-6/G-5/R)",
.pixelformat = V4L2_PIX_FMT_RGB565,
.trans = RGB16_COMPOSED,
.depth = 16,
.flags = 0,
}, {
.name = "RGB-24 (B-G-R)",
.pixelformat = V4L2_PIX_FMT_BGR24,
.trans = RGB24_COMPOSED,
.depth = 24,
.flags = 0,
}, {
.name = "RGB-32 (B-G-R)",
.pixelformat = V4L2_PIX_FMT_BGR32,
.trans = RGB32_COMPOSED,
.depth = 32,
.flags = 0,
}, {
.name = "RGB-32 (R-G-B)",
.pixelformat = V4L2_PIX_FMT_RGB32,
.trans = RGB32_COMPOSED,
.depth = 32,
.flags = 0,
.swap = 0x2,
}, {
.name = "Greyscale-8",
.pixelformat = V4L2_PIX_FMT_GREY,
.trans = Y8,
.depth = 8,
.flags = 0,
}, {
.name = "YUV 4:2:2 planar (Y-Cb-Cr)",
.pixelformat = V4L2_PIX_FMT_YUV422P,
.trans = YUV422_DECOMPOSED,
.depth = 16,
.flags = FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR,
}, {
.name = "YVU 4:2:0 planar (Y-Cb-Cr)",
.pixelformat = V4L2_PIX_FMT_YVU420,
.trans = YUV420_DECOMPOSED,
.depth = 12,
.flags = FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR,
}, {
.name = "YUV 4:2:0 planar (Y-Cb-Cr)",
.pixelformat = V4L2_PIX_FMT_YUV420,
.trans = YUV420_DECOMPOSED,
.depth = 12,
.flags = FORMAT_IS_PLANAR,
}, {
.name = "YUV 4:2:2 (U-Y-V-Y)",
.pixelformat = V4L2_PIX_FMT_UYVY,
.trans = YUV422_COMPOSED,
.depth = 16,
@ -147,10 +137,10 @@ int saa7146_start_preview(struct saa7146_fh *fh)
}
vv->ov.win = fmt.fmt.win;
DEB_D("%dx%d+%d+%d %s field=%s\n",
DEB_D("%dx%d+%d+%d 0x%08x field=%s\n",
vv->ov.win.w.width, vv->ov.win.w.height,
vv->ov.win.w.left, vv->ov.win.w.top,
vv->ov_fmt->name, v4l2_field_names[vv->ov.win.field]);
vv->ov_fmt->pixelformat, v4l2_field_names[vv->ov.win.field]);
if (0 != (ret = saa7146_enable_overlay(fh))) {
DEB_D("enabling overlay failed: %d\n", ret);
@ -515,8 +505,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtd
{
if (f->index >= ARRAY_SIZE(formats))
return -EINVAL;
strscpy((char *)f->description, formats[f->index].name,
sizeof(f->description));
f->pixelformat = formats[f->index].pixelformat;
return 0;
}

View File

@ -217,9 +217,21 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_RGB444:
case V4L2_PIX_FMT_XRGB444:
case V4L2_PIX_FMT_ARGB444:
case V4L2_PIX_FMT_RGBX444:
case V4L2_PIX_FMT_RGBA444:
case V4L2_PIX_FMT_XBGR444:
case V4L2_PIX_FMT_ABGR444:
case V4L2_PIX_FMT_BGRX444:
case V4L2_PIX_FMT_BGRA444:
case V4L2_PIX_FMT_RGB555:
case V4L2_PIX_FMT_XRGB555:
case V4L2_PIX_FMT_ARGB555:
case V4L2_PIX_FMT_RGBX555:
case V4L2_PIX_FMT_RGBA555:
case V4L2_PIX_FMT_XBGR555:
case V4L2_PIX_FMT_ABGR555:
case V4L2_PIX_FMT_BGRX555:
case V4L2_PIX_FMT_BGRA555:
case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
case V4L2_PIX_FMT_ARGB555X:
@ -232,6 +244,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_XBGR32:
case V4L2_PIX_FMT_ARGB32:
case V4L2_PIX_FMT_ABGR32:
case V4L2_PIX_FMT_RGBX32:
case V4L2_PIX_FMT_BGRX32:
case V4L2_PIX_FMT_RGBA32:
case V4L2_PIX_FMT_BGRA32:
tpg->color_enc = TGP_COLOR_ENC_RGB;
break;
case V4L2_PIX_FMT_GREY:
@ -343,9 +359,21 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_RGB444:
case V4L2_PIX_FMT_XRGB444:
case V4L2_PIX_FMT_ARGB444:
case V4L2_PIX_FMT_RGBX444:
case V4L2_PIX_FMT_RGBA444:
case V4L2_PIX_FMT_XBGR444:
case V4L2_PIX_FMT_ABGR444:
case V4L2_PIX_FMT_BGRX444:
case V4L2_PIX_FMT_BGRA444:
case V4L2_PIX_FMT_RGB555:
case V4L2_PIX_FMT_XRGB555:
case V4L2_PIX_FMT_ARGB555:
case V4L2_PIX_FMT_RGBX555:
case V4L2_PIX_FMT_RGBA555:
case V4L2_PIX_FMT_XBGR555:
case V4L2_PIX_FMT_ABGR555:
case V4L2_PIX_FMT_BGRX555:
case V4L2_PIX_FMT_BGRA555:
case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
case V4L2_PIX_FMT_ARGB555X:
@ -375,6 +403,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_XBGR32:
case V4L2_PIX_FMT_ARGB32:
case V4L2_PIX_FMT_ABGR32:
case V4L2_PIX_FMT_RGBX32:
case V4L2_PIX_FMT_BGRX32:
case V4L2_PIX_FMT_RGBA32:
case V4L2_PIX_FMT_BGRA32:
case V4L2_PIX_FMT_YUV32:
case V4L2_PIX_FMT_AYUV32:
case V4L2_PIX_FMT_XYUV32:
@ -1007,6 +1039,12 @@ static void precalculate_color(struct tpg_data *tpg, int k)
case V4L2_PIX_FMT_RGB444:
case V4L2_PIX_FMT_XRGB444:
case V4L2_PIX_FMT_ARGB444:
case V4L2_PIX_FMT_RGBX444:
case V4L2_PIX_FMT_RGBA444:
case V4L2_PIX_FMT_XBGR444:
case V4L2_PIX_FMT_ABGR444:
case V4L2_PIX_FMT_BGRX444:
case V4L2_PIX_FMT_BGRA444:
r >>= 8;
g >>= 8;
b >>= 8;
@ -1014,6 +1052,12 @@ static void precalculate_color(struct tpg_data *tpg, int k)
case V4L2_PIX_FMT_RGB555:
case V4L2_PIX_FMT_XRGB555:
case V4L2_PIX_FMT_ARGB555:
case V4L2_PIX_FMT_RGBX555:
case V4L2_PIX_FMT_RGBA555:
case V4L2_PIX_FMT_XBGR555:
case V4L2_PIX_FMT_ABGR555:
case V4L2_PIX_FMT_BGRX555:
case V4L2_PIX_FMT_BGRA555:
case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
case V4L2_PIX_FMT_ARGB555X:
@ -1237,6 +1281,27 @@ static void gen_twopix(struct tpg_data *tpg,
buf[0][offset] = (g_u_s << 4) | b_v;
buf[0][offset + 1] = (alpha & 0xf0) | r_y_h;
break;
case V4L2_PIX_FMT_RGBX444:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_RGBA444:
buf[0][offset] = (b_v << 4) | (alpha >> 4);
buf[0][offset + 1] = (r_y_h << 4) | g_u_s;
break;
case V4L2_PIX_FMT_XBGR444:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_ABGR444:
buf[0][offset] = (g_u_s << 4) | r_y_h;
buf[0][offset + 1] = (alpha & 0xf0) | b_v;
break;
case V4L2_PIX_FMT_BGRX444:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_BGRA444:
buf[0][offset] = (r_y_h << 4) | (alpha >> 4);
buf[0][offset + 1] = (b_v << 4) | g_u_s;
break;
case V4L2_PIX_FMT_RGB555:
case V4L2_PIX_FMT_XRGB555:
alpha = 0;
@ -1247,6 +1312,30 @@ static void gen_twopix(struct tpg_data *tpg,
buf[0][offset + 1] = (alpha & 0x80) | (r_y_h << 2)
| (g_u_s >> 3);
break;
case V4L2_PIX_FMT_RGBX555:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_RGBA555:
buf[0][offset] = (g_u_s << 6) | (b_v << 1) |
((alpha & 0x80) >> 7);
buf[0][offset + 1] = (r_y_h << 3) | (g_u_s >> 2);
break;
case V4L2_PIX_FMT_XBGR555:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_ABGR555:
buf[0][offset] = (g_u_s << 5) | r_y_h;
buf[0][offset + 1] = (alpha & 0x80) | (b_v << 2)
| (g_u_s >> 3);
break;
case V4L2_PIX_FMT_BGRX555:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_BGRA555:
buf[0][offset] = (g_u_s << 6) | (r_y_h << 1) |
((alpha & 0x80) >> 7);
buf[0][offset + 1] = (b_v << 3) | (g_u_s >> 2);
break;
case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
alpha = 0;
@ -1286,6 +1375,15 @@ static void gen_twopix(struct tpg_data *tpg,
buf[0][offset + 2] = g_u_s;
buf[0][offset + 3] = b_v;
break;
case V4L2_PIX_FMT_RGBX32:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_RGBA32:
buf[0][offset] = r_y_h;
buf[0][offset + 1] = g_u_s;
buf[0][offset + 2] = b_v;
buf[0][offset + 3] = alpha;
break;
case V4L2_PIX_FMT_BGR32:
case V4L2_PIX_FMT_XBGR32:
case V4L2_PIX_FMT_VUYX32:
@ -1298,6 +1396,15 @@ static void gen_twopix(struct tpg_data *tpg,
buf[0][offset + 2] = r_y_h;
buf[0][offset + 3] = alpha;
break;
case V4L2_PIX_FMT_BGRX32:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_BGRA32:
buf[0][offset] = alpha;
buf[0][offset + 1] = b_v;
buf[0][offset + 2] = g_u_s;
buf[0][offset + 3] = r_y_h;
break;
case V4L2_PIX_FMT_SBGGR8:
buf[0][offset] = odd ? g_u_s : b_v;
buf[1][offset] = odd ? r_y_h : g_u_s;

View File

@ -267,8 +267,14 @@ static void vb2_dc_dmabuf_ops_detach(struct dma_buf *dbuf,
/* release the scatterlist cache */
if (attach->dma_dir != DMA_NONE)
dma_unmap_sg(db_attach->dev, sgt->sgl, sgt->orig_nents,
attach->dma_dir);
/*
* Cache sync can be skipped here, as the vb2_dc memory is
* allocated from device coherent memory, which means the
* memory locations do not require any explicit cache
* maintenance prior or after being used by the device.
*/
dma_unmap_sg_attrs(db_attach->dev, sgt->sgl, sgt->orig_nents,
attach->dma_dir, DMA_ATTR_SKIP_CPU_SYNC);
sg_free_table(sgt);
kfree(attach);
db_attach->priv = NULL;
@ -293,14 +299,17 @@ static struct sg_table *vb2_dc_dmabuf_ops_map(
/* release any previous cache */
if (attach->dma_dir != DMA_NONE) {
dma_unmap_sg(db_attach->dev, sgt->sgl, sgt->orig_nents,
attach->dma_dir);
dma_unmap_sg_attrs(db_attach->dev, sgt->sgl, sgt->orig_nents,
attach->dma_dir, DMA_ATTR_SKIP_CPU_SYNC);
attach->dma_dir = DMA_NONE;
}
/* mapping to the client with new direction */
sgt->nents = dma_map_sg(db_attach->dev, sgt->sgl, sgt->orig_nents,
dma_dir);
/*
* mapping to the client with new direction, no cache sync
* required see comment in vb2_dc_dmabuf_ops_detach()
*/
sgt->nents = dma_map_sg_attrs(db_attach->dev, sgt->sgl, sgt->orig_nents,
dma_dir, DMA_ATTR_SKIP_CPU_SYNC);
if (!sgt->nents) {
pr_err("failed to map scatterlist\n");
mutex_unlock(lock);

View File

@ -872,17 +872,19 @@ EXPORT_SYMBOL_GPL(vb2_queue_release);
__poll_t vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
{
struct video_device *vfd = video_devdata(file);
__poll_t res = 0;
__poll_t res;
res = vb2_core_poll(q, file, wait);
if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) {
struct v4l2_fh *fh = file->private_data;
poll_wait(file, &fh->wait, wait);
if (v4l2_event_pending(fh))
res = EPOLLPRI;
res |= EPOLLPRI;
}
return res | vb2_core_poll(q, file, wait);
return res;
}
EXPORT_SYMBOL_GPL(vb2_poll);

View File

@ -152,6 +152,9 @@ static void dvb_frontend_free(struct kref *ref)
static void dvb_frontend_put(struct dvb_frontend *fe)
{
/* call detach before dropping the reference count */
if (fe->ops.detach)
fe->ops.detach(fe);
/*
* Check if the frontend was registered, as otherwise
* kref was not initialized yet.
@ -3040,7 +3043,6 @@ void dvb_frontend_detach(struct dvb_frontend *fe)
dvb_frontend_invoke_release(fe, fe->ops.release_sec);
dvb_frontend_invoke_release(fe, fe->ops.tuner_ops.release);
dvb_frontend_invoke_release(fe, fe->ops.analog_ops.release);
dvb_frontend_invoke_release(fe, fe->ops.detach);
dvb_frontend_put(fe);
}
EXPORT_SYMBOL(dvb_frontend_detach);

View File

@ -339,8 +339,10 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev,
if (npads) {
dvbdev->pads = kcalloc(npads, sizeof(*dvbdev->pads),
GFP_KERNEL);
if (!dvbdev->pads)
if (!dvbdev->pads) {
kfree(dvbdev->entity);
return -ENOMEM;
}
}
switch (type) {
@ -476,7 +478,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
return -ENOMEM;
}
dvbdevfops = kzalloc(sizeof(struct file_operations), GFP_KERNEL);
dvbdevfops = kmemdup(template->fops, sizeof(*dvbdevfops), GFP_KERNEL);
if (!dvbdevfops){
kfree (dvbdev);
@ -492,7 +494,6 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
dvbdev->fops = dvbdevfops;
init_waitqueue_head (&dvbdev->wait_queue);
memcpy(dvbdevfops, template->fops, sizeof(struct file_operations));
dvbdevfops->owner = adap->module;
list_add_tail (&dvbdev->list_head, &adap->device_list);

View File

@ -1,5 +1,8 @@
comment "DVB Frontend drivers hidden by 'Autoselect ancillary drivers'"
depends on MEDIA_HIDE_ANCILLARY_SUBDRV
menu "Customise DVB Frontends"
visible if !MEDIA_SUBDRV_AUTOSELECT || COMPILE_TEST || EXPERT
visible if !MEDIA_HIDE_ANCILLARY_SUBDRV
comment "Multistandard (satellite) frontends"
depends on DVB_CORE

View File

@ -619,8 +619,10 @@ static int cx24117_load_firmware(struct dvb_frontend *fe,
/* send fw */
ret = i2c_transfer(state->priv->i2c, &msg, 1);
if (ret < 0)
if (ret < 0) {
kfree(buf);
return ret;
}
kfree(buf);

View File

@ -431,7 +431,7 @@ static u32 cx24123_int_log2(u32 a, u32 b)
u32 div = a / b;
if (a % b >= b / 2)
++div;
if (div < (1 << 31)) {
if (div < (1UL << 31)) {
for (exp = 1; div > exp; nearest++)
exp += exp;
}

View File

@ -594,7 +594,7 @@ static int write_data(struct dvb_ca_en50221 *ca, int slot, u8 *ebuf, int ecount)
return ecount;
}
static struct dvb_ca_en50221 en_templ = {
static const struct dvb_ca_en50221 en_templ = {
.read_attribute_mem = read_attribute_mem,
.write_attribute_mem = write_attribute_mem,
.read_cam_control = read_cam_control,

View File

@ -632,12 +632,11 @@ static int cxd2820r_probe(struct i2c_client *client,
* one dummy I2C client in in order to get own I2C client for each
* register bank.
*/
priv->client[1] = i2c_new_dummy(client->adapter, client->addr | (1 << 1));
if (!priv->client[1]) {
ret = -ENODEV;
priv->client[1] = i2c_new_dummy_device(client->adapter, client->addr | (1 << 1));
if (IS_ERR(priv->client[1])) {
ret = PTR_ERR(priv->client[1]);
dev_err(&client->dev, "I2C registration failed\n");
if (ret)
goto err_regmap_0_regmap_exit;
goto err_regmap_0_regmap_exit;
}
priv->regmap[1] = regmap_init_i2c(priv->client[1], &regmap_config1);

View File

@ -2036,7 +2036,8 @@ static int dib7000pc_detection(struct i2c_adapter *i2c_adap)
if (i2c_transfer(i2c_adap, msg, 2) == 2)
if (rx[0] == 0x01 && rx[1] == 0xb3) {
dprintk("-D- DiB7000PC detected\n");
return 1;
ret = 1;
goto out;
}
msg[0].addr = msg[1].addr = 0x40;
@ -2044,11 +2045,13 @@ static int dib7000pc_detection(struct i2c_adapter *i2c_adap)
if (i2c_transfer(i2c_adap, msg, 2) == 2)
if (rx[0] == 0x01 && rx[1] == 0xb3) {
dprintk("-D- DiB7000PC detected\n");
return 1;
ret = 1;
goto out;
}
dprintk("-D- DiB7000PC not detected\n");
out:
kfree(rx);
rx_memory_error:
kfree(tx);

View File

@ -12287,7 +12287,8 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
if (state == NULL)
goto error;
demod = kmalloc(sizeof(struct drx_demod_instance), GFP_KERNEL);
demod = kmemdup(&drxj_default_demod_g,
sizeof(struct drx_demod_instance), GFP_KERNEL);
if (demod == NULL)
goto error;
@ -12311,8 +12312,6 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
state->demod = demod;
/* setup the demod data */
memcpy(demod, &drxj_default_demod_g, sizeof(struct drx_demod_instance));
demod->my_i2c_dev_addr = demod_addr;
demod->my_common_attr = demod_comm_attr;
demod->my_i2c_dev_addr->user_data = state;

View File

@ -9,6 +9,7 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/idr.h>
#include <linux/dvb/frontend.h>
#include <asm/types.h>
@ -34,8 +35,7 @@ struct dvb_pll_priv {
};
#define DVB_PLL_MAX 64
static unsigned int dvb_pll_devcount;
static DEFINE_IDA(pll_ida);
static int debug;
module_param(debug, int, 0644);
@ -787,6 +787,7 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
struct dvb_pll_priv *priv = NULL;
int ret;
const struct dvb_pll_desc *desc;
int nr;
b1 = kmalloc(1, GFP_KERNEL);
if (!b1)
@ -795,9 +796,14 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
b1[0] = 0;
msg.buf = b1;
if ((id[dvb_pll_devcount] > DVB_PLL_UNDEFINED) &&
(id[dvb_pll_devcount] < ARRAY_SIZE(pll_list)))
pll_desc_id = id[dvb_pll_devcount];
nr = ida_simple_get(&pll_ida, 0, DVB_PLL_MAX, GFP_KERNEL);
if (nr < 0) {
kfree(b1);
return NULL;
}
if (id[nr] > DVB_PLL_UNDEFINED && id[nr] < ARRAY_SIZE(pll_list))
pll_desc_id = id[nr];
BUG_ON(pll_desc_id < 1 || pll_desc_id >= ARRAY_SIZE(pll_list));
@ -808,24 +814,20 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
fe->ops.i2c_gate_ctrl(fe, 1);
ret = i2c_transfer (i2c, &msg, 1);
if (ret != 1) {
kfree(b1);
return NULL;
}
if (ret != 1)
goto out;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL);
if (!priv) {
kfree(b1);
return NULL;
}
if (!priv)
goto out;
priv->pll_i2c_address = pll_addr;
priv->i2c = i2c;
priv->pll_desc = desc;
priv->nr = dvb_pll_devcount++;
priv->nr = nr;
memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops,
sizeof(struct dvb_tuner_ops));
@ -858,6 +860,11 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
kfree(b1);
return fe;
out:
kfree(b1);
ida_simple_remove(&pll_ida, nr);
return NULL;
}
EXPORT_SYMBOL(dvb_pll_attach);
@ -894,9 +901,10 @@ dvb_pll_probe(struct i2c_client *client, const struct i2c_device_id *id)
static int dvb_pll_remove(struct i2c_client *client)
{
struct dvb_frontend *fe;
struct dvb_frontend *fe = i2c_get_clientdata(client);
struct dvb_pll_priv *priv = fe->tuner_priv;
fe = i2c_get_clientdata(client);
ida_simple_remove(&pll_ida, priv->nr);
dvb_pll_release(fe);
return 0;
}

View File

@ -722,9 +722,9 @@ static int mn88443x_probe(struct i2c_client *client,
* Chip has two I2C addresses for each satellite/terrestrial system.
* ISDB-T uses address ISDB-S + 4, so we register a dummy client.
*/
chip->client_t = i2c_new_dummy(client->adapter, client->addr + 4);
if (!chip->client_t)
return -ENODEV;
chip->client_t = i2c_new_dummy_device(client->adapter, client->addr + 4);
if (IS_ERR(chip->client_t))
return PTR_ERR(chip->client_t);
chip->regmap_t = devm_regmap_init_i2c(chip->client_t, &regmap_config);
if (IS_ERR(chip->regmap_t)) {

View File

@ -612,12 +612,11 @@ static int mn88472_probe(struct i2c_client *client,
* Also, register bank 2 do not support sequential I/O. Only single
* register write or read is allowed to that bank.
*/
dev->client[1] = i2c_new_dummy(client->adapter, 0x1a);
if (!dev->client[1]) {
ret = -ENODEV;
dev->client[1] = i2c_new_dummy_device(client->adapter, 0x1a);
if (IS_ERR(dev->client[1])) {
ret = PTR_ERR(dev->client[1]);
dev_err(&client->dev, "I2C registration failed\n");
if (ret)
goto err_regmap_0_regmap_exit;
goto err_regmap_0_regmap_exit;
}
dev->regmap[1] = regmap_init_i2c(dev->client[1], &regmap_config);
if (IS_ERR(dev->regmap[1])) {
@ -626,12 +625,11 @@ static int mn88472_probe(struct i2c_client *client,
}
i2c_set_clientdata(dev->client[1], dev);
dev->client[2] = i2c_new_dummy(client->adapter, 0x1c);
if (!dev->client[2]) {
ret = -ENODEV;
dev->client[2] = i2c_new_dummy_device(client->adapter, 0x1c);
if (IS_ERR(dev->client[2])) {
ret = PTR_ERR(dev->client[2]);
dev_err(&client->dev, "2nd I2C registration failed\n");
if (ret)
goto err_regmap_1_regmap_exit;
goto err_regmap_1_regmap_exit;
}
dev->regmap[2] = regmap_init_i2c(dev->client[2], &regmap_config);
if (IS_ERR(dev->regmap[2])) {

View File

@ -657,12 +657,11 @@ static int mn88473_probe(struct i2c_client *client,
* Also, register bank 2 do not support sequential I/O. Only single
* register write or read is allowed to that bank.
*/
dev->client[1] = i2c_new_dummy(client->adapter, 0x1a);
if (dev->client[1] == NULL) {
ret = -ENODEV;
dev->client[1] = i2c_new_dummy_device(client->adapter, 0x1a);
if (IS_ERR(dev->client[1])) {
ret = PTR_ERR(dev->client[1]);
dev_err(&client->dev, "I2C registration failed\n");
if (ret)
goto err_regmap_0_regmap_exit;
goto err_regmap_0_regmap_exit;
}
dev->regmap[1] = regmap_init_i2c(dev->client[1], &regmap_config);
if (IS_ERR(dev->regmap[1])) {
@ -671,12 +670,11 @@ static int mn88473_probe(struct i2c_client *client,
}
i2c_set_clientdata(dev->client[1], dev);
dev->client[2] = i2c_new_dummy(client->adapter, 0x1c);
if (dev->client[2] == NULL) {
ret = -ENODEV;
dev->client[2] = i2c_new_dummy_device(client->adapter, 0x1c);
if (IS_ERR(dev->client[2])) {
ret = PTR_ERR(dev->client[2]);
dev_err(&client->dev, "2nd I2C registration failed\n");
if (ret)
goto err_regmap_1_regmap_exit;
goto err_regmap_1_regmap_exit;
}
dev->regmap[2] = regmap_init_i2c(dev->client[2], &regmap_config);
if (IS_ERR(dev->regmap[2])) {

View File

@ -81,11 +81,9 @@ struct rtl2832_sdr_format {
static struct rtl2832_sdr_format formats[] = {
{
.name = "Complex U8",
.pixelformat = V4L2_SDR_FMT_CU8,
.buffersize = BULK_BUFFER_SIZE,
}, {
.name = "Complex U16LE (emulated)",
.pixelformat = V4L2_SDR_FMT_CU16LE,
.buffersize = BULK_BUFFER_SIZE * 2,
},
@ -1116,7 +1114,6 @@ static int rtl2832_sdr_enum_fmt_sdr_cap(struct file *file, void *priv,
if (f->index >= dev->num_formats)
return -EINVAL;
strscpy(f->description, formats[f->index].name, sizeof(f->description));
f->pixelformat = formats[f->index].pixelformat;
return 0;

View File

@ -11,6 +11,13 @@
static const struct dvb_frontend_ops si2168_ops;
static void cmd_init(struct si2168_cmd *cmd, const u8 *buf, int wlen, int rlen)
{
memcpy(cmd->args, buf, wlen);
cmd->wlen = wlen;
cmd->rlen = rlen;
}
/* execute firmware command */
static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd)
{
@ -82,16 +89,23 @@ static int si2168_ts_bus_ctrl(struct dvb_frontend *fe, int acquire)
dev_dbg(&client->dev, "%s acquire: %d\n", __func__, acquire);
/* set manual value */
if (dev->ts_mode & SI2168_TS_CLK_MANUAL) {
cmd_init(&cmd, "\x14\x00\x0d\x10\xe8\x03", 6, 4);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
return ret;
}
/* set TS_MODE property */
memcpy(cmd.args, "\x14\x00\x01\x10\x10\x00", 6);
cmd_init(&cmd, "\x14\x00\x01\x10\x10\x00", 6, 4);
if (dev->ts_mode & SI2168_TS_CLK_MANUAL)
cmd.args[4] = SI2168_TS_CLK_MANUAL;
if (acquire)
cmd.args[4] |= dev->ts_mode;
else
cmd.args[4] |= SI2168_TS_TRISTATE;
if (dev->ts_clock_gapped)
cmd.args[4] |= 0x40;
cmd.wlen = 6;
cmd.rlen = 4;
ret = si2168_cmd_execute(client, &cmd);
return ret;
@ -115,19 +129,13 @@ static int si2168_read_status(struct dvb_frontend *fe, enum fe_status *status)
switch (c->delivery_system) {
case SYS_DVBT:
memcpy(cmd.args, "\xa0\x01", 2);
cmd.wlen = 2;
cmd.rlen = 13;
cmd_init(&cmd, "\xa0\x01", 2, 13);
break;
case SYS_DVBC_ANNEX_A:
memcpy(cmd.args, "\x90\x01", 2);
cmd.wlen = 2;
cmd.rlen = 9;
cmd_init(&cmd, "\x90\x01", 2, 9);
break;
case SYS_DVBT2:
memcpy(cmd.args, "\x50\x01", 2);
cmd.wlen = 2;
cmd.rlen = 14;
cmd_init(&cmd, "\x50\x01", 2, 14);
break;
default:
ret = -EINVAL;
@ -164,9 +172,7 @@ static int si2168_read_status(struct dvb_frontend *fe, enum fe_status *status)
/* BER */
if (*status & FE_HAS_VITERBI) {
memcpy(cmd.args, "\x82\x00", 2);
cmd.wlen = 2;
cmd.rlen = 3;
cmd_init(&cmd, "\x82\x00", 2, 3);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -197,9 +203,7 @@ static int si2168_read_status(struct dvb_frontend *fe, enum fe_status *status)
/* UCB */
if (*status & FE_HAS_SYNC) {
memcpy(cmd.args, "\x84\x01", 2);
cmd.wlen = 2;
cmd.rlen = 3;
cmd_init(&cmd, "\x84\x01", 2, 3);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -285,22 +289,18 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
goto err;
}
memcpy(cmd.args, "\x88\x02\x02\x02\x02", 5);
cmd.wlen = 5;
cmd.rlen = 5;
cmd_init(&cmd, "\x88\x02\x02\x02\x02", 5, 5);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
/* that has no big effect */
if (c->delivery_system == SYS_DVBT)
memcpy(cmd.args, "\x89\x21\x06\x11\xff\x98", 6);
cmd_init(&cmd, "\x89\x21\x06\x11\xff\x98", 6, 3);
else if (c->delivery_system == SYS_DVBC_ANNEX_A)
memcpy(cmd.args, "\x89\x21\x06\x11\x89\xf0", 6);
cmd_init(&cmd, "\x89\x21\x06\x11\x89\xf0", 6, 3);
else if (c->delivery_system == SYS_DVBT2)
memcpy(cmd.args, "\x89\x21\x06\x11\x89\x20", 6);
cmd.wlen = 6;
cmd.rlen = 3;
cmd_init(&cmd, "\x89\x21\x06\x11\x89\x20", 6, 3);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -317,103 +317,77 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
goto err;
}
memcpy(cmd.args, "\x51\x03", 2);
cmd.wlen = 2;
cmd.rlen = 12;
cmd_init(&cmd, "\x51\x03", 2, 12);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x12\x08\x04", 3);
cmd.wlen = 3;
cmd.rlen = 3;
cmd_init(&cmd, "\x12\x08\x04", 3, 3);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x14\x00\x0c\x10\x12\x00", 6);
cmd.wlen = 6;
cmd.rlen = 4;
cmd_init(&cmd, "\x14\x00\x0c\x10\x12\x00", 6, 4);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x14\x00\x06\x10\x24\x00", 6);
cmd.wlen = 6;
cmd.rlen = 4;
cmd_init(&cmd, "\x14\x00\x06\x10\x24\x00", 6, 4);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x14\x00\x07\x10\x00\x24", 6);
cmd.wlen = 6;
cmd.rlen = 4;
cmd_init(&cmd, "\x14\x00\x07\x10\x00\x24", 6, 4);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x14\x00\x0a\x10\x00\x00", 6);
cmd_init(&cmd, "\x14\x00\x0a\x10\x00\x00", 6, 4);
cmd.args[4] = delivery_system | bandwidth;
if (dev->spectral_inversion)
cmd.args[5] |= 1;
cmd.wlen = 6;
cmd.rlen = 4;
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
/* set DVB-C symbol rate */
if (c->delivery_system == SYS_DVBC_ANNEX_A) {
memcpy(cmd.args, "\x14\x00\x02\x11", 4);
cmd_init(&cmd, "\x14\x00\x02\x11\x00\x00", 6, 4);
cmd.args[4] = ((c->symbol_rate / 1000) >> 0) & 0xff;
cmd.args[5] = ((c->symbol_rate / 1000) >> 8) & 0xff;
cmd.wlen = 6;
cmd.rlen = 4;
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
}
memcpy(cmd.args, "\x14\x00\x0f\x10\x10\x00", 6);
cmd.wlen = 6;
cmd.rlen = 4;
cmd_init(&cmd, "\x14\x00\x0f\x10\x10\x00", 6, 4);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x14\x00\x09\x10\xe3\x08", 6);
cmd_init(&cmd, "\x14\x00\x09\x10\xe3\x08", 6, 4);
cmd.args[5] |= dev->ts_clock_inv ? 0x00 : 0x10;
cmd.wlen = 6;
cmd.rlen = 4;
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x14\x00\x08\x10\xd7\x05", 6);
cmd_init(&cmd, "\x14\x00\x08\x10\xd7\x05", 6, 4);
cmd.args[5] |= dev->ts_clock_inv ? 0x00 : 0x10;
cmd.wlen = 6;
cmd.rlen = 4;
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x14\x00\x01\x12\x00\x00", 6);
cmd.wlen = 6;
cmd.rlen = 4;
cmd_init(&cmd, "\x14\x00\x01\x12\x00\x00", 6, 4);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x14\x00\x01\x03\x0c\x00", 6);
cmd.wlen = 6;
cmd.rlen = 4;
cmd_init(&cmd, "\x14\x00\x01\x03\x0c\x00", 6, 4);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
memcpy(cmd.args, "\x85", 1);
cmd.wlen = 1;
cmd.rlen = 1;
cmd_init(&cmd, "\x85", 1, 1);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -443,26 +417,21 @@ static int si2168_init(struct dvb_frontend *fe)
dev_dbg(&client->dev, "\n");
/* initialize */
memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13);
cmd.wlen = 13;
cmd.rlen = 0;
cmd_init(&cmd, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00",
13, 0);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
if (dev->warm) {
/* resume */
memcpy(cmd.args, "\xc0\x06\x08\x0f\x00\x20\x21\x01", 8);
cmd.wlen = 8;
cmd.rlen = 1;
cmd_init(&cmd, "\xc0\x06\x08\x0f\x00\x20\x21\x01", 8, 1);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
udelay(100);
memcpy(cmd.args, "\x85", 1);
cmd.wlen = 1;
cmd.rlen = 1;
cmd_init(&cmd, "\x85", 1, 1);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -471,9 +440,7 @@ static int si2168_init(struct dvb_frontend *fe)
}
/* power up */
memcpy(cmd.args, "\xc0\x06\x01\x0f\x00\x20\x20\x01", 8);
cmd.wlen = 8;
cmd.rlen = 1;
cmd_init(&cmd, "\xc0\x06\x01\x0f\x00\x20\x20\x01", 8, 1);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -511,9 +478,8 @@ static int si2168_init(struct dvb_frontend *fe)
ret = -EINVAL;
break;
}
memcpy(cmd.args, &fw->data[(fw->size - remaining) + 1], len);
cmd.wlen = len;
cmd.rlen = 1;
cmd_init(&cmd, &fw->data[(fw->size - remaining) + 1],
len, 1);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
break;
@ -521,10 +487,7 @@ static int si2168_init(struct dvb_frontend *fe)
} else if (fw->size % 8 == 0) {
/* firmware is in the old format */
for (remaining = fw->size; remaining > 0; remaining -= 8) {
len = 8;
memcpy(cmd.args, &fw->data[fw->size - remaining], len);
cmd.wlen = len;
cmd.rlen = 1;
cmd_init(&cmd, &fw->data[fw->size - remaining], 8, 1);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
break;
@ -541,17 +504,13 @@ static int si2168_init(struct dvb_frontend *fe)
release_firmware(fw);
memcpy(cmd.args, "\x01\x01", 2);
cmd.wlen = 2;
cmd.rlen = 1;
cmd_init(&cmd, "\x01\x01", 2, 1);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
/* query firmware version */
memcpy(cmd.args, "\x11", 1);
cmd.wlen = 1;
cmd.rlen = 10;
cmd_init(&cmd, "\x11", 1, 10);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -609,9 +568,7 @@ static int si2168_sleep(struct dvb_frontend *fe)
if (dev->version > ('B' << 24 | 4 << 16 | 0 << 8 | 11 << 0))
dev->warm = false;
memcpy(cmd.args, "\x13", 1);
cmd.wlen = 1;
cmd.rlen = 0;
cmd_init(&cmd, "\x13", 1, 0);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -637,9 +594,7 @@ static int si2168_select(struct i2c_mux_core *muxc, u32 chan)
struct si2168_cmd cmd;
/* open I2C gate */
memcpy(cmd.args, "\xc0\x0d\x01", 3);
cmd.wlen = 3;
cmd.rlen = 0;
cmd_init(&cmd, "\xc0\x0d\x01", 3, 0);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -657,9 +612,7 @@ static int si2168_deselect(struct i2c_mux_core *muxc, u32 chan)
struct si2168_cmd cmd;
/* close I2C gate */
memcpy(cmd.args, "\xc0\x0d\x00", 3);
cmd.wlen = 3;
cmd.rlen = 0;
cmd_init(&cmd, "\xc0\x0d\x00", 3, 0);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err;
@ -730,25 +683,20 @@ static int si2168_probe(struct i2c_client *client,
mutex_init(&dev->i2c_mutex);
/* Initialize */
memcpy(cmd.args, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00", 13);
cmd.wlen = 13;
cmd.rlen = 0;
cmd_init(&cmd, "\xc0\x12\x00\x0c\x00\x0d\x16\x00\x00\x00\x00\x00\x00",
13, 0);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err_kfree;
/* Power up */
memcpy(cmd.args, "\xc0\x06\x01\x0f\x00\x20\x20\x01", 8);
cmd.wlen = 8;
cmd.rlen = 1;
cmd_init(&cmd, "\xc0\x06\x01\x0f\x00\x20\x20\x01", 8, 1);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err_kfree;
/* Query chip revision */
memcpy(cmd.args, "\x02", 1);
cmd.wlen = 1;
cmd.rlen = 13;
cmd_init(&cmd, "\x02", 1, 13);
ret = si2168_cmd_execute(client, &cmd);
if (ret)
goto err_kfree;

View File

@ -30,6 +30,7 @@ struct si2168_config {
#define SI2168_TS_PARALLEL 0x06
#define SI2168_TS_SERIAL 0x03
#define SI2168_TS_TRISTATE 0x00
#define SI2168_TS_CLK_MANUAL 0x20
u8 ts_mode;
/* TS clock inverted */

View File

@ -270,7 +270,7 @@ static enum fe_stv0900_error stv0900_initialize(struct stv0900_internal *intp)
static u32 stv0900_get_mclk_freq(struct stv0900_internal *intp, u32 ext_clk)
{
u32 mclk = 90000000, div = 0, ad_div = 0;
u32 mclk, div, ad_div;
div = stv0900_get_bits(intp, F0900_M_DIV);
ad_div = ((stv0900_get_bits(intp, F0900_SELX1RATIO) == 1) ? 4 : 6);

View File

@ -421,8 +421,7 @@ static int zd1301_demod_i2c_master_xfer(struct i2c_adapter *adapter,
} else {
dev_dbg(&pdev->dev, "unknown msg[0].len=%u\n", msg[0].len);
ret = -EOPNOTSUPP;
if (ret)
goto err;
goto err;
}
return num;

View File

@ -217,7 +217,7 @@ static const struct file_operations fdtv_ca_fops = {
.llseek = noop_llseek,
};
static struct dvb_device fdtv_ca = {
static const struct dvb_device fdtv_ca = {
.users = 1,
.readers = 1,
.writers = 1,

View File

@ -22,8 +22,11 @@ config VIDEO_IR_I2C
# Encoder / Decoder module configuration
#
comment "I2C drivers hidden by 'Autoselect ancillary drivers'"
depends on MEDIA_HIDE_ANCILLARY_SUBDRV
menu "I2C Encoders, decoders, sensors and other helper chips"
visible if !MEDIA_SUBDRV_AUTOSELECT || COMPILE_TEST || EXPERT
visible if !MEDIA_HIDE_ANCILLARY_SUBDRV
comment "Audio decoders, processors and mixers"
@ -723,6 +726,19 @@ config VIDEO_OV5670
To compile this driver as a module, choose M here: the
module will be called ov5670.
config VIDEO_OV5675
tristate "OmniVision OV5675 sensor support"
depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
depends on MEDIA_CAMERA_SUPPORT
depends on MEDIA_CONTROLLER
select V4L2_FWNODE
help
This is a Video4Linux2 sensor driver for the OmniVision
OV5675 camera.
To compile this driver as a module, choose M here: the
module will be called ov5675.
config VIDEO_OV5695
tristate "OmniVision OV5695 sensor support"
depends on I2C && VIDEO_V4L2

View File

@ -70,6 +70,7 @@ obj-$(CONFIG_VIDEO_OV5640) += ov5640.o
obj-$(CONFIG_VIDEO_OV5645) += ov5645.o
obj-$(CONFIG_VIDEO_OV5647) += ov5647.o
obj-$(CONFIG_VIDEO_OV5670) += ov5670.o
obj-$(CONFIG_VIDEO_OV5675) += ov5675.o
obj-$(CONFIG_VIDEO_OV5695) += ov5695.o
obj-$(CONFIG_VIDEO_OV6650) += ov6650.o
obj-$(CONFIG_VIDEO_OV7251) += ov7251.o

View File

@ -1148,10 +1148,10 @@ static int ad9389b_probe(struct i2c_client *client, const struct i2c_device_id *
v4l2_dbg(1, debug, sd, "reg 0x41 0x%x, chip version (reg 0x00) 0x%x\n",
ad9389b_rd(sd, 0x41), state->chip_revision);
state->edid_i2c_client = i2c_new_dummy(client->adapter, (0x7e>>1));
if (state->edid_i2c_client == NULL) {
state->edid_i2c_client = i2c_new_dummy_device(client->adapter, (0x7e >> 1));
if (IS_ERR(state->edid_i2c_client)) {
v4l2_err(sd, "failed to register edid i2c client\n");
err = -ENOMEM;
err = PTR_ERR(state->edid_i2c_client);
goto err_entity;
}

View File

@ -1329,17 +1329,17 @@ static int adv7180_probe(struct i2c_client *client,
}
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) {
state->csi_client = i2c_new_dummy(client->adapter,
state->csi_client = i2c_new_dummy_device(client->adapter,
ADV7180_DEFAULT_CSI_I2C_ADDR);
if (!state->csi_client)
return -ENOMEM;
if (IS_ERR(state->csi_client))
return PTR_ERR(state->csi_client);
}
if (state->chip_info->flags & ADV7180_FLAG_I2P) {
state->vpp_client = i2c_new_dummy(client->adapter,
state->vpp_client = i2c_new_dummy_device(client->adapter,
ADV7180_DEFAULT_VPP_I2C_ADDR);
if (!state->vpp_client) {
ret = -ENOMEM;
if (IS_ERR(state->vpp_client)) {
ret = PTR_ERR(state->vpp_client);
goto err_unregister_csi_client;
}
}

View File

@ -428,8 +428,7 @@ done:
return pdata;
}
static int adv7343_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int adv7343_probe(struct i2c_client *client)
{
struct adv7343_state *state;
int err;
@ -524,7 +523,7 @@ static struct i2c_driver adv7343_driver = {
.of_match_table = of_match_ptr(adv7343_of_match),
.name = "adv7343",
},
.probe = adv7343_probe,
.probe_new = adv7343_probe,
.remove = adv7343_remove,
.id_table = adv7343_id,
};

View File

@ -668,8 +668,7 @@ static void adv748x_dt_cleanup(struct adv748x_state *state)
of_node_put(state->endpoints[i]);
}
static int adv748x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int adv748x_probe(struct i2c_client *client)
{
struct adv748x_state *state;
int ret;
@ -797,13 +796,6 @@ static int adv748x_remove(struct i2c_client *client)
return 0;
}
static const struct i2c_device_id adv748x_id[] = {
{ "adv7481", 0 },
{ "adv7482", 0 },
{ },
};
MODULE_DEVICE_TABLE(i2c, adv748x_id);
static const struct of_device_id adv748x_of_table[] = {
{ .compatible = "adi,adv7481", },
{ .compatible = "adi,adv7482", },
@ -816,9 +808,8 @@ static struct i2c_driver adv748x_driver = {
.name = "adv748x",
.of_match_table = adv748x_of_table,
},
.probe = adv748x_probe,
.probe_new = adv748x_probe,
.remove = adv748x_remove,
.id_table = adv748x_id,
};
module_i2c_driver(adv748x_driver);

View File

@ -1872,11 +1872,11 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id *
goto err_entity;
}
state->i2c_edid = i2c_new_dummy(client->adapter,
state->i2c_edid = i2c_new_dummy_device(client->adapter,
state->i2c_edid_addr >> 1);
if (state->i2c_edid == NULL) {
if (IS_ERR(state->i2c_edid)) {
v4l2_err(sd, "failed to register edid i2c client\n");
err = -ENOMEM;
err = PTR_ERR(state->i2c_edid);
goto err_entity;
}
@ -1889,11 +1889,11 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id *
}
if (state->pdata.cec_clk) {
state->i2c_cec = i2c_new_dummy(client->adapter,
state->i2c_cec = i2c_new_dummy_device(client->adapter,
state->i2c_cec_addr >> 1);
if (state->i2c_cec == NULL) {
if (IS_ERR(state->i2c_cec)) {
v4l2_err(sd, "failed to register cec i2c client\n");
err = -ENOMEM;
err = PTR_ERR(state->i2c_cec);
goto err_unreg_edid;
}
adv7511_wr(sd, 0xe2, 0x00); /* power up cec section */
@ -1901,10 +1901,10 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id *
adv7511_wr(sd, 0xe2, 0x01); /* power down cec section */
}
state->i2c_pktmem = i2c_new_dummy(client->adapter, state->i2c_pktmem_addr >> 1);
if (state->i2c_pktmem == NULL) {
state->i2c_pktmem = i2c_new_dummy_device(client->adapter, state->i2c_pktmem_addr >> 1);
if (IS_ERR(state->i2c_pktmem)) {
v4l2_err(sd, "failed to register pktmem i2c client\n");
err = -ENOMEM;
err = PTR_ERR(state->i2c_pktmem);
goto err_unreg_cec;
}
@ -1940,8 +1940,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id *
err_unreg_pktmem:
i2c_unregister_device(state->i2c_pktmem);
err_unreg_cec:
if (state->i2c_cec)
i2c_unregister_device(state->i2c_cec);
i2c_unregister_device(state->i2c_cec);
err_unreg_edid:
i2c_unregister_device(state->i2c_edid);
err_entity:
@ -1967,8 +1966,7 @@ static int adv7511_remove(struct i2c_client *client)
adv7511_init_setup(sd);
cancel_delayed_work(&state->edid_handler);
i2c_unregister_device(state->i2c_edid);
if (state->i2c_cec)
i2c_unregister_device(state->i2c_cec);
i2c_unregister_device(state->i2c_cec);
i2c_unregister_device(state->i2c_pktmem);
destroy_workqueue(state->work_queue);
v4l2_device_unregister_subdev(sd);
@ -1980,14 +1978,14 @@ static int adv7511_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id adv7511_id[] = {
{ "adv7511", 0 },
{ "adv7511-v4l2", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, adv7511_id);
static struct i2c_driver adv7511_driver = {
.driver = {
.name = "adv7511",
.name = "adv7511-v4l2",
},
.probe = adv7511_probe,
.remove = adv7511_remove,

View File

@ -3351,28 +3351,17 @@ static const struct v4l2_ctrl_config adv7842_ctrl_free_run_color = {
static void adv7842_unregister_clients(struct v4l2_subdev *sd)
{
struct adv7842_state *state = to_state(sd);
if (state->i2c_avlink)
i2c_unregister_device(state->i2c_avlink);
if (state->i2c_cec)
i2c_unregister_device(state->i2c_cec);
if (state->i2c_infoframe)
i2c_unregister_device(state->i2c_infoframe);
if (state->i2c_sdp_io)
i2c_unregister_device(state->i2c_sdp_io);
if (state->i2c_sdp)
i2c_unregister_device(state->i2c_sdp);
if (state->i2c_afe)
i2c_unregister_device(state->i2c_afe);
if (state->i2c_repeater)
i2c_unregister_device(state->i2c_repeater);
if (state->i2c_edid)
i2c_unregister_device(state->i2c_edid);
if (state->i2c_hdmi)
i2c_unregister_device(state->i2c_hdmi);
if (state->i2c_cp)
i2c_unregister_device(state->i2c_cp);
if (state->i2c_vdp)
i2c_unregister_device(state->i2c_vdp);
i2c_unregister_device(state->i2c_avlink);
i2c_unregister_device(state->i2c_cec);
i2c_unregister_device(state->i2c_infoframe);
i2c_unregister_device(state->i2c_sdp_io);
i2c_unregister_device(state->i2c_sdp);
i2c_unregister_device(state->i2c_afe);
i2c_unregister_device(state->i2c_repeater);
i2c_unregister_device(state->i2c_edid);
i2c_unregister_device(state->i2c_hdmi);
i2c_unregister_device(state->i2c_cp);
i2c_unregister_device(state->i2c_vdp);
state->i2c_avlink = NULL;
state->i2c_cec = NULL;
@ -3400,9 +3389,12 @@ static struct i2c_client *adv7842_dummy_client(struct v4l2_subdev *sd, const cha
return NULL;
}
cp = i2c_new_dummy(client->adapter, io_read(sd, io_reg) >> 1);
if (!cp)
v4l2_err(sd, "register %s on i2c addr 0x%x failed\n", desc, addr);
cp = i2c_new_dummy_device(client->adapter, io_read(sd, io_reg) >> 1);
if (IS_ERR(cp)) {
v4l2_err(sd, "register %s on i2c addr 0x%x failed with %ld\n",
desc, addr, PTR_ERR(cp));
cp = NULL;
}
return cp;
}

View File

@ -1396,8 +1396,7 @@ static int __maybe_unused et8ek8_resume(struct device *dev)
return __et8ek8_set_power(sensor, true);
}
static int et8ek8_probe(struct i2c_client *client,
const struct i2c_device_id *devid)
static int et8ek8_probe(struct i2c_client *client)
{
struct et8ek8_sensor *sensor;
struct device *dev = &client->dev;
@ -1504,7 +1503,7 @@ static struct i2c_driver et8ek8_i2c_driver = {
.pm = &et8ek8_pm_ops,
.of_match_table = et8ek8_of_table,
},
.probe = et8ek8_probe,
.probe_new = et8ek8_probe,
.remove = __exit_p(et8ek8_remove),
.id_table = et8ek8_id_table,
};

View File

@ -1821,8 +1821,7 @@ static const struct i2c_device_id imx274_id[] = {
};
MODULE_DEVICE_TABLE(i2c, imx274_id);
static int imx274_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int imx274_probe(struct i2c_client *client)
{
struct v4l2_subdev *sd;
struct stimx274 *imx274;
@ -1984,7 +1983,7 @@ static struct i2c_driver imx274_i2c_driver = {
.name = DRIVER_NAME,
.of_match_table = imx274_of_id_table,
},
.probe = imx274_probe,
.probe_new = imx274_probe,
.remove = imx274_remove,
.id_table = imx274_id,
};

View File

@ -885,9 +885,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
INIT_DELAYED_WORK(&ir->work, ir_work);
if (probe_tx) {
ir->tx_c = i2c_new_dummy(client->adapter, 0x70);
if (!ir->tx_c) {
ir->tx_c = i2c_new_dummy_device(client->adapter, 0x70);
if (IS_ERR(ir->tx_c)) {
dev_err(&client->dev, "failed to setup tx i2c address");
err = PTR_ERR(ir->tx_c);
goto err_out_free;
} else if (!zilog_init(ir)) {
ir->carrier = 38000;
ir->duty_cycle = 40;
@ -904,7 +906,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
return 0;
err_out_free:
if (ir->tx_c)
if (!IS_ERR(ir->tx_c))
i2c_unregister_device(ir->tx_c);
/* Only frees rc if it were allocated internally */
@ -916,16 +918,12 @@ static int ir_remove(struct i2c_client *client)
{
struct IR_i2c *ir = i2c_get_clientdata(client);
/* kill outstanding polls */
cancel_delayed_work_sync(&ir->work);
if (ir->tx_c)
i2c_unregister_device(ir->tx_c);
i2c_unregister_device(ir->tx_c);
/* unregister device */
rc_unregister_device(ir->rc);
/* free memory */
return 0;
}

View File

@ -1271,8 +1271,7 @@ static int max2175_refout_load_to_bits(struct i2c_client *client, u32 load,
return 0;
}
static int max2175_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int max2175_probe(struct i2c_client *client)
{
bool master = true, am_hiz = false;
u32 refout_load, refout_bits = 0; /* REFOUT disabled */
@ -1433,7 +1432,7 @@ static struct i2c_driver max2175_driver = {
.name = DRIVER_NAME,
.of_match_table = max2175_of_ids,
},
.probe = max2175_probe,
.probe_new = max2175_probe,
.remove = max2175_remove,
.id_table = max2175_id,
};

View File

@ -726,8 +726,7 @@ static const struct v4l2_subdev_ops mt9m001_subdev_ops = {
.pad = &mt9m001_subdev_pad_ops,
};
static int mt9m001_probe(struct i2c_client *client,
const struct i2c_device_id *did)
static int mt9m001_probe(struct i2c_client *client)
{
struct mt9m001 *mt9m001;
struct i2c_adapter *adapter = client->adapter;
@ -872,7 +871,7 @@ static struct i2c_driver mt9m001_i2c_driver = {
.pm = &mt9m001_pm_ops,
.of_match_table = mt9m001_of_match,
},
.probe = mt9m001_probe,
.probe_new = mt9m001_probe,
.remove = mt9m001_remove,
.id_table = mt9m001_id,
};

View File

@ -533,7 +533,7 @@ static int mt9m111_get_fmt(struct v4l2_subdev *sd,
format->format = *mf;
return 0;
#else
return -ENOTTY;
return -EINVAL;
#endif
}
@ -1243,8 +1243,7 @@ out_put_fw:
return ret;
}
static int mt9m111_probe(struct i2c_client *client,
const struct i2c_device_id *did)
static int mt9m111_probe(struct i2c_client *client)
{
struct mt9m111 *mt9m111;
struct i2c_adapter *adapter = client->adapter;
@ -1388,7 +1387,7 @@ static struct i2c_driver mt9m111_i2c_driver = {
.name = "mt9m111",
.of_match_table = of_match_ptr(mt9m111_of_match),
},
.probe = mt9m111_probe,
.probe_new = mt9m111_probe,
.remove = mt9m111_remove,
.id_table = mt9m111_id,
};

View File

@ -929,7 +929,7 @@ static int ov2640_get_fmt(struct v4l2_subdev *sd,
format->format = *mf;
return 0;
#else
return -ENOTTY;
return -EINVAL;
#endif
}
@ -1190,8 +1190,7 @@ static int ov2640_probe_dt(struct i2c_client *client,
/*
* i2c_driver functions
*/
static int ov2640_probe(struct i2c_client *client,
const struct i2c_device_id *did)
static int ov2640_probe(struct i2c_client *client)
{
struct ov2640_priv *priv;
struct i2c_adapter *adapter = client->adapter;
@ -1302,7 +1301,7 @@ static struct i2c_driver ov2640_i2c_driver = {
.name = "ov2640",
.of_match_table = of_match_ptr(ov2640_of_match),
},
.probe = ov2640_probe,
.probe_new = ov2640_probe,
.remove = ov2640_remove,
.id_table = ov2640_id,
};

View File

@ -1055,7 +1055,7 @@ static int ov2659_get_fmt(struct v4l2_subdev *sd,
mutex_unlock(&ov2659->lock);
return 0;
#else
return -ENOTTY;
return -EINVAL;
#endif
}
@ -1131,8 +1131,6 @@ static int ov2659_set_fmt(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
*mf = fmt->format;
#else
ret = -ENOTTY;
#endif
} else {
s64 val;
@ -1386,8 +1384,7 @@ done:
return pdata;
}
static int ov2659_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int ov2659_probe(struct i2c_client *client)
{
const struct ov2659_platform_data *pdata = ov2659_get_pdata(client);
struct v4l2_subdev *sd;
@ -1515,7 +1512,7 @@ static struct i2c_driver ov2659_i2c_driver = {
.name = DRIVER_NAME,
.of_match_table = of_match_ptr(ov2659_of_match),
},
.probe = ov2659_probe,
.probe_new = ov2659_probe,
.remove = ov2659_remove,
.id_table = ov2659_id,
};

View File

@ -675,7 +675,7 @@ static int ov2680_get_fmt(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
fmt = v4l2_subdev_get_try_format(&sensor->sd, cfg, format->pad);
#else
ret = -ENOTTY;
ret = -EINVAL;
#endif
} else {
fmt = &sensor->fmt;
@ -723,10 +723,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
try_fmt = v4l2_subdev_get_try_format(sd, cfg, 0);
format->format = *try_fmt;
#else
ret = -ENOTTY;
#endif
goto unlock;
}
@ -1023,7 +1020,7 @@ static int ov2680_check_id(struct ov2680_dev *sensor)
return 0;
}
static int ov2860_parse_dt(struct ov2680_dev *sensor)
static int ov2680_parse_dt(struct ov2680_dev *sensor)
{
struct device *dev = ov2680_to_dev(sensor);
int ret;
@ -1064,7 +1061,7 @@ static int ov2680_probe(struct i2c_client *client)
sensor->i2c_client = client;
ret = ov2860_parse_dt(sensor);
ret = ov2680_parse_dt(sensor);
if (ret < 0)
return -EINVAL;

View File

@ -158,8 +158,8 @@ static const int ov5640_framerates[] = {
/* regulator supplies */
static const char * const ov5640_supply_name[] = {
"DOVDD", /* Digital I/O (1.8V) supply */
"DVDD", /* Digital Core (1.5V) supply */
"AVDD", /* Analog (2.8V) supply */
"DVDD", /* Digital Core (1.5V) supply */
};
#define OV5640_NUM_SUPPLIES ARRAY_SIZE(ov5640_supply_name)
@ -2936,8 +2936,7 @@ power_off:
return ret;
}
static int ov5640_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int ov5640_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct fwnode_handle *endpoint;
@ -3022,9 +3021,14 @@ static int ov5640_probe(struct i2c_client *client,
/* request optional power down pin */
sensor->pwdn_gpio = devm_gpiod_get_optional(dev, "powerdown",
GPIOD_OUT_HIGH);
if (IS_ERR(sensor->pwdn_gpio))
return PTR_ERR(sensor->pwdn_gpio);
/* request optional reset pin */
sensor->reset_gpio = devm_gpiod_get_optional(dev, "reset",
GPIOD_OUT_HIGH);
if (IS_ERR(sensor->reset_gpio))
return PTR_ERR(sensor->reset_gpio);
v4l2_i2c_subdev_init(&sensor->sd, client, &ov5640_subdev_ops);
@ -3050,7 +3054,7 @@ static int ov5640_probe(struct i2c_client *client,
if (ret)
goto entity_cleanup;
ret = v4l2_async_register_subdev(&sensor->sd);
ret = v4l2_async_register_subdev_sensor_common(&sensor->sd);
if (ret)
goto free_ctrls;
@ -3095,7 +3099,7 @@ static struct i2c_driver ov5640_i2c_driver = {
.of_match_table = ov5640_dt_ids,
},
.id_table = ov5640_id,
.probe = ov5640_probe,
.probe_new = ov5640_probe,
.remove = ov5640_remove,
};

View File

@ -34,10 +34,6 @@
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
#define OV5645_VOLTAGE_ANALOG 2800000
#define OV5645_VOLTAGE_DIGITAL_CORE 1500000
#define OV5645_VOLTAGE_DIGITAL_IO 1800000
#define OV5645_SYSTEM_CTRL0 0x3008
#define OV5645_SYSTEM_CTRL0_START 0x02
#define OV5645_SYSTEM_CTRL0_STOP 0x42
@ -45,6 +41,8 @@
#define OV5645_CHIP_ID_HIGH_BYTE 0x56
#define OV5645_CHIP_ID_LOW 0x300b
#define OV5645_CHIP_ID_LOW_BYTE 0x45
#define OV5645_IO_MIPI_CTRL00 0x300e
#define OV5645_PAD_OUTPUT00 0x3019
#define OV5645_AWB_MANUAL_CONTROL 0x3406
#define OV5645_AWB_MANUAL_ENABLE BIT(0)
#define OV5645_AEC_PK_MANUAL 0x3503
@ -55,6 +53,7 @@
#define OV5645_ISP_VFLIP BIT(2)
#define OV5645_TIMING_TC_REG21 0x3821
#define OV5645_SENSOR_MIRROR BIT(1)
#define OV5645_MIPI_CTRL00 0x4800
#define OV5645_PRE_ISP_TEST_SETTING_1 0x503d
#define OV5645_TEST_PATTERN_MASK 0x3
#define OV5645_SET_TEST_PATTERN(x) ((x) & OV5645_TEST_PATTERN_MASK)
@ -62,6 +61,15 @@
#define OV5645_SDE_SAT_U 0x5583
#define OV5645_SDE_SAT_V 0x5584
/* regulator supplies */
static const char * const ov5645_supply_name[] = {
"vdddo", /* Digital I/O (1.8V) supply */
"vdda", /* Analog (2.8V) supply */
"vddd", /* Digital Core (1.5V) supply */
};
#define OV5645_NUM_SUPPLIES ARRAY_SIZE(ov5645_supply_name)
struct reg_value {
u16 reg;
u8 val;
@ -86,9 +94,7 @@ struct ov5645 {
struct v4l2_rect crop;
struct clk *xclk;
struct regulator *io_regulator;
struct regulator *core_regulator;
struct regulator *analog_regulator;
struct regulator_bulk_data supplies[OV5645_NUM_SUPPLIES];
const struct ov5645_mode_info *current_mode;
@ -121,7 +127,6 @@ static const struct reg_value ov5645_global_init_setting[] = {
{ 0x3503, 0x07 },
{ 0x3002, 0x1c },
{ 0x3006, 0xc3 },
{ 0x300e, 0x45 },
{ 0x3017, 0x00 },
{ 0x3018, 0x00 },
{ 0x302e, 0x0b },
@ -350,7 +355,10 @@ static const struct reg_value ov5645_global_init_setting[] = {
{ 0x3a1f, 0x14 },
{ 0x0601, 0x02 },
{ 0x3008, 0x42 },
{ 0x3008, 0x02 }
{ 0x3008, 0x02 },
{ OV5645_IO_MIPI_CTRL00, 0x40 },
{ OV5645_MIPI_CTRL00, 0x24 },
{ OV5645_PAD_OUTPUT00, 0x70 }
};
static const struct reg_value ov5645_setting_sxga[] = {
@ -533,55 +541,6 @@ static const struct ov5645_mode_info ov5645_mode_info_data[] = {
},
};
static int ov5645_regulators_enable(struct ov5645 *ov5645)
{
int ret;
ret = regulator_enable(ov5645->io_regulator);
if (ret < 0) {
dev_err(ov5645->dev, "set io voltage failed\n");
return ret;
}
ret = regulator_enable(ov5645->analog_regulator);
if (ret) {
dev_err(ov5645->dev, "set analog voltage failed\n");
goto err_disable_io;
}
ret = regulator_enable(ov5645->core_regulator);
if (ret) {
dev_err(ov5645->dev, "set core voltage failed\n");
goto err_disable_analog;
}
return 0;
err_disable_analog:
regulator_disable(ov5645->analog_regulator);
err_disable_io:
regulator_disable(ov5645->io_regulator);
return ret;
}
static void ov5645_regulators_disable(struct ov5645 *ov5645)
{
int ret;
ret = regulator_disable(ov5645->core_regulator);
if (ret < 0)
dev_err(ov5645->dev, "core regulator disable failed\n");
ret = regulator_disable(ov5645->analog_regulator);
if (ret < 0)
dev_err(ov5645->dev, "analog regulator disable failed\n");
ret = regulator_disable(ov5645->io_regulator);
if (ret < 0)
dev_err(ov5645->dev, "io regulator disable failed\n");
}
static int ov5645_write_reg(struct ov5645 *ov5645, u16 reg, u8 val)
{
u8 regbuf[3];
@ -680,15 +639,14 @@ static int ov5645_set_power_on(struct ov5645 *ov5645)
{
int ret;
ret = ov5645_regulators_enable(ov5645);
if (ret < 0) {
ret = regulator_bulk_enable(OV5645_NUM_SUPPLIES, ov5645->supplies);
if (ret < 0)
return ret;
}
ret = clk_prepare_enable(ov5645->xclk);
if (ret < 0) {
dev_err(ov5645->dev, "clk prepare enable failed\n");
ov5645_regulators_disable(ov5645);
regulator_bulk_disable(OV5645_NUM_SUPPLIES, ov5645->supplies);
return ret;
}
@ -708,7 +666,7 @@ static void ov5645_set_power_off(struct ov5645 *ov5645)
gpiod_set_value_cansleep(ov5645->rst_gpio, 1);
gpiod_set_value_cansleep(ov5645->enable_gpio, 0);
clk_disable_unprepare(ov5645->xclk);
ov5645_regulators_disable(ov5645);
regulator_bulk_disable(OV5645_NUM_SUPPLIES, ov5645->supplies);
}
static int ov5645_s_power(struct v4l2_subdev *sd, int on)
@ -737,13 +695,9 @@ static int ov5645_s_power(struct v4l2_subdev *sd, int on)
goto exit;
}
ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0,
OV5645_SYSTEM_CTRL0_STOP);
if (ret < 0) {
ov5645_set_power_off(ov5645);
goto exit;
}
usleep_range(500, 1000);
} else {
ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x58);
ov5645_set_power_off(ov5645);
}
}
@ -1049,11 +1003,20 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable)
dev_err(ov5645->dev, "could not sync v4l2 controls\n");
return ret;
}
ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x45);
if (ret < 0)
return ret;
ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0,
OV5645_SYSTEM_CTRL0_START);
if (ret < 0)
return ret;
} else {
ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40);
if (ret < 0)
return ret;
ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0,
OV5645_SYSTEM_CTRL0_STOP);
if (ret < 0)
@ -1086,13 +1049,13 @@ static const struct v4l2_subdev_ops ov5645_subdev_ops = {
.pad = &ov5645_subdev_pad_ops,
};
static int ov5645_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int ov5645_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct device_node *endpoint;
struct ov5645 *ov5645;
u8 chip_id_high, chip_id_low;
unsigned int i;
u32 xclk_freq;
int ret;
@ -1150,47 +1113,13 @@ static int ov5645_probe(struct i2c_client *client,
return ret;
}
ov5645->io_regulator = devm_regulator_get(dev, "vdddo");
if (IS_ERR(ov5645->io_regulator)) {
dev_err(dev, "cannot get io regulator\n");
return PTR_ERR(ov5645->io_regulator);
}
for (i = 0; i < OV5645_NUM_SUPPLIES; i++)
ov5645->supplies[i].supply = ov5645_supply_name[i];
ret = regulator_set_voltage(ov5645->io_regulator,
OV5645_VOLTAGE_DIGITAL_IO,
OV5645_VOLTAGE_DIGITAL_IO);
if (ret < 0) {
dev_err(dev, "cannot set io voltage\n");
ret = devm_regulator_bulk_get(dev, OV5645_NUM_SUPPLIES,
ov5645->supplies);
if (ret < 0)
return ret;
}
ov5645->core_regulator = devm_regulator_get(dev, "vddd");
if (IS_ERR(ov5645->core_regulator)) {
dev_err(dev, "cannot get core regulator\n");
return PTR_ERR(ov5645->core_regulator);
}
ret = regulator_set_voltage(ov5645->core_regulator,
OV5645_VOLTAGE_DIGITAL_CORE,
OV5645_VOLTAGE_DIGITAL_CORE);
if (ret < 0) {
dev_err(dev, "cannot set core voltage\n");
return ret;
}
ov5645->analog_regulator = devm_regulator_get(dev, "vdda");
if (IS_ERR(ov5645->analog_regulator)) {
dev_err(dev, "cannot get analog regulator\n");
return PTR_ERR(ov5645->analog_regulator);
}
ret = regulator_set_voltage(ov5645->analog_regulator,
OV5645_VOLTAGE_ANALOG,
OV5645_VOLTAGE_ANALOG);
if (ret < 0) {
dev_err(dev, "cannot set analog voltage\n");
return ret;
}
ov5645->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
if (IS_ERR(ov5645->enable_gpio)) {
@ -1355,7 +1284,7 @@ static struct i2c_driver ov5645_i2c_driver = {
.of_match_table = of_match_ptr(ov5645_of_match),
.name = "ov5645",
},
.probe = ov5645_probe,
.probe_new = ov5645_probe,
.remove = ov5645_remove,
.id_table = ov5645_id,
};

View File

@ -547,8 +547,7 @@ static int ov5647_parse_dt(struct device_node *np)
return ret;
}
static int ov5647_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int ov5647_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct ov5647 *sensor;
@ -644,7 +643,7 @@ static struct i2c_driver ov5647_driver = {
.of_match_table = of_match_ptr(ov5647_of_match),
.name = SENSOR_NAME,
},
.probe = ov5647_probe,
.probe_new = ov5647_probe,
.remove = ov5647_remove,
.id_table = ov5647_id,
};

File diff suppressed because it is too large Load Diff

View File

@ -823,9 +823,6 @@ static int ov5695_set_fmt(struct v4l2_subdev *sd,
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
*v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format;
#else
mutex_unlock(&ov5695->mutex);
return -ENOTTY;
#endif
} else {
ov5695->cur_mode = mode;
@ -856,7 +853,7 @@ static int ov5695_get_fmt(struct v4l2_subdev *sd,
fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
#else
mutex_unlock(&ov5695->mutex);
return -ENOTTY;
return -EINVAL;
#endif
} else {
fmt->format.width = mode->width;

View File

@ -1110,10 +1110,8 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
mbus_fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
*mbus_fmt = format->format;
return 0;
#else
return -ENOTTY;
#endif
return 0;
}
ret = ov7670_try_fmt_internal(sd, &format->format, &info->fmt, &info->wsize);
@ -1146,7 +1144,7 @@ static int ov7670_get_fmt(struct v4l2_subdev *sd,
format->format = *mbus_fmt;
return 0;
#else
return -ENOTTY;
return -EINVAL;
#endif
} else {
format->format = info->format;

View File

@ -1352,8 +1352,7 @@ static const struct v4l2_subdev_ops ov772x_subdev_ops = {
* i2c_driver function
*/
static int ov772x_probe(struct i2c_client *client,
const struct i2c_device_id *did)
static int ov772x_probe(struct i2c_client *client)
{
struct ov772x_priv *priv;
int ret;
@ -1486,7 +1485,7 @@ static struct i2c_driver ov772x_i2c_driver = {
.name = "ov772x",
.of_match_table = ov772x_of_match,
},
.probe = ov772x_probe,
.probe_new = ov772x_probe,
.remove = ov772x_remove,
.id_table = ov772x_id,
};

View File

@ -827,13 +827,9 @@ static int ov7740_set_fmt(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
mbus_fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
*mbus_fmt = format->format;
#endif
mutex_unlock(&ov7740->mutex);
return 0;
#else
ret = -ENOTTY;
goto error;
#endif
}
ret = ov7740_try_fmt_internal(sd, &format->format, &ovfmt, &fsize);
@ -868,7 +864,7 @@ static int ov7740_get_fmt(struct v4l2_subdev *sd,
format->format = *mbus_fmt;
ret = 0;
#else
ret = -ENOTTY;
ret = -EINVAL;
#endif
} else {
format->format = ov7740->format;
@ -1066,8 +1062,7 @@ static const struct regmap_config ov7740_regmap_config = {
.max_register = OV7740_MAX_REGISTER,
};
static int ov7740_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int ov7740_probe(struct i2c_client *client)
{
struct ov7740 *ov7740;
struct v4l2_subdev *sd;
@ -1229,7 +1224,7 @@ static struct i2c_driver ov7740_i2c_driver = {
.pm = &ov7740_pm_ops,
.of_match_table = of_match_ptr(ov7740_of_match),
},
.probe = ov7740_probe,
.probe_new = ov7740_probe,
.remove = ov7740_remove,
.id_table = ov7740_id,
};

View File

@ -1106,7 +1106,10 @@ static int ov8856_check_hwcfg(struct device *dev)
if (!fwnode)
return -ENXIO;
fwnode_property_read_u32(fwnode, "clock-frequency", &mclk);
ret = fwnode_property_read_u32(fwnode, "clock-frequency", &mclk);
if (ret)
return ret;
if (mclk != OV8856_MCLK) {
dev_err(dev, "external clock %d is not supported", mclk);
return -EINVAL;

View File

@ -703,6 +703,11 @@ static int ov965x_set_gain(struct ov965x *ov965x, int auto_gain)
for (m = 6; m >= 0; m--)
if (gain >= (1 << m) * 16)
break;
/* Sanity check: don't adjust the gain with a negative value */
if (m < 0)
return -EINVAL;
rgain = (gain - ((1 << m) * 16)) / (1 << m);
rgain |= (((1 << m) - 1) << 4);
@ -1485,8 +1490,7 @@ out:
return ret;
}
static int ov965x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int ov965x_probe(struct i2c_client *client)
{
const struct ov9650_platform_data *pdata = client->dev.platform_data;
struct v4l2_subdev *sd;
@ -1613,7 +1617,7 @@ static struct i2c_driver ov965x_i2c_driver = {
.name = DRIVER_NAME,
.of_match_table = of_match_ptr(ov965x_of_match),
},
.probe = ov965x_probe,
.probe_new = ov965x_probe,
.remove = ov965x_remove,
.id_table = ov965x_id,
};

View File

@ -1650,8 +1650,7 @@ static int s5c73m3_get_platform_data(struct s5c73m3 *state)
return 0;
}
static int s5c73m3_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int s5c73m3_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct v4l2_subdev *sd;
@ -1806,7 +1805,7 @@ static struct i2c_driver s5c73m3_i2c_driver = {
.of_match_table = of_match_ptr(s5c73m3_of_match),
.name = DRIVER_NAME,
},
.probe = s5c73m3_probe,
.probe_new = s5c73m3_probe,
.remove = s5c73m3_remove,
.id_table = s5c73m3_id,
};

View File

@ -1946,8 +1946,7 @@ static int s5k5baf_configure_regulators(struct s5k5baf *state)
return ret;
}
static int s5k5baf_probe(struct i2c_client *c,
const struct i2c_device_id *id)
static int s5k5baf_probe(struct i2c_client *c)
{
struct s5k5baf *state;
int ret;
@ -2046,7 +2045,7 @@ static struct i2c_driver s5k5baf_i2c_driver = {
.of_match_table = s5k5baf_of_match,
.name = S5K5BAF_DRIVER_NAME
},
.probe = s5k5baf_probe,
.probe_new = s5k5baf_probe,
.remove = s5k5baf_remove,
.id_table = s5k5baf_id,
};

View File

@ -275,8 +275,7 @@ static const struct v4l2_subdev_ops s5k6a3_subdev_ops = {
.pad = &s5k6a3_pad_ops,
};
static int s5k6a3_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int s5k6a3_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct s5k6a3 *sensor;
@ -378,7 +377,7 @@ static struct i2c_driver s5k6a3_driver = {
.of_match_table = of_match_ptr(s5k6a3_of_match),
.name = S5K6A3_DRV_NAME,
},
.probe = s5k6a3_probe,
.probe_new = s5k6a3_probe,
.remove = s5k6a3_remove,
.id_table = s5k6a3_ids,
};

View File

@ -2847,8 +2847,7 @@ out_err:
return NULL;
}
static int smiapp_probe(struct i2c_client *client,
const struct i2c_device_id *devid)
static int smiapp_probe(struct i2c_client *client)
{
struct smiapp_sensor *sensor;
struct smiapp_hwconfig *hwcfg = smiapp_get_hwconfig(&client->dev);
@ -3172,7 +3171,7 @@ static struct i2c_driver smiapp_i2c_driver = {
.name = SMIAPP_NAME,
.pm = &smiapp_pm_ops,
},
.probe = smiapp_probe,
.probe_new = smiapp_probe,
.remove = smiapp_remove,
.id_table = smiapp_id_table,
};

View File

@ -2026,8 +2026,7 @@ static inline int tc358743_probe_of(struct tc358743_state *state)
}
#endif
static int tc358743_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int tc358743_probe(struct i2c_client *client)
{
static struct v4l2_dv_timings default_timing =
V4L2_DV_BT_CEA_640X480P59_94;
@ -2222,7 +2221,7 @@ static struct i2c_driver tc358743_driver = {
.name = "tc358743",
.of_match_table = of_match_ptr(tc358743_of_match),
},
.probe = tc358743_probe,
.probe_new = tc358743_probe,
.remove = tc358743_remove,
.id_table = tc358743_id,
};

View File

@ -2691,7 +2691,13 @@ static int tda1997x_probe(struct i2c_client *client,
}
ret = 0x34 + ((io_read(sd, REG_SLAVE_ADDR)>>4) & 0x03);
state->client_cec = i2c_new_dummy(client->adapter, ret);
state->client_cec = devm_i2c_new_dummy_device(&client->dev,
client->adapter, ret);
if (IS_ERR(state->client_cec)) {
ret = PTR_ERR(state->client_cec);
goto err_free_mutex;
}
v4l_info(client, "CEC slave address 0x%02x\n", ret);
ret = tda1997x_core_init(sd);
@ -2798,7 +2804,6 @@ static int tda1997x_remove(struct i2c_client *client)
media_entity_cleanup(&sd->entity);
v4l2_ctrl_handler_free(&state->hdl);
regulator_bulk_disable(TDA1997X_NUM_SUPPLIES, state->supplies);
i2c_unregister_device(state->client_cec);
cancel_delayed_work(&state->delayed_work_enable_hpd);
mutex_destroy(&state->page_lock);
mutex_destroy(&state->lock);

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