提交 0b49ce5a 编写于 作者: L Linus Torvalds

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

Pull media updates from Mauro Carvalho Chehab:

 - addition of fwnode support at V4L2 core

 - addition of a few more SDR formats

 - new imx driver to support i.MX6 cameras

 - new driver for Qualcon venus codecs

 - new I2C sensor drivers: dw9714, max2175, ov13858, ov5640

 - new CEC driver: stm32-cec

 - some improvements to DVB frontend documentation and a few fixups

 - several driver improvements and fixups

* tag 'media/v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (361 commits)
  [media] media: entity: Catch unbalanced media_pipeline_stop calls
  [media] media/uapi/v4l: clarify cropcap/crop/selection behavior
  [media] v4l2-ioctl/exynos: fix G/S_SELECTION's type handling
  [media] vimc: sen: Declare vimc_sen_video_ops as static
  [media] vimc: sca: Add scaler
  [media] vimc: deb: Add debayer filter
  [media] vimc: Subdevices as modules
  [media] vimc: cap: Support several image formats
  [media] vimc: sen: Support several image formats
  [media] vimc: common: Add vimc_colorimetry_clamp
  [media] vimc: common: Add vimc_link_validate
  [media] vimc: common: Add vimc_pipeline_s_stream helper
  [media] vimc: common: Add vimc_ent_sd_* helper
  [media] vimc: Move common code from the core
  [media] vimc: sen: Integrate the tpg on the sensor
  [media] media: i2c: ov772x: Force use of SCCB protocol
  [media] dvb uapi docs: enums are passed by value, not reference
  [media] dvb: don't use 'time_t' in event ioctl
  [media] media: venus: enable building with COMPILE_TEST
  [media] af9013: refactor power control
  ...
Common bindings for HDMI CEC adapters
- hdmi-phandle: phandle to the HDMI controller.
- needs-hpd: if present the CEC support is only available when the HPD
is high. Some boards only let the CEC pin through if the HPD is high,
for example if there is a level converter that uses the HPD to power
up or down.
...@@ -6,6 +6,8 @@ digital interfaces like MIPI CSI-2 or parallel video. ...@@ -6,6 +6,8 @@ digital interfaces like MIPI CSI-2 or parallel video.
Required Properties : Required Properties :
- compatible : value must be one of - compatible : value must be one of
"adi,adv7180" "adi,adv7180"
"adi,adv7180cp"
"adi,adv7180st"
"adi,adv7182" "adi,adv7182"
"adi,adv7280" "adi,adv7280"
"adi,adv7280-m" "adi,adv7280-m"
...@@ -15,6 +17,19 @@ Required Properties : ...@@ -15,6 +17,19 @@ Required Properties :
"adi,adv7282" "adi,adv7282"
"adi,adv7282-m" "adi,adv7282-m"
Device nodes of "adi,adv7180cp" and "adi,adv7180st" must contain one
'port' child node per device input and output port, in accordance with the
video interface bindings defined in
Documentation/devicetree/bindings/media/video-interfaces.txt. The port
nodes are numbered as follows.
Port adv7180cp adv7180st
-------------------------------------------------------------------
Input 0-2 0-5
Output 3 6
The digital output port node must contain at least one endpoint.
Optional Properties : Optional Properties :
- powerdown-gpios: reference to the GPIO connected to the powerdown pin, - powerdown-gpios: reference to the GPIO connected to the powerdown pin,
if any. if any.
......
Maxim Integrated MAX2175 RF to Bits tuner
-----------------------------------------
The MAX2175 IC is an advanced analog/digital hybrid-radio receiver with
RF to Bits® front-end designed for software-defined radio solutions.
Required properties:
--------------------
- compatible: "maxim,max2175" for MAX2175 RF-to-bits tuner.
- clocks: clock specifier.
- port: child port node corresponding to the I2S output, in accordance with
the video interface bindings defined in
Documentation/devicetree/bindings/media/video-interfaces.txt. The port
node must contain at least one endpoint.
Optional properties:
--------------------
- maxim,master : phandle to the master tuner if it is a slave. This
is used to define two tuners in diversity mode
(1 master, 1 slave). By default each tuner is an
individual master.
- maxim,refout-load : load capacitance value (in picofarads) on reference
output drive level. The possible load values are:
0 (default - refout disabled)
10
20
30
40
60
70
- maxim,am-hiz-filter : empty property indicates the AM Hi-Z filter is used
in this hardware for AM antenna input.
Example:
--------
Board specific DTS file
/* Fixed XTAL clock node */
maxim_xtal: clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <36864000>;
};
/* A tuner device instance under i2c bus */
max2175_0: tuner@60 {
compatible = "maxim,max2175";
reg = <0x60>;
clocks = <&maxim_xtal>;
maxim,refout-load = <10>;
port {
max2175_0_ep: endpoint {
remote-endpoint = <&slave_rx_device>;
};
};
};
* Omnivision OV5640 MIPI CSI-2 sensor
Required Properties:
- compatible: should be "ovti,ov5640"
- clocks: reference to the xclk input clock.
- clock-names: should be "xclk".
- DOVDD-supply: Digital I/O voltage supply, 1.8 volts
- AVDD-supply: Analog voltage supply, 2.8 volts
- DVDD-supply: Digital core voltage supply, 1.5 volts
Optional Properties:
- reset-gpios: reference to the GPIO connected to the reset pin, if any.
This is an active low signal to the OV5640.
- powerdown-gpios: reference to the GPIO connected to the powerdown pin,
if any. This is an active high signal to the OV5640.
The device node must contain one 'port' child node for its digital output
video port, in accordance with the video interface bindings defined in
Documentation/devicetree/bindings/media/video-interfaces.txt.
Example:
&i2c1 {
ov5640: camera@3c {
compatible = "ovti,ov5640";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ov5640>;
reg = <0x3c>;
clocks = <&clks IMX6QDL_CLK_CKO>;
clock-names = "xclk";
DOVDD-supply = <&vgen4_reg>; /* 1.8v */
AVDD-supply = <&vgen3_reg>; /* 2.8v */
DVDD-supply = <&vgen2_reg>; /* 1.5v */
powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
port {
ov5640_to_mipi_csi2: endpoint {
remote-endpoint = <&mipi_csi2_from_ov5640>;
clock-lanes = <0>;
data-lanes = <1 2>;
};
};
};
};
Freescale i.MX Media Video Device
=================================
Video Media Controller node
---------------------------
This is the media controller node for video capture support. It is a
virtual device that lists the camera serial interface nodes that the
media device will control.
Required properties:
- compatible : "fsl,imx-capture-subsystem";
- ports : Should contain a list of phandles pointing to camera
sensor interface ports of IPU devices
example:
capture-subsystem {
compatible = "fsl,imx-capture-subsystem";
ports = <&ipu1_csi0>, <&ipu1_csi1>;
};
mipi_csi2 node
--------------
This is the device node for the MIPI CSI-2 Receiver core in the i.MX
SoC. This is a Synopsys Designware MIPI CSI-2 host controller core
combined with a D-PHY core mixed into the same register block. In
addition this device consists of an i.MX-specific "CSI2IPU gasket"
glue logic, also controlled from the same register block. The CSI2IPU
gasket demultiplexes the four virtual channel streams from the host
controller's 32-bit output image bus onto four 16-bit parallel busses
to the i.MX IPU CSIs.
Required properties:
- compatible : "fsl,imx6-mipi-csi2";
- reg : physical base address and length of the register set;
- clocks : the MIPI CSI-2 receiver requires three clocks: hsi_tx
(the D-PHY clock), video_27m (D-PHY PLL reference
clock), and eim_podf;
- clock-names : must contain "dphy", "ref", "pix";
- port@* : five port nodes must exist, containing endpoints
connecting to the source and sink devices according to
of_graph bindings. The first port is an input port,
connecting with a MIPI CSI-2 source, and ports 1
through 4 are output ports connecting with parallel
bus sink endpoint nodes and correspond to the four
MIPI CSI-2 virtual channel outputs.
Optional properties:
- interrupts : must contain two level-triggered interrupts,
in order: 100 and 101;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Media Data Path is used for scaling and color space conversion. Media Data Path is used for scaling and color space conversion.
Required properties (controller (parent) node): Required properties (controller node):
- compatible: "mediatek,mt8173-mdp" - compatible: "mediatek,mt8173-mdp"
- mediatek,vpu: the node of video processor unit, see - mediatek,vpu: the node of video processor unit, see
Documentation/devicetree/bindings/media/mediatek-vpu.txt for details. Documentation/devicetree/bindings/media/mediatek-vpu.txt for details.
...@@ -32,21 +32,16 @@ Required properties (DMA function blocks, child node): ...@@ -32,21 +32,16 @@ Required properties (DMA function blocks, child node):
for details. for details.
Example: Example:
mdp {
compatible = "mediatek,mt8173-mdp";
#address-cells = <2>;
#size-cells = <2>;
ranges;
mediatek,vpu = <&vpu>;
mdp_rdma0: rdma@14001000 { mdp_rdma0: rdma@14001000 {
compatible = "mediatek,mt8173-mdp-rdma"; compatible = "mediatek,mt8173-mdp-rdma";
"mediatek,mt8173-mdp";
reg = <0 0x14001000 0 0x1000>; reg = <0 0x14001000 0 0x1000>;
clocks = <&mmsys CLK_MM_MDP_RDMA0>, clocks = <&mmsys CLK_MM_MDP_RDMA0>,
<&mmsys CLK_MM_MUTEX_32K>; <&mmsys CLK_MM_MUTEX_32K>;
power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>; power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
iommus = <&iommu M4U_PORT_MDP_RDMA0>; iommus = <&iommu M4U_PORT_MDP_RDMA0>;
mediatek,larb = <&larb0>; mediatek,larb = <&larb0>;
mediatek,vpu = <&vpu>;
}; };
mdp_rdma1: rdma@14002000 { mdp_rdma1: rdma@14002000 {
...@@ -106,4 +101,3 @@ mdp { ...@@ -106,4 +101,3 @@ mdp {
iommus = <&iommu M4U_PORT_MDP_WROT1>; iommus = <&iommu M4U_PORT_MDP_WROT1>;
mediatek,larb = <&larb4>; mediatek,larb = <&larb4>;
}; };
};
* Qualcomm Venus video encoder/decoder accelerators
- compatible:
Usage: required
Value type: <stringlist>
Definition: Value should contain one of:
- "qcom,msm8916-venus"
- "qcom,msm8996-venus"
- reg:
Usage: required
Value type: <prop-encoded-array>
Definition: Register base address and length of the register map.
- interrupts:
Usage: required
Value type: <prop-encoded-array>
Definition: Should contain interrupt line number.
- clocks:
Usage: required
Value type: <prop-encoded-array>
Definition: A List of phandle and clock specifier pairs as listed
in clock-names property.
- clock-names:
Usage: required for msm8916
Value type: <stringlist>
Definition: Should contain the following entries:
- "core" Core video accelerator clock
- "iface" Video accelerator AHB clock
- "bus" Video accelerator AXI clock
- clock-names:
Usage: required for msm8996
Value type: <stringlist>
Definition: Should contain the following entries:
- "core" Core video accelerator clock
- "iface" Video accelerator AHB clock
- "bus" Video accelerator AXI clock
- "mbus" Video MAXI clock
- power-domains:
Usage: required
Value type: <prop-encoded-array>
Definition: A phandle and power domain specifier pairs to the
power domain which is responsible for collapsing
and restoring power to the peripheral.
- iommus:
Usage: required
Value type: <prop-encoded-array>
Definition: A list of phandle and IOMMU specifier pairs.
- memory-region:
Usage: required
Value type: <phandle>
Definition: reference to the reserved-memory for the firmware
memory region.
* Subnodes
The Venus video-codec node must contain two subnodes representing
video-decoder and video-encoder.
Every of video-encoder or video-decoder subnode should have:
- compatible:
Usage: required
Value type: <stringlist>
Definition: Value should contain "venus-decoder" or "venus-encoder"
- clocks:
Usage: required for msm8996
Value type: <prop-encoded-array>
Definition: A List of phandle and clock specifier pairs as listed
in clock-names property.
- clock-names:
Usage: required for msm8996
Value type: <stringlist>
Definition: Should contain the following entries:
- "core" Subcore video accelerator clock
- power-domains:
Usage: required for msm8996
Value type: <prop-encoded-array>
Definition: A phandle and power domain specifier pairs to the
power domain which is responsible for collapsing
and restoring power to the subcore.
* An Example
video-codec@1d00000 {
compatible = "qcom,msm8916-venus";
reg = <0x01d00000 0xff000>;
interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>,
<&gcc GCC_VENUS0_AHB_CLK>,
<&gcc GCC_VENUS0_AXI_CLK>;
clock-names = "core", "iface", "bus";
power-domains = <&gcc VENUS_GDSC>;
iommus = <&apps_iommu 5>;
memory-region = <&venus_mem>;
video-decoder {
compatible = "venus-decoder";
clocks = <&mmcc VIDEO_SUBCORE0_CLK>;
clock-names = "core";
power-domains = <&mmcc VENUS_CORE0_GDSC>;
};
video-encoder {
compatible = "venus-encoder";
clocks = <&mmcc VIDEO_SUBCORE1_CLK>;
clock-names = "core";
power-domains = <&mmcc VENUS_CORE1_GDSC>;
};
};
Renesas RCar Video Input driver (rcar_vin) Renesas R-Car Video Input driver (rcar_vin)
------------------------------------------ -------------------------------------------
The rcar_vin device provides video input capabilities for the Renesas R-Car The rcar_vin device provides video input capabilities for the Renesas R-Car
family of devices. The current blocks are always slaves and suppot one input family of devices. The current blocks are always slaves and suppot one input
......
Renesas R-Car Gen3 Digital Radio Interface controller (DRIF)
------------------------------------------------------------
R-Car Gen3 DRIF is a SPI like receive only slave device. A general
representation of DRIF interfacing with a master device is shown below.
+---------------------+ +---------------------+
| |-----SCK------->|CLK |
| Master |-----SS-------->|SYNC DRIFn (slave) |
| |-----SD0------->|D0 |
| |-----SD1------->|D1 |
+---------------------+ +---------------------+
As per datasheet, each DRIF channel (drifn) is made up of two internal
channels (drifn0 & drifn1). These two internal channels share the common
CLK & SYNC. Each internal channel has its own dedicated resources like
irq, dma channels, address space & clock. This internal split is not
visible to the external master device.
The device tree model represents each internal channel as a separate node.
The internal channels sharing the CLK & SYNC are tied together by their
phandles using a property called "renesas,bonding". For the rest of
the documentation, unless explicitly stated, the word channel implies an
internal channel.
When both internal channels are enabled they need to be managed together
as one (i.e.) they cannot operate alone as independent devices. Out of the
two, one of them needs to act as a primary device that accepts common
properties of both the internal channels. This channel is identified by a
property called "renesas,primary-bond".
To summarize,
- When both the internal channels that are bonded together are enabled,
the zeroth channel is selected as primary-bond. This channels accepts
properties common to all the members of the bond.
- When only one of the bonded channels need to be enabled, the property
"renesas,bonding" or "renesas,primary-bond" will have no effect. That
enabled channel can act alone as any other independent device.
Required properties of an internal channel:
-------------------------------------------
- compatible: "renesas,r8a7795-drif" if DRIF controller is a part of R8A7795 SoC.
"renesas,rcar-gen3-drif" for a generic R-Car Gen3 compatible device.
When compatible with the generic version, nodes must list the
SoC-specific version corresponding to the platform first
followed by the generic version.
- reg: offset and length of that channel.
- interrupts: associated with that channel.
- clocks: phandle and clock specifier of that channel.
- clock-names: clock input name string: "fck".
- dmas: phandles to the DMA channels.
- dma-names: names of the DMA channel: "rx".
- renesas,bonding: phandle to the other channel.
Optional properties of an internal channel:
-------------------------------------------
- power-domains: phandle to the respective power domain.
Required properties of an internal channel when:
- It is the only enabled channel of the bond (or)
- If it acts as primary among enabled bonds
--------------------------------------------------------
- pinctrl-0: pin control group to be used for this channel.
- pinctrl-names: must be "default".
- renesas,primary-bond: empty property indicating the channel acts as primary
among the bonded channels.
- port: child port node corresponding to the data input, in accordance with
the video interface bindings defined in
Documentation/devicetree/bindings/media/video-interfaces.txt. The port
node must contain at least one endpoint.
Optional endpoint property:
---------------------------
- sync-active: Indicates sync signal polarity, 0/1 for low/high respectively.
This property maps to SYNCAC bit in the hardware manual. The
default is 1 (active high).
Example:
--------
(1) Both internal channels enabled:
-----------------------------------
When interfacing with a third party tuner device with two data pins as shown
below.
+---------------------+ +---------------------+
| |-----SCK------->|CLK |
| Master |-----SS-------->|SYNC DRIFn (slave) |
| |-----SD0------->|D0 |
| |-----SD1------->|D1 |
+---------------------+ +---------------------+
drif00: rif@e6f40000 {
compatible = "renesas,r8a7795-drif",
"renesas,rcar-gen3-drif";
reg = <0 0xe6f40000 0 0x64>;
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 515>;
clock-names = "fck";
dmas = <&dmac1 0x20>, <&dmac2 0x20>;
dma-names = "rx", "rx";
power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
renesas,bonding = <&drif01>;
renesas,primary-bond;
pinctrl-0 = <&drif0_pins>;
pinctrl-names = "default";
port {
drif0_ep: endpoint {
remote-endpoint = <&tuner_ep>;
};
};
};
drif01: rif@e6f50000 {
compatible = "renesas,r8a7795-drif",
"renesas,rcar-gen3-drif";
reg = <0 0xe6f50000 0 0x64>;
interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 514>;
clock-names = "fck";
dmas = <&dmac1 0x22>, <&dmac2 0x22>;
dma-names = "rx", "rx";
power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
renesas,bonding = <&drif00>;
};
(2) Internal channel 1 alone is enabled:
----------------------------------------
When interfacing with a third party tuner device with one data pin as shown
below.
+---------------------+ +---------------------+
| |-----SCK------->|CLK |
| Master |-----SS-------->|SYNC DRIFn (slave) |
| | |D0 (unused) |
| |-----SD-------->|D1 |
+---------------------+ +---------------------+
drif00: rif@e6f40000 {
compatible = "renesas,r8a7795-drif",
"renesas,rcar-gen3-drif";
reg = <0 0xe6f40000 0 0x64>;
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 515>;
clock-names = "fck";
dmas = <&dmac1 0x20>, <&dmac2 0x20>;
dma-names = "rx", "rx";
power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
renesas,bonding = <&drif01>;
};
drif01: rif@e6f50000 {
compatible = "renesas,r8a7795-drif",
"renesas,rcar-gen3-drif";
reg = <0 0xe6f50000 0 0x64>;
interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cpg CPG_MOD 514>;
clock-names = "fck";
dmas = <&dmac1 0x22>, <&dmac2 0x22>;
dma-names = "rx", "rx";
power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
renesas,bonding = <&drif00>;
pinctrl-0 = <&drif0_pins>;
pinctrl-names = "default";
port {
drif0_ep: endpoint {
remote-endpoint = <&tuner_ep>;
sync-active = <0>;
};
};
};
...@@ -15,7 +15,11 @@ Required properties: ...@@ -15,7 +15,11 @@ Required properties:
- clock-names : from common clock binding: must contain "hdmicec", - clock-names : from common clock binding: must contain "hdmicec",
corresponding to entry in the clocks property. corresponding to entry in the clocks property.
- samsung,syscon-phandle - phandle to the PMU system controller - samsung,syscon-phandle - phandle to the PMU system controller
- hdmi-phandle - phandle to the HDMI controller - hdmi-phandle - phandle to the HDMI controller, see also cec.txt.
Optional:
- needs-hpd : if present the CEC support is only available when the HPD
is high. See cec.txt for more details.
Example: Example:
......
STMicroelectronics STM32 CEC driver
Required properties:
- compatible : value should be "st,stm32-cec"
- reg : Physical base address of the IP registers and length of memory
mapped region.
- clocks : from common clock binding: handle to CEC clocks
- clock-names : from common clock binding: must be "cec" and "hdmi-cec".
- interrupts : CEC interrupt number to the CPU.
Example for stm32f746:
cec: cec@40006c00 {
compatible = "st,stm32-cec";
reg = <0x40006C00 0x400>;
interrupts = <94>;
clocks = <&rcc 0 STM32F7_APB1_CLOCK(CEC)>, <&rcc 1 CLK_HDMI_CEC>;
clock-names = "cec", "hdmi-cec";
};
STMicroelectronics STM32 Digital Camera Memory Interface (DCMI)
Required properties:
- compatible: "st,stm32-dcmi"
- reg: physical base address and length of the registers set for the device
- interrupts: should contain IRQ line for the DCMI
- resets: reference to a reset controller,
see Documentation/devicetree/bindings/reset/st,stm32-rcc.txt
- clocks: list of clock specifiers, corresponding to entries in
the clock-names property
- clock-names: must contain "mclk", which is the DCMI peripherial clock
- pinctrl: the pincontrol settings to configure muxing properly
for pins that connect to DCMI device.
See Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt.
- dmas: phandle to DMA controller node,
see Documentation/devicetree/bindings/dma/stm32-dma.txt
- dma-names: must contain "tx", which is the transmit channel from DCMI to DMA
DCMI supports a single port node with parallel bus. It should contain one
'port' child node with child 'endpoint' node. Please refer to the bindings
defined in Documentation/devicetree/bindings/media/video-interfaces.txt.
Example:
dcmi: dcmi@50050000 {
compatible = "st,stm32-dcmi";
reg = <0x50050000 0x400>;
interrupts = <78>;
resets = <&rcc STM32F4_AHB2_RESET(DCMI)>;
clocks = <&rcc 0 STM32F4_AHB2_CLOCK(DCMI)>;
clock-names = "mclk";
pinctrl-names = "default";
pinctrl-0 = <&dcmi_pins>;
dmas = <&dma2 1 1 0x414 0x3>;
dma-names = "tx";
port {
dcmi_0: endpoint {
remote-endpoint = <...>;
bus-width = <8>;
hsync-active = <0>;
vsync-active = <0>;
pclk-sample = <1>;
};
};
};
...@@ -9,7 +9,7 @@ Required properties: ...@@ -9,7 +9,7 @@ Required properties:
- pinctrl-names: Contains only one value - "default" - pinctrl-names: Contains only one value - "default"
- pinctrl-0: Specifies the pin control groups used for CEC hardware. - pinctrl-0: Specifies the pin control groups used for CEC hardware.
- resets: Reference to a reset controller - resets: Reference to a reset controller
- hdmi-phandle: Phandle to the HDMI controller - hdmi-phandle: Phandle to the HDMI controller, see also cec.txt.
Example for STIH407: Example for STIH407:
......
Video Multiplexer
=================
Video multiplexers allow to select between multiple input ports. Video received
on the active input port is passed through to the output port. Muxes described
by this binding are controlled by a multiplexer controller that is described by
the bindings in Documentation/devicetree/bindings/mux/mux-controller.txt
Required properties:
- compatible : should be "video-mux"
- mux-controls : mux controller node to use for operating the mux
- #address-cells: should be <1>
- #size-cells: should be <0>
- port@*: at least three port nodes containing endpoints connecting to the
source and sink devices according to of_graph bindings. The last port is
the output port, all others are inputs.
Optionally, #address-cells, #size-cells, and port nodes can be grouped under a
ports node as described in Documentation/devicetree/bindings/graph.txt.
Example:
mux: mux-controller {
compatible = "gpio-mux";
#mux-control-cells = <0>;
mux-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
};
video-mux {
compatible = "video-mux";
mux-controls = <&mux>;
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
mux_in0: endpoint {
remote-endpoint = <&video_source0_out>;
};
};
port@1 {
reg = <1>;
mux_in1: endpoint {
remote-endpoint = <&video_source1_out>;
};
};
port@2 {
reg = <2>;
mux_out: endpoint {
remote-endpoint = <&capture_interface_in>;
};
};
};
};
...@@ -30,6 +30,7 @@ Electricity ...@@ -30,6 +30,7 @@ Electricity
-micro-ohms : micro Ohms -micro-ohms : micro Ohms
-microwatt-hours: micro Watt-hours -microwatt-hours: micro Watt-hours
-microvolt : micro volts -microvolt : micro volts
-picofarads : picofarads
Temperature Temperature
---------------------------------------- ----------------------------------------
......
...@@ -194,6 +194,11 @@ When a transmit finished (successfully or otherwise): ...@@ -194,6 +194,11 @@ When a transmit finished (successfully or otherwise):
void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt); u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt);
or:
.. c:function::
void cec_transmit_attempt_done(struct cec_adapter *adap, u8 status);
The status can be one of: The status can be one of:
CEC_TX_STATUS_OK: CEC_TX_STATUS_OK:
...@@ -231,6 +236,11 @@ to 1, if the hardware does support retry then either set these counters to ...@@ -231,6 +236,11 @@ to 1, if the hardware does support retry then either set these counters to
0 if the hardware provides no feedback of which errors occurred and how many 0 if the hardware provides no feedback of which errors occurred and how many
times, or fill in the correct values as reported by the hardware. times, or fill in the correct values as reported by the hardware.
The cec_transmit_attempt_done() function is a helper for cases where the
hardware never retries, so the transmit is always for just a single
attempt. It will call cec_transmit_done() in turn, filling in 1 for the
count argument corresponding to the status. Or all 0 if the status was OK.
When a CEC message was received: When a CEC message was received:
.. c:function:: .. c:function::
...@@ -306,6 +316,14 @@ then the CEC adapter will be disabled. If you change a valid physical address ...@@ -306,6 +316,14 @@ then the CEC adapter will be disabled. If you change a valid physical address
to another valid physical address, then this function will first set the to another valid physical address, then this function will first set the
address to CEC_PHYS_ADDR_INVALID before enabling the new physical address. address to CEC_PHYS_ADDR_INVALID before enabling the new physical address.
.. c:function::
void cec_s_phys_addr_from_edid(struct cec_adapter *adap,
const struct edid *edid);
A helper function that extracts the physical address from the edid struct
and calls cec_s_phys_addr() with that address, or CEC_PHYS_ADDR_INVALID
if the EDID did not contain a physical address or edid was a NULL pointer.
.. c:function:: .. c:function::
int cec_s_log_addrs(struct cec_adapter *adap, int cec_s_log_addrs(struct cec_adapter *adap,
struct cec_log_addrs *log_addrs, bool block); struct cec_log_addrs *log_addrs, bool block);
......
...@@ -19,7 +19,7 @@ Video4Linux devices ...@@ -19,7 +19,7 @@ Video4Linux devices
v4l2-mc v4l2-mc
v4l2-mediabus v4l2-mediabus
v4l2-mem2mem v4l2-mem2mem
v4l2-of v4l2-fwnode
v4l2-rect v4l2-rect
v4l2-tuner v4l2-tuner
v4l2-common v4l2-common
......
V4L2 fwnode kAPI
^^^^^^^^^^^^^^^^
.. kernel-doc:: include/media/v4l2-fwnode.h
V4L2 Open Firmware kAPI
^^^^^^^^^^^^^^^^^^^^^^^
.. kernel-doc:: include/media/v4l2-of.h
...@@ -113,6 +113,14 @@ returns the information to the application. The ioctl never fails. ...@@ -113,6 +113,14 @@ returns the information to the application. The ioctl never fails.
- 0x00000020 - 0x00000020
- The CEC hardware can monitor all messages, not just directed and - The CEC hardware can monitor all messages, not just directed and
broadcast messages. broadcast messages.
* .. _`CEC-CAP-NEEDS-HPD`:
- ``CEC_CAP_NEEDS_HPD``
- 0x00000040
- The CEC hardware is only active if the HDMI Hotplug Detect pin is
high. This makes it impossible to use CEC to wake up displays that
set the HPD pin low when in standby mode, but keep the CEC bus
alive.
......
...@@ -15,7 +15,7 @@ FE_DISEQC_SEND_BURST - Sends a 22KHz tone burst for 2x1 mini DiSEqC satellite se ...@@ -15,7 +15,7 @@ FE_DISEQC_SEND_BURST - Sends a 22KHz tone burst for 2x1 mini DiSEqC satellite se
Synopsis Synopsis
======== ========
.. c:function:: int ioctl( int fd, FE_DISEQC_SEND_BURST, enum fe_sec_mini_cmd *tone ) .. c:function:: int ioctl( int fd, FE_DISEQC_SEND_BURST, enum fe_sec_mini_cmd tone )
:name: FE_DISEQC_SEND_BURST :name: FE_DISEQC_SEND_BURST
...@@ -26,7 +26,7 @@ Arguments ...@@ -26,7 +26,7 @@ Arguments
File descriptor returned by :ref:`open() <frontend_f_open>`. File descriptor returned by :ref:`open() <frontend_f_open>`.
``tone`` ``tone``
pointer to enum :c:type:`fe_sec_mini_cmd` an integer enumered value described at :c:type:`fe_sec_mini_cmd`
Description Description
......
...@@ -15,7 +15,7 @@ FE_SET_TONE - Sets/resets the generation of the continuous 22kHz tone. ...@@ -15,7 +15,7 @@ FE_SET_TONE - Sets/resets the generation of the continuous 22kHz tone.
Synopsis Synopsis
======== ========
.. c:function:: int ioctl( int fd, FE_SET_TONE, enum fe_sec_tone_mode *tone ) .. c:function:: int ioctl( int fd, FE_SET_TONE, enum fe_sec_tone_mode tone )
:name: FE_SET_TONE :name: FE_SET_TONE
...@@ -26,7 +26,7 @@ Arguments ...@@ -26,7 +26,7 @@ Arguments
File descriptor returned by :ref:`open() <frontend_f_open>`. File descriptor returned by :ref:`open() <frontend_f_open>`.
``tone`` ``tone``
pointer to enum :c:type:`fe_sec_tone_mode` an integer enumered value described at :c:type:`fe_sec_tone_mode`
Description Description
......
...@@ -15,7 +15,7 @@ FE_SET_VOLTAGE - Allow setting the DC level sent to the antenna subsystem. ...@@ -15,7 +15,7 @@ FE_SET_VOLTAGE - Allow setting the DC level sent to the antenna subsystem.
Synopsis Synopsis
======== ========
.. c:function:: int ioctl( int fd, FE_SET_VOLTAGE, enum fe_sec_voltage *voltage ) .. c:function:: int ioctl( int fd, FE_SET_VOLTAGE, enum fe_sec_voltage voltage )
:name: FE_SET_VOLTAGE :name: FE_SET_VOLTAGE
...@@ -26,10 +26,7 @@ Arguments ...@@ -26,10 +26,7 @@ Arguments
File descriptor returned by :ref:`open() <frontend_f_open>`. File descriptor returned by :ref:`open() <frontend_f_open>`.
``voltage`` ``voltage``
pointer to enum :c:type:`fe_sec_voltage` an integer enumered value described at :c:type:`fe_sec_voltage`
Valid values are described at enum
:c:type:`fe_sec_voltage`.
Description Description
......
...@@ -241,7 +241,7 @@ desired arrays with the media graph elements. ...@@ -241,7 +241,7 @@ desired arrays with the media graph elements.
.. c:type:: media_v2_intf_devnode .. c:type:: media_v2_intf_devnode
.. flat-table:: struct media_v2_interface .. flat-table:: struct media_v2_intf_devnode
:header-rows: 0 :header-rows: 0
:stub-columns: 0 :stub-columns: 0
:widths: 1 2 8 :widths: 1 2 8
...@@ -312,7 +312,7 @@ desired arrays with the media graph elements. ...@@ -312,7 +312,7 @@ desired arrays with the media graph elements.
.. c:type:: media_v2_link .. c:type:: media_v2_link
.. flat-table:: struct media_v2_pad .. flat-table:: struct media_v2_link
:header-rows: 0 :header-rows: 0
:stub-columns: 0 :stub-columns: 0
:widths: 1 2 8 :widths: 1 2 8
...@@ -324,7 +324,7 @@ desired arrays with the media graph elements. ...@@ -324,7 +324,7 @@ desired arrays with the media graph elements.
- ``id`` - ``id``
- Unique ID for the pad. - Unique ID for the link.
- .. row 2 - .. row 2
...@@ -334,7 +334,7 @@ desired arrays with the media graph elements. ...@@ -334,7 +334,7 @@ desired arrays with the media graph elements.
- On pad to pad links: unique ID for the source pad. - On pad to pad links: unique ID for the source pad.
On interface to entity links: unique ID for the interface. On interface to entity links: unique ID for the entity.
- .. row 3 - .. row 3
......
...@@ -299,6 +299,27 @@ Types and flags used to represent the media graph elements ...@@ -299,6 +299,27 @@ Types and flags used to represent the media graph elements
received on its sink pad and outputs the statistics data on received on its sink pad and outputs the statistics data on
its source pad. its source pad.
- .. row 29
.. _MEDIA-ENT-F-VID-MUX:
- ``MEDIA_ENT_F_VID_MUX``
- Video multiplexer. An entity capable of multiplexing must have at
least two sink pads and one source pad, and must pass the video
frame(s) received from the active sink pad to the source pad.
- .. row 30
.. _MEDIA-ENT-F-VID-IF-BRIDGE:
- ``MEDIA_ENT_F_VID_IF_BRIDGE``
- Video interface bridge. A video interface bridge entity must have at
least one sink pad and at least one source pad. It receives video
frames on its sink pad from an input video bus of one type (HDMI, eDP,
MIPI CSI-2, ...), and outputs them on its source pad to an output
video bus of another type (eDP, MIPI CSI-2, parallel, ...).
.. tabularcolumns:: |p{5.5cm}|p{12.0cm}| .. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
......
...@@ -137,6 +137,12 @@ Control IDs ...@@ -137,6 +137,12 @@ Control IDs
``V4L2_CID_GAIN`` ``(integer)`` ``V4L2_CID_GAIN`` ``(integer)``
Gain control. Gain control.
Primarily used to control gain on e.g. TV tuners but also on
webcams. Most devices control only digital gain with this control
but on some this could include analogue gain as well. Devices that
recognise the difference between digital and analogue gain use
controls ``V4L2_CID_DIGITAL_GAIN`` and ``V4L2_CID_ANALOGUE_GAIN``.
``V4L2_CID_HFLIP`` ``(boolean)`` ``V4L2_CID_HFLIP`` ``(boolean)``
Mirror the picture horizontally. Mirror the picture horizontally.
......
...@@ -2019,7 +2019,7 @@ enum v4l2_exposure_auto_type - ...@@ -2019,7 +2019,7 @@ enum v4l2_exposure_auto_type -
dynamically vary the frame rate. By default this feature is disabled dynamically vary the frame rate. By default this feature is disabled
(0) and the frame rate must remain constant. (0) and the frame rate must remain constant.
``V4L2_CID_EXPOSURE_BIAS (integer menu)`` ``V4L2_CID_AUTO_EXPOSURE_BIAS (integer menu)``
Determines the automatic exposure compensation, it is effective only Determines the automatic exposure compensation, it is effective only
when ``V4L2_CID_EXPOSURE_AUTO`` control is set to ``AUTO``, when ``V4L2_CID_EXPOSURE_AUTO`` control is set to ``AUTO``,
``SHUTTER_PRIORITY`` or ``APERTURE_PRIORITY``. It is expressed in ``SHUTTER_PRIORITY`` or ``APERTURE_PRIORITY``. It is expressed in
...@@ -3021,6 +3021,13 @@ Image Process Control IDs ...@@ -3021,6 +3021,13 @@ Image Process Control IDs
The video deinterlacing mode (such as Bob, Weave, ...). The menu items are The video deinterlacing mode (such as Bob, Weave, ...). The menu items are
driver specific and are documented in :ref:`v4l-drivers`. driver specific and are documented in :ref:`v4l-drivers`.
``V4L2_CID_DIGITAL_GAIN (integer)``
Digital gain is the value by which all colour components
are multiplied by. Typically the digital gain applied is the
control value divided by e.g. 0x100, meaning that to get no
digital gain the control value needs to be 0x100. The no-gain
configuration is also typically the default.
.. _dv-controls: .. _dv-controls:
......
.. -*- coding: utf-8; mode: rst -*-
.. _V4L2-SDR-FMT-PCU16BE:
******************************
V4L2_SDR_FMT_PCU16BE ('PC16')
******************************
Planar complex unsigned 16-bit big endian IQ sample
Description
===========
This format contains a sequence of complex number samples. Each complex
number consist of two parts called In-phase and Quadrature (IQ). Both I
and Q are represented as a 16 bit unsigned big endian number stored in
32 bit space. The remaining unused bits within the 32 bit space will be
padded with 0. I value starts first and Q value starts at an offset
equalling half of the buffer size (i.e.) offset = buffersize/2. Out of
the 16 bits, bit 15:2 (14 bit) is data and bit 1:0 (2 bit) can be any
value.
**Byte Order.**
Each cell is one byte.
.. flat-table::
:header-rows: 1
:stub-columns: 0
* - Offset:
- Byte B0
- Byte B1
- Byte B2
- Byte B3
* - start + 0:
- I'\ :sub:`0[13:6]`
- I'\ :sub:`0[5:0]; B1[1:0]=pad`
- pad
- pad
* - start + 4:
- I'\ :sub:`1[13:6]`
- I'\ :sub:`1[5:0]; B1[1:0]=pad`
- pad
- pad
* - ...
* - start + offset:
- Q'\ :sub:`0[13:6]`
- Q'\ :sub:`0[5:0]; B1[1:0]=pad`
- pad
- pad
* - start + offset + 4:
- Q'\ :sub:`1[13:6]`
- Q'\ :sub:`1[5:0]; B1[1:0]=pad`
- pad
- pad
.. -*- coding: utf-8; mode: rst -*-
.. _V4L2-SDR-FMT-PCU18BE:
******************************
V4L2_SDR_FMT_PCU18BE ('PC18')
******************************
Planar complex unsigned 18-bit big endian IQ sample
Description
===========
This format contains a sequence of complex number samples. Each complex
number consist of two parts called In-phase and Quadrature (IQ). Both I
and Q are represented as a 18 bit unsigned big endian number stored in
32 bit space. The remaining unused bits within the 32 bit space will be
padded with 0. I value starts first and Q value starts at an offset
equalling half of the buffer size (i.e.) offset = buffersize/2. Out of
the 18 bits, bit 17:2 (16 bit) is data and bit 1:0 (2 bit) can be any
value.
**Byte Order.**
Each cell is one byte.
.. flat-table::
:header-rows: 1
:stub-columns: 0
* - Offset:
- Byte B0
- Byte B1
- Byte B2
- Byte B3
* - start + 0:
- I'\ :sub:`0[17:10]`
- I'\ :sub:`0[9:2]`
- I'\ :sub:`0[1:0]; B2[5:0]=pad`
- pad
* - start + 4:
- I'\ :sub:`1[17:10]`
- I'\ :sub:`1[9:2]`
- I'\ :sub:`1[1:0]; B2[5:0]=pad`
- pad
* - ...
* - start + offset:
- Q'\ :sub:`0[17:10]`
- Q'\ :sub:`0[9:2]`
- Q'\ :sub:`0[1:0]; B2[5:0]=pad`
- pad
* - start + offset + 4:
- Q'\ :sub:`1[17:10]`
- Q'\ :sub:`1[9:2]`
- Q'\ :sub:`1[1:0]; B2[5:0]=pad`
- pad
.. -*- coding: utf-8; mode: rst -*-
.. _V4L2-SDR-FMT-PCU20BE:
******************************
V4L2_SDR_FMT_PCU20BE ('PC20')
******************************
Planar complex unsigned 20-bit big endian IQ sample
Description
===========
This format contains a sequence of complex number samples. Each complex
number consist of two parts called In-phase and Quadrature (IQ). Both I
and Q are represented as a 20 bit unsigned big endian number stored in
32 bit space. The remaining unused bits within the 32 bit space will be
padded with 0. I value starts first and Q value starts at an offset
equalling half of the buffer size (i.e.) offset = buffersize/2. Out of
the 20 bits, bit 19:2 (18 bit) is data and bit 1:0 (2 bit) can be any
value.
**Byte Order.**
Each cell is one byte.
.. flat-table::
:header-rows: 1
:stub-columns: 0
* - Offset:
- Byte B0
- Byte B1
- Byte B2
- Byte B3
* - start + 0:
- I'\ :sub:`0[19:12]`
- I'\ :sub:`0[11:4]`
- I'\ :sub:`0[3:0]; B2[3:0]=pad`
- pad
* - start + 4:
- I'\ :sub:`1[19:12]`
- I'\ :sub:`1[11:4]`
- I'\ :sub:`1[3:0]; B2[3:0]=pad`
- pad
* - ...
* - start + offset:
- Q'\ :sub:`0[19:12]`
- Q'\ :sub:`0[11:4]`
- Q'\ :sub:`0[3:0]; B2[3:0]=pad`
- pad
* - start + offset + 4:
- Q'\ :sub:`1[19:12]`
- Q'\ :sub:`1[11:4]`
- Q'\ :sub:`1[3:0]; B2[3:0]=pad`
- pad
...@@ -17,3 +17,6 @@ These formats are used for :ref:`SDR <sdr>` interface only. ...@@ -17,3 +17,6 @@ These formats are used for :ref:`SDR <sdr>` interface only.
pixfmt-sdr-cs08 pixfmt-sdr-cs08
pixfmt-sdr-cs14le pixfmt-sdr-cs14le
pixfmt-sdr-ru12le pixfmt-sdr-ru12le
pixfmt-sdr-pcu16be
pixfmt-sdr-pcu18be
pixfmt-sdr-pcu20be
...@@ -39,17 +39,10 @@ structure. Drivers fill the rest of the structure. The results are ...@@ -39,17 +39,10 @@ structure. Drivers fill the rest of the structure. The results are
constant except when switching the video standard. Remember this switch constant except when switching the video standard. Remember this switch
can occur implicit when switching the video input or output. can occur implicit when switching the video input or output.
Do not use the multiplanar buffer types. Use
``V4L2_BUF_TYPE_VIDEO_CAPTURE`` instead of
``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and use
``V4L2_BUF_TYPE_VIDEO_OUTPUT`` instead of
``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``.
This ioctl must be implemented for video capture or output devices that This ioctl must be implemented for video capture or output devices that
support cropping and/or scaling and/or have non-square pixels, and for support cropping and/or scaling and/or have non-square pixels, and for
overlay devices. overlay devices.
.. c:type:: v4l2_cropcap .. c:type:: v4l2_cropcap
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
...@@ -62,9 +55,9 @@ overlay devices. ...@@ -62,9 +55,9 @@ overlay devices.
* - __u32 * - __u32
- ``type`` - ``type``
- Type of the data stream, set by the application. Only these types - Type of the data stream, set by the application. Only these types
are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``, are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``, ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``,
``V4L2_BUF_TYPE_VIDEO_OUTPUT`` and ``V4L2_BUF_TYPE_VIDEO_OUTPUT``, ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE`` and
``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :c:type:`v4l2_buf_type`. ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :c:type:`v4l2_buf_type` and the note above.
* - struct :ref:`v4l2_rect <v4l2-rect-crop>` * - struct :ref:`v4l2_rect <v4l2-rect-crop>`
- ``bounds`` - ``bounds``
- Defines the window within capturing or output is possible, this - Defines the window within capturing or output is possible, this
...@@ -90,6 +83,16 @@ overlay devices. ...@@ -90,6 +83,16 @@ overlay devices.
``pixelaspect`` to 1/1. Other common values are 54/59 for PAL and ``pixelaspect`` to 1/1. Other common values are 54/59 for PAL and
SECAM, 11/10 for NTSC sampled according to [:ref:`itu601`]. SECAM, 11/10 for NTSC sampled according to [:ref:`itu601`].
.. note::
Unfortunately in the case of multiplanar buffer types
(``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``)
this API was messed up with regards to how the :c:type:`v4l2_cropcap` ``type`` field
should be filled in. Some drivers only accepted the ``_MPLANE`` buffer type while
other drivers only accepted a non-multiplanar buffer type (i.e. without the
``_MPLANE`` at the end).
Starting with kernel 4.13 both variations are allowed.
.. _v4l2-rect-crop: .. _v4l2-rect-crop:
......
...@@ -45,12 +45,6 @@ and struct :c:type:`v4l2_rect` substructure named ``c`` of a ...@@ -45,12 +45,6 @@ and struct :c:type:`v4l2_rect` substructure named ``c`` of a
v4l2_crop structure and call the :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` ioctl with a pointer v4l2_crop structure and call the :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` ioctl with a pointer
to this structure. to this structure.
Do not use the multiplanar buffer types. Use
``V4L2_BUF_TYPE_VIDEO_CAPTURE`` instead of
``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and use
``V4L2_BUF_TYPE_VIDEO_OUTPUT`` instead of
``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``.
The driver first adjusts the requested dimensions against hardware The driver first adjusts the requested dimensions against hardware
limits, i. e. the bounds given by the capture/output window, and it limits, i. e. the bounds given by the capture/output window, and it
rounds to the closest possible values of horizontal and vertical offset, rounds to the closest possible values of horizontal and vertical offset,
...@@ -87,14 +81,24 @@ When cropping is not supported then no parameters are changed and ...@@ -87,14 +81,24 @@ When cropping is not supported then no parameters are changed and
* - __u32 * - __u32
- ``type`` - ``type``
- Type of the data stream, set by the application. Only these types - Type of the data stream, set by the application. Only these types
are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``, are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``, ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``,
``V4L2_BUF_TYPE_VIDEO_OUTPUT`` and ``V4L2_BUF_TYPE_VIDEO_OUTPUT``, ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE`` and
``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :c:type:`v4l2_buf_type`. ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :c:type:`v4l2_buf_type` and the note above.
* - struct :c:type:`v4l2_rect` * - struct :c:type:`v4l2_rect`
- ``c`` - ``c``
- Cropping rectangle. The same co-ordinate system as for struct - Cropping rectangle. The same co-ordinate system as for struct
:c:type:`v4l2_cropcap` ``bounds`` is used. :c:type:`v4l2_cropcap` ``bounds`` is used.
.. note::
Unfortunately in the case of multiplanar buffer types
(``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``)
this API was messed up with regards to how the :c:type:`v4l2_crop` ``type`` field
should be filled in. Some drivers only accepted the ``_MPLANE`` buffer type while
other drivers only accepted a non-multiplanar buffer type (i.e. without the
``_MPLANE`` at the end).
Starting with kernel 4.13 both variations are allowed.
Return Value Return Value
============ ============
......
...@@ -42,11 +42,7 @@ The ioctls are used to query and configure selection rectangles. ...@@ -42,11 +42,7 @@ The ioctls are used to query and configure selection rectangles.
To query the cropping (composing) rectangle set struct To query the cropping (composing) rectangle set struct
:c:type:`v4l2_selection` ``type`` field to the :c:type:`v4l2_selection` ``type`` field to the
respective buffer type. Do not use the multiplanar buffer types. Use respective buffer type. The next step is setting the
``V4L2_BUF_TYPE_VIDEO_CAPTURE`` instead of
``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and use
``V4L2_BUF_TYPE_VIDEO_OUTPUT`` instead of
``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``. The next step is setting the
value of struct :c:type:`v4l2_selection` ``target`` value of struct :c:type:`v4l2_selection` ``target``
field to ``V4L2_SEL_TGT_CROP`` (``V4L2_SEL_TGT_COMPOSE``). Please refer field to ``V4L2_SEL_TGT_CROP`` (``V4L2_SEL_TGT_COMPOSE``). Please refer
to table :ref:`v4l2-selections-common` or :ref:`selection-api` for to table :ref:`v4l2-selections-common` or :ref:`selection-api` for
...@@ -64,11 +60,7 @@ pixels. ...@@ -64,11 +60,7 @@ pixels.
To change the cropping (composing) rectangle set the struct To change the cropping (composing) rectangle set the struct
:c:type:`v4l2_selection` ``type`` field to the :c:type:`v4l2_selection` ``type`` field to the
respective buffer type. Do not use multiplanar buffers. Use respective buffer type. The next step is setting the
``V4L2_BUF_TYPE_VIDEO_CAPTURE`` instead of
``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``. Use
``V4L2_BUF_TYPE_VIDEO_OUTPUT`` instead of
``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``. The next step is setting the
value of struct :c:type:`v4l2_selection` ``target`` to value of struct :c:type:`v4l2_selection` ``target`` to
``V4L2_SEL_TGT_CROP`` (``V4L2_SEL_TGT_COMPOSE``). Please refer to table ``V4L2_SEL_TGT_CROP`` (``V4L2_SEL_TGT_COMPOSE``). Please refer to table
:ref:`v4l2-selections-common` or :ref:`selection-api` for additional :ref:`v4l2-selections-common` or :ref:`selection-api` for additional
...@@ -169,6 +161,16 @@ Selection targets and flags are documented in ...@@ -169,6 +161,16 @@ Selection targets and flags are documented in
- Reserved fields for future use. Drivers and applications must zero - Reserved fields for future use. Drivers and applications must zero
this array. this array.
.. note::
Unfortunately in the case of multiplanar buffer types
(``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``)
this API was messed up with regards to how the :c:type:`v4l2_selection` ``type`` field
should be filled in. Some drivers only accepted the ``_MPLANE`` buffer type while
other drivers only accepted a non-multiplanar buffer type (i.e. without the
``_MPLANE`` at the end).
Starting with kernel 4.13 both variations are allowed.
Return Value Return Value
============ ============
......
此差异已折叠。
...@@ -42,6 +42,7 @@ For more details see the file COPYING in the source distribution of Linux. ...@@ -42,6 +42,7 @@ For more details see the file COPYING in the source distribution of Linux.
davinci-vpbe davinci-vpbe
fimc fimc
ivtv ivtv
max2175
meye meye
omap3isp omap3isp
omap4_camera omap4_camera
......
Maxim Integrated MAX2175 RF to bits tuner driver
================================================
The MAX2175 driver implements the following driver-specific controls:
``V4L2_CID_MAX2175_I2S_ENABLE``
-------------------------------
Enable/Disable I2S output of the tuner. This is a private control
that can be accessed only using the subdev interface.
Refer to Documentation/media/kapi/v4l2-controls for more details.
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 4
* - ``(0)``
- I2S output is disabled.
* - ``(1)``
- I2S output is enabled.
``V4L2_CID_MAX2175_HSLS``
-------------------------
The high-side/low-side (HSLS) control of the tuner for a given band.
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 4
* - ``(0)``
- The LO frequency position is below the desired frequency.
* - ``(1)``
- The LO frequency position is above the desired frequency.
``V4L2_CID_MAX2175_RX_MODE (menu)``
-----------------------------------
The Rx mode controls a number of preset parameters of the tuner like
sample clock (sck), sampling rate etc. These multiple settings are
provided under one single label called Rx mode in the datasheet. The
list below shows the supported modes with a brief description.
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 4
* - ``"Europe modes"``
* - ``"FM 1.2" (0)``
- This configures FM band with a sample rate of 0.512 million
samples/sec with a 10.24 MHz sck.
* - ``"DAB 1.2" (1)``
- This configures VHF band with a sample rate of 2.048 million
samples/sec with a 32.768 MHz sck.
* - ``"North America modes"``
* - ``"FM 1.0" (0)``
- This configures FM band with a sample rate of 0.7441875 million
samples/sec with a 14.88375 MHz sck.
* - ``"DAB 1.2" (1)``
- This configures FM band with a sample rate of 0.372 million
samples/sec with a 7.441875 MHz sck.
...@@ -1802,11 +1802,12 @@ F: arch/arm/plat-samsung/s5p-dev-mfc.c ...@@ -1802,11 +1802,12 @@ F: arch/arm/plat-samsung/s5p-dev-mfc.c
F: drivers/media/platform/s5p-mfc/ F: drivers/media/platform/s5p-mfc/
ARM/SAMSUNG S5P SERIES HDMI CEC SUBSYSTEM SUPPORT ARM/SAMSUNG S5P SERIES HDMI CEC SUBSYSTEM SUPPORT
M: Kyungmin Park <kyungmin.park@samsung.com> M: Marek Szyprowski <m.szyprowski@samsung.com>
L: linux-arm-kernel@lists.infradead.org L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
S: Maintained S: Maintained
F: drivers/staging/media/platform/s5p-cec/ F: drivers/media/platform/s5p-cec/
F: Documentation/devicetree/bindings/media/s5p-cec.txt
ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT
M: Andrzej Pietrasiewicz <andrzej.p@samsung.com> M: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
...@@ -3174,6 +3175,7 @@ F: include/media/cec.h ...@@ -3174,6 +3175,7 @@ F: include/media/cec.h
F: include/media/cec-notifier.h F: include/media/cec-notifier.h
F: include/uapi/linux/cec.h F: include/uapi/linux/cec.h
F: include/uapi/linux/cec-funcs.h F: include/uapi/linux/cec-funcs.h
F: Documentation/devicetree/bindings/media/cec.txt
CELL BROADBAND ENGINE ARCHITECTURE CELL BROADBAND ENGINE ARCHITECTURE
M: Arnd Bergmann <arnd@arndb.de> M: Arnd Bergmann <arnd@arndb.de>
...@@ -4734,6 +4736,13 @@ S: Maintained ...@@ -4734,6 +4736,13 @@ S: Maintained
F: drivers/media/usb/dvb-usb-v2/dvb_usb* F: drivers/media/usb/dvb-usb-v2/dvb_usb*
F: drivers/media/usb/dvb-usb-v2/usb_urb.c F: drivers/media/usb/dvb-usb-v2/usb_urb.c
DONGWOON DW9714 LENS VOICE COIL DRIVER
M: Sakari Ailus <sakari.ailus@linux.intel.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/dw9714.c
DYNAMIC DEBUG DYNAMIC DEBUG
M: Jason Baron <jbaron@akamai.com> M: Jason Baron <jbaron@akamai.com>
S: Maintained S: Maintained
...@@ -8101,6 +8110,16 @@ S: Maintained ...@@ -8101,6 +8110,16 @@ S: Maintained
F: Documentation/hwmon/max20751 F: Documentation/hwmon/max20751
F: drivers/hwmon/max20751.c F: drivers/hwmon/max20751.c
MAX2175 SDR TUNER DRIVER
M: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: Documentation/devicetree/bindings/media/i2c/max2175.txt
F: Documentation/media/v4l-drivers/max2175.rst
F: drivers/media/i2c/max2175*
F: include/uapi/linux/max2175.h
MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
L: linux-hwmon@vger.kernel.org L: linux-hwmon@vger.kernel.org
S: Orphan S: Orphan
...@@ -8181,6 +8200,27 @@ L: linux-iio@vger.kernel.org ...@@ -8181,6 +8200,27 @@ L: linux-iio@vger.kernel.org
S: Maintained S: Maintained
F: drivers/iio/dac/cio-dac.c F: drivers/iio/dac/cio-dac.c
MEDIA DRIVERS FOR RENESAS - DRIF
M: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
L: linux-media@vger.kernel.org
L: linux-renesas-soc@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Supported
F: Documentation/devicetree/bindings/media/renesas,drif.txt
F: drivers/media/platform/rcar_drif.c
MEDIA DRIVERS FOR FREESCALE IMX
M: Steve Longerbeam <slongerbeam@gmail.com>
M: Philipp Zabel <p.zabel@pengutronix.de>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: Documentation/devicetree/bindings/media/imx.txt
F: Documentation/media/v4l-drivers/imx.rst
F: drivers/staging/media/imx/
F: include/linux/imx-media.h
F: include/media/imx.h
MEDIA DRIVERS FOR RENESAS - FCP MEDIA DRIVERS FOR RENESAS - FCP
M: Laurent Pinchart <laurent.pinchart@ideasonboard.com> M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
...@@ -9548,6 +9588,13 @@ M: Harald Welte <laforge@gnumonks.org> ...@@ -9548,6 +9588,13 @@ M: Harald Welte <laforge@gnumonks.org>
S: Maintained S: Maintained
F: drivers/char/pcmcia/cm4040_cs.* F: drivers/char/pcmcia/cm4040_cs.*
OMNIVISION OV5640 SENSOR DRIVER
M: Steve Longerbeam <slongerbeam@gmail.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/ov5640.c
OMNIVISION OV5647 SENSOR DRIVER OMNIVISION OV5647 SENSOR DRIVER
M: Ramiro Oliveira <roliveir@synopsys.com> M: Ramiro Oliveira <roliveir@synopsys.com>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
...@@ -9563,6 +9610,13 @@ S: Maintained ...@@ -9563,6 +9610,13 @@ S: Maintained
F: drivers/media/i2c/ov7670.c F: drivers/media/i2c/ov7670.c
F: Documentation/devicetree/bindings/media/i2c/ov7670.txt F: Documentation/devicetree/bindings/media/i2c/ov7670.txt
OMNIVISION OV13858 SENSOR DRIVER
M: Sakari Ailus <sakari.ailus@linux.intel.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/ov13858.c
ONENAND FLASH DRIVER ONENAND FLASH DRIVER
M: Kyungmin Park <kyungmin.park@samsung.com> M: Kyungmin Park <kyungmin.park@samsung.com>
L: linux-mtd@lists.infradead.org L: linux-mtd@lists.infradead.org
...@@ -10714,6 +10768,14 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel.g ...@@ -10714,6 +10768,14 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel.g
S: Supported S: Supported
F: arch/hexagon/ F: arch/hexagon/
QUALCOMM VENUS VIDEO ACCELERATOR DRIVER
M: Stanimir Varbanov <stanimir.varbanov@linaro.org>
L: linux-media@vger.kernel.org
L: linux-arm-msm@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/platform/qcom/venus/
QUALCOMM WCN36XX WIRELESS DRIVER QUALCOMM WCN36XX WIRELESS DRIVER
M: Eugene Krasnikov <k.eugene.e@gmail.com> M: Eugene Krasnikov <k.eugene.e@gmail.com>
L: wcn36xx@lists.infradead.org L: wcn36xx@lists.infradead.org
...@@ -12118,8 +12180,9 @@ F: drivers/leds/leds-net48xx.c ...@@ -12118,8 +12180,9 @@ F: drivers/leds/leds-net48xx.c
SOFTLOGIC 6x10 MPEG CODEC SOFTLOGIC 6x10 MPEG CODEC
M: Bluecherry Maintainers <maintainers@bluecherrydvr.com> M: Bluecherry Maintainers <maintainers@bluecherrydvr.com>
M: Anton Sviridenko <anton@corp.bluecherry.net>
M: Andrey Utkin <andrey.utkin@corp.bluecherry.net> M: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
M: Andrey Utkin <andrey.krieger.utkin@gmail.com> M: Andrey Utkin <andrey_utkin@fastmail.com>
M: Ismael Luceno <ismael@iodev.co.uk> M: Ismael Luceno <ismael@iodev.co.uk>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
S: Supported S: Supported
...@@ -13067,6 +13130,7 @@ F: Documentation/media/v4l-drivers/tm6000* ...@@ -13067,6 +13130,7 @@ F: Documentation/media/v4l-drivers/tm6000*
TW5864 VIDEO4LINUX DRIVER TW5864 VIDEO4LINUX DRIVER
M: Bluecherry Maintainers <maintainers@bluecherrydvr.com> M: Bluecherry Maintainers <maintainers@bluecherrydvr.com>
M: Anton Sviridenko <anton@corp.bluecherry.net>
M: Andrey Utkin <andrey.utkin@corp.bluecherry.net> M: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
M: Andrey Utkin <andrey_utkin@fastmail.com> M: Andrey Utkin <andrey_utkin@fastmail.com>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
...@@ -13692,6 +13756,12 @@ S: Maintained ...@@ -13692,6 +13756,12 @@ S: Maintained
F: drivers/media/v4l2-core/videobuf2-* F: drivers/media/v4l2-core/videobuf2-*
F: include/media/videobuf2-* F: include/media/videobuf2-*
VIDEO MULTIPLEXER DRIVER
M: Philipp Zabel <p.zabel@pengutronix.de>
L: linux-media@vger.kernel.org
S: Maintained
F: drivers/media/platform/video-mux.c
VIRTIO AND VHOST VSOCK DRIVER VIRTIO AND VHOST VSOCK DRIVER
M: Stefan Hajnoczi <stefanha@redhat.com> M: Stefan Hajnoczi <stefanha@redhat.com>
L: kvm@vger.kernel.org L: kvm@vger.kernel.org
......
...@@ -503,8 +503,9 @@ static int aat1290_led_probe(struct platform_device *pdev) ...@@ -503,8 +503,9 @@ static int aat1290_led_probe(struct platform_device *pdev)
aat1290_init_v4l2_flash_config(led, &led_cfg, &v4l2_sd_cfg); aat1290_init_v4l2_flash_config(led, &led_cfg, &v4l2_sd_cfg);
/* Create V4L2 Flash subdev. */ /* Create V4L2 Flash subdev. */
led->v4l2_flash = v4l2_flash_init(dev, sub_node, fled_cdev, NULL, led->v4l2_flash = v4l2_flash_init(dev, of_fwnode_handle(sub_node),
&v4l2_flash_ops, &v4l2_sd_cfg); fled_cdev, NULL, &v4l2_flash_ops,
&v4l2_sd_cfg);
if (IS_ERR(led->v4l2_flash)) { if (IS_ERR(led->v4l2_flash)) {
ret = PTR_ERR(led->v4l2_flash); ret = PTR_ERR(led->v4l2_flash);
goto error_v4l2_flash_init; goto error_v4l2_flash_init;
......
...@@ -930,8 +930,9 @@ static int max77693_register_led(struct max77693_sub_led *sub_led, ...@@ -930,8 +930,9 @@ static int max77693_register_led(struct max77693_sub_led *sub_led,
max77693_init_v4l2_flash_config(sub_led, led_cfg, &v4l2_sd_cfg); max77693_init_v4l2_flash_config(sub_led, led_cfg, &v4l2_sd_cfg);
/* Register in the V4L2 subsystem. */ /* Register in the V4L2 subsystem. */
sub_led->v4l2_flash = v4l2_flash_init(dev, sub_node, fled_cdev, NULL, sub_led->v4l2_flash = v4l2_flash_init(dev, of_fwnode_handle(sub_node),
&v4l2_flash_ops, &v4l2_sd_cfg); fled_cdev, NULL, &v4l2_flash_ops,
&v4l2_sd_cfg);
if (IS_ERR(sub_led->v4l2_flash)) { if (IS_ERR(sub_led->v4l2_flash)) {
ret = PTR_ERR(sub_led->v4l2_flash); ret = PTR_ERR(sub_led->v4l2_flash);
goto err_v4l2_flash_init; goto err_v4l2_flash_init;
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/types.h> #include <linux/types.h>
#include <drm/drm_edid.h>
#include "cec-priv.h" #include "cec-priv.h"
static void cec_fill_msg_report_features(struct cec_adapter *adap, static void cec_fill_msg_report_features(struct cec_adapter *adap,
...@@ -366,6 +368,8 @@ int cec_thread_func(void *_adap) ...@@ -366,6 +368,8 @@ int cec_thread_func(void *_adap)
* transmit should be canceled. * transmit should be canceled.
*/ */
err = wait_event_interruptible_timeout(adap->kthread_waitq, err = wait_event_interruptible_timeout(adap->kthread_waitq,
(adap->needs_hpd &&
(!adap->is_configured && !adap->is_configuring)) ||
kthread_should_stop() || kthread_should_stop() ||
(!adap->transmitting && (!adap->transmitting &&
!list_empty(&adap->transmit_queue)), !list_empty(&adap->transmit_queue)),
...@@ -381,7 +385,9 @@ int cec_thread_func(void *_adap) ...@@ -381,7 +385,9 @@ int cec_thread_func(void *_adap)
mutex_lock(&adap->lock); mutex_lock(&adap->lock);
if (kthread_should_stop()) { if ((adap->needs_hpd &&
(!adap->is_configured && !adap->is_configuring)) ||
kthread_should_stop()) {
cec_flush(adap); cec_flush(adap);
goto unlock; goto unlock;
} }
...@@ -392,7 +398,7 @@ int cec_thread_func(void *_adap) ...@@ -392,7 +398,7 @@ int cec_thread_func(void *_adap)
* happen and is an indication of a faulty CEC adapter * happen and is an indication of a faulty CEC adapter
* driver, or the CEC bus is in some weird state. * driver, or the CEC bus is in some weird state.
*/ */
dprintk(0, "message %*ph timed out!\n", dprintk(0, "%s: message %*ph timed out!\n", __func__,
adap->transmitting->msg.len, adap->transmitting->msg.len,
adap->transmitting->msg.msg); adap->transmitting->msg.msg);
/* Just give up on this. */ /* Just give up on this. */
...@@ -468,7 +474,7 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, ...@@ -468,7 +474,7 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
struct cec_msg *msg; struct cec_msg *msg;
u64 ts = ktime_get_ns(); u64 ts = ktime_get_ns();
dprintk(2, "cec_transmit_done %02x\n", status); dprintk(2, "%s: status %02x\n", __func__, status);
mutex_lock(&adap->lock); mutex_lock(&adap->lock);
data = adap->transmitting; data = adap->transmitting;
if (!data) { if (!data) {
...@@ -477,7 +483,8 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, ...@@ -477,7 +483,8 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
* unplugged while the transmit is ongoing. Ignore this * unplugged while the transmit is ongoing. Ignore this
* transmit in that case. * transmit in that case.
*/ */
dprintk(1, "cec_transmit_done without an ongoing transmit!\n"); dprintk(1, "%s was called without an ongoing transmit!\n",
__func__);
goto unlock; goto unlock;
} }
...@@ -504,6 +511,12 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, ...@@ -504,6 +511,12 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
!(status & (CEC_TX_STATUS_MAX_RETRIES | CEC_TX_STATUS_OK))) { !(status & (CEC_TX_STATUS_MAX_RETRIES | CEC_TX_STATUS_OK))) {
/* Retry this message */ /* Retry this message */
data->attempts--; data->attempts--;
if (msg->timeout)
dprintk(2, "retransmit: %*ph (attempts: %d, wait for 0x%02x)\n",
msg->len, msg->msg, data->attempts, msg->reply);
else
dprintk(2, "retransmit: %*ph (attempts: %d)\n",
msg->len, msg->msg, data->attempts);
/* Add the message in front of the transmit queue */ /* Add the message in front of the transmit queue */
list_add(&data->list, &adap->transmit_queue); list_add(&data->list, &adap->transmit_queue);
adap->transmit_queue_sz++; adap->transmit_queue_sz++;
...@@ -544,6 +557,32 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, ...@@ -544,6 +557,32 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
} }
EXPORT_SYMBOL_GPL(cec_transmit_done); EXPORT_SYMBOL_GPL(cec_transmit_done);
void cec_transmit_attempt_done(struct cec_adapter *adap, u8 status)
{
switch (status) {
case CEC_TX_STATUS_OK:
cec_transmit_done(adap, status, 0, 0, 0, 0);
return;
case CEC_TX_STATUS_ARB_LOST:
cec_transmit_done(adap, status, 1, 0, 0, 0);
return;
case CEC_TX_STATUS_NACK:
cec_transmit_done(adap, status, 0, 1, 0, 0);
return;
case CEC_TX_STATUS_LOW_DRIVE:
cec_transmit_done(adap, status, 0, 0, 1, 0);
return;
case CEC_TX_STATUS_ERROR:
cec_transmit_done(adap, status, 0, 0, 0, 1);
return;
default:
/* Should never happen */
WARN(1, "cec-%s: invalid status 0x%02x\n", adap->name, status);
return;
}
}
EXPORT_SYMBOL_GPL(cec_transmit_attempt_done);
/* /*
* Called when waiting for a reply times out. * Called when waiting for a reply times out.
*/ */
...@@ -647,7 +686,7 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg, ...@@ -647,7 +686,7 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
return -EINVAL; return -EINVAL;
} }
if (!adap->is_configured && !adap->is_configuring) { if (!adap->is_configured && !adap->is_configuring) {
if (msg->msg[0] != 0xf0) { if (adap->needs_hpd || msg->msg[0] != 0xf0) {
dprintk(1, "%s: adapter is unconfigured\n", __func__); dprintk(1, "%s: adapter is unconfigured\n", __func__);
return -ENONET; return -ENONET;
} }
...@@ -911,7 +950,7 @@ void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg) ...@@ -911,7 +950,7 @@ void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg)
memset(msg->msg + msg->len, 0, sizeof(msg->msg) - msg->len); memset(msg->msg + msg->len, 0, sizeof(msg->msg) - msg->len);
mutex_lock(&adap->lock); mutex_lock(&adap->lock);
dprintk(2, "cec_received_msg: %*ph\n", msg->len, msg->msg); dprintk(2, "%s: %*ph\n", __func__, msg->len, msg->msg);
/* Check if this message was for us (directed or broadcast). */ /* Check if this message was for us (directed or broadcast). */
if (!cec_msg_is_broadcast(msg)) if (!cec_msg_is_broadcast(msg))
...@@ -1112,9 +1151,6 @@ static int cec_config_log_addr(struct cec_adapter *adap, ...@@ -1112,9 +1151,6 @@ static int cec_config_log_addr(struct cec_adapter *adap,
las->log_addr[idx] = log_addr; las->log_addr[idx] = log_addr;
las->log_addr_mask |= 1 << log_addr; las->log_addr_mask |= 1 << log_addr;
adap->phys_addrs[log_addr] = adap->phys_addr; adap->phys_addrs[log_addr] = adap->phys_addr;
dprintk(2, "claimed addr %d (%d)\n", log_addr,
las->primary_device_type[idx]);
return 1; return 1;
} }
...@@ -1126,7 +1162,9 @@ static int cec_config_log_addr(struct cec_adapter *adap, ...@@ -1126,7 +1162,9 @@ static int cec_config_log_addr(struct cec_adapter *adap,
*/ */
static void cec_adap_unconfigure(struct cec_adapter *adap) static void cec_adap_unconfigure(struct cec_adapter *adap)
{ {
WARN_ON(adap->ops->adap_log_addr(adap, CEC_LOG_ADDR_INVALID)); if (!adap->needs_hpd ||
adap->phys_addr != CEC_PHYS_ADDR_INVALID)
WARN_ON(adap->ops->adap_log_addr(adap, CEC_LOG_ADDR_INVALID));
adap->log_addrs.log_addr_mask = 0; adap->log_addrs.log_addr_mask = 0;
adap->is_configuring = false; adap->is_configuring = false;
adap->is_configured = false; adap->is_configured = false;
...@@ -1300,7 +1338,7 @@ static int cec_config_thread_func(void *arg) ...@@ -1300,7 +1338,7 @@ static int cec_config_thread_func(void *arg)
/* Report Physical Address */ /* Report Physical Address */
cec_msg_report_physical_addr(&msg, adap->phys_addr, cec_msg_report_physical_addr(&msg, adap->phys_addr,
las->primary_device_type[i]); las->primary_device_type[i]);
dprintk(2, "config: la %d pa %x.%x.%x.%x\n", dprintk(1, "config: la %d pa %x.%x.%x.%x\n",
las->log_addr[i], las->log_addr[i],
cec_phys_addr_exp(adap->phys_addr)); cec_phys_addr_exp(adap->phys_addr));
cec_transmit_msg_fh(adap, &msg, NULL, false); cec_transmit_msg_fh(adap, &msg, NULL, false);
...@@ -1355,6 +1393,8 @@ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block) ...@@ -1355,6 +1393,8 @@ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block)
if (phys_addr == adap->phys_addr || adap->devnode.unregistered) if (phys_addr == adap->phys_addr || adap->devnode.unregistered)
return; return;
dprintk(1, "new physical address %x.%x.%x.%x\n",
cec_phys_addr_exp(phys_addr));
if (phys_addr == CEC_PHYS_ADDR_INVALID || if (phys_addr == CEC_PHYS_ADDR_INVALID ||
adap->phys_addr != CEC_PHYS_ADDR_INVALID) { adap->phys_addr != CEC_PHYS_ADDR_INVALID) {
adap->phys_addr = CEC_PHYS_ADDR_INVALID; adap->phys_addr = CEC_PHYS_ADDR_INVALID;
...@@ -1364,7 +1404,7 @@ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block) ...@@ -1364,7 +1404,7 @@ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block)
if (adap->monitor_all_cnt) if (adap->monitor_all_cnt)
WARN_ON(call_op(adap, adap_monitor_all_enable, false)); WARN_ON(call_op(adap, adap_monitor_all_enable, false));
mutex_lock(&adap->devnode.lock); mutex_lock(&adap->devnode.lock);
if (list_empty(&adap->devnode.fhs)) if (adap->needs_hpd || list_empty(&adap->devnode.fhs))
WARN_ON(adap->ops->adap_enable(adap, false)); WARN_ON(adap->ops->adap_enable(adap, false));
mutex_unlock(&adap->devnode.lock); mutex_unlock(&adap->devnode.lock);
if (phys_addr == CEC_PHYS_ADDR_INVALID) if (phys_addr == CEC_PHYS_ADDR_INVALID)
...@@ -1372,7 +1412,7 @@ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block) ...@@ -1372,7 +1412,7 @@ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block)
} }
mutex_lock(&adap->devnode.lock); mutex_lock(&adap->devnode.lock);
if (list_empty(&adap->devnode.fhs) && if ((adap->needs_hpd || list_empty(&adap->devnode.fhs)) &&
adap->ops->adap_enable(adap, true)) { adap->ops->adap_enable(adap, true)) {
mutex_unlock(&adap->devnode.lock); mutex_unlock(&adap->devnode.lock);
return; return;
...@@ -1380,7 +1420,7 @@ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block) ...@@ -1380,7 +1420,7 @@ void __cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block)
if (adap->monitor_all_cnt && if (adap->monitor_all_cnt &&
call_op(adap, adap_monitor_all_enable, true)) { call_op(adap, adap_monitor_all_enable, true)) {
if (list_empty(&adap->devnode.fhs)) if (adap->needs_hpd || list_empty(&adap->devnode.fhs))
WARN_ON(adap->ops->adap_enable(adap, false)); WARN_ON(adap->ops->adap_enable(adap, false));
mutex_unlock(&adap->devnode.lock); mutex_unlock(&adap->devnode.lock);
return; return;
...@@ -1404,6 +1444,18 @@ void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block) ...@@ -1404,6 +1444,18 @@ void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block)
} }
EXPORT_SYMBOL_GPL(cec_s_phys_addr); EXPORT_SYMBOL_GPL(cec_s_phys_addr);
void cec_s_phys_addr_from_edid(struct cec_adapter *adap,
const struct edid *edid)
{
u16 pa = CEC_PHYS_ADDR_INVALID;
if (edid && edid->extensions)
pa = cec_get_edid_phys_addr((const u8 *)edid,
EDID_LENGTH * (edid->extensions + 1), NULL);
cec_s_phys_addr(adap, pa, false);
}
EXPORT_SYMBOL_GPL(cec_s_phys_addr_from_edid);
/* /*
* Called from either the ioctl or a driver to set the logical addresses. * Called from either the ioctl or a driver to set the logical addresses.
* *
...@@ -1534,12 +1586,12 @@ int __cec_s_log_addrs(struct cec_adapter *adap, ...@@ -1534,12 +1586,12 @@ int __cec_s_log_addrs(struct cec_adapter *adap,
if (log_addrs->num_log_addrs == 2) { if (log_addrs->num_log_addrs == 2) {
if (!(type_mask & ((1 << CEC_LOG_ADDR_TYPE_AUDIOSYSTEM) | if (!(type_mask & ((1 << CEC_LOG_ADDR_TYPE_AUDIOSYSTEM) |
(1 << CEC_LOG_ADDR_TYPE_TV)))) { (1 << CEC_LOG_ADDR_TYPE_TV)))) {
dprintk(1, "Two LAs is only allowed for audiosystem and TV\n"); dprintk(1, "two LAs is only allowed for audiosystem and TV\n");
return -EINVAL; return -EINVAL;
} }
if (!(type_mask & ((1 << CEC_LOG_ADDR_TYPE_PLAYBACK) | if (!(type_mask & ((1 << CEC_LOG_ADDR_TYPE_PLAYBACK) |
(1 << CEC_LOG_ADDR_TYPE_RECORD)))) { (1 << CEC_LOG_ADDR_TYPE_RECORD)))) {
dprintk(1, "An audiosystem/TV can only be combined with record or playback\n"); dprintk(1, "an audiosystem/TV can only be combined with record or playback\n");
return -EINVAL; return -EINVAL;
} }
} }
...@@ -1653,7 +1705,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg, ...@@ -1653,7 +1705,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
bool from_unregistered = init_laddr == 0xf; bool from_unregistered = init_laddr == 0xf;
struct cec_msg tx_cec_msg = { }; struct cec_msg tx_cec_msg = { };
dprintk(1, "cec_receive_notify: %*ph\n", msg->len, msg->msg); dprintk(2, "%s: %*ph\n", __func__, msg->len, msg->msg);
/* If this is a CDC-Only device, then ignore any non-CDC messages */ /* If this is a CDC-Only device, then ignore any non-CDC messages */
if (cec_is_cdc_only(&adap->log_addrs) && if (cec_is_cdc_only(&adap->log_addrs) &&
...@@ -1722,7 +1774,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg, ...@@ -1722,7 +1774,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
if (!from_unregistered) if (!from_unregistered)
adap->phys_addrs[init_laddr] = pa; adap->phys_addrs[init_laddr] = pa;
dprintk(1, "Reported physical address %x.%x.%x.%x for logical address %d\n", dprintk(1, "reported physical address %x.%x.%x.%x for logical address %d\n",
cec_phys_addr_exp(pa), init_laddr); cec_phys_addr_exp(pa), init_laddr);
break; break;
} }
......
...@@ -202,7 +202,8 @@ static long cec_transmit(struct cec_adapter *adap, struct cec_fh *fh, ...@@ -202,7 +202,8 @@ static long cec_transmit(struct cec_adapter *adap, struct cec_fh *fh,
err = -EPERM; err = -EPERM;
else if (adap->is_configuring) else if (adap->is_configuring)
err = -ENONET; err = -ENONET;
else if (!adap->is_configured && msg.msg[0] != 0xf0) else if (!adap->is_configured &&
(adap->needs_hpd || msg.msg[0] != 0xf0))
err = -ENONET; err = -ENONET;
else if (cec_is_busy(adap, fh)) else if (cec_is_busy(adap, fh))
err = -EBUSY; err = -EBUSY;
...@@ -515,6 +516,7 @@ static int cec_open(struct inode *inode, struct file *filp) ...@@ -515,6 +516,7 @@ static int cec_open(struct inode *inode, struct file *filp)
mutex_lock(&devnode->lock); mutex_lock(&devnode->lock);
if (list_empty(&devnode->fhs) && if (list_empty(&devnode->fhs) &&
!adap->needs_hpd &&
adap->phys_addr == CEC_PHYS_ADDR_INVALID) { adap->phys_addr == CEC_PHYS_ADDR_INVALID) {
err = adap->ops->adap_enable(adap, true); err = adap->ops->adap_enable(adap, true);
if (err) { if (err) {
...@@ -559,6 +561,7 @@ static int cec_release(struct inode *inode, struct file *filp) ...@@ -559,6 +561,7 @@ static int cec_release(struct inode *inode, struct file *filp)
mutex_lock(&devnode->lock); mutex_lock(&devnode->lock);
list_del(&fh->list); list_del(&fh->list);
if (list_empty(&devnode->fhs) && if (list_empty(&devnode->fhs) &&
!adap->needs_hpd &&
adap->phys_addr == CEC_PHYS_ADDR_INVALID) { adap->phys_addr == CEC_PHYS_ADDR_INVALID) {
WARN_ON(adap->ops->adap_enable(adap, false)); WARN_ON(adap->ops->adap_enable(adap, false));
} }
......
...@@ -230,6 +230,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, ...@@ -230,6 +230,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
adap->log_addrs.cec_version = CEC_OP_CEC_VERSION_2_0; adap->log_addrs.cec_version = CEC_OP_CEC_VERSION_2_0;
adap->log_addrs.vendor_id = CEC_VENDOR_ID_NONE; adap->log_addrs.vendor_id = CEC_VENDOR_ID_NONE;
adap->capabilities = caps; adap->capabilities = caps;
adap->needs_hpd = caps & CEC_CAP_NEEDS_HPD;
adap->available_log_addrs = available_las; adap->available_log_addrs = available_las;
adap->sequence = 0; adap->sequence = 0;
adap->ops = ops; adap->ops = ops;
......
...@@ -193,8 +193,10 @@ static void dvb_ca_private_put(struct dvb_ca_private *ca) ...@@ -193,8 +193,10 @@ static void dvb_ca_private_put(struct dvb_ca_private *ca)
} }
static void dvb_ca_en50221_thread_wakeup(struct dvb_ca_private *ca); static void dvb_ca_en50221_thread_wakeup(struct dvb_ca_private *ca);
static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * ebuf, int ecount); static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot,
static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * ebuf, int ecount); u8 *ebuf, int ecount);
static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,
u8 *ebuf, int ecount);
/** /**
...@@ -206,7 +208,7 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * e ...@@ -206,7 +208,7 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * e
* @nlen: Number of bytes in needle. * @nlen: Number of bytes in needle.
* @return Pointer into haystack needle was found at, or NULL if not found. * @return Pointer into haystack needle was found at, or NULL if not found.
*/ */
static char *findstr(char * haystack, int hlen, char * needle, int nlen) static char *findstr(char *haystack, int hlen, char *needle, int nlen)
{ {
int i; int i;
...@@ -390,7 +392,8 @@ static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot) ...@@ -390,7 +392,8 @@ static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot)
* @return 0 on success, nonzero on error. * @return 0 on success, nonzero on error.
*/ */
static int dvb_ca_en50221_read_tuple(struct dvb_ca_private *ca, int slot, static int dvb_ca_en50221_read_tuple(struct dvb_ca_private *ca, int slot,
int *address, int *tupleType, int *tupleLength, u8 * tuple) int *address, int *tupleType,
int *tupleLength, u8 *tuple)
{ {
int i; int i;
int _tupleType; int _tupleType;
...@@ -621,7 +624,8 @@ static int dvb_ca_en50221_set_configoption(struct dvb_ca_private *ca, int slot) ...@@ -621,7 +624,8 @@ static int dvb_ca_en50221_set_configoption(struct dvb_ca_private *ca, int slot)
* *
* @return Number of bytes read, or < 0 on error * @return Number of bytes read, or < 0 on error
*/ */
static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * ebuf, int ecount) static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot,
u8 *ebuf, int ecount)
{ {
int bytes_read; int bytes_read;
int status; int status;
...@@ -745,7 +749,8 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb ...@@ -745,7 +749,8 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb
* *
* @return Number of bytes written, or < 0 on error. * @return Number of bytes written, or < 0 on error.
*/ */
static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * buf, int bytes_write) static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,
u8 *buf, int bytes_write)
{ {
int status; int status;
int i; int i;
...@@ -840,7 +845,6 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b ...@@ -840,7 +845,6 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
exitnowrite: exitnowrite:
return status; return status;
} }
EXPORT_SYMBOL(dvb_ca_en50221_camchange_irq);
...@@ -849,7 +853,7 @@ EXPORT_SYMBOL(dvb_ca_en50221_camchange_irq); ...@@ -849,7 +853,7 @@ EXPORT_SYMBOL(dvb_ca_en50221_camchange_irq);
/** /**
* dvb_ca_en50221_camready_irq - A CAM has been removed => shut it down. * dvb_ca_en50221_slot_shutdown - A CAM has been removed => shut it down.
* *
* @ca: CA instance. * @ca: CA instance.
* @slot: Slot to shut down. * @slot: Slot to shut down.
...@@ -870,11 +874,10 @@ static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot) ...@@ -870,11 +874,10 @@ static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot)
/* success */ /* success */
return 0; return 0;
} }
EXPORT_SYMBOL(dvb_ca_en50221_camready_irq);
/** /**
* dvb_ca_en50221_camready_irq - A CAMCHANGE IRQ has occurred. * dvb_ca_en50221_camchange_irq - A CAMCHANGE IRQ has occurred.
* *
* @ca: CA instance. * @ca: CA instance.
* @slot: Slot concerned. * @slot: Slot concerned.
...@@ -899,7 +902,7 @@ void dvb_ca_en50221_camchange_irq(struct dvb_ca_en50221 *pubca, int slot, int ch ...@@ -899,7 +902,7 @@ void dvb_ca_en50221_camchange_irq(struct dvb_ca_en50221 *pubca, int slot, int ch
atomic_inc(&ca->slot_info[slot].camchange_count); atomic_inc(&ca->slot_info[slot].camchange_count);
dvb_ca_en50221_thread_wakeup(ca); dvb_ca_en50221_thread_wakeup(ca);
} }
EXPORT_SYMBOL(dvb_ca_en50221_frda_irq); EXPORT_SYMBOL(dvb_ca_en50221_camchange_irq);
/** /**
...@@ -919,10 +922,11 @@ void dvb_ca_en50221_camready_irq(struct dvb_ca_en50221 *pubca, int slot) ...@@ -919,10 +922,11 @@ void dvb_ca_en50221_camready_irq(struct dvb_ca_en50221 *pubca, int slot)
dvb_ca_en50221_thread_wakeup(ca); dvb_ca_en50221_thread_wakeup(ca);
} }
} }
EXPORT_SYMBOL(dvb_ca_en50221_camready_irq);
/** /**
* An FR or DA IRQ has occurred. * dvb_ca_en50221_frda_irq - An FR or DA IRQ has occurred.
* *
* @ca: CA instance. * @ca: CA instance.
* @slot: Slot concerned. * @slot: Slot concerned.
...@@ -949,7 +953,7 @@ void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *pubca, int slot) ...@@ -949,7 +953,7 @@ void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *pubca, int slot)
break; break;
} }
} }
EXPORT_SYMBOL(dvb_ca_en50221_frda_irq);
/* ******************************************************************************** */ /* ******************************************************************************** */
...@@ -1345,7 +1349,8 @@ static long dvb_ca_en50221_io_ioctl(struct file *file, ...@@ -1345,7 +1349,8 @@ static long dvb_ca_en50221_io_ioctl(struct file *file,
* @return Number of bytes read, or <0 on error. * @return Number of bytes read, or <0 on error.
*/ */
static ssize_t dvb_ca_en50221_io_write(struct file *file, static ssize_t dvb_ca_en50221_io_write(struct file *file,
const char __user * buf, size_t count, loff_t * ppos) const char __user *buf, size_t count,
loff_t *ppos)
{ {
struct dvb_device *dvbdev = file->private_data; struct dvb_device *dvbdev = file->private_data;
struct dvb_ca_private *ca = dvbdev->priv; struct dvb_ca_private *ca = dvbdev->priv;
...@@ -1485,8 +1490,8 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, ...@@ -1485,8 +1490,8 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca,
* *
* @return Number of bytes read, or <0 on error. * @return Number of bytes read, or <0 on error.
*/ */
static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user * buf, static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user *buf,
size_t count, loff_t * ppos) size_t count, loff_t *ppos)
{ {
struct dvb_device *dvbdev = file->private_data; struct dvb_device *dvbdev = file->private_data;
struct dvb_ca_private *ca = dvbdev->priv; struct dvb_ca_private *ca = dvbdev->priv;
...@@ -1664,7 +1669,7 @@ static int dvb_ca_en50221_io_release(struct inode *inode, struct file *file) ...@@ -1664,7 +1669,7 @@ static int dvb_ca_en50221_io_release(struct inode *inode, struct file *file)
* *
* @return Standard poll mask. * @return Standard poll mask.
*/ */
static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait) static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
{ {
struct dvb_device *dvbdev = file->private_data; struct dvb_device *dvbdev = file->private_data;
struct dvb_ca_private *ca = dvbdev->priv; struct dvb_ca_private *ca = dvbdev->priv;
......
...@@ -436,6 +436,7 @@ config DVB_TDA10048 ...@@ -436,6 +436,7 @@ config DVB_TDA10048
config DVB_AF9013 config DVB_AF9013
tristate "Afatech AF9013 demodulator" tristate "Afatech AF9013 demodulator"
depends on DVB_CORE && I2C depends on DVB_CORE && I2C
select REGMAP
default m if !MEDIA_SUBDRV_AUTOSELECT default m if !MEDIA_SUBDRV_AUTOSELECT
help help
Say Y when you want to support this frontend. Say Y when you want to support this frontend.
......
...@@ -23,29 +23,27 @@ ...@@ -23,29 +23,27 @@
#include <linux/dvb/frontend.h> #include <linux/dvb/frontend.h>
/* AF9013/5 GPIOs (mostly guessed) /*
demod#1-gpio#0 - set demod#2 i2c-addr for dual devices * I2C address: 0x1c, 0x1d
demod#1-gpio#1 - xtal setting (?) */
demod#1-gpio#3 - tuner#1
demod#2-gpio#0 - tuner#2
demod#2-gpio#1 - xtal setting (?)
*/
struct af9013_config {
/*
* I2C address
*/
u8 i2c_addr;
/**
* struct af9013_platform_data - Platform data for the af9013 driver
* @clk: Clock frequency.
* @tuner: Used tuner model.
* @if_frequency: IF frequency.
* @ts_mode: TS mode.
* @ts_output_pin: TS output pin.
* @spec_inv: Input spectrum inverted.
* @api_version: Firmware API version.
* @gpio: GPIOs.
* @get_dvb_frontend: Get DVB frontend callback.
*/
struct af9013_platform_data {
/* /*
* clock
* 20480000, 25000000, 28000000, 28800000 * 20480000, 25000000, 28000000, 28800000
*/ */
u32 clock; u32 clk;
/*
* tuner
*/
#define AF9013_TUNER_MXL5003D 3 /* MaxLinear */ #define AF9013_TUNER_MXL5003D 3 /* MaxLinear */
#define AF9013_TUNER_MXL5005D 13 /* MaxLinear */ #define AF9013_TUNER_MXL5005D 13 /* MaxLinear */
#define AF9013_TUNER_MXL5005R 30 /* MaxLinear */ #define AF9013_TUNER_MXL5005R 30 /* MaxLinear */
...@@ -60,33 +58,14 @@ struct af9013_config { ...@@ -60,33 +58,14 @@ struct af9013_config {
#define AF9013_TUNER_MXL5007T 177 /* MaxLinear */ #define AF9013_TUNER_MXL5007T 177 /* MaxLinear */
#define AF9013_TUNER_TDA18218 179 /* NXP */ #define AF9013_TUNER_TDA18218 179 /* NXP */
u8 tuner; u8 tuner;
/*
* IF frequency
*/
u32 if_frequency; u32 if_frequency;
#define AF9013_TS_MODE_USB 0
/* #define AF9013_TS_MODE_PARALLEL 1
* TS settings #define AF9013_TS_MODE_SERIAL 2
*/ u8 ts_mode;
#define AF9013_TS_USB 0 u8 ts_output_pin;
#define AF9013_TS_PARALLEL 1
#define AF9013_TS_SERIAL 2
u8 ts_mode:2;
/*
* input spectrum inversion
*/
bool spec_inv; bool spec_inv;
/*
* firmware API version
*/
u8 api_version[4]; u8 api_version[4];
/*
* GPIOs
*/
#define AF9013_GPIO_ON (1 << 0) #define AF9013_GPIO_ON (1 << 0)
#define AF9013_GPIO_EN (1 << 1) #define AF9013_GPIO_EN (1 << 1)
#define AF9013_GPIO_O (1 << 2) #define AF9013_GPIO_O (1 << 2)
...@@ -96,8 +75,29 @@ struct af9013_config { ...@@ -96,8 +75,29 @@ struct af9013_config {
#define AF9013_GPIO_TUNER_ON (AF9013_GPIO_ON|AF9013_GPIO_EN) #define AF9013_GPIO_TUNER_ON (AF9013_GPIO_ON|AF9013_GPIO_EN)
#define AF9013_GPIO_TUNER_OFF (AF9013_GPIO_ON|AF9013_GPIO_EN|AF9013_GPIO_O) #define AF9013_GPIO_TUNER_OFF (AF9013_GPIO_ON|AF9013_GPIO_EN|AF9013_GPIO_O)
u8 gpio[4]; u8 gpio[4];
struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *);
/* private: For legacy media attach wrapper. Do not set value. */
bool attach_in_use;
u8 i2c_addr;
u32 clock;
}; };
#define af9013_config af9013_platform_data
#define AF9013_TS_USB AF9013_TS_MODE_USB
#define AF9013_TS_PARALLEL AF9013_TS_MODE_PARALLEL
#define AF9013_TS_SERIAL AF9013_TS_MODE_SERIAL
/*
* AF9013/5 GPIOs (mostly guessed)
* demod#1-gpio#0 - set demod#2 i2c-addr for dual devices
* demod#1-gpio#1 - xtal setting (?)
* demod#1-gpio#3 - tuner#1
* demod#2-gpio#0 - tuner#2
* demod#2-gpio#1 - xtal setting (?)
*/
#if IS_REACHABLE(CONFIG_DVB_AF9013) #if IS_REACHABLE(CONFIG_DVB_AF9013)
extern struct dvb_frontend *af9013_attach(const struct af9013_config *config, extern struct dvb_frontend *af9013_attach(const struct af9013_config *config,
struct i2c_adapter *i2c); struct i2c_adapter *i2c);
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "dvb_frontend.h" #include "dvb_frontend.h"
#include "af9013.h" #include "af9013.h"
#include <linux/firmware.h> #include <linux/firmware.h>
#include <linux/math64.h>
#include <linux/regmap.h>
#define AF9013_FIRMWARE "dvb-fe-af9013.fw" #define AF9013_FIRMWARE "dvb-fe-af9013.fw"
......
...@@ -234,6 +234,7 @@ int au8522_init(struct dvb_frontend *fe) ...@@ -234,6 +234,7 @@ int au8522_init(struct dvb_frontend *fe)
chip, so that when it gets powered back up it won't think chip, so that when it gets powered back up it won't think
that it is already tuned */ that it is already tuned */
state->current_frequency = 0; state->current_frequency = 0;
state->current_modulation = VSB_8;
au8522_writereg(state, 0xa4, 1 << 5); au8522_writereg(state, 0xa4, 1 << 5);
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
/* Developer notes: /* Developer notes:
* *
* VBI support is not yet working
* Enough is implemented here for CVBS and S-Video inputs, but the actual * Enough is implemented here for CVBS and S-Video inputs, but the actual
* analog demodulator code isn't implemented (not needed for xc5000 since it * analog demodulator code isn't implemented (not needed for xc5000 since it
* has its own demodulator and outputs CVBS) * has its own demodulator and outputs CVBS)
...@@ -179,42 +178,6 @@ static inline struct au8522_state *to_state(struct v4l2_subdev *sd) ...@@ -179,42 +178,6 @@ static inline struct au8522_state *to_state(struct v4l2_subdev *sd)
return container_of(sd, struct au8522_state, sd); return container_of(sd, struct au8522_state, sd);
} }
static void setup_vbi(struct au8522_state *state, int aud_input)
{
int i;
/* These are set to zero regardless of what mode we're in */
au8522_writereg(state, AU8522_TVDEC_VBI_CTRL_H_REG017H, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_CTRL_L_REG018H, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_TOTAL_BITS_REG019H, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_TUNIT_H_REG01AH, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_TUNIT_L_REG01BH, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_THRESH1_REG01CH, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_PAT2_REG01EH, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_PAT1_REG01FH, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_PAT0_REG020H, 0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK2_REG021H,
0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK1_REG022H,
0x00);
au8522_writereg(state, AU8522_TVDEC_VBI_USER_FRAME_MASK0_REG023H,
0x00);
/* Setup the VBI registers */
for (i = 0x30; i < 0x60; i++)
au8522_writereg(state, i, 0x40);
/* For some reason, every register is 0x40 except register 0x44
(confirmed via the HVR-950q USB capture) */
au8522_writereg(state, 0x44, 0x60);
/* Enable VBI (we always do this regardless of whether the user is
viewing closed caption info) */
au8522_writereg(state, AU8522_TVDEC_VBI_CTRL_H_REG017H,
AU8522_TVDEC_VBI_CTRL_H_REG017H_CCON);
}
static void setup_decoder_defaults(struct au8522_state *state, bool is_svideo) static void setup_decoder_defaults(struct au8522_state *state, bool is_svideo)
{ {
int i; int i;
...@@ -317,8 +280,6 @@ static void setup_decoder_defaults(struct au8522_state *state, bool is_svideo) ...@@ -317,8 +280,6 @@ static void setup_decoder_defaults(struct au8522_state *state, bool is_svideo)
AU8522_TOREGAAGC_REG0E5H_CVBS); AU8522_TOREGAAGC_REG0E5H_CVBS);
au8522_writereg(state, AU8522_REG016H, AU8522_REG016H_CVBS); au8522_writereg(state, AU8522_REG016H, AU8522_REG016H_CVBS);
setup_vbi(state, 0);
if (is_svideo) { if (is_svideo) {
/* Despite what the table says, for the HVR-950q we still need /* Despite what the table says, for the HVR-950q we still need
to be in CVBS mode for the S-Video input (reason unknown). */ to be in CVBS mode for the S-Video input (reason unknown). */
...@@ -456,30 +417,29 @@ static void set_audio_input(struct au8522_state *state) ...@@ -456,30 +417,29 @@ static void set_audio_input(struct au8522_state *state)
lpfilter_coef[i].reg_val[0]); lpfilter_coef[i].reg_val[0]);
} }
/* Setup audio */ /* Set the volume */
au8522_writereg(state, AU8522_AUDIO_VOLUME_L_REG0F2H, 0x00);
au8522_writereg(state, AU8522_AUDIO_VOLUME_R_REG0F3H, 0x00);
au8522_writereg(state, AU8522_AUDIO_VOLUME_REG0F4H, 0x00);
au8522_writereg(state, AU8522_I2C_CONTROL_REG1_REG091H, 0x80);
au8522_writereg(state, AU8522_I2C_CONTROL_REG0_REG090H, 0x84);
msleep(150);
au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H, 0x00);
msleep(10);
au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H,
AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H_CVBS);
msleep(50);
au8522_writereg(state, AU8522_AUDIO_VOLUME_L_REG0F2H, 0x7F); au8522_writereg(state, AU8522_AUDIO_VOLUME_L_REG0F2H, 0x7F);
au8522_writereg(state, AU8522_AUDIO_VOLUME_R_REG0F3H, 0x7F); au8522_writereg(state, AU8522_AUDIO_VOLUME_R_REG0F3H, 0x7F);
au8522_writereg(state, AU8522_AUDIO_VOLUME_REG0F4H, 0xff); au8522_writereg(state, AU8522_AUDIO_VOLUME_REG0F4H, 0xff);
msleep(80);
au8522_writereg(state, AU8522_AUDIO_VOLUME_L_REG0F2H, 0x7F); /* Not sure what this does */
au8522_writereg(state, AU8522_AUDIO_VOLUME_R_REG0F3H, 0x7F);
au8522_writereg(state, AU8522_REG0F9H, AU8522_REG0F9H_AUDIO); au8522_writereg(state, AU8522_REG0F9H, AU8522_REG0F9H_AUDIO);
/* Setup the audio mode to stereo DBX */
au8522_writereg(state, AU8522_AUDIO_MODE_REG0F1H, 0x82); au8522_writereg(state, AU8522_AUDIO_MODE_REG0F1H, 0x82);
msleep(70); msleep(70);
au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_1_REG0A5H, 0x09);
/* Start the audio processing module */
au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_0_REG0A4H, 0x9d);
/* Set the audio frequency to 48 KHz */
au8522_writereg(state, AU8522_AUDIOFREQ_REG606H, 0x03); au8522_writereg(state, AU8522_AUDIOFREQ_REG606H, 0x03);
/* Set the I2S parameters (WS, LSB, mode, sample rate */
au8522_writereg(state, AU8522_I2S_CTRL_2_REG112H, 0xc2); au8522_writereg(state, AU8522_I2S_CTRL_2_REG112H, 0xc2);
/* Enable the I2S output */
au8522_writereg(state, AU8522_SYSTEM_MODULE_CONTROL_1_REG0A5H, 0x09);
} }
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
...@@ -663,10 +623,12 @@ static int au8522_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) ...@@ -663,10 +623,12 @@ static int au8522_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
int val = 0; int val = 0;
struct au8522_state *state = to_state(sd); struct au8522_state *state = to_state(sd);
u8 lock_status; u8 lock_status;
u8 pll_status;
/* Interrogate the decoder to see if we are getting a real signal */ /* Interrogate the decoder to see if we are getting a real signal */
lock_status = au8522_readreg(state, 0x00); lock_status = au8522_readreg(state, 0x00);
if (lock_status == 0xa2) pll_status = au8522_readreg(state, 0x7e);
if ((lock_status == 0xa2) && (pll_status & 0x10))
vt->signal = 0xffff; vt->signal = 0xffff;
else else
vt->signal = 0x00; vt->signal = 0x00;
......
...@@ -271,9 +271,9 @@ static int au8522_set_if(struct dvb_frontend *fe, enum au8522_if_freq if_freq) ...@@ -271,9 +271,9 @@ static int au8522_set_if(struct dvb_frontend *fe, enum au8522_if_freq if_freq)
return -EINVAL; return -EINVAL;
} }
dprintk("%s() %s MHz\n", __func__, ifmhz); dprintk("%s() %s MHz\n", __func__, ifmhz);
au8522_writereg(state, 0x80b5, r0b5); au8522_writereg(state, 0x00b5, r0b5);
au8522_writereg(state, 0x80b6, r0b6); au8522_writereg(state, 0x00b6, r0b6);
au8522_writereg(state, 0x80b7, r0b7); au8522_writereg(state, 0x00b7, r0b7);
return 0; return 0;
} }
...@@ -283,33 +283,32 @@ static struct { ...@@ -283,33 +283,32 @@ static struct {
u16 reg; u16 reg;
u16 data; u16 data;
} VSB_mod_tab[] = { } VSB_mod_tab[] = {
{ 0x8090, 0x84 }, { 0x0090, 0x84 },
{ 0x4092, 0x11 },
{ 0x2005, 0x00 }, { 0x2005, 0x00 },
{ 0x8091, 0x80 }, { 0x0091, 0x80 },
{ 0x80a3, 0x0c }, { 0x00a3, 0x0c },
{ 0x80a4, 0xe8 }, { 0x00a4, 0xe8 },
{ 0x8081, 0xc4 }, { 0x0081, 0xc4 },
{ 0x80a5, 0x40 }, { 0x00a5, 0x40 },
{ 0x80a7, 0x40 }, { 0x00a7, 0x40 },
{ 0x80a6, 0x67 }, { 0x00a6, 0x67 },
{ 0x8262, 0x20 }, { 0x0262, 0x20 },
{ 0x821c, 0x30 }, { 0x021c, 0x30 },
{ 0x80d8, 0x1a }, { 0x00d8, 0x1a },
{ 0x8227, 0xa0 }, { 0x0227, 0xa0 },
{ 0x8121, 0xff }, { 0x0121, 0xff },
{ 0x80a8, 0xf0 }, { 0x00a8, 0xf0 },
{ 0x80a9, 0x05 }, { 0x00a9, 0x05 },
{ 0x80aa, 0x77 }, { 0x00aa, 0x77 },
{ 0x80ab, 0xf0 }, { 0x00ab, 0xf0 },
{ 0x80ac, 0x05 }, { 0x00ac, 0x05 },
{ 0x80ad, 0x77 }, { 0x00ad, 0x77 },
{ 0x80ae, 0x41 }, { 0x00ae, 0x41 },
{ 0x80af, 0x66 }, { 0x00af, 0x66 },
{ 0x821b, 0xcc }, { 0x021b, 0xcc },
{ 0x821d, 0x80 }, { 0x021d, 0x80 },
{ 0x80a4, 0xe8 }, { 0x00a4, 0xe8 },
{ 0x8231, 0x13 }, { 0x0231, 0x13 },
}; };
/* QAM64 Modulation table */ /* QAM64 Modulation table */
...@@ -396,78 +395,78 @@ static struct { ...@@ -396,78 +395,78 @@ static struct {
u16 reg; u16 reg;
u16 data; u16 data;
} QAM256_mod_tab[] = { } QAM256_mod_tab[] = {
{ 0x80a3, 0x09 }, { 0x00a3, 0x09 },
{ 0x80a4, 0x00 }, { 0x00a4, 0x00 },
{ 0x8081, 0xc4 }, { 0x0081, 0xc4 },
{ 0x80a5, 0x40 }, { 0x00a5, 0x40 },
{ 0x80aa, 0x77 }, { 0x00aa, 0x77 },
{ 0x80ad, 0x77 }, { 0x00ad, 0x77 },
{ 0x80a6, 0x67 }, { 0x00a6, 0x67 },
{ 0x8262, 0x20 }, { 0x0262, 0x20 },
{ 0x821c, 0x30 }, { 0x021c, 0x30 },
{ 0x80b8, 0x3e }, { 0x00b8, 0x3e },
{ 0x80b9, 0xf0 }, { 0x00b9, 0xf0 },
{ 0x80ba, 0x01 }, { 0x00ba, 0x01 },
{ 0x80bb, 0x18 }, { 0x00bb, 0x18 },
{ 0x80bc, 0x50 }, { 0x00bc, 0x50 },
{ 0x80bd, 0x00 }, { 0x00bd, 0x00 },
{ 0x80be, 0xea }, { 0x00be, 0xea },
{ 0x80bf, 0xef }, { 0x00bf, 0xef },
{ 0x80c0, 0xfc }, { 0x00c0, 0xfc },
{ 0x80c1, 0xbd }, { 0x00c1, 0xbd },
{ 0x80c2, 0x1f }, { 0x00c2, 0x1f },
{ 0x80c3, 0xfc }, { 0x00c3, 0xfc },
{ 0x80c4, 0xdd }, { 0x00c4, 0xdd },
{ 0x80c5, 0xaf }, { 0x00c5, 0xaf },
{ 0x80c6, 0x00 }, { 0x00c6, 0x00 },
{ 0x80c7, 0x38 }, { 0x00c7, 0x38 },
{ 0x80c8, 0x30 }, { 0x00c8, 0x30 },
{ 0x80c9, 0x05 }, { 0x00c9, 0x05 },
{ 0x80ca, 0x4a }, { 0x00ca, 0x4a },
{ 0x80cb, 0xd0 }, { 0x00cb, 0xd0 },
{ 0x80cc, 0x01 }, { 0x00cc, 0x01 },
{ 0x80cd, 0xd9 }, { 0x00cd, 0xd9 },
{ 0x80ce, 0x6f }, { 0x00ce, 0x6f },
{ 0x80cf, 0xf9 }, { 0x00cf, 0xf9 },
{ 0x80d0, 0x70 }, { 0x00d0, 0x70 },
{ 0x80d1, 0xdf }, { 0x00d1, 0xdf },
{ 0x80d2, 0xf7 }, { 0x00d2, 0xf7 },
{ 0x80d3, 0xc2 }, { 0x00d3, 0xc2 },
{ 0x80d4, 0xdf }, { 0x00d4, 0xdf },
{ 0x80d5, 0x02 }, { 0x00d5, 0x02 },
{ 0x80d6, 0x9a }, { 0x00d6, 0x9a },
{ 0x80d7, 0xd0 }, { 0x00d7, 0xd0 },
{ 0x8250, 0x0d }, { 0x0250, 0x0d },
{ 0x8251, 0xcd }, { 0x0251, 0xcd },
{ 0x8252, 0xe0 }, { 0x0252, 0xe0 },
{ 0x8253, 0x05 }, { 0x0253, 0x05 },
{ 0x8254, 0xa7 }, { 0x0254, 0xa7 },
{ 0x8255, 0xff }, { 0x0255, 0xff },
{ 0x8256, 0xed }, { 0x0256, 0xed },
{ 0x8257, 0x5b }, { 0x0257, 0x5b },
{ 0x8258, 0xae }, { 0x0258, 0xae },
{ 0x8259, 0xe6 }, { 0x0259, 0xe6 },
{ 0x825a, 0x3d }, { 0x025a, 0x3d },
{ 0x825b, 0x0f }, { 0x025b, 0x0f },
{ 0x825c, 0x0d }, { 0x025c, 0x0d },
{ 0x825d, 0xea }, { 0x025d, 0xea },
{ 0x825e, 0xf2 }, { 0x025e, 0xf2 },
{ 0x825f, 0x51 }, { 0x025f, 0x51 },
{ 0x8260, 0xf5 }, { 0x0260, 0xf5 },
{ 0x8261, 0x06 }, { 0x0261, 0x06 },
{ 0x821a, 0x00 }, { 0x021a, 0x00 },
{ 0x8546, 0x40 }, { 0x0546, 0x40 },
{ 0x8210, 0x26 }, { 0x0210, 0x26 },
{ 0x8211, 0xf6 }, { 0x0211, 0xf6 },
{ 0x8212, 0x84 }, { 0x0212, 0x84 },
{ 0x8213, 0x02 }, { 0x0213, 0x02 },
{ 0x8502, 0x01 }, { 0x0502, 0x01 },
{ 0x8121, 0x04 }, { 0x0121, 0x04 },
{ 0x8122, 0x04 }, { 0x0122, 0x04 },
{ 0x852e, 0x10 }, { 0x052e, 0x10 },
{ 0x80a4, 0xca }, { 0x00a4, 0xca },
{ 0x80a7, 0x40 }, { 0x00a7, 0x40 },
{ 0x8526, 0x01 }, { 0x0526, 0x01 },
}; };
static struct { static struct {
...@@ -654,12 +653,12 @@ static int au8522_read_status(struct dvb_frontend *fe, enum fe_status *status) ...@@ -654,12 +653,12 @@ static int au8522_read_status(struct dvb_frontend *fe, enum fe_status *status)
if (state->current_modulation == VSB_8) { if (state->current_modulation == VSB_8) {
dprintk("%s() Checking VSB_8\n", __func__); dprintk("%s() Checking VSB_8\n", __func__);
reg = au8522_readreg(state, 0x4088); reg = au8522_readreg(state, 0x0088);
if ((reg & 0x03) == 0x03) if ((reg & 0x03) == 0x03)
*status |= FE_HAS_LOCK | FE_HAS_SYNC | FE_HAS_VITERBI; *status |= FE_HAS_LOCK | FE_HAS_SYNC | FE_HAS_VITERBI;
} else { } else {
dprintk("%s() Checking QAM\n", __func__); dprintk("%s() Checking QAM\n", __func__);
reg = au8522_readreg(state, 0x4541); reg = au8522_readreg(state, 0x0541);
if (reg & 0x80) if (reg & 0x80)
*status |= FE_HAS_VITERBI; *status |= FE_HAS_VITERBI;
if (reg & 0x20) if (reg & 0x20)
...@@ -745,17 +744,17 @@ static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -745,17 +744,17 @@ static int au8522_read_snr(struct dvb_frontend *fe, u16 *snr)
if (state->current_modulation == QAM_256) if (state->current_modulation == QAM_256)
ret = au8522_mse2snr_lookup(qam256_mse2snr_tab, ret = au8522_mse2snr_lookup(qam256_mse2snr_tab,
ARRAY_SIZE(qam256_mse2snr_tab), ARRAY_SIZE(qam256_mse2snr_tab),
au8522_readreg(state, 0x4522), au8522_readreg(state, 0x0522),
snr); snr);
else if (state->current_modulation == QAM_64) else if (state->current_modulation == QAM_64)
ret = au8522_mse2snr_lookup(qam64_mse2snr_tab, ret = au8522_mse2snr_lookup(qam64_mse2snr_tab,
ARRAY_SIZE(qam64_mse2snr_tab), ARRAY_SIZE(qam64_mse2snr_tab),
au8522_readreg(state, 0x4522), au8522_readreg(state, 0x0522),
snr); snr);
else /* VSB_8 */ else /* VSB_8 */
ret = au8522_mse2snr_lookup(vsb_mse2snr_tab, ret = au8522_mse2snr_lookup(vsb_mse2snr_tab,
ARRAY_SIZE(vsb_mse2snr_tab), ARRAY_SIZE(vsb_mse2snr_tab),
au8522_readreg(state, 0x4311), au8522_readreg(state, 0x0311),
snr); snr);
if (state->config.led_cfg) if (state->config.led_cfg)
...@@ -804,9 +803,9 @@ static int au8522_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) ...@@ -804,9 +803,9 @@ static int au8522_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
struct au8522_state *state = fe->demodulator_priv; struct au8522_state *state = fe->demodulator_priv;
if (state->current_modulation == VSB_8) if (state->current_modulation == VSB_8)
*ucblocks = au8522_readreg(state, 0x4087); *ucblocks = au8522_readreg(state, 0x0087);
else else
*ucblocks = au8522_readreg(state, 0x4543); *ucblocks = au8522_readreg(state, 0x0543);
return 0; return 0;
} }
......
...@@ -538,6 +538,7 @@ static int bcm3510_set_frontend(struct dvb_frontend *fe) ...@@ -538,6 +538,7 @@ static int bcm3510_set_frontend(struct dvb_frontend *fe)
cmd.ACQUIRE0.MODE = 0x9; cmd.ACQUIRE0.MODE = 0x9;
cmd.ACQUIRE1.SYM_RATE = 0x0; cmd.ACQUIRE1.SYM_RATE = 0x0;
cmd.ACQUIRE1.IF_FREQ = 0x0; cmd.ACQUIRE1.IF_FREQ = 0x0;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -772,7 +773,8 @@ static int bcm3510_init(struct dvb_frontend* fe) ...@@ -772,7 +773,8 @@ static int bcm3510_init(struct dvb_frontend* fe)
deb_info("attempting to download firmware\n"); deb_info("attempting to download firmware\n");
if ((ret = bcm3510_init_cold(st)) < 0) if ((ret = bcm3510_init_cold(st)) < 0)
return ret; return ret;
case JDEC_EEPROM_LOAD_WAIT: /* fall-through is wanted */ /* fall-through */
case JDEC_EEPROM_LOAD_WAIT:
deb_info("firmware is loaded\n"); deb_info("firmware is loaded\n");
bcm3510_check_firmware_version(st); bcm3510_check_firmware_version(st);
break; break;
......
...@@ -24,6 +24,15 @@ ...@@ -24,6 +24,15 @@
#include <linux/dvb/frontend.h> #include <linux/dvb/frontend.h>
#define CXD2841ER_USE_GATECTRL 1 /* bit 0 */
#define CXD2841ER_AUTO_IFHZ 2 /* bit 1 */
#define CXD2841ER_TS_SERIAL 4 /* bit 2 */
#define CXD2841ER_ASCOT 8 /* bit 3 */
#define CXD2841ER_EARLY_TUNE 16 /* bit 4 */
#define CXD2841ER_NO_WAIT_LOCK 32 /* bit 5 */
#define CXD2841ER_NO_AGCNEG 64 /* bit 6 */
#define CXD2841ER_TSBITS 128 /* bit 7 */
enum cxd2841er_xtal { enum cxd2841er_xtal {
SONY_XTAL_20500, /* 20.5 MHz */ SONY_XTAL_20500, /* 20.5 MHz */
SONY_XTAL_24000, /* 24 MHz */ SONY_XTAL_24000, /* 24 MHz */
...@@ -33,6 +42,7 @@ enum cxd2841er_xtal { ...@@ -33,6 +42,7 @@ enum cxd2841er_xtal {
struct cxd2841er_config { struct cxd2841er_config {
u8 i2c_addr; u8 i2c_addr;
enum cxd2841er_xtal xtal; enum cxd2841er_xtal xtal;
u32 flags;
}; };
#if IS_REACHABLE(CONFIG_DVB_CXD2841ER) #if IS_REACHABLE(CONFIG_DVB_CXD2841ER)
......
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
#define I2C_SLVX 0 #define I2C_SLVX 0
#define I2C_SLVT 1 #define I2C_SLVT 1
#define CXD2837ER_CHIP_ID 0xb1
#define CXD2838ER_CHIP_ID 0xb0
#define CXD2841ER_CHIP_ID 0xa7 #define CXD2841ER_CHIP_ID 0xa7
#define CXD2843ER_CHIP_ID 0xa4
#define CXD2854ER_CHIP_ID 0xc1 #define CXD2854ER_CHIP_ID 0xc1
#define CXD2841ER_DVBS_POLLING_INVL 10 #define CXD2841ER_DVBS_POLLING_INVL 10
......
...@@ -279,10 +279,10 @@ static int dib7000p_set_power_mode(struct dib7000p_state *state, enum dib7000p_p ...@@ -279,10 +279,10 @@ static int dib7000p_set_power_mode(struct dib7000p_state *state, enum dib7000p_p
if (state->version != SOC7090) if (state->version != SOC7090)
reg_1280 &= ~((1 << 11)); reg_1280 &= ~((1 << 11));
reg_1280 &= ~(1 << 6); reg_1280 &= ~(1 << 6);
/* fall through wanted to enable the interfaces */ /* fall-through */
case DIB7000P_POWER_INTERFACE_ONLY:
/* just leave power on the control-interfaces: GPIO and (I2C or SDIO) */ /* just leave power on the control-interfaces: GPIO and (I2C or SDIO) */
case DIB7000P_POWER_INTERFACE_ONLY: /* TODO power up either SDIO or I2C */ /* TODO power up either SDIO or I2C */
if (state->version == SOC7090) if (state->version == SOC7090)
reg_1280 &= ~((1 << 7) | (1 << 5)); reg_1280 &= ~((1 << 7) | (1 << 5));
else else
......
...@@ -2837,7 +2837,8 @@ ctrl_set_cfg_mpeg_output(struct drx_demod_instance *demod, struct drx_cfg_mpeg_o ...@@ -2837,7 +2837,8 @@ ctrl_set_cfg_mpeg_output(struct drx_demod_instance *demod, struct drx_cfg_mpeg_o
/* coef = 188/204 */ /* coef = 188/204 */
max_bit_rate = max_bit_rate =
(ext_attr->curr_symbol_rate / 8) * nr_bits * 188; (ext_attr->curr_symbol_rate / 8) * nr_bits * 188;
/* pass through b/c Annex A/c need following settings */ /* pass through as b/c Annex A/c need following settings */
/* fall-through */
case DRX_STANDARD_ITU_B: case DRX_STANDARD_ITU_B:
rc = drxj_dap_write_reg16(dev_addr, FEC_OC_FCT_USAGE__A, FEC_OC_FCT_USAGE__PRE, 0); rc = drxj_dap_write_reg16(dev_addr, FEC_OC_FCT_USAGE__A, FEC_OC_FCT_USAGE__PRE, 0);
if (rc != 0) { if (rc != 0) {
...@@ -4776,9 +4777,9 @@ set_frequency(struct drx_demod_instance *demod, ...@@ -4776,9 +4777,9 @@ set_frequency(struct drx_demod_instance *demod,
No need to account for mirroring on RF No need to account for mirroring on RF
*/ */
switch (ext_attr->standard) { switch (ext_attr->standard) {
case DRX_STANDARD_ITU_A: /* fallthrough */ case DRX_STANDARD_ITU_A:
case DRX_STANDARD_ITU_C: /* fallthrough */ case DRX_STANDARD_ITU_C:
case DRX_STANDARD_PAL_SECAM_LP: /* fallthrough */ case DRX_STANDARD_PAL_SECAM_LP:
case DRX_STANDARD_8VSB: case DRX_STANDARD_8VSB:
select_pos_image = true; select_pos_image = true;
break; break;
...@@ -4787,11 +4788,12 @@ set_frequency(struct drx_demod_instance *demod, ...@@ -4787,11 +4788,12 @@ set_frequency(struct drx_demod_instance *demod,
Sound carrier is already 3Mhz above centre frequency due Sound carrier is already 3Mhz above centre frequency due
to tuner setting so now add an extra shift of 1MHz... */ to tuner setting so now add an extra shift of 1MHz... */
fm_frequency_shift = 1000; fm_frequency_shift = 1000;
case DRX_STANDARD_ITU_B: /* fallthrough */ /*fall through */
case DRX_STANDARD_NTSC: /* fallthrough */ case DRX_STANDARD_ITU_B:
case DRX_STANDARD_PAL_SECAM_BG: /* fallthrough */ case DRX_STANDARD_NTSC:
case DRX_STANDARD_PAL_SECAM_DK: /* fallthrough */ case DRX_STANDARD_PAL_SECAM_BG:
case DRX_STANDARD_PAL_SECAM_I: /* fallthrough */ case DRX_STANDARD_PAL_SECAM_DK:
case DRX_STANDARD_PAL_SECAM_I:
case DRX_STANDARD_PAL_SECAM_L: case DRX_STANDARD_PAL_SECAM_L:
select_pos_image = false; select_pos_image = false;
break; break;
......
...@@ -1517,12 +1517,14 @@ static int SetDeviceTypeId(struct drxd_state *state) ...@@ -1517,12 +1517,14 @@ static int SetDeviceTypeId(struct drxd_state *state)
switch (deviceId) { switch (deviceId) {
case 4: case 4:
state->diversity = 1; state->diversity = 1;
/* fall through */
case 3: case 3:
case 7: case 7:
state->PGA = 1; state->PGA = 1;
break; break;
case 6: case 6:
state->diversity = 1; state->diversity = 1;
/* fall through */
case 5: case 5:
case 8: case 8:
break; break;
...@@ -1969,7 +1971,8 @@ static int DRX_Start(struct drxd_state *state, s32 off) ...@@ -1969,7 +1971,8 @@ static int DRX_Start(struct drxd_state *state, s32 off)
switch (p->transmission_mode) { switch (p->transmission_mode) {
default: /* Not set, detect it automatically */ default: /* Not set, detect it automatically */
operationMode |= SC_RA_RAM_OP_AUTO_MODE__M; operationMode |= SC_RA_RAM_OP_AUTO_MODE__M;
/* fall through , try first guess DRX_FFTMODE_8K */ /* try first guess DRX_FFTMODE_8K */
/* fall through */
case TRANSMISSION_MODE_8K: case TRANSMISSION_MODE_8K:
transmissionParams |= SC_RA_RAM_OP_PARAM_MODE_8K; transmissionParams |= SC_RA_RAM_OP_PARAM_MODE_8K;
if (state->type_A) { if (state->type_A) {
...@@ -2143,8 +2146,8 @@ static int DRX_Start(struct drxd_state *state, s32 off) ...@@ -2143,8 +2146,8 @@ static int DRX_Start(struct drxd_state *state, s32 off)
switch (p->modulation) { switch (p->modulation) {
default: default:
operationMode |= SC_RA_RAM_OP_AUTO_CONST__M; operationMode |= SC_RA_RAM_OP_AUTO_CONST__M;
/* fall through , try first guess /* try first guess DRX_CONSTELLATION_QAM64 */
DRX_CONSTELLATION_QAM64 */ /* fall through */
case QAM_64: case QAM_64:
transmissionParams |= SC_RA_RAM_OP_PARAM_CONST_QAM64; transmissionParams |= SC_RA_RAM_OP_PARAM_CONST_QAM64;
if (state->type_A) { if (state->type_A) {
...@@ -2280,6 +2283,7 @@ static int DRX_Start(struct drxd_state *state, s32 off) ...@@ -2280,6 +2283,7 @@ static int DRX_Start(struct drxd_state *state, s32 off)
break; break;
default: default:
operationMode |= SC_RA_RAM_OP_AUTO_RATE__M; operationMode |= SC_RA_RAM_OP_AUTO_RATE__M;
/* fall through */
case FEC_2_3: case FEC_2_3:
transmissionParams |= SC_RA_RAM_OP_PARAM_RATE_2_3; transmissionParams |= SC_RA_RAM_OP_PARAM_RATE_2_3;
if (state->type_A) { if (state->type_A) {
......
...@@ -3271,10 +3271,12 @@ static int dvbt_sc_command(struct drxk_state *state, ...@@ -3271,10 +3271,12 @@ static int dvbt_sc_command(struct drxk_state *state,
case OFDM_SC_RA_RAM_CMD_PROGRAM_PARAM: case OFDM_SC_RA_RAM_CMD_PROGRAM_PARAM:
status |= write16(state, OFDM_SC_RA_RAM_PARAM1__A, param1); status |= write16(state, OFDM_SC_RA_RAM_PARAM1__A, param1);
/* All commands using 1 parameters */ /* All commands using 1 parameters */
/* fall through */
case OFDM_SC_RA_RAM_CMD_SET_ECHO_TIMING: case OFDM_SC_RA_RAM_CMD_SET_ECHO_TIMING:
case OFDM_SC_RA_RAM_CMD_USER_IO: case OFDM_SC_RA_RAM_CMD_USER_IO:
status |= write16(state, OFDM_SC_RA_RAM_PARAM0__A, param0); status |= write16(state, OFDM_SC_RA_RAM_PARAM0__A, param0);
/* All commands using 0 parameters */ /* All commands using 0 parameters */
/* fall through */
case OFDM_SC_RA_RAM_CMD_GET_OP_PARAM: case OFDM_SC_RA_RAM_CMD_GET_OP_PARAM:
case OFDM_SC_RA_RAM_CMD_NULL: case OFDM_SC_RA_RAM_CMD_NULL:
/* Write command */ /* Write command */
...@@ -3782,7 +3784,8 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, ...@@ -3782,7 +3784,8 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,
case TRANSMISSION_MODE_AUTO: case TRANSMISSION_MODE_AUTO:
default: default:
operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_MODE__M; operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_MODE__M;
/* fall through , try first guess DRX_FFTMODE_8K */ /* try first guess DRX_FFTMODE_8K */
/* fall through */
case TRANSMISSION_MODE_8K: case TRANSMISSION_MODE_8K:
transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_MODE_8K; transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_MODE_8K;
break; break;
...@@ -3796,7 +3799,8 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, ...@@ -3796,7 +3799,8 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,
default: default:
case GUARD_INTERVAL_AUTO: case GUARD_INTERVAL_AUTO:
operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_GUARD__M; operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_GUARD__M;
/* fall through , try first guess DRX_GUARD_1DIV4 */ /* try first guess DRX_GUARD_1DIV4 */
/* fall through */
case GUARD_INTERVAL_1_4: case GUARD_INTERVAL_1_4:
transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_GUARD_4; transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_GUARD_4;
break; break;
...@@ -3817,9 +3821,9 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, ...@@ -3817,9 +3821,9 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,
case HIERARCHY_NONE: case HIERARCHY_NONE:
default: default:
operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_HIER__M; operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_HIER__M;
/* fall through , try first guess SC_RA_RAM_OP_PARAM_HIER_NO */ /* try first guess SC_RA_RAM_OP_PARAM_HIER_NO */
/* transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_HIER_NO; */ /* transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_HIER_NO; */
/* break; */ /* fall through */
case HIERARCHY_1: case HIERARCHY_1:
transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_HIER_A1; transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_HIER_A1;
break; break;
...@@ -3837,7 +3841,8 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, ...@@ -3837,7 +3841,8 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,
case QAM_AUTO: case QAM_AUTO:
default: default:
operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_CONST__M; operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_CONST__M;
/* fall through , try first guess DRX_CONSTELLATION_QAM64 */ /* try first guess DRX_CONSTELLATION_QAM64 */
/* fall through */
case QAM_64: case QAM_64:
transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_CONST_QAM64; transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_CONST_QAM64;
break; break;
...@@ -3880,7 +3885,8 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, ...@@ -3880,7 +3885,8 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,
case FEC_AUTO: case FEC_AUTO:
default: default:
operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_RATE__M; operation_mode |= OFDM_SC_RA_RAM_OP_AUTO_RATE__M;
/* fall through , try first guess DRX_CODERATE_2DIV3 */ /* try first guess DRX_CODERATE_2DIV3 */
/* fall through */
case FEC_2_3: case FEC_2_3:
transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_RATE_2_3; transmission_params |= OFDM_SC_RA_RAM_OP_PARAM_RATE_2_3;
break; break;
...@@ -3914,7 +3920,7 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz, ...@@ -3914,7 +3920,7 @@ static int set_dvbt(struct drxk_state *state, u16 intermediate_freqk_hz,
switch (state->props.bandwidth_hz) { switch (state->props.bandwidth_hz) {
case 0: case 0:
state->props.bandwidth_hz = 8000000; state->props.bandwidth_hz = 8000000;
/* fall though */ /* fall through */
case 8000000: case 8000000:
bandwidth = DRXK_BANDWIDTH_8MHZ_IN_HZ; bandwidth = DRXK_BANDWIDTH_8MHZ_IN_HZ;
status = write16(state, OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A, status = write16(state, OFDM_SC_RA_RAM_SRMM_FIX_FACT_8K__A,
......
...@@ -211,6 +211,7 @@ static int mt352_set_parameters(struct dvb_frontend *fe) ...@@ -211,6 +211,7 @@ static int mt352_set_parameters(struct dvb_frontend *fe)
if (op->hierarchy == HIERARCHY_AUTO || if (op->hierarchy == HIERARCHY_AUTO ||
op->hierarchy == HIERARCHY_NONE) op->hierarchy == HIERARCHY_NONE)
break; break;
/* fall through */
default: default:
return -EINVAL; return -EINVAL;
} }
......
...@@ -493,8 +493,8 @@ static int or51132_read_snr(struct dvb_frontend* fe, u16* snr) ...@@ -493,8 +493,8 @@ static int or51132_read_snr(struct dvb_frontend* fe, u16* snr)
switch (reg&0xff) { switch (reg&0xff) {
case 0x06: case 0x06:
if (reg & 0x1000) usK = 3 << 24; if (reg & 0x1000) usK = 3 << 24;
/* Fall through to QAM64 case */ /* fall through */
case 0x43: case 0x43: /* QAM64 */
c = 150204167; c = 150204167;
break; break;
case 0x45: case 0x45:
......
...@@ -51,7 +51,7 @@ static int debug; ...@@ -51,7 +51,7 @@ static int debug;
#define dprintk(arg...) do { \ #define dprintk(arg...) do { \
if (debug) \ if (debug) \
printk(arg); \ printk(arg); \
} while (0) } while (0)
/* Register values to initialise the demod, defaults to VSB */ /* Register values to initialise the demod, defaults to VSB */
static struct init_tab { static struct init_tab {
...@@ -410,7 +410,7 @@ static int s5h1411_set_if_freq(struct dvb_frontend *fe, int KHz) ...@@ -410,7 +410,7 @@ static int s5h1411_set_if_freq(struct dvb_frontend *fe, int KHz)
default: default:
dprintk("%s(%d KHz) Invalid, defaulting to 5380\n", dprintk("%s(%d KHz) Invalid, defaulting to 5380\n",
__func__, KHz); __func__, KHz);
/* no break, need to continue */ /* fall through */
case 5380: case 5380:
case 44000: case 44000:
s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x38, 0x1be4); s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x38, 0x1be4);
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
#include <linux/dvb/frontend.h> #include <linux/dvb/frontend.h>
#include "dvb_frontend.h" #include "dvb_frontend.h"
#define STV0367_ICSPEED_53125 53125000
#define STV0367_ICSPEED_58000 58000000
struct stv0367_config { struct stv0367_config {
u8 demod_address; u8 demod_address;
u32 xtal; u32 xtal;
...@@ -41,6 +44,9 @@ dvb_frontend *stv0367ter_attach(const struct stv0367_config *config, ...@@ -41,6 +44,9 @@ dvb_frontend *stv0367ter_attach(const struct stv0367_config *config,
extern struct extern struct
dvb_frontend *stv0367cab_attach(const struct stv0367_config *config, dvb_frontend *stv0367cab_attach(const struct stv0367_config *config,
struct i2c_adapter *i2c); struct i2c_adapter *i2c);
extern struct
dvb_frontend *stv0367ddb_attach(const struct stv0367_config *config,
struct i2c_adapter *i2c);
#else #else
static inline struct static inline struct
dvb_frontend *stv0367ter_attach(const struct stv0367_config *config, dvb_frontend *stv0367ter_attach(const struct stv0367_config *config,
...@@ -56,6 +62,13 @@ dvb_frontend *stv0367cab_attach(const struct stv0367_config *config, ...@@ -56,6 +62,13 @@ dvb_frontend *stv0367cab_attach(const struct stv0367_config *config,
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL; return NULL;
} }
static inline struct
dvb_frontend *stv0367ddb_attach(const struct stv0367_config *config,
struct i2c_adapter *i2c)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif #endif
#endif #endif
此差异已折叠。
...@@ -2639,8 +2639,6 @@ ...@@ -2639,8 +2639,6 @@
#define R367TER_DEBUG_LT9 0xf405 #define R367TER_DEBUG_LT9 0xf405
#define F367TER_F_DEBUG_LT9 0xf40500ff #define F367TER_F_DEBUG_LT9 0xf40500ff
#define STV0367TER_NBREGS 445
/* ID */ /* ID */
#define R367CAB_ID 0xf000 #define R367CAB_ID 0xf000
#define F367CAB_IDENTIFICATIONREGISTER 0xf00000ff #define F367CAB_IDENTIFICATIONREGISTER 0xf00000ff
...@@ -3605,6 +3603,4 @@ ...@@ -3605,6 +3603,4 @@
#define R367CAB_T_O_ID_3 0xf4d3 #define R367CAB_T_O_ID_3 0xf4d3
#define F367CAB_TS_ID_I_H 0xf4d300ff #define F367CAB_TS_ID_I_H 0xf4d300ff
#define STV0367CAB_NBREGS 187
#endif #endif
...@@ -211,7 +211,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe) ...@@ -211,7 +211,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe)
break; break;
default: default:
c->bandwidth_hz = 8000000; c->bandwidth_hz = 8000000;
/* fall though */ /* fall through */
case 8000000: case 8000000:
zl10353_single_write(fe, MCLK_RATIO, 0x75); zl10353_single_write(fe, MCLK_RATIO, 0x75);
zl10353_single_write(fe, 0x64, 0x36); zl10353_single_write(fe, 0x64, 0x36);
...@@ -268,6 +268,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe) ...@@ -268,6 +268,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe)
if (c->hierarchy == HIERARCHY_AUTO || if (c->hierarchy == HIERARCHY_AUTO ||
c->hierarchy == HIERARCHY_NONE) c->hierarchy == HIERARCHY_NONE)
break; break;
/* fall through */
default: default:
return -EINVAL; return -EINVAL;
} }
......
此差异已折叠。
...@@ -21,6 +21,7 @@ obj-$(CONFIG_VIDEO_SAA7127) += saa7127.o ...@@ -21,6 +21,7 @@ obj-$(CONFIG_VIDEO_SAA7127) += saa7127.o
obj-$(CONFIG_VIDEO_SAA7185) += saa7185.o obj-$(CONFIG_VIDEO_SAA7185) += saa7185.o
obj-$(CONFIG_VIDEO_SAA6752HS) += saa6752hs.o obj-$(CONFIG_VIDEO_SAA6752HS) += saa6752hs.o
obj-$(CONFIG_VIDEO_AD5820) += ad5820.o obj-$(CONFIG_VIDEO_AD5820) += ad5820.o
obj-$(CONFIG_VIDEO_DW9714) += dw9714.o
obj-$(CONFIG_VIDEO_ADV7170) += adv7170.o obj-$(CONFIG_VIDEO_ADV7170) += adv7170.o
obj-$(CONFIG_VIDEO_ADV7175) += adv7175.o obj-$(CONFIG_VIDEO_ADV7175) += adv7175.o
obj-$(CONFIG_VIDEO_ADV7180) += adv7180.o obj-$(CONFIG_VIDEO_ADV7180) += adv7180.o
...@@ -58,11 +59,13 @@ obj-$(CONFIG_VIDEO_SONY_BTF_MPX) += sony-btf-mpx.o ...@@ -58,11 +59,13 @@ obj-$(CONFIG_VIDEO_SONY_BTF_MPX) += sony-btf-mpx.o
obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o
obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
obj-$(CONFIG_VIDEO_OV2640) += ov2640.o obj-$(CONFIG_VIDEO_OV2640) += ov2640.o
obj-$(CONFIG_VIDEO_OV5640) += ov5640.o
obj-$(CONFIG_VIDEO_OV5645) += ov5645.o obj-$(CONFIG_VIDEO_OV5645) += ov5645.o
obj-$(CONFIG_VIDEO_OV5647) += ov5647.o obj-$(CONFIG_VIDEO_OV5647) += ov5647.o
obj-$(CONFIG_VIDEO_OV7640) += ov7640.o obj-$(CONFIG_VIDEO_OV7640) += ov7640.o
obj-$(CONFIG_VIDEO_OV7670) += ov7670.o obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
obj-$(CONFIG_VIDEO_OV9650) += ov9650.o obj-$(CONFIG_VIDEO_OV9650) += ov9650.o
obj-$(CONFIG_VIDEO_OV13858) += ov13858.o
obj-$(CONFIG_VIDEO_MT9M032) += mt9m032.o obj-$(CONFIG_VIDEO_MT9M032) += mt9m032.o
obj-$(CONFIG_VIDEO_MT9M111) += mt9m111.o obj-$(CONFIG_VIDEO_MT9M111) += mt9m111.o
obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
...@@ -86,3 +89,5 @@ obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o ...@@ -86,3 +89,5 @@ obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o
obj-$(CONFIG_VIDEO_ML86V7667) += ml86v7667.o obj-$(CONFIG_VIDEO_ML86V7667) += ml86v7667.o
obj-$(CONFIG_VIDEO_OV2659) += ov2659.o obj-$(CONFIG_VIDEO_OV2659) += ov2659.o
obj-$(CONFIG_VIDEO_TC358743) += tc358743.o obj-$(CONFIG_VIDEO_TC358743) += tc358743.o
obj-$(CONFIG_SDR_MAX2175) += max2175.o
...@@ -341,7 +341,7 @@ static int ad5820_remove(struct i2c_client *client) ...@@ -341,7 +341,7 @@ static int ad5820_remove(struct i2c_client *client)
struct v4l2_subdev *subdev = i2c_get_clientdata(client); struct v4l2_subdev *subdev = i2c_get_clientdata(client);
struct ad5820_device *coil = to_ad5820_device(subdev); struct ad5820_device *coil = to_ad5820_device(subdev);
v4l2_device_unregister_subdev(&coil->subdev); v4l2_async_unregister_subdev(&coil->subdev);
v4l2_ctrl_handler_free(&coil->ctrls); v4l2_ctrl_handler_free(&coil->ctrls);
media_entity_cleanup(&coil->subdev.entity); media_entity_cleanup(&coil->subdev.entity);
mutex_destroy(&coil->power_lock); mutex_destroy(&coil->power_lock);
......
...@@ -1452,6 +1452,8 @@ static SIMPLE_DEV_PM_OPS(adv7180_pm_ops, adv7180_suspend, adv7180_resume); ...@@ -1452,6 +1452,8 @@ static SIMPLE_DEV_PM_OPS(adv7180_pm_ops, adv7180_suspend, adv7180_resume);
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id adv7180_of_id[] = { static const struct of_device_id adv7180_of_id[] = {
{ .compatible = "adi,adv7180", }, { .compatible = "adi,adv7180", },
{ .compatible = "adi,adv7180cp", },
{ .compatible = "adi,adv7180st", },
{ .compatible = "adi,adv7182", }, { .compatible = "adi,adv7182", },
{ .compatible = "adi,adv7280", }, { .compatible = "adi,adv7280", },
{ .compatible = "adi,adv7280-m", }, { .compatible = "adi,adv7280-m", },
......
此差异已折叠。
...@@ -294,8 +294,8 @@ static int as3645a_read_fault(struct as3645a *flash) ...@@ -294,8 +294,8 @@ static int as3645a_read_fault(struct as3645a *flash)
dev_dbg(&client->dev, "Inductor Peak limit fault\n"); dev_dbg(&client->dev, "Inductor Peak limit fault\n");
if (rval & AS_FAULT_INFO_INDICATOR_LED) if (rval & AS_FAULT_INFO_INDICATOR_LED)
dev_dbg(&client->dev, "Indicator LED fault: " dev_dbg(&client->dev,
"Short circuit or open loop\n"); "Indicator LED fault: Short circuit or open loop\n");
dev_dbg(&client->dev, "%u connected LEDs\n", dev_dbg(&client->dev, "%u connected LEDs\n",
rval & AS_FAULT_INFO_LED_AMOUNT ? 2 : 1); rval & AS_FAULT_INFO_LED_AMOUNT ? 2 : 1);
...@@ -310,8 +310,8 @@ static int as3645a_read_fault(struct as3645a *flash) ...@@ -310,8 +310,8 @@ static int as3645a_read_fault(struct as3645a *flash)
dev_dbg(&client->dev, "Short circuit fault\n"); dev_dbg(&client->dev, "Short circuit fault\n");
if (rval & AS_FAULT_INFO_OVER_VOLTAGE) if (rval & AS_FAULT_INFO_OVER_VOLTAGE)
dev_dbg(&client->dev, "Over voltage fault: " dev_dbg(&client->dev,
"Indicates missing capacitor or open connection\n"); "Over voltage fault: Indicates missing capacitor or open connection\n");
return rval; return rval;
} }
...@@ -583,8 +583,8 @@ static int as3645a_registered(struct v4l2_subdev *sd) ...@@ -583,8 +583,8 @@ static int as3645a_registered(struct v4l2_subdev *sd)
/* Verify the chip model and version. */ /* Verify the chip model and version. */
if (model != 0x01 || rfu != 0x00) { if (model != 0x01 || rfu != 0x00) {
dev_err(&client->dev, "AS3645A not detected " dev_err(&client->dev,
"(model %d rfu %d)\n", model, rfu); "AS3645A not detected (model %d rfu %d)\n", model, rfu);
rval = -ENODEV; rval = -ENODEV;
goto power_off; goto power_off;
} }
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册