Commit 71f3a82f authored by Linus Torvalds's avatar Linus Torvalds

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

Pull media updates from Mauro Carvalho Chehab:

 - new Socionext MN88443x ISDB-S/T demodulator driver: mn88443x

 - new sensor drivers: ak7375, ov2680 and rj54n1cb0c

 - an old soc-camera sensor driver converted to the V4L2 framework:
   mt9v111

 - a new Voice-Coil Motor (VCM) driver: dw9807-vcm

 - some cleanups at cx25821, removing legacy unused code

 - some improvements at ddbridge driver

 - new platform driver: vicodec

 - some DVB API cleanups, removing ioctls and compat code for old
   out-of-tree drivers that were never merged upstream

 - improvements at DVB core to support frontents that support both
   Satellite and non-satellite delivery systems

 - got rid of the unused VIDIOC_RESERVED V4L2 ioctl

 - some cleanups/improvements at gl861 ISDB driver

 - several improvements on ov772x, ov7670 and ov5640, imx274, ov5645,
   and smiapp sensor drivers

 - fixes at em28xx to support dual TS devices

 - some cleanups at V4L2/VB2 locking logic

 - some API improvements at media controller

 - some cec core and drivers improvements

 - some uvcvideo improvements

 - some improvements at platform drivers: stm32-dcmi, rcar-vin, coda,
   reneseas-ceu, imx, vsp1, venus, camss

 - lots of other cleanups and fixes

* tag 'media/v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (406 commits)
  Revert "media: vivid: shut up warnings due to a non-trivial logic"
  siano: get rid of an unused return code for debugfs register
  media: isp: fix a warning about a wrong struct initializer
  media: radio-wl1273: fix return code for the polling routine
  media: s3c-camif: fix return code for the polling routine
  media: saa7164: fix return codes for the polling routine
  media: exynos-gsc: fix return code if mutex was interrupted
  media: mt9v111: Fix build error with no VIDEO_V4L2_SUBDEV_API
  media: xc4000: get rid of uneeded casts
  media: drxj: get rid of uneeded casts
  media: tuner-xc2028: don't use casts for printing sizes
  media: cleanup fall-through comments
  media: vivid: shut up warnings due to a non-trivial logic
  media: rtl28xxu: be sure that it won't go past the array size
  media: mt9v111: avoid going past the buffer
  media: vsp1_dl: add a description for cmdpool field
  media: sta2x11: add a missing parameter description
  media: v4l2-mem2mem: add descriptions to MC fields
  media: i2c: fix warning in Aptina MT9V111
  media: imx: shut up a false positive warning
  ...
parents 54dbe75b da2048b7
......@@ -4,8 +4,8 @@ The HDMI CEC GPIO module supports CEC implementations where the CEC line
is hooked up to a pull-up GPIO line and - optionally - the HPD line is
hooked up to another GPIO line.
Please note: the maximum voltage for the CEC line is 3.63V, for the HPD
line it is 5.3V. So you may need some sort of level conversion circuitry
Please note: the maximum voltage for the CEC line is 3.63V, for the HPD and
5V lines it is 5.3V. So you may need some sort of level conversion circuitry
when connecting them to a GPIO line.
Required properties:
......@@ -19,18 +19,24 @@ following property is also required:
- hdmi-phandle - phandle to the HDMI controller, see also cec.txt.
If the CEC line is not associated with an HDMI receiver/transmitter, then
the following property is optional:
the following property is optional and can be used for debugging HPD changes:
- hpd-gpios: gpio that the HPD line is connected to.
This property is optional and can be used for debugging changes on the 5V line:
- v5-gpios: gpio that the 5V line is connected to.
Example for the Raspberry Pi 3 where the CEC line is connected to
pin 26 aka BCM7 aka CE1 on the GPIO pin header and the HPD line is
connected to pin 11 aka BCM17 (some level shifter is needed for this!):
pin 26 aka BCM7 aka CE1 on the GPIO pin header, the HPD line is
connected to pin 11 aka BCM17 and the 5V line is connected to pin
15 aka BCM22 (some level shifter is needed for the HPD and 5V lines!):
#include <dt-bindings/gpio/gpio.h>
cec-gpio {
compatible = "cec-gpio";
cec-gpios = <&gpio 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
hpd-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
compatible = "cec-gpio";
cec-gpios = <&gpio 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
hpd-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
v5-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
};
Asahi Kasei Microdevices AK7375 voice coil lens driver
AK7375 is a camera voice coil lens.
Mandatory properties:
- compatible: "asahi-kasei,ak7375"
- reg: I2C slave address
* Aptina MT9V111 CMOS sensor
----------------------------
The Aptina MT9V111 is a 1/4-Inch VGA-format digital image sensor with a core
based on Aptina MT9V011 sensor and an integrated Image Flow Processor (IFP).
The sensor has an active pixel array of 640x480 pixels and can output a number
of image resolution and formats controllable through a simple two-wires
interface.
Required properties:
--------------------
- compatible: shall be "aptina,mt9v111".
- clocks: reference to the system clock input provider.
Optional properties:
--------------------
- enable-gpios: output enable signal, pin name "OE#". Active low.
- standby-gpios: low power state control signal, pin name "STANDBY".
Active high.
- reset-gpios: chip reset signal, pin name "RESET#". Active low.
The device node must contain one 'port' child node with one 'endpoint' child
sub-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 {
camera@48 {
compatible = "aptina,mt9v111";
reg = <0x48>;
clocks = <&camera_clk>;
port {
mt9v111_out: endpoint {
remote-endpoint = <&ceu_in>;
};
};
};
};
Dongwoon Anatech DW9807 voice coil lens driver
DW9807 is a 10-bit DAC with current sink capability. It is intended for
controlling voice coil lenses.
Mandatory properties:
- compatible: "dongwoon,dw9807-vcm"
- reg: I2C slave address
......@@ -29,6 +29,9 @@ Optional properties
- reset-gpios: XSHUTDOWN GPIO
- flash-leds: See ../video-interfaces.txt
- lens-focus: See ../video-interfaces.txt
- rotation: Integer property; valid values are 0 (sensor mounted upright)
and 180 (sensor mounted upside down). See
../video-interfaces.txt .
Endpoint node mandatory properties
......
* Omnivision OV2680 MIPI CSI-2 sensor
Required Properties:
- compatible: should be "ovti,ov2680".
- clocks: reference to the xvclk input clock.
- clock-names: should be "xvclk".
- DOVDD-supply: Digital I/O voltage supply.
- DVDD-supply: Digital core voltage supply.
- AVDD-supply: Analog voltage supply.
Optional Properties:
- reset-gpios: reference to the GPIO connected to the powerdown/reset pin,
if any. This is an active low signal to the OV2680.
The device node must contain one 'port' child node for its digital output
video port, and this port must have a single endpoint in accordance with
the video interface bindings defined in
Documentation/devicetree/bindings/media/video-interfaces.txt.
Endpoint node required properties for CSI-2 connection are:
- remote-endpoint: a phandle to the bus receiver's endpoint node.
- clock-lanes: should be set to <0> (clock lane on hardware lane 0).
- data-lanes: should be set to <1> (one CSI-2 lane supported).
Example:
&i2c2 {
ov2680: camera-sensor@36 {
compatible = "ovti,ov2680";
reg = <0x36>;
clocks = <&osc>;
clock-names = "xvclk";
reset-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
DOVDD-supply = <&sw2_reg>;
DVDD-supply = <&sw2_reg>;
AVDD-supply = <&reg_peri_3p15v>;
port {
ov2680_to_mipi: endpoint {
remote-endpoint = <&mipi_from_sensor>;
clock-lanes = <0>;
data-lanes = <1>;
};
};
};
};
......@@ -13,6 +13,10 @@ Optional Properties:
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.
- rotation: as defined in
Documentation/devicetree/bindings/media/video-interfaces.txt,
valid values are 0 (sensor mounted upright) and 180 (sensor
mounted upside down).
The device node must contain one 'port' child node for its digital output
video port, in accordance with the video interface bindings defined in
......@@ -51,6 +55,7 @@ Examples:
DVDD-supply = <&vgen2_reg>; /* 1.5v */
powerdown-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
rotation = <180>;
port {
/* MIPI CSI-2 bus endpoint */
......
......@@ -27,9 +27,15 @@ Required properties:
- sxe
- clocks : Must include the following entries:
- vde
- resets : Must include the following entries:
- resets : Must contain an entry for each entry in reset-names.
- reset-names : Should include the following entries:
- vde
Optional properties:
- resets : Must contain an entry for each entry in reset-names.
- reset-names : Must include the following entries:
- mc
Example:
video-codec@6001a000 {
......@@ -51,5 +57,6 @@ video-codec@6001a000 {
<GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; /* SXE interrupt */
interrupt-names = "sync-token", "bsev", "sxe";
clocks = <&tegra_car TEGRA20_CLK_VDE>;
resets = <&tegra_car 61>;
reset-names = "vde", "mc";
resets = <&tegra_car 61>, <&mc TEGRA20_MC_RESET_VDE>;
};
......@@ -5,8 +5,9 @@ Qualcomm Camera Subsystem
- compatible:
Usage: required
Value type: <stringlist>
Definition: Should contain:
Definition: Should contain one of:
- "qcom,msm8916-camss"
- "qcom,msm8996-camss"
- reg:
Usage: required
Value type: <prop-encoded-array>
......@@ -19,11 +20,16 @@ Qualcomm Camera Subsystem
- "csiphy0_clk_mux"
- "csiphy1"
- "csiphy1_clk_mux"
- "csiphy2" (8996 only)
- "csiphy2_clk_mux" (8996 only)
- "csid0"
- "csid1"
- "csid2" (8996 only)
- "csid3" (8996 only)
- "ispif"
- "csi_clk_mux"
- "vfe0"
- "vfe1" (8996 only)
- interrupts:
Usage: required
Value type: <prop-encoded-array>
......@@ -34,10 +40,14 @@ Qualcomm Camera Subsystem
Definition: Should contain the following entries:
- "csiphy0"
- "csiphy1"
- "csiphy2" (8996 only)
- "csid0"
- "csid1"
- "csid2" (8996 only)
- "csid3" (8996 only)
- "ispif"
- "vfe0"
- "vfe1" (8996 only)
- power-domains:
Usage: required
Value type: <prop-encoded-array>
......@@ -53,25 +63,42 @@ Qualcomm Camera Subsystem
Usage: required
Value type: <stringlist>
Definition: Should contain the following entries:
- "camss_top_ahb"
- "ispif_ahb"
- "csiphy0_timer"
- "csiphy1_timer"
- "csi0_ahb"
- "csi0"
- "csi0_phy"
- "csi0_pix"
- "csi0_rdi"
- "csi1_ahb"
- "csi1"
- "csi1_phy"
- "csi1_pix"
- "csi1_rdi"
- "camss_ahb"
- "camss_vfe_vfe"
- "camss_csi_vfe"
- "iface"
- "bus"
- "top_ahb"
- "ispif_ahb"
- "csiphy0_timer"
- "csiphy1_timer"
- "csiphy2_timer" (8996 only)
- "csi0_ahb"
- "csi0"
- "csi0_phy"
- "csi0_pix"
- "csi0_rdi"
- "csi1_ahb"
- "csi1"
- "csi1_phy"
- "csi1_pix"
- "csi1_rdi"
- "csi2_ahb" (8996 only)
- "csi2" (8996 only)
- "csi2_phy" (8996 only)
- "csi2_pix" (8996 only)
- "csi2_rdi" (8996 only)
- "csi3_ahb" (8996 only)
- "csi3" (8996 only)
- "csi3_phy" (8996 only)
- "csi3_pix" (8996 only)
- "csi3_rdi" (8996 only)
- "ahb"
- "vfe0"
- "csi_vfe0"
- "vfe0_ahb", (8996 only)
- "vfe0_stream", (8996 only)
- "vfe1", (8996 only)
- "csi_vfe1", (8996 only)
- "vfe1_ahb", (8996 only)
- "vfe1_stream", (8996 only)
- "vfe_ahb"
- "vfe_axi"
- vdda-supply:
Usage: required
Value type: <phandle>
......@@ -90,22 +117,27 @@ Qualcomm Camera Subsystem
- reg:
Usage: required
Value type: <u32>
Definition: Selects CSI2 PHY interface - PHY0 or PHY1.
Definition: Selects CSI2 PHY interface - PHY0, PHY1
or PHY2 (8996 only)
Endpoint node properties:
- clock-lanes:
Usage: required
Value type: <u32>
Definition: The physical clock lane index. The value
must always be <1> as the physical clock
lane is lane 1.
Definition: The physical clock lane index. On 8916
the value must always be <1> as the physical
clock lane is lane 1. On 8996 the value must
always be <7> as the hardware supports D-PHY
and C-PHY, indexes are in a common set and
D-PHY physical clock lane is labeled as 7.
- data-lanes:
Usage: required
Value type: <prop-encoded-array>
Definition: An array of physical data lanes indexes.
Position of an entry determines the logical
lane number, while the value of an entry
indicates physical lane index. Lane swapping
is supported.
Definition: An array of physical data lanes indexes.
Position of an entry determines the logical
lane number, while the value of an entry
indicates physical lane index. Lane swapping
is supported. Physical lane indexes for
8916: 0, 2, 3, 4; for 8996: 0, 1, 2, 3.
* An Example
......@@ -161,25 +193,25 @@ Qualcomm Camera Subsystem
<&gcc GCC_CAMSS_CSI_VFE0_CLK>,
<&gcc GCC_CAMSS_VFE_AHB_CLK>,
<&gcc GCC_CAMSS_VFE_AXI_CLK>;
clock-names = "camss_top_ahb",
"ispif_ahb",
"csiphy0_timer",
"csiphy1_timer",
"csi0_ahb",
"csi0",
"csi0_phy",
"csi0_pix",
"csi0_rdi",
"csi1_ahb",
"csi1",
"csi1_phy",
"csi1_pix",
"csi1_rdi",
"camss_ahb",
"camss_vfe_vfe",
"camss_csi_vfe",
"iface",
"bus";
clock-names = "top_ahb",
"ispif_ahb",
"csiphy0_timer",
"csiphy1_timer",
"csi0_ahb",
"csi0",
"csi0_phy",
"csi0_pix",
"csi0_rdi",
"csi1_ahb",
"csi1",
"csi1_phy",
"csi1_pix",
"csi1_rdi",
"ahb",
"vfe0",
"csi_vfe0",
"vfe_ahb",
"vfe_axi";
vdda-supply = <&pm8916_l2>;
iommus = <&apps_iommu 3>;
ports {
......
......@@ -6,6 +6,7 @@
Definition: Value should contain one of:
- "qcom,msm8916-venus"
- "qcom,msm8996-venus"
- "qcom,sdm845-venus"
- reg:
Usage: required
Value type: <prop-encoded-array>
......
......@@ -21,7 +21,9 @@ on Gen3 platforms to a CSI-2 receiver.
- "renesas,vin-r8a7794" for the R8A7794 device
- "renesas,vin-r8a7795" for the R8A7795 device
- "renesas,vin-r8a7796" for the R8A7796 device
- "renesas,vin-r8a77965" for the R8A77965 device
- "renesas,vin-r8a77970" for the R8A77970 device
- "renesas,vin-r8a77995" for the R8A77995 device
- "renesas,rcar-gen2-vin" for a generic R-Car Gen2 or RZ/G1 compatible
device.
......@@ -37,30 +39,51 @@ Additionally, an alias named vinX will need to be created to specify
which video input device this is.
The per-board settings Gen2 platforms:
- port sub-node describing a single endpoint connected to the vin
as described in video-interfaces.txt[1]. Only the first one will
be considered as each vin interface has one input port.
- port - sub-node describing a single endpoint connected to the VIN
from external SoC pins as described in video-interfaces.txt[1].
Only the first one will be considered as each vin interface has one
input port.
- Optional properties for endpoint nodes:
- hsync-active: see [1] for description. Default is active high.
- vsync-active: see [1] for description. Default is active high.
If both HSYNC and VSYNC polarities are not specified, embedded
synchronization is selected.
- field-active-even: see [1] for description. Default is active high.
- bus-width: see [1] for description. The selected bus width depends on
the SoC type and selected input image format.
Valid values are: 8, 10, 12, 16, 24 and 32.
- data-shift: see [1] for description. Valid values are 0 and 8.
- data-enable-active: polarity of CLKENB signal, see [1] for
description. Default is active high.
The per-board settings Gen3 platforms:
Gen3 platforms can support both a single connected parallel input source
from external SoC pins (port0) and/or multiple parallel input sources
from local SoC CSI-2 receivers (port1) depending on SoC.
from external SoC pins (port@0) and/or multiple parallel input sources
from local SoC CSI-2 receivers (port@1) depending on SoC.
- renesas,id - ID number of the VIN, VINx in the documentation.
- ports
- port 0 - sub-node describing a single endpoint connected to the VIN
from external SoC pins described in video-interfaces.txt[1].
Describing more then one endpoint in port 0 is invalid. Only VIN
instances that are connected to external pins should have port 0.
- port 1 - sub-nodes describing one or more endpoints connected to
- port@0 - sub-node describing a single endpoint connected to the VIN
from external SoC pins as described in video-interfaces.txt[1].
Describing more than one endpoint in port@0 is invalid. Only VIN
instances that are connected to external pins should have port@0.
Endpoint nodes of port@0 support the optional properties listed in
the Gen2 per-board settings description.
- port@1 - sub-nodes describing one or more endpoints connected to
the VIN from local SoC CSI-2 receivers. The endpoint numbers must
use the following schema.
- Endpoint 0 - sub-node describing the endpoint connected to CSI20
- Endpoint 1 - sub-node describing the endpoint connected to CSI21
- Endpoint 2 - sub-node describing the endpoint connected to CSI40
- Endpoint 3 - sub-node describing the endpoint connected to CSI41
- endpoint@0 - sub-node describing the endpoint connected to CSI20
- endpoint@1 - sub-node describing the endpoint connected to CSI21
- endpoint@2 - sub-node describing the endpoint connected to CSI40
- endpoint@3 - sub-node describing the endpoint connected to CSI41
Endpoint nodes of port@1 do not support any optional endpoint property.
Device node example for Gen2 platforms
--------------------------------------
......@@ -107,9 +130,6 @@ Board setup example for Gen2 platforms (vin1 composite video input)
status = "okay";
port {
#address-cells = <1>;
#size-cells = <0>;
vin1ep0: endpoint {
remote-endpoint = <&adv7180>;
bus-width = <8>;
......
......@@ -85,6 +85,10 @@ Optional properties
- lens-focus: A phandle to the node of the focus lens controller.
- rotation: The device, typically an image sensor, is not mounted upright,
but a number of degrees counter clockwise. Typical values are 0 and 180
(upside down).
Optional endpoint properties
----------------------------
......@@ -109,6 +113,8 @@ Optional endpoint properties
Note, that if HSYNC and VSYNC polarities are not specified, embedded
synchronization may be required, where supported.
- data-active: similar to HSYNC and VSYNC, specifies data line polarity.
- data-enable-active: similar to HSYNC and VSYNC, specifies the data enable
signal polarity.
- field-even-active: field signal level during the even field data transmission.
- pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock
signal.
......
# Ignore header name
ignore define _DVBAUDIO_H_
# Typedef pointing to structs
replace typedef audio_karaoke_t :c:type:`audio_karaoke`
# Undocumented audio caps, as this is a deprecated API anyway
ignore define AUDIO_CAP_DTS
ignore define AUDIO_CAP_LPCM
......
......@@ -6,10 +6,10 @@ ignore define MEDIA_API_VERSION
ignore define MEDIA_ENT_F_BASE
ignore define MEDIA_ENT_F_OLD_BASE
ignore define MEDIA_ENT_F_OLD_SUBDEV_BASE
ignore define MEDIA_ENT_F_DTV_DECODER
ignore define MEDIA_INTF_T_DVB_BASE
ignore define MEDIA_INTF_T_V4L_BASE
ignore define MEDIA_INTF_T_ALSA_BASE
#ignore legacy entity type macros
ignore define MEDIA_ENT_TYPE_SHIFT
ignore define MEDIA_ENT_TYPE_MASK
......
......@@ -179,6 +179,24 @@ it is guaranteed that the state did change in between the two events.
capability set. When open() is called, the HPD pin can be read and
if the HPD is high, then an initial event will be generated for that
filehandle.
* .. _`CEC-EVENT-PIN-5V-LOW`:
- ``CEC_EVENT_PIN_5V_LOW``
- 6
- Generated if the 5V pin goes from a high voltage to a low voltage.
Only applies to adapters that have the ``CEC_CAP_MONITOR_PIN``
capability set. When open() is called, the 5V pin can be read and
if the 5V is low, then an initial event will be generated for that
filehandle.
* .. _`CEC-EVENT-PIN-5V-HIGH`:
- ``CEC_EVENT_PIN_5V_HIGH``
- 7
- Generated if the 5V pin goes from a low voltage to a high voltage.
Only applies to adapters that have the ``CEC_CAP_MONITOR_PIN``
capability set. When open() is called, the 5V pin can be read and
if the 5V is high, then an initial event will be generated for that
filehandle.
.. tabularcolumns:: |p{6.0cm}|p{0.6cm}|p{10.9cm}|
......
.. -*- coding: utf-8; mode: rst -*-
.. _AUDIO_GET_PTS:
=============
AUDIO_GET_PTS
=============
Name
----
AUDIO_GET_PTS
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(int fd, AUDIO_GET_PTS, __u64 *pts)
:name: AUDIO_GET_PTS
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- __u64 \*pts
- Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 /
ISO/IEC 13818-1.
The PTS should belong to the currently played frame if possible,
but may also be a value close to it like the PTS of the last
decoded frame or the last PTS extracted by the PES parser.
Description
-----------
This ioctl is obsolete. Do not use in new drivers. If you need this
functionality, then please contact the linux-media mailing list
(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__).
This ioctl call asks the Audio Device to return the current PTS
timestamp.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. -*- coding: utf-8; mode: rst -*-
.. _AUDIO_SET_ATTRIBUTES:
====================
AUDIO_SET_ATTRIBUTES
====================
Name
----
AUDIO_SET_ATTRIBUTES
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(fd, AUDIO_SET_ATTRIBUTES, struct audio_attributes *attr )
:name: AUDIO_SET_ATTRIBUTES
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- audio_attributes_t attr
- audio attributes according to section ??
Description
-----------
This ioctl is intended for DVD playback and allows you to set certain
information about the audio stream.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- attr is not a valid or supported attribute setting.
.. -*- coding: utf-8; mode: rst -*-
.. _AUDIO_SET_EXT_ID:
================
AUDIO_SET_EXT_ID
================
Name
----
AUDIO_SET_EXT_ID
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(fd, AUDIO_SET_EXT_ID, int id)
:name: AUDIO_SET_EXT_ID
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- int id
- audio sub_stream_id
Description
-----------
This ioctl can be used to set the extension id for MPEG streams in DVD
playback. Only the first 3 bits are recognized.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- id is not a valid id.
.. -*- coding: utf-8; mode: rst -*-
.. _AUDIO_SET_KARAOKE:
=================
AUDIO_SET_KARAOKE
=================
Name
----
AUDIO_SET_KARAOKE
.. attention:: This ioctl is deprecated
Synopsis
--------
.. c:function:: int ioctl(fd, AUDIO_SET_KARAOKE, struct audio_karaoke *karaoke)
:name: AUDIO_SET_KARAOKE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- int fd
- File descriptor returned by a previous call to open().
-
- audio_karaoke_t \*karaoke
- karaoke settings according to section ??.
Description
-----------
This ioctl allows one to set the mixer settings for a karaoke DVD.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- karaoke is not a valid or supported karaoke setting.
......@@ -114,40 +114,3 @@ following bits set according to the hardwares capabilities.
#define AUDIO_CAP_OGG 64
#define AUDIO_CAP_SDDS 128
#define AUDIO_CAP_AC3 256
.. c:type:: audio_karaoke
The ioctl AUDIO_SET_KARAOKE uses the following format:
.. code-block:: c
typedef
struct audio_karaoke {
int vocal1;
int vocal2;
int melody;
} audio_karaoke_t;
If Vocal1 or Vocal2 are non-zero, they get mixed into left and right t
at 70% each. If both, Vocal1 and Vocal2 are non-zero, Vocal1 gets mixed
into the left channel and Vocal2 into the right channel at 100% each. Ff
Melody is non-zero, the melody channel gets mixed into left and right.
.. c:type:: audio_attributes
The following attributes can be set by a call to AUDIO_SET_ATTRIBUTES:
.. code-block:: c
typedef uint16_t audio_attributes_t;
/* bits: descr. */
/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
/* 12 multichannel extension */
/* 11-10 audio type (0=not spec, 1=language included) */
/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */
/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
/* 2- 0 number of audio channels (n+1 channels) */
......@@ -22,13 +22,9 @@ Audio Function Calls
audio-set-bypass-mode
audio-channel-select
audio-bilingual-channel-select
audio-get-pts
audio-get-status
audio-get-capabilities
audio-clear-buffer
audio-set-id
audio-set-mixer
audio-set-streamtype
audio-set-ext-id
audio-set-attributes
audio-set-karaoke
.. -*- coding: utf-8; mode: rst -*-
.. _VIDEO_GET_FRAME_RATE:
====================
VIDEO_GET_FRAME_RATE
====================
Name
----
VIDEO_GET_FRAME_RATE
.. attention:: This ioctl is deprecated.
Synopsis
--------
.. c:function:: int ioctl(int fd, VIDEO_GET_FRAME_RATE, unsigned int *rate)
:name: VIDEO_GET_FRAME_RATE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- int request
- Equals VIDEO_GET_FRAME_RATE for this command.
- .. row 3
- unsigned int \*rate
- Returns the framerate in number of frames per 1000 seconds.
Description
-----------
This ioctl call asks the Video Device to return the current framerate.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. -*- coding: utf-8; mode: rst -*-
.. _VIDEO_GET_NAVI:
==============
VIDEO_GET_NAVI
==============
Name
----
VIDEO_GET_NAVI
.. attention:: This ioctl is deprecated.
Synopsis
--------
.. c:function:: int ioctl(fd, VIDEO_GET_NAVI , struct video_navi_pack *navipack)
:name: VIDEO_GET_NAVI
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- int request
- Equals VIDEO_GET_NAVI for this command.
- .. row 3
- video_navi_pack_t \*navipack
- PCI or DSI pack (private stream 2) according to section ??.
Description
-----------
This ioctl returns navigational information from the DVD stream. This is
especially needed if an encoded stream has to be decoded by the
hardware.
.. c:type:: video_navi_pack
.. code-block::c
typedef struct video_navi_pack {
int length; /* 0 ... 1024 */
__u8 data[1024];
} video_navi_pack_t;
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EFAULT``
- driver is not able to return navigational information
.. -*- coding: utf-8; mode: rst -*-
.. _VIDEO_SET_ATTRIBUTES:
====================
VIDEO_SET_ATTRIBUTES
====================
Name
----
VIDEO_SET_ATTRIBUTES
.. attention:: This ioctl is deprecated.
Synopsis
--------
.. c:function:: int ioctl(fd, VIDEO_SET_ATTRIBUTE ,video_attributes_t vattr)
:name: VIDEO_SET_ATTRIBUTE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- int request
- Equals VIDEO_SET_ATTRIBUTE for this command.
- .. row 3
- video_attributes_t vattr
- video attributes according to section ??.
Description
-----------
This ioctl is intended for DVD playback and allows you to set certain
information about the stream. Some hardware may not need this
information, but the call also tells the hardware to prepare for DVD
playback.
.. c:type:: video_attributes_t
.. code-block::c
typedef __u16 video_attributes_t;
/* bits: descr. */
/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
/* 13-12 TV system (0=525/60, 1=625/50) */
/* 11-10 Aspect ratio (0=4:3, 3=16:9) */
/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
/* 7 line 21-1 data present in GOP (1=yes, 0=no) */
/* 6 line 21-2 data present in GOP (1=yes, 0=no) */
/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
/* 2 source letterboxed (1=yes, 0=no) */
/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- input is not a valid attribute setting.
.. -*- coding: utf-8; mode: rst -*-
.. _VIDEO_SET_HIGHLIGHT:
===================
VIDEO_SET_HIGHLIGHT
===================
Name
----
VIDEO_SET_HIGHLIGHT
.. attention:: This ioctl is deprecated.
Synopsis
--------
.. c:function:: int ioctl(fd, VIDEO_SET_HIGHLIGHT, struct video_highlight *vhilite)
:name: VIDEO_SET_HIGHLIGHT
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- int request
- Equals VIDEO_SET_HIGHLIGHT for this command.
- .. row 3
- video_highlight_t \*vhilite
- SPU Highlight information according to section ??.
Description
-----------
This ioctl sets the SPU highlight information for the menu access of a
DVD.
.. c:type:: video_highlight
.. code-block:: c
typedef
struct video_highlight {
int active; /* 1=show highlight, 0=hide highlight */
__u8 contrast1; /* 7- 4 Pattern pixel contrast */
/* 3- 0 Background pixel contrast */
__u8 contrast2; /* 7- 4 Emphasis pixel-2 contrast */
/* 3- 0 Emphasis pixel-1 contrast */
__u8 color1; /* 7- 4 Pattern pixel color */
/* 3- 0 Background pixel color */
__u8 color2; /* 7- 4 Emphasis pixel-2 color */
/* 3- 0 Emphasis pixel-1 color */
__u32 ypos; /* 23-22 auto action mode */
/* 21-12 start y */
/* 9- 0 end y */
__u32 xpos; /* 23-22 button color number */
/* 21-12 start x */
/* 9- 0 end x */
} video_highlight_t;
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. -*- coding: utf-8; mode: rst -*-
.. _VIDEO_SET_ID:
============
VIDEO_SET_ID
============
Name
----
VIDEO_SET_ID
.. attention:: This ioctl is deprecated.
Synopsis
--------
.. c:function:: int ioctl(int fd, VIDEO_SET_ID, int id)
:name: VIDEO_SET_ID
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- int request
- Equals VIDEO_SET_ID for this command.
- .. row 3
- int id
- video sub-stream id
Description
-----------
This ioctl selects which sub-stream is to be decoded if a program or
system stream is sent to the video device.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- Invalid sub-stream id.
.. -*- coding: utf-8; mode: rst -*-
.. _VIDEO_SET_SPU_PALETTE:
=====================
VIDEO_SET_SPU_PALETTE
=====================
Name
----
VIDEO_SET_SPU_PALETTE
.. attention:: This ioctl is deprecated.
Synopsis
--------
.. c:function:: int ioctl(fd, VIDEO_SET_SPU_PALETTE, struct video_spu_palette *palette )
:name: VIDEO_SET_SPU_PALETTE
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- int request
- Equals VIDEO_SET_SPU_PALETTE for this command.
- .. row 3
- video_spu_palette_t \*palette
- SPU palette according to section ??.
Description
-----------
This ioctl sets the SPU color palette.
.. c:type:: video_spu_palette
.. code-block::c
typedef struct video_spu_palette { /* SPU Palette information */
int length;
__u8 __user *palette;
} video_spu_palette_t;
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- input is not a valid palette or driver doesn’t handle SPU.
.. -*- coding: utf-8; mode: rst -*-
.. _VIDEO_SET_SPU:
=============
VIDEO_SET_SPU
=============
Name
----
VIDEO_SET_SPU
.. attention:: This ioctl is deprecated.
Synopsis
--------
.. c:function:: int ioctl(fd, VIDEO_SET_SPU , struct video_spu *spu)
:name: VIDEO_SET_SPU
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- int request
- Equals VIDEO_SET_SPU for this command.
- .. row 3
- video_spu_t \*spu
- SPU decoding (de)activation and subid setting according to section
??.
Description
-----------
This ioctl activates or deactivates SPU decoding in a DVD input stream.
It can only be used, if the driver is able to handle a DVD stream.
.. c:type:: struct video_spu
.. code-block:: c
typedef struct video_spu {
int active;
int stream_id;
} video_spu_t;
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- input is not a valid spu setting or driver cannot handle SPU.
.. -*- coding: utf-8; mode: rst -*-
.. _VIDEO_SET_SYSTEM:
================
VIDEO_SET_SYSTEM
================
Name
----
VIDEO_SET_SYSTEM
.. attention:: This ioctl is deprecated.
Synopsis
--------
.. c:function:: int ioctl(fd, VIDEO_SET_SYSTEM , video_system_t system)
:name: VIDEO_SET_SYSTEM
Arguments
---------
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- int fd
- File descriptor returned by a previous call to open().
- .. row 2
- int request
- Equals VIDEO_SET_FORMAT for this command.
- .. row 3
- video_system_t system
- video system of TV output.
Description
-----------
This ioctl sets the television output format. The format (see section
??) may vary from the color format of the displayed MPEG stream. If the
hardware is not able to display the requested format the call will
return an error.
Return Value
------------
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- .. row 1
- ``EINVAL``
- system is not a valid or supported video system.
......@@ -21,7 +21,6 @@ Video Function Calls
video-get-status
video-get-frame-count
video-get-pts
video-get-frame-rate
video-get-event
video-command
video-try-command
......@@ -31,13 +30,7 @@ Video Function Calls
video-fast-forward
video-slowmotion
video-get-capabilities
video-set-id
video-clear-buffer
video-set-streamtype
video-set-format
video-set-system
video-set-highlight
video-set-spu
video-set-spu-palette
video-get-navi
video-set-attributes
......@@ -246,134 +246,3 @@ following bits set according to the hardwares capabilities.
#define VIDEO_CAP_SPU 16
#define VIDEO_CAP_NAVI 32
#define VIDEO_CAP_CSS 64
.. _video-system:
video_system_t
==============
A call to VIDEO_SET_SYSTEM sets the desired video system for TV
output. The following system types can be set:
.. code-block:: c
typedef enum {
VIDEO_SYSTEM_PAL,
VIDEO_SYSTEM_NTSC,
VIDEO_SYSTEM_PALN,
VIDEO_SYSTEM_PALNc,
VIDEO_SYSTEM_PALM,
VIDEO_SYSTEM_NTSC60,
VIDEO_SYSTEM_PAL60,
VIDEO_SYSTEM_PALM60
} video_system_t;
.. c:type:: video_highlight
struct video_highlight
======================
Calling the ioctl VIDEO_SET_HIGHLIGHTS posts the SPU highlight
information. The call expects the following format for that information:
.. code-block:: c
typedef
struct video_highlight {
boolean active; /* 1=show highlight, 0=hide highlight */
uint8_t contrast1; /* 7- 4 Pattern pixel contrast */
/* 3- 0 Background pixel contrast */
uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */
/* 3- 0 Emphasis pixel-1 contrast */
uint8_t color1; /* 7- 4 Pattern pixel color */
/* 3- 0 Background pixel color */
uint8_t color2; /* 7- 4 Emphasis pixel-2 color */
/* 3- 0 Emphasis pixel-1 color */
uint32_t ypos; /* 23-22 auto action mode */
/* 21-12 start y */
/* 9- 0 end y */
uint32_t xpos; /* 23-22 button color number */
/* 21-12 start x */
/* 9- 0 end x */
} video_highlight_t;
.. c:type:: video_spu
struct video_spu
================
Calling VIDEO_SET_SPU deactivates or activates SPU decoding, according
to the following format:
.. code-block:: c
typedef
struct video_spu {
boolean active;
int stream_id;
} video_spu_t;
.. c:type:: video_spu_palette
struct video_spu_palette
========================
The following structure is used to set the SPU palette by calling
VIDEO_SPU_PALETTE:
.. code-block:: c
typedef
struct video_spu_palette {
int length;
uint8_t *palette;
} video_spu_palette_t;
.. c:type:: video_navi_pack
struct video_navi_pack
======================
In order to get the navigational data the following structure has to be
passed to the ioctl VIDEO_GET_NAVI:
.. code-block:: c
typedef
struct video_navi_pack {
int length; /* 0 ... 1024 */
uint8_t data[1024];
} video_navi_pack_t;
.. _video-attributes-t:
video_attributes_t
==================
The following attributes can be set by a call to VIDEO_SET_ATTRIBUTES:
.. code-block:: c
typedef uint16_t video_attributes_t;
/* bits: descr. */
/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
/* 13-12 TV system (0=525/60, 1=625/50) */
/* 11-10 Aspect ratio (0=4:3, 3=16:9) */
/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
/* 7 line 21-1 data present in GOP (1=yes, 0=no) */
/* 6 line 21-2 data present in GOP (1=yes, 0=no) */
/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
/* 2 source letterboxed (1=yes, 0=no) */
/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */
......@@ -48,12 +48,8 @@ ioctl never fails.
:widths: 1 1 2
- .. row 1
- char
* - char
- ``driver``\ [16]
- Name of the driver implementing the media API as a NUL-terminated
ASCII string. The driver version is stored in the
``driver_version`` field.
......@@ -62,66 +58,38 @@ ioctl never fails.
the driver identity. It is also useful to work around known bugs,
or to identify drivers in error reports.
- .. row 2
- char
* - char
- ``model``\ [32]
- Device model name as a NUL-terminated UTF-8 string. The device
version is stored in the ``device_version`` field and is not be
appended to the model name.
- .. row 3
- char
* - char
- ``serial``\ [40]
- Serial number as a NUL-terminated ASCII string.
- .. row 4
- char
* - char
- ``bus_info``\ [32]
- Location of the device in the system as a NUL-terminated ASCII
string. This includes the bus type name (PCI, USB, ...) and a
bus-specific identifier.
- .. row 5
- __u32
* - __u32
- ``media_version``
- Media API version, formatted with the ``KERNEL_VERSION()`` macro.
- .. row 6
- __u32
* - __u32
- ``hw_revision``
- Hardware device revision in a driver-specific format.
- .. row 7
- __u32
* - __u32
- ``driver_version``
- Media device driver version, formatted with the
``KERNEL_VERSION()`` macro. Together with the ``driver`` field
this identifies a particular driver.
- .. row 8
- __u32
* - __u32
- ``reserved``\ [31]
- Reserved for future extensions. Drivers and applications must set
this array to zero.
......
......@@ -58,142 +58,90 @@ id's until they get an error.
:stub-columns: 0
:widths: 1 1 1 1 8
- .. row 1
- __u32
* - __u32
- ``id``
-
-
- Entity id, set by the application. When the id is or'ed with
- Entity ID, set by the application. When the ID is or'ed with
``MEDIA_ENT_ID_FLAG_NEXT``, the driver clears the flag and returns
the first entity with a larger id.
- .. row 2
- char
the first entity with a larger ID. Do not expect that the ID will
always be the same for each instance of the device. In other words,
do not hardcode entity IDs in an application.
* - char
- ``name``\ [32]
-
-
- Entity name as an UTF-8 NULL-terminated string.
- .. row 3
- __u32
- Entity name as an UTF-8 NULL-terminated string. This name must be unique
within the media topology.
* - __u32
- ``type``
-
-
- Entity type, see :ref:`media-entity-functions` for details.
- .. row 4
- __u32
* - __u32
- ``revision``
-
-
- Entity revision. Always zero (obsolete)
- .. row 5
- __u32
* - __u32
- ``flags``
-
-
- Entity flags, see :ref:`media-entity-flag` for details.
- .. row 6
- __u32
* - __u32
- ``group_id``
-
-
- Entity group ID. Always zero (obsolete)
- .. row 7
- __u16
* - __u16
- ``pads``
-
-
- Number of pads
- .. row 8
- __u16
* - __u16
- ``links``
-
-
- Total number of outbound links. Inbound links are not counted in
this field.
- .. row 9
- __u32
* - __u32
- ``reserved[4]``
-
-
- Reserved for future extensions. Drivers and applications must set
the array to zero.
- .. row 10
- union
- .. row 11
* - union
-
* -
- struct
- ``dev``
-
- Valid for (sub-)devices that create a single device node.
- .. row 12
-
* -
-
- __u32
- ``major``
- Device node major number.
- .. row 13
-
* -
-
- __u32
- ``minor``
- Device node minor number.
- .. row 14
-
* -
- __u8
- ``raw``\ [184]
-
-
......
......@@ -62,35 +62,21 @@ returned during the enumeration process.
:stub-columns: 0
:widths: 1 1 2
- .. row 1
- __u32
* - __u32
- ``entity``
- Entity id, set by the application.
- .. row 2
- struct :c:type:`media_pad_desc`
* - struct :c:type:`media_pad_desc`
- \*\ ``pads``
- Pointer to a pads array allocated by the application. Ignored if
NULL.
- .. row 3
- struct :c:type:`media_link_desc`
* - struct :c:type:`media_link_desc`
- \*\ ``links``
- Pointer to a links array allocated by the application. Ignored if
NULL.
.. c:type:: media_pad_desc
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
......@@ -100,37 +86,20 @@ returned during the enumeration process.
:stub-columns: 0
:widths: 1 1 2
- .. row 1
- __u32
* - __u32
- ``entity``
- ID of the entity this pad belongs to.
- .. row 2
- __u16
* - __u16
- ``index``
- Pad index, starts at 0.
- 0-based pad index.
- .. row 3
- __u32
* - __u32
- ``flags``
- Pad flags, see :ref:`media-pad-flag` for more details.
- .. row 4
- __u32
* - __u32
- ``reserved[2]``
- Reserved for future extensions. Drivers and applications must set
the array to zero.
......@@ -145,37 +114,20 @@ returned during the enumeration process.
:stub-columns: 0
:widths: 1 1 2
- .. row 1
- struct :c:type:`media_pad_desc`
* - struct :c:type:`media_pad_desc`
- ``source``
- Pad at the origin of this link.
- .. row 2
- struct :c:type:`media_pad_desc`
* - struct :c:type:`media_pad_desc`
- ``sink``
- Pad at the target of this link.
- .. row 3
- __u32
* - __u32
- ``flags``
- Link flags, see :ref:`media-link-flag` for more details.
- .. row 4
- __u32
* - __u32
- ``reserved[4]``
- Reserved for future extensions. Drivers and applications must set
the array to zero.
......
......@@ -55,119 +55,66 @@ desired arrays with the media graph elements.
:stub-columns: 0
:widths: 1 2 8
- .. row 1
- __u64
* - __u64
- ``topology_version``
- Version of the media graph topology. When the graph is created,
this field starts with zero. Every time a graph element is added
or removed, this field is incremented.
- .. row 2
- __u32
* - __u32
- ``num_entities``
- Number of entities in the graph
- .. row 3
- __u32
* - __u32
- ``reserved1``
- Applications and drivers shall set this to 0.
- .. row 4
- __u64
* - __u64
- ``ptr_entities``
- A pointer to a memory area where the entities array will be
stored, converted to a 64-bits integer. It can be zero. if zero,
the ioctl won't store the entities. It will just update
``num_entities``
- .. row 5
- __u32
* - __u32
- ``num_interfaces``
- Number of interfaces in the graph
- .. row 6
- __u32
* - __u32
- ``reserved2``
- Applications and drivers shall set this to 0.
- .. row 7
- __u64
* - __u64
- ``ptr_interfaces``
- A pointer to a memory area where the interfaces array will be
stored, converted to a 64-bits integer. It can be zero. if zero,
the ioctl won't store the interfaces. It will just update
``num_interfaces``
- .. row 8
- __u32
* - __u32
- ``num_pads``
- Total number of pads in the graph
- .. row 9
- __u32
* - __u32
- ``reserved3``
- Applications and drivers shall set this to 0.
- .. row 10
- __u64
* - __u64
- ``ptr_pads``
- A pointer to a memory area where the pads array will be stored,
converted to a 64-bits integer. It can be zero. if zero, the ioctl
won't store the pads. It will just update ``num_pads``
- .. row 11
- __u32
* - __u32
- ``num_links``
- Total number of data and interface links in the graph
- .. row 12
- __u32
* - __u32
- ``reserved4``
- Applications and drivers shall set this to 0.
- .. row 13
- __u64
* - __u64
- ``ptr_links``
- A pointer to a memory area where the links array will be stored,
converted to a 64-bits integer. It can be zero. if zero, the ioctl
won't store the links. It will just update ``num_links``
......@@ -182,37 +129,31 @@ desired arrays with the media graph elements.
:stub-columns: 0
:widths: 1 2 8
- .. row 1
- __u32
* - __u32
- ``id``
- Unique ID for the entity. Do not expect that the ID will
always be the same for each instance of the device. In other words,
do not hardcode entity IDs in an application.
- Unique ID for the entity.
- .. row 2
- char
* - char
- ``name``\ [64]
- Entity name as an UTF-8 NULL-terminated string. This name must be unique
within the media topology.
- Entity name as an UTF-8 NULL-terminated string.
- .. row 3
- __u32
* - __u32
- ``function``
- Entity main function, see :ref:`media-entity-functions` for details.
- .. row 4
- __u32
- ``reserved``\ [6]
* - __u32
- ``flags``
- Entity flags, see :ref:`media-entity-flag` for details.
Only valid if ``MEDIA_V2_ENTITY_HAS_FLAGS(media_version)``
returns true. The ``media_version`` is defined in struct
:c:type:`media_device_info` and can be retrieved using
:ref:`MEDIA_IOC_DEVICE_INFO`.
* - __u32
- ``reserved``\ [5]
- Reserved for future extensions. Drivers and applications must set
this array to zero.
......@@ -226,47 +167,29 @@ desired arrays with the media graph elements.
:stub-columns: 0
:widths: 1 2 8
- .. row 1
- __u32
* - __u32
- ``id``
- Unique ID for the interface. Do not expect that the ID will
always be the same for each instance of the device. In other words,
do not hardcode interface IDs in an application.
- Unique ID for the interface.
- .. row 2
- __u32
* - __u32
- ``intf_type``
- Interface type, see :ref:`media-intf-type` for details.
- .. row 3
- __u32
* - __u32
- ``flags``
- Interface flags. Currently unused.
- .. row 4
- __u32
* - __u32
- ``reserved``\ [9]
- Reserved for future extensions. Drivers and applications must set
this array to zero.
- .. row 5
- struct media_v2_intf_devnode
* - struct media_v2_intf_devnode
- ``devnode``
- Used only for device node interfaces. See
:c:type:`media_v2_intf_devnode` for details..
:c:type:`media_v2_intf_devnode` for details.
.. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
......@@ -278,24 +201,14 @@ desired arrays with the media graph elements.
:stub-columns: 0
:widths: 1 2 8
- .. row 1
- __u32
* - __u32
- ``major``
- Device node major number.
- .. row 2
- __u32
* - __u32
- ``minor``
- Device node minor number.
.. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
.. c:type:: media_v2_pad
......@@ -305,37 +218,29 @@ desired arrays with the media graph elements.
:stub-columns: 0
:widths: 1 2 8
- .. row 1
- __u32
* - __u32
- ``id``
- Unique ID for the pad. Do not expect that the ID will
always be the same for each instance of the device. In other words,
do not hardcode pad IDs in an application.
- Unique ID for the pad.
- .. row 2
- __u32
* - __u32
- ``entity_id``
- Unique ID for the entity where this pad belongs.
- .. row 3
- __u32
* - __u32
- ``flags``
- Pad flags, see :ref:`media-pad-flag` for more details.
- .. row 4
- __u32
- ``reserved``\ [5]
* - __u32
- ``index``
- Pad index, starts at 0. Only valid if ``MEDIA_V2_PAD_HAS_INDEX(media_version)``
returns true. The ``media_version`` is defined in struct
:c:type:`media_device_info` and can be retrieved using
:ref:`MEDIA_IOC_DEVICE_INFO`.
* - __u32
- ``reserved``\ [4]
- Reserved for future extensions. Drivers and applications must set
this array to zero.
......@@ -349,49 +254,30 @@ desired arrays with the media graph elements.
:stub-columns: 0
:widths: 1 2 8
- .. row 1
- __u32
* - __u32
- ``id``
- Unique ID for the link. Do not expect that the ID will
always be the same for each instance of the device. In other words,
do not hardcode link IDs in an application.
- Unique ID for the link.
- .. row 2
- __u32
* - __u32
- ``source_id``
- On pad to pad links: unique ID for the source pad.
On interface to entity links: unique ID for the interface.
- .. row 3
- __u32
* - __u32
- ``sink_id``
- On pad to pad links: unique ID for the sink pad.
On interface to entity links: unique ID for the entity.
- .. row 4
- __u32
* - __u32
- ``flags``
- Link flags, see :ref:`media-link-flag` for more details.
- .. row 5
- __u32
* - __u32
- ``reserved``\ [6]
- Reserved for future extensions. Drivers and applications must set
this array to zero.
......
......@@ -1955,9 +1955,51 @@ enum v4l2_vp8_golden_frame_sel -
``V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (integer)``
Quantization parameter for a P frame for VP8.
``V4L2_CID_MPEG_VIDEO_VPX_PROFILE (integer)``
Select the desired profile for VPx encoder. Acceptable values are 0,
1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3.
.. _v4l2-mpeg-video-vp8-profile:
``V4L2_CID_MPEG_VIDEO_VP8_PROFILE``
(enum)
enum v4l2_mpeg_video_vp8_profile -
This control allows selecting the profile for VP8 encoder.
This is also used to enumerate supported profiles by VP8 encoder or decoder.
Possible values are:
.. flat-table::
:header-rows: 0
:stub-columns: 0
* - ``V4L2_MPEG_VIDEO_VP8_PROFILE_0``
- Profile 0
* - ``V4L2_MPEG_VIDEO_VP8_PROFILE_1``
- Profile 1
* - ``V4L2_MPEG_VIDEO_VP8_PROFILE_2``
- Profile 2
* - ``V4L2_MPEG_VIDEO_VP8_PROFILE_3``
- Profile 3
.. _v4l2-mpeg-video-vp9-profile:
``V4L2_CID_MPEG_VIDEO_VP9_PROFILE``
(enum)
enum v4l2_mpeg_video_vp9_profile -
This control allows selecting the profile for VP9 encoder.
This is also used to enumerate supported profiles by VP9 encoder or decoder.
Possible values are:
.. flat-table::
:header-rows: 0
:stub-columns: 0
* - ``V4L2_MPEG_VIDEO_VP9_PROFILE_0``
- Profile 0
* - ``V4L2_MPEG_VIDEO_VP9_PROFILE_1``
- Profile 1
* - ``V4L2_MPEG_VIDEO_VP9_PROFILE_2``
- Profile 2
* - ``V4L2_MPEG_VIDEO_VP9_PROFILE_3``
- Profile 3
High Efficiency Video Coding (HEVC/H.265) Control Reference
......
......@@ -95,3 +95,10 @@ Compressed Formats
- ``V4L2_PIX_FMT_HEVC``
- 'HEVC'
- HEVC/H.265 video elementary stream.
* .. _V4L2-PIX-FMT-FWHT:
- ``V4L2_PIX_FMT_FWHT``
- 'FWHT'
- Video elementary stream using a codec based on the Fast Walsh Hadamard
Transform. This codec is implemented by the vicodec ('Virtual Codec')
driver. See the vicodec-codec.h header for more details.
......@@ -19,4 +19,5 @@ RGB Formats
pixfmt-srggb10-ipu3
pixfmt-srggb12
pixfmt-srggb12p
pixfmt-srggb14p
pixfmt-srggb16
.. -*- coding: utf-8; mode: rst -*-
.. _V4L2-PIX-FMT-SRGGB14P:
.. _v4l2-pix-fmt-sbggr14p:
.. _v4l2-pix-fmt-sgbrg14p:
.. _v4l2-pix-fmt-sgrbg14p:
*******************************************************************************************************************************
V4L2_PIX_FMT_SRGGB14P ('pRCC'), V4L2_PIX_FMT_SGRBG14P ('pgCC'), V4L2_PIX_FMT_SGBRG14P ('pGCC'), V4L2_PIX_FMT_SBGGR14P ('pBCC'),
*******************************************************************************************************************************
*man V4L2_PIX_FMT_SRGGB14P(2)*
V4L2_PIX_FMT_SGRBG14P
V4L2_PIX_FMT_SGBRG14P
V4L2_PIX_FMT_SBGGR14P
14-bit packed Bayer formats
Description
===========
These four pixel formats are packed raw sRGB / Bayer formats with 14
bits per colour. Every four consecutive samples are packed into seven
bytes. Each of the first four bytes contain the eight high order bits
of the pixels, and the three following bytes contains the six least
significants bits of each pixel, in the same order.
Each n-pixel row contains n/2 green samples and n/2 blue or red samples,
with alternating green-red and green-blue rows. They are conventionally
described as GRGR... BGBG..., RGRG... GBGB..., etc. Below is an example
of one of these formats:
**Byte Order.**
Each cell is one byte.
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 2 1 1 1 1 1 1 1
- .. row 1
- start + 0:
- B\ :sub:`00high`
- G\ :sub:`01high`
- B\ :sub:`02high`
- G\ :sub:`03high`
- G\ :sub:`01low bits 1--0`\ (bits 7--6)
B\ :sub:`00low bits 5--0`\ (bits 5--0)
- R\ :sub:`02low bits 3--0`\ (bits 7--4)
G\ :sub:`01low bits 5--2`\ (bits 3--0)
- G\ :sub:`03low bits 5--0`\ (bits 7--2)
R\ :sub:`02low bits 5--4`\ (bits 1--0)
- .. row 2
- start + 7:
- G\ :sub:`00high`
- R\ :sub:`01high`
- G\ :sub:`02high`
- R\ :sub:`03high`
- R\ :sub:`01low bits 1--0`\ (bits 7--6)
G\ :sub:`00low bits 5--0`\ (bits 5--0)
- G\ :sub:`02low bits 3--0`\ (bits 7--4)
R\ :sub:`01low bits 5--2`\ (bits 3--0)
- R\ :sub:`03low bits 5--0`\ (bits 7--2)
G\ :sub:`02low bits 5--4`\ (bits 1--0)
- .. row 3
- start + 14
- B\ :sub:`20high`
- G\ :sub:`21high`
- B\ :sub:`22high`
- G\ :sub:`23high`
- G\ :sub:`21low bits 1--0`\ (bits 7--6)
B\ :sub:`20low bits 5--0`\ (bits 5--0)
- R\ :sub:`22low bits 3--0`\ (bits 7--4)
G\ :sub:`21low bits 5--2`\ (bits 3--0)
- G\ :sub:`23low bits 5--0`\ (bits 7--2)
R\ :sub:`22low bits 5--4`\ (bits 1--0)
- .. row 4
- start + 21
- G\ :sub:`30high`
- R\ :sub:`31high`
- G\ :sub:`32high`
- R\ :sub:`33high`
- R\ :sub:`31low bits 1--0`\ (bits 7--6)
G\ :sub:`30low bits 5--0`\ (bits 5--0)
- G\ :sub:`32low bits 3--0`\ (bits 7--4)
R\ :sub:`31low bits 5--2`\ (bits 3--0)
- R\ :sub:`33low bits 5--0`\ (bits 7--2)
G\ :sub:`32low bits 5--4`\ (bits 1--0)
.. -*- coding: utf-8; mode: rst -*-
.. _V4L2-PIX-FMT-Y10P:
******************************
V4L2_PIX_FMT_Y10P ('Y10P')
******************************
Grey-scale image as a MIPI RAW10 packed array
Description
===========
This is a packed grey-scale image format with a depth of 10 bits per
pixel. Every four consecutive pixels are packed into 5 bytes. Each of
the first 4 bytes contain the 8 high order bits of the pixels, and
the 5th byte contains the 2 least significants bits of each pixel,
in the same order.
**Bit-packed representation.**
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 8 8 8 8 64
* - Y'\ :sub:`00[9:2]`
- Y'\ :sub:`01[9:2]`
- Y'\ :sub:`02[9:2]`
- Y'\ :sub:`03[9:2]`
- Y'\ :sub:`03[1:0]`\ (bits 7--6) Y'\ :sub:`02[1:0]`\ (bits 5--4)
Y'\ :sub:`01[1:0]`\ (bits 3--2) Y'\ :sub:`00[1:0]`\ (bits 1--0)
......@@ -37,19 +37,22 @@ Media Bus Formats
- Image colorspace, from enum
:c:type:`v4l2_colorspace`. See
:ref:`colorspaces` for details.
* - enum :c:type:`v4l2_ycbcr_encoding`
* - __u16
- ``ycbcr_enc``
- This information supplements the ``colorspace`` and must be set by
- Y'CbCr encoding, from enum :c:type:`v4l2_ycbcr_encoding`.
This information supplements the ``colorspace`` and must be set by
the driver for capture streams and by the application for output
streams, see :ref:`colorspaces`.
* - enum :c:type:`v4l2_quantization`
* - __u16
- ``quantization``
- This information supplements the ``colorspace`` and must be set by
- Quantization range, from enum :c:type:`v4l2_quantization`.
This information supplements the ``colorspace`` and must be set by
the driver for capture streams and by the application for output
streams, see :ref:`colorspaces`.
* - enum :c:type:`v4l2_xfer_func`
* - __u16
- ``xfer_func``
- This information supplements the ``colorspace`` and must be set by
- Transfer function, from enum :c:type:`v4l2_xfer_func`.
This information supplements the ``colorspace`` and must be set by
the driver for capture streams and by the application for output
streams, see :ref:`colorspaces`.
* - __u16
......@@ -4315,6 +4318,78 @@ the following codes.
- y\ :sub:`2`
- y\ :sub:`1`
- y\ :sub:`0`
* .. _MEDIA-BUS-FMT-Y10-2X8-PADHI_LE:
- MEDIA_BUS_FMT_Y10_2X8_PADHI_LE
- 0x202c
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- y\ :sub:`7`
- y\ :sub:`6`
- y\ :sub:`5`
- y\ :sub:`4`
- y\ :sub:`3`
- y\ :sub:`2`
- y\ :sub:`1`
- y\ :sub:`0`
* -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0
- 0
- 0
- 0
- 0
- 0
- y\ :sub:`9`
- y\ :sub:`8`
* .. _MEDIA-BUS-FMT-UYVY10-2X10:
- MEDIA_BUS_FMT_UYVY10_2X10
......
......@@ -2,14 +2,14 @@
.. _VIDIOC_ENUMSTD:
********************
ioctl VIDIOC_ENUMSTD
********************
*******************************************
ioctl VIDIOC_ENUMSTD, VIDIOC_SUBDEV_ENUMSTD
*******************************************
Name
====
VIDIOC_ENUMSTD - Enumerate supported video standards
VIDIOC_ENUMSTD - VIDIOC_SUBDEV_ENUMSTD - Enumerate supported video standards
Synopsis
......@@ -18,6 +18,9 @@ Synopsis
.. c:function:: int ioctl( int fd, VIDIOC_ENUMSTD, struct v4l2_standard *argp )
:name: VIDIOC_ENUMSTD
.. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUMSTD, struct v4l2_standard *argp )
:name: VIDIOC_SUBDEV_ENUMSTD
Arguments
=========
......
......@@ -2,14 +2,14 @@
.. _VIDIOC_G_STD:
********************************
ioctl VIDIOC_G_STD, VIDIOC_S_STD
********************************
**************************************************************************
ioctl VIDIOC_G_STD, VIDIOC_S_STD, VIDIOC_SUBDEV_G_STD, VIDIOC_SUBDEV_S_STD
**************************************************************************
Name
====
VIDIOC_G_STD - VIDIOC_S_STD - Query or select the video standard of the current input
VIDIOC_G_STD - VIDIOC_S_STD - VIDIOC_SUBDEV_G_STD - VIDIOC_SUBDEV_S_STD - Query or select the video standard of the current input
Synopsis
......@@ -21,6 +21,12 @@ Synopsis
.. c:function:: int ioctl( int fd, VIDIOC_S_STD, const v4l2_std_id *argp )
:name: VIDIOC_S_STD
.. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_G_STD, v4l2_std_id *argp )
:name: VIDIOC_SUBDEV_G_STD
.. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_S_STD, const v4l2_std_id *argp )
:name: VIDIOC_SUBDEV_S_STD
Arguments
=========
......
......@@ -2,14 +2,14 @@
.. _VIDIOC_QUERYSTD:
*********************
ioctl VIDIOC_QUERYSTD
*********************
*********************************************
ioctl VIDIOC_QUERYSTD, VIDIOC_SUBDEV_QUERYSTD
*********************************************
Name
====
VIDIOC_QUERYSTD - Sense the video standard received by the current input
VIDIOC_QUERYSTD - VIDIOC_SUBDEV_QUERYSTD - Sense the video standard received by the current input
Synopsis
......@@ -18,6 +18,9 @@ Synopsis
.. c:function:: int ioctl( int fd, VIDIOC_QUERYSTD, v4l2_std_id *argp )
:name: VIDIOC_QUERYSTD
.. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_QUERYSTD, v4l2_std_id *argp )
:name: VIDIOC_SUBDEV_QUERYSTD
Arguments
=========
......
......@@ -29,6 +29,7 @@ to brightness information.
pixfmt-y10
pixfmt-y12
pixfmt-y10b
pixfmt-y10p
pixfmt-y16
pixfmt-y16-be
pixfmt-y8i
......
......@@ -7,34 +7,34 @@ Introduction
------------
This file documents the Qualcomm Camera Subsystem driver located under
drivers/media/platform/qcom/camss-8x16.
drivers/media/platform/qcom/camss.
The current version of the driver supports the Camera Subsystem found on
Qualcomm MSM8916 and APQ8016 processors.
Qualcomm MSM8916/APQ8016 and MSM8996/APQ8096 processors.
The driver implements V4L2, Media controller and V4L2 subdev interfaces.
Camera sensor using V4L2 subdev interface in the kernel is supported.
The driver is implemented using as a reference the Qualcomm Camera Subsystem
driver for Android as found in Code Aurora [#f1]_.
driver for Android as found in Code Aurora [#f1]_ [#f2]_.
Qualcomm Camera Subsystem hardware
----------------------------------
The Camera Subsystem hardware found on 8x16 processors and supported by the
driver consists of:
The Camera Subsystem hardware found on 8x16 / 8x96 processors and supported by
the driver consists of:
- 2 CSIPHY modules. They handle the Physical layer of the CSI2 receivers.
- 2 / 3 CSIPHY modules. They handle the Physical layer of the CSI2 receivers.
A separate camera sensor can be connected to each of the CSIPHY module;
- 2 CSID (CSI Decoder) modules. They handle the Protocol and Application layer
of the CSI2 receivers. A CSID can decode data stream from any of the CSIPHY.
Each CSID also contains a TG (Test Generator) block which can generate
- 2 / 4 CSID (CSI Decoder) modules. They handle the Protocol and Application
layer of the CSI2 receivers. A CSID can decode data stream from any of the
CSIPHY. Each CSID also contains a TG (Test Generator) block which can generate
artificial input data for test purposes;
- ISPIF (ISP Interface) module. Handles the routing of the data streams from
the CSIDs to the inputs of the VFE;
- VFE (Video Front End) module. Contains a pipeline of image processing hardware
blocks. The VFE has different input interfaces. The PIX (Pixel) input
- 1 / 2 VFE (Video Front End) module(s). Contain a pipeline of image processing
hardware blocks. The VFE has different input interfaces. The PIX (Pixel) input
interface feeds the input data to the image processing pipeline. The image
processing pipeline contains also a scale and crop module at the end. Three
RDI (Raw Dump Interface) input interfaces bypass the image processing
......@@ -49,18 +49,33 @@ The current version of the driver supports:
- Input from camera sensor via CSIPHY;
- Generation of test input data by the TG in CSID;
- RDI interface of VFE - raw dump of the input data to memory.
- RDI interface of VFE
Supported formats:
- Raw dump of the input data to memory.
- YUYV/UYVY/YVYU/VYUY (packed YUV 4:2:2 - V4L2_PIX_FMT_YUYV /
V4L2_PIX_FMT_UYVY / V4L2_PIX_FMT_YVYU / V4L2_PIX_FMT_VYUY);
- MIPI RAW8 (8bit Bayer RAW - V4L2_PIX_FMT_SRGGB8 /
V4L2_PIX_FMT_SGRBG8 / V4L2_PIX_FMT_SGBRG8 / V4L2_PIX_FMT_SBGGR8);
- MIPI RAW10 (10bit packed Bayer RAW - V4L2_PIX_FMT_SBGGR10P /
V4L2_PIX_FMT_SGBRG10P / V4L2_PIX_FMT_SGRBG10P / V4L2_PIX_FMT_SRGGB10P);
- MIPI RAW12 (12bit packed Bayer RAW - V4L2_PIX_FMT_SRGGB12P /
V4L2_PIX_FMT_SGBRG12P / V4L2_PIX_FMT_SGRBG12P / V4L2_PIX_FMT_SRGGB12P).
Supported formats:
- YUYV/UYVY/YVYU/VYUY (packed YUV 4:2:2 - V4L2_PIX_FMT_YUYV /
V4L2_PIX_FMT_UYVY / V4L2_PIX_FMT_YVYU / V4L2_PIX_FMT_VYUY);
- MIPI RAW8 (8bit Bayer RAW - V4L2_PIX_FMT_SRGGB8 /
V4L2_PIX_FMT_SGRBG8 / V4L2_PIX_FMT_SGBRG8 / V4L2_PIX_FMT_SBGGR8);
- MIPI RAW10 (10bit packed Bayer RAW - V4L2_PIX_FMT_SBGGR10P /
V4L2_PIX_FMT_SGBRG10P / V4L2_PIX_FMT_SGRBG10P / V4L2_PIX_FMT_SRGGB10P /
V4L2_PIX_FMT_Y10P);
- MIPI RAW12 (12bit packed Bayer RAW - V4L2_PIX_FMT_SRGGB12P /
V4L2_PIX_FMT_SGBRG12P / V4L2_PIX_FMT_SGRBG12P / V4L2_PIX_FMT_SRGGB12P).
- (8x96 only) MIPI RAW14 (14bit packed Bayer RAW - V4L2_PIX_FMT_SRGGB14P /
V4L2_PIX_FMT_SGBRG14P / V4L2_PIX_FMT_SGRBG14P / V4L2_PIX_FMT_SRGGB14P).
- (8x96 only) Format conversion of the input data.
Supported input formats:
- MIPI RAW10 (10bit packed Bayer RAW - V4L2_PIX_FMT_SBGGR10P / V4L2_PIX_FMT_Y10P).
Supported output formats:
- Plain16 RAW10 (10bit unpacked Bayer RAW - V4L2_PIX_FMT_SBGGR10 / V4L2_PIX_FMT_Y10).
- PIX interface of VFE
......@@ -75,14 +90,16 @@ The current version of the driver supports:
- NV12/NV21 (two plane YUV 4:2:0 - V4L2_PIX_FMT_NV12 / V4L2_PIX_FMT_NV21);
- NV16/NV61 (two plane YUV 4:2:2 - V4L2_PIX_FMT_NV16 / V4L2_PIX_FMT_NV61).
- (8x96 only) YUYV/UYVY/YVYU/VYUY (packed YUV 4:2:2 - V4L2_PIX_FMT_YUYV /
V4L2_PIX_FMT_UYVY / V4L2_PIX_FMT_YVYU / V4L2_PIX_FMT_VYUY).
- Scaling support. Configuration of the VFE Encoder Scale module
for downscalling with ratio up to 16x.
- Cropping support. Configuration of the VFE Encoder Crop module.
- Concurrent and independent usage of two data inputs - could be camera sensors
and/or TG.
- Concurrent and independent usage of two (8x96: three) data inputs -
could be camera sensors and/or TG.
Driver Architecture and Design
......@@ -90,14 +107,14 @@ Driver Architecture and Design
The driver implements the V4L2 subdev interface. With the goal to model the
hardware links between the modules and to expose a clean, logical and usable
interface, the driver is split into V4L2 sub-devices as follows:
interface, the driver is split into V4L2 sub-devices as follows (8x16 / 8x96):
- 2 CSIPHY sub-devices - each CSIPHY is represented by a single sub-device;
- 2 CSID sub-devices - each CSID is represented by a single sub-device;
- 2 ISPIF sub-devices - ISPIF is represented by a number of sub-devices equal
to the number of CSID sub-devices;
- 4 VFE sub-devices - VFE is represented by a number of sub-devices equal to
the number of the input interfaces (3 RDI and 1 PIX).
- 2 / 3 CSIPHY sub-devices - each CSIPHY is represented by a single sub-device;
- 2 / 4 CSID sub-devices - each CSID is represented by a single sub-device;
- 2 / 4 ISPIF sub-devices - ISPIF is represented by a number of sub-devices
equal to the number of CSID sub-devices;
- 4 / 8 VFE sub-devices - VFE is represented by a number of sub-devices equal to
the number of the input interfaces (3 RDI and 1 PIX for each VFE).
The considerations to split the driver in this particular way are as follows:
......@@ -115,8 +132,8 @@ The considerations to split the driver in this particular way are as follows:
Each VFE sub-device is linked to a separate video device node.
The media controller pipeline graph is as follows (with connected two OV5645
camera sensors):
The media controller pipeline graph is as follows (with connected two / three
OV5645 camera sensors):
.. _qcom_camss_graph:
......@@ -124,7 +141,13 @@ camera sensors):
:alt: qcom_camss_graph.dot
:align: center
Media pipeline graph
Media pipeline graph 8x16
.. kernel-figure:: qcom_camss_8x96_graph.dot
:alt: qcom_camss_8x96_graph.dot
:align: center
Media pipeline graph 8x96
Implementation
......@@ -149,8 +172,12 @@ APQ8016 Specification:
https://developer.qualcomm.com/download/sd410/snapdragon-410-processor-device-specification.pdf
Referenced 2016-11-24.
APQ8096 Specification:
https://developer.qualcomm.com/download/sd820e/qualcomm-snapdragon-820e-processor-apq8096sge-device-specification.pdf
Referenced 2018-06-22.
References
----------
.. [#f1] https://source.codeaurora.org/quic/la/kernel/msm-3.10/
.. [#f2] https://source.codeaurora.org/quic/la/kernel/msm-3.18/
digraph board {
rankdir=TB
n00000001 [label="{{<port0> 0} | msm_csiphy0\n/dev/v4l-subdev0 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000001:port1 -> n0000000a:port0 [style=dashed]
n00000001:port1 -> n0000000d:port0 [style=dashed]
n00000001:port1 -> n00000010:port0 [style=dashed]
n00000001:port1 -> n00000013:port0 [style=dashed]
n00000004 [label="{{<port0> 0} | msm_csiphy1\n/dev/v4l-subdev1 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000004:port1 -> n0000000a:port0 [style=dashed]
n00000004:port1 -> n0000000d:port0 [style=dashed]
n00000004:port1 -> n00000010:port0 [style=dashed]
n00000004:port1 -> n00000013:port0 [style=dashed]
n00000007 [label="{{<port0> 0} | msm_csiphy2\n/dev/v4l-subdev2 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000007:port1 -> n0000000a:port0 [style=dashed]
n00000007:port1 -> n0000000d:port0 [style=dashed]
n00000007:port1 -> n00000010:port0 [style=dashed]
n00000007:port1 -> n00000013:port0 [style=dashed]
n0000000a [label="{{<port0> 0} | msm_csid0\n/dev/v4l-subdev3 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n0000000a:port1 -> n00000016:port0 [style=dashed]
n0000000a:port1 -> n00000019:port0 [style=dashed]
n0000000a:port1 -> n0000001c:port0 [style=dashed]
n0000000a:port1 -> n0000001f:port0 [style=dashed]
n0000000d [label="{{<port0> 0} | msm_csid1\n/dev/v4l-subdev4 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n0000000d:port1 -> n00000016:port0 [style=dashed]
n0000000d:port1 -> n00000019:port0 [style=dashed]
n0000000d:port1 -> n0000001c:port0 [style=dashed]
n0000000d:port1 -> n0000001f:port0 [style=dashed]
n00000010 [label="{{<port0> 0} | msm_csid2\n/dev/v4l-subdev5 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000010:port1 -> n00000016:port0 [style=dashed]
n00000010:port1 -> n00000019:port0 [style=dashed]
n00000010:port1 -> n0000001c:port0 [style=dashed]
n00000010:port1 -> n0000001f:port0 [style=dashed]
n00000013 [label="{{<port0> 0} | msm_csid3\n/dev/v4l-subdev6 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000013:port1 -> n00000016:port0 [style=dashed]
n00000013:port1 -> n00000019:port0 [style=dashed]
n00000013:port1 -> n0000001c:port0 [style=dashed]
n00000013:port1 -> n0000001f:port0 [style=dashed]
n00000016 [label="{{<port0> 0} | msm_ispif0\n/dev/v4l-subdev7 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000016:port1 -> n00000022:port0 [style=dashed]
n00000016:port1 -> n0000002b:port0 [style=dashed]
n00000016:port1 -> n00000034:port0 [style=dashed]
n00000016:port1 -> n0000003d:port0 [style=dashed]
n00000016:port1 -> n00000046:port0 [style=dashed]
n00000016:port1 -> n0000004f:port0 [style=dashed]
n00000016:port1 -> n00000058:port0 [style=dashed]
n00000016:port1 -> n00000061:port0 [style=dashed]
n00000019 [label="{{<port0> 0} | msm_ispif1\n/dev/v4l-subdev8 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000019:port1 -> n00000022:port0 [style=dashed]
n00000019:port1 -> n0000002b:port0 [style=dashed]
n00000019:port1 -> n00000034:port0 [style=dashed]
n00000019:port1 -> n0000003d:port0 [style=dashed]
n00000019:port1 -> n00000046:port0 [style=dashed]
n00000019:port1 -> n0000004f:port0 [style=dashed]
n00000019:port1 -> n00000058:port0 [style=dashed]
n00000019:port1 -> n00000061:port0 [style=dashed]
n0000001c [label="{{<port0> 0} | msm_ispif2\n/dev/v4l-subdev9 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n0000001c:port1 -> n00000022:port0 [style=dashed]
n0000001c:port1 -> n0000002b:port0 [style=dashed]
n0000001c:port1 -> n00000034:port0 [style=dashed]
n0000001c:port1 -> n0000003d:port0 [style=dashed]
n0000001c:port1 -> n00000046:port0 [style=dashed]
n0000001c:port1 -> n0000004f:port0 [style=dashed]
n0000001c:port1 -> n00000058:port0 [style=dashed]
n0000001c:port1 -> n00000061:port0 [style=dashed]
n0000001f [label="{{<port0> 0} | msm_ispif3\n/dev/v4l-subdev10 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n0000001f:port1 -> n00000022:port0 [style=dashed]
n0000001f:port1 -> n0000002b:port0 [style=dashed]
n0000001f:port1 -> n00000034:port0 [style=dashed]
n0000001f:port1 -> n0000003d:port0 [style=dashed]
n0000001f:port1 -> n00000046:port0 [style=dashed]
n0000001f:port1 -> n0000004f:port0 [style=dashed]
n0000001f:port1 -> n00000058:port0 [style=dashed]
n0000001f:port1 -> n00000061:port0 [style=dashed]
n00000022 [label="{{<port0> 0} | msm_vfe0_rdi0\n/dev/v4l-subdev11 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000022:port1 -> n00000025 [style=bold]
n00000025 [label="msm_vfe0_video0\n/dev/video0", shape=box, style=filled, fillcolor=yellow]
n0000002b [label="{{<port0> 0} | msm_vfe0_rdi1\n/dev/v4l-subdev12 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n0000002b:port1 -> n0000002e [style=bold]
n0000002e [label="msm_vfe0_video1\n/dev/video1", shape=box, style=filled, fillcolor=yellow]
n00000034 [label="{{<port0> 0} | msm_vfe0_rdi2\n/dev/v4l-subdev13 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000034:port1 -> n00000037 [style=bold]
n00000037 [label="msm_vfe0_video2\n/dev/video2", shape=box, style=filled, fillcolor=yellow]
n0000003d [label="{{<port0> 0} | msm_vfe0_pix\n/dev/v4l-subdev14 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n0000003d:port1 -> n00000040 [style=bold]
n00000040 [label="msm_vfe0_video3\n/dev/video3", shape=box, style=filled, fillcolor=yellow]
n00000046 [label="{{<port0> 0} | msm_vfe1_rdi0\n/dev/v4l-subdev15 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000046:port1 -> n00000049 [style=bold]
n00000049 [label="msm_vfe1_video0\n/dev/video4", shape=box, style=filled, fillcolor=yellow]
n0000004f [label="{{<port0> 0} | msm_vfe1_rdi1\n/dev/v4l-subdev16 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n0000004f:port1 -> n00000052 [style=bold]
n00000052 [label="msm_vfe1_video1\n/dev/video5", shape=box, style=filled, fillcolor=yellow]
n00000058 [label="{{<port0> 0} | msm_vfe1_rdi2\n/dev/v4l-subdev17 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000058:port1 -> n0000005b [style=bold]
n0000005b [label="msm_vfe1_video2\n/dev/video6", shape=box, style=filled, fillcolor=yellow]
n00000061 [label="{{<port0> 0} | msm_vfe1_pix\n/dev/v4l-subdev18 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
n00000061:port1 -> n00000064 [style=bold]
n00000064 [label="msm_vfe1_video3\n/dev/video7", shape=box, style=filled, fillcolor=yellow]
n000000e2 [label="{{} | ov5645 3-0039\n/dev/v4l-subdev19 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
n000000e2:port0 -> n00000004:port0 [style=bold]
n000000e4 [label="{{} | ov5645 3-003a\n/dev/v4l-subdev20 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
n000000e4:port0 -> n00000007:port0 [style=bold]
n000000e6 [label="{{} | ov5645 3-003b\n/dev/v4l-subdev21 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
n000000e6:port0 -> n00000001:port0 [style=bold]
}
......@@ -34,7 +34,4 @@ replace typedef video_displayformat_t :c:type:`video_displayformat`
replace typedef video_size_t :c:type:`video_size`
replace typedef video_stream_source_t :c:type:`video_stream_source`
replace typedef video_play_state_t :c:type:`video_play_state`
replace typedef video_highlight_t :c:type:`video_highlight`
replace typedef video_spu_t :c:type:`video_spu`
replace typedef video_spu_palette_t :c:type:`video_spu_palette`
replace typedef video_navi_pack_t :c:type:`video_navi_pack`
......@@ -517,7 +517,6 @@ ignore define V4L2_CTRL_WHICH_DEF_VAL
ignore define V4L2_OUT_CAP_CUSTOM_TIMINGS
ignore define V4L2_CID_MAX_CTRLS
ignore ioctl VIDIOC_RESERVED
ignore define BASE_VIDIOC_PRIVATE
# Associate ioctls with their counterparts
......
......@@ -2295,6 +2295,14 @@ L: linux-leds@vger.kernel.org
S: Maintained
F: drivers/leds/leds-as3645a.c
ASAHI KASEI AK7375 LENS VOICE COIL DRIVER
M: Tianshu Qiu <tian.shu.qiu@intel.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/ak7375.c
F: Documentation/devicetree/bindings/media/i2c/ak7375.txt
ASAHI KASEI AK8974 DRIVER
M: Linus Walleij <linus.walleij@linaro.org>
L: linux-iio@vger.kernel.org
......@@ -4436,6 +4444,13 @@ T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/dw9714.c
DONGWOON DW9807 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/dw9807.c
DOUBLETALK DRIVER
M: "James R. Van Zandt" <jrv@vanzandt.mv.com>
L: blinux-list@redhat.com
......@@ -5086,6 +5101,18 @@ T: git git://linuxtv.org/anttip/media_tree.git
S: Maintained
F: drivers/media/tuners/e4000*
EARTH_PT1 MEDIA DRIVER
M: Akihiro Tsukada <tskd08@gmail.com>
L: linux-media@vger.kernel.org
S: Odd Fixes
F: drivers/media/pci/pt1/
EARTH_PT3 MEDIA DRIVER
M: Akihiro Tsukada <tskd08@gmail.com>
L: linux-media@vger.kernel.org
S: Odd Fixes
F: drivers/media/pci/pt3/
EC100 MEDIA DRIVER
M: Antti Palosaari <crope@iki.fi>
L: linux-media@vger.kernel.org
......@@ -7276,6 +7303,9 @@ F: drivers/dma/iop-adma.c
INTEL IPU3 CSI-2 CIO2 DRIVER
M: Yong Zhi <yong.zhi@intel.com>
M: Sakari Ailus <sakari.ailus@linux.intel.com>
M: Bingbu Cao <bingbu.cao@intel.com>
R: Tian Shu Qiu <tian.shu.qiu@intel.com>
R: Jian Xu Zheng <jian.xu.zheng@intel.com>
L: linux-media@vger.kernel.org
S: Maintained
F: drivers/media/pci/intel/ipu3/
......@@ -8988,6 +9018,14 @@ T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/dvb-frontends/stv6111*
MEDIA DRIVERS FOR STM32 - DCMI
M: Hugues Fruchet <hugues.fruchet@st.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Supported
F: Documentation/devicetree/bindings/media/st,stm32-dcmi.txt
F: drivers/media/platform/stm32/stm32-dcmi.c
MEDIA DRIVERS FOR NVIDIA TEGRA - VDE
M: Dmitry Osipenko <digetx@gmail.com>
L: linux-media@vger.kernel.org
......@@ -9678,6 +9716,14 @@ F: Documentation/devicetree/bindings/media/i2c/mt9v032.txt
F: drivers/media/i2c/mt9v032.c
F: include/media/i2c/mt9v032.h
MT9V111 APTINA CAMERA SENSOR
M: Jacopo Mondi <jacopo@jmondi.org>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: Documentation/devicetree/bindings/media/i2c/aptina,mt9v111.txt
F: drivers/media/i2c/mt9v111.c
MULTIFUNCTION DEVICES (MFD)
M: Lee Jones <lee.jones@linaro.org>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
......@@ -9722,6 +9768,12 @@ L: linux-usb@vger.kernel.org
S: Maintained
F: drivers/usb/musb/
MXL301RF MEDIA DRIVER
M: Akihiro Tsukada <tskd08@gmail.com>
L: linux-media@vger.kernel.org
S: Odd Fixes
F: drivers/media/tuners/mxl301rf*
MXL5007T MEDIA DRIVER
M: Michael Krufky <mkrufky@linuxtv.org>
L: linux-media@vger.kernel.org
......@@ -10504,6 +10556,14 @@ T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/ov13858.c
OMNIVISION OV2680 SENSOR DRIVER
M: Rui Miguel Silva <rmfrfs@gmail.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Maintained
F: drivers/media/i2c/ov2680.c
F: Documentation/devicetree/bindings/media/i2c/ov2680.txt
OMNIVISION OV2685 SENSOR DRIVER
M: Shunqian Zheng <zhengsq@rock-chips.com>
L: linux-media@vger.kernel.org
......@@ -11807,6 +11867,18 @@ L: netdev@vger.kernel.org
S: Supported
F: drivers/net/ethernet/qlogic/qlge/
QM1D1B0004 MEDIA DRIVER
M: Akihiro Tsukada <tskd08@gmail.com>
L: linux-media@vger.kernel.org
S: Odd Fixes
F: drivers/media/tuners/qm1d1b0004*
QM1D1C0042 MEDIA DRIVER
M: Akihiro Tsukada <tskd08@gmail.com>
L: linux-media@vger.kernel.org
S: Odd Fixes
F: drivers/media/tuners/qm1d1c0042*
QNX4 FILESYSTEM
M: Anders Larsen <al@alarsen.net>
W: http://www.alarsen.net/linux/qnx4fs/
......@@ -11855,7 +11927,7 @@ L: linux-media@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/media/qcom,camss.txt
F: Documentation/media/v4l-drivers/qcom_camss.rst
F: drivers/media/platform/qcom/camss-8x16/
F: drivers/media/platform/qcom/camss/
QUALCOMM CPUFREQ DRIVER MSM8996/APQ8096
M: Ilia Lin <ilia.lin@gmail.com>
......@@ -12913,6 +12985,14 @@ W: http://www.ibm.com/developerworks/linux/linux390/
S: Supported
F: net/smc/
SHARP RJ54N1CB0C SENSOR DRIVER
M: Jacopo Mondi <jacopo@jmondi.org>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Odd fixes
F: drivers/media/i2c/rj54n1cb0c.c
F: include/media/i2c/rj54n1cb0c.h
SH_VEU V4L2 MEM2MEM DRIVER
L: linux-media@vger.kernel.org
S: Orphan
......@@ -13929,6 +14009,12 @@ F: include/uapi/linux/tc_act/
F: include/uapi/linux/tc_ematch/
F: net/sched/
TC90522 MEDIA DRIVER
M: Akihiro Tsukada <tskd08@gmail.com>
L: linux-media@vger.kernel.org
S: Odd Fixes
F: drivers/media/dvb-frontends/tc90522*
TCP LOW PRIORITY MODULE
M: "Wong Hoi Sing, Edison" <hswong3i@gmail.com>
M: "Hung Hing Lun, Mike" <hlhung3i@gmail.com>
......@@ -15218,6 +15304,14 @@ L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/ethernet/via/via-velocity.*
VICODEC VIRTUAL CODEC DRIVER
M: Hans Verkuil <hans.verkuil@cisco.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
W: https://linuxtv.org
S: Maintained
F: drivers/media/platform/vicodec/*
VIDEO MULTIPLEXER DRIVER
M: Philipp Zabel <p.zabel@pengutronix.de>
L: linux-media@vger.kernel.org
......
// SPDX-License-Identifier: GPL-2.0
/*
* Renesas - AP-325RXA
* (Compatible with Algo System ., LTD. - AP-320A)
*
* Copyright (C) 2008 Renesas Solutions Corp.
* Author : Yusuke Goda <goda.yuske@renesas.com>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <asm/clock.h>
#include <asm/io.h>
#include <asm/suspend.h>
#include <cpu/sh7723.h>
#include <linux/clkdev.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/memblock.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/sh_flctl.h>
#include <linux/mfd/tmio.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/sh_intc.h>
#include <linux/smsc911x.h>
#include <linux/gpio.h>
#include <linux/videodev2.h>
#include <linux/sh_intc.h>
#include <media/drv-intf/renesas-ceu.h>
#include <media/i2c/ov772x.h>
#include <media/soc_camera.h>
#include <linux/platform_data/media/soc_camera_platform.h>
#include <media/drv-intf/sh_mobile_ceu.h>
#include <video/sh_mobile_lcdc.h>
#include <asm/io.h>
#include <asm/clock.h>
#include <asm/suspend.h>
#include <cpu/sh7723.h>
#define CEU_BUFFER_MEMORY_SIZE (4 << 20)
static phys_addr_t ceu_dma_membase;
/* Dummy supplies, where voltage doesn't matter */
static struct regulator_consumer_supply dummy_supplies[] = {
......@@ -253,150 +258,25 @@ static struct platform_device lcdc_device = {
},
};
static void camera_power(int val)
{
gpio_set_value(GPIO_PTZ5, val); /* RST_CAM/RSTB */
mdelay(10);
}
#ifdef CONFIG_I2C
/* support for the old ncm03j camera */
static unsigned char camera_ncm03j_magic[] =
{
0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8,
0x1D, 0x00, 0x1E, 0x8A, 0x21, 0x00, 0x33, 0x36,
0x36, 0x60, 0x37, 0x08, 0x3B, 0x31, 0x44, 0x0F,
0x46, 0xF0, 0x4B, 0x28, 0x4C, 0x21, 0x4D, 0x55,
0x4E, 0x1B, 0x4F, 0xC7, 0x50, 0xFC, 0x51, 0x12,
0x58, 0x02, 0x66, 0xC0, 0x67, 0x46, 0x6B, 0xA0,
0x6C, 0x34, 0x7E, 0x25, 0x7F, 0x25, 0x8D, 0x0F,
0x92, 0x40, 0x93, 0x04, 0x94, 0x26, 0x95, 0x0A,
0x99, 0x03, 0x9A, 0xF0, 0x9B, 0x14, 0x9D, 0x7A,
0xC5, 0x02, 0xD6, 0x07, 0x59, 0x00, 0x5A, 0x1A,
0x5B, 0x2A, 0x5C, 0x37, 0x5D, 0x42, 0x5E, 0x56,
0xC8, 0x00, 0xC9, 0x1A, 0xCA, 0x2A, 0xCB, 0x37,
0xCC, 0x42, 0xCD, 0x56, 0xCE, 0x00, 0xCF, 0x1A,
0xD0, 0x2A, 0xD1, 0x37, 0xD2, 0x42, 0xD3, 0x56,
0x5F, 0x68, 0x60, 0x87, 0x61, 0xA3, 0x62, 0xBC,
0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F,
};
static int camera_probe(void)
{
struct i2c_adapter *a = i2c_get_adapter(0);
struct i2c_msg msg;
int ret;
if (!a)
return -ENODEV;
camera_power(1);
msg.addr = 0x6e;
msg.buf = camera_ncm03j_magic;
msg.len = 2;
msg.flags = 0;
ret = i2c_transfer(a, &msg, 1);
camera_power(0);
return ret;
}
static int camera_set_capture(struct soc_camera_platform_info *info,
int enable)
{
struct i2c_adapter *a = i2c_get_adapter(0);
struct i2c_msg msg;
int ret = 0;
int i;
camera_power(0);
if (!enable)
return 0; /* no disable for now */
camera_power(1);
for (i = 0; i < ARRAY_SIZE(camera_ncm03j_magic); i += 2) {
u_int8_t buf[8];
msg.addr = 0x6e;
msg.buf = buf;
msg.len = 2;
msg.flags = 0;
buf[0] = camera_ncm03j_magic[i];
buf[1] = camera_ncm03j_magic[i + 1];
ret = (ret < 0) ? ret : i2c_transfer(a, &msg, 1);
}
return ret;
}
static int ap325rxa_camera_add(struct soc_camera_device *icd);
static void ap325rxa_camera_del(struct soc_camera_device *icd);
static struct soc_camera_platform_info camera_info = {
.format_name = "UYVY",
.format_depth = 16,
.format = {
.code = MEDIA_BUS_FMT_UYVY8_2X8,
.colorspace = V4L2_COLORSPACE_SMPTE170M,
.field = V4L2_FIELD_NONE,
.width = 640,
.height = 480,
/* Powerdown/reset gpios for CEU image sensors */
static struct gpiod_lookup_table ov7725_gpios = {
.dev_id = "0-0021",
.table = {
GPIO_LOOKUP("sh7723_pfc", GPIO_PTZ5, "reset", GPIO_ACTIVE_LOW),
},
.mbus_param = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER |
V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH |
V4L2_MBUS_DATA_ACTIVE_HIGH,
.mbus_type = V4L2_MBUS_PARALLEL,
.set_capture = camera_set_capture,
};
static struct soc_camera_link camera_link = {
.bus_id = 0,
.add_device = ap325rxa_camera_add,
.del_device = ap325rxa_camera_del,
.module_name = "soc_camera_platform",
.priv = &camera_info,
};
static struct platform_device *camera_device;
static void ap325rxa_camera_release(struct device *dev)
{
soc_camera_platform_release(&camera_device);
}
static int ap325rxa_camera_add(struct soc_camera_device *icd)
{
int ret = soc_camera_platform_add(icd, &camera_device, &camera_link,
ap325rxa_camera_release, 0);
if (ret < 0)
return ret;
ret = camera_probe();
if (ret < 0)
soc_camera_platform_del(icd, camera_device, &camera_link);
return ret;
}
static void ap325rxa_camera_del(struct soc_camera_device *icd)
{
soc_camera_platform_del(icd, camera_device, &camera_link);
}
#endif /* CONFIG_I2C */
static int ov7725_power(struct device *dev, int mode)
{
camera_power(0);
if (mode)
camera_power(1);
return 0;
}
static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
.flags = SH_CEU_FLAG_USE_8BIT_BUS,
static struct ceu_platform_data ceu0_pdata = {
.num_subdevs = 1,
.subdevs = {
{ /* [0] = ov7725 */
.flags = 0,
.bus_width = 8,
.bus_shift = 0,
.i2c_adapter_id = 0,
.i2c_address = 0x21,
},
},
};
static struct resource ceu_resources[] = {
......@@ -410,18 +290,15 @@ static struct resource ceu_resources[] = {
.start = evt2irq(0x880),
.flags = IORESOURCE_IRQ,
},
[2] = {
/* place holder for contiguous memory */
},
};
static struct platform_device ceu_device = {
.name = "sh_mobile_ceu",
.id = 0, /* "ceu0" clock */
static struct platform_device ap325rxa_ceu_device = {
.name = "renesas-ceu",
.id = 0, /* "ceu.0" clock */
.num_resources = ARRAY_SIZE(ceu_resources),
.resource = ceu_resources,
.dev = {
.platform_data = &sh_mobile_ceu_info,
.platform_data = &ceu0_pdata,
},
};
......@@ -488,44 +365,18 @@ static struct platform_device sdhi1_cn7_device = {
},
};
static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
{
I2C_BOARD_INFO("pcf8563", 0x51),
},
};
static struct i2c_board_info ap325rxa_i2c_camera[] = {
{
I2C_BOARD_INFO("ov772x", 0x21),
},
};
static struct ov772x_camera_info ov7725_info = {
.flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
.edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
};
static struct soc_camera_link ov7725_link = {
.bus_id = 0,
.power = ov7725_power,
.board_info = &ap325rxa_i2c_camera[0],
.i2c_adapter_id = 0,
.priv = &ov7725_info,
};
static struct platform_device ap325rxa_camera[] = {
static struct i2c_board_info ap325rxa_i2c_devices[] __initdata = {
{
.name = "soc-camera-pdrv",
.id = 0,
.dev = {
.platform_data = &ov7725_link,
},
}, {
.name = "soc-camera-pdrv",
.id = 1,
.dev = {
.platform_data = &camera_link,
},
I2C_BOARD_INFO("pcf8563", 0x51),
},
{
I2C_BOARD_INFO("ov772x", 0x21),
.platform_data = &ov7725_info,
},
};
......@@ -533,12 +384,9 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
&smsc9118_device,
&ap325rxa_nor_flash_device,
&lcdc_device,
&ceu_device,
&nand_flash_device,
&sdhi0_cn3_device,
&sdhi1_cn7_device,
&ap325rxa_camera[0],
&ap325rxa_camera[1],
};
extern char ap325rxa_sdram_enter_start;
......@@ -649,8 +497,6 @@ static int __init ap325rxa_devices_setup(void)
__raw_writew(0xFFFF, PORT_DRVCRA);
__raw_writew(0xFFFF, PORT_DRVCRB);
platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
/* SDHI0 - CN3 - SD CARD */
gpio_request(GPIO_FN_SDHI0CD_PTD, NULL);
gpio_request(GPIO_FN_SDHI0WP_PTD, NULL);
......@@ -670,9 +516,25 @@ static int __init ap325rxa_devices_setup(void)
gpio_request(GPIO_FN_SDHI1CMD, NULL);
gpio_request(GPIO_FN_SDHI1CLK, NULL);
/* Add a clock alias for ov7725 xclk source. */
clk_add_alias(NULL, "0-0021", "video_clk", NULL);
/* Register RSTB gpio for ov7725 camera sensor. */
gpiod_add_lookup_table(&ov7725_gpios);
i2c_register_board_info(0, ap325rxa_i2c_devices,
ARRAY_SIZE(ap325rxa_i2c_devices));
/* Initialize CEU platform device separately to map memory first */
device_initialize(&ap325rxa_ceu_device.dev);
arch_setup_pdev_archdata(&ap325rxa_ceu_device);
dma_declare_coherent_memory(&ap325rxa_ceu_device.dev,
ceu_dma_membase, ceu_dma_membase,
ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1,
DMA_MEMORY_EXCLUSIVE);
platform_device_add(&ap325rxa_ceu_device);
return platform_add_devices(ap325rxa_devices,
ARRAY_SIZE(ap325rxa_devices));
}
......@@ -689,7 +551,21 @@ static int ap325rxa_mode_pins(void)
return MODE_PIN5 | MODE_PIN8;
}
/* Reserve a portion of memory for CEU buffers */
static void __init ap325rxa_mv_mem_reserve(void)
{
phys_addr_t phys;
phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
phys = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_ALLOC_ANYWHERE);
memblock_free(phys, size);
memblock_remove(phys, size);
ceu_dma_membase = phys;
}
static struct sh_machine_vector mv_ap325rxa __initmv = {
.mv_name = "AP-325RXA",
.mv_mode_pins = ap325rxa_mode_pins,
.mv_mem_reserve = ap325rxa_mv_mem_reserve,
};
// SPDX-License-Identifier: GPL-2.0
/*
* KFR2R09 board support code
*
* Copyright (C) 2009 Magnus Damm
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/mmc/host.h>
#include <linux/mfd/tmio.h>
#include <linux/mtd/physmap.h>
#include <linux/mtd/onenand.h>
#include <asm/clock.h>
#include <asm/io.h>
#include <asm/machvec.h>
#include <asm/suspend.h>
#include <cpu/sh7724.h>
#include <linux/clkdev.h>
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/input/sh_keysc.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/memblock.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/mtd/onenand.h>
#include <linux/mtd/physmap.h>
#include <linux/platform_data/lv5207lp.h>
#include <linux/platform_device.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/sh_intc.h>
#include <linux/usb/r8a66597.h>
#include <linux/videodev2.h>
#include <linux/sh_intc.h>
#include <mach/kfr2r09.h>
#include <media/drv-intf/renesas-ceu.h>
#include <media/i2c/rj54n1cb0c.h>
#include <media/soc_camera.h>
#include <media/drv-intf/sh_mobile_ceu.h>
#include <video/sh_mobile_lcdc.h>
#include <asm/suspend.h>
#include <asm/clock.h>
#include <asm/machvec.h>
#include <asm/io.h>
#include <cpu/sh7724.h>
#include <mach/kfr2r09.h>
#define CEU_BUFFER_MEMORY_SIZE (4 << 20)
static phys_addr_t ceu_dma_membase;
/* set VIO_CKO clock to 25MHz */
#define CEU_MCLK_FREQ 25000000
#define DRVCRB 0xA405018C
static struct mtd_partition kfr2r09_nor_flash_partitions[] =
{
......@@ -230,8 +242,17 @@ static struct platform_device kfr2r09_usb0_gadget_device = {
.resource = kfr2r09_usb0_gadget_resources,
};
static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
.flags = SH_CEU_FLAG_USE_8BIT_BUS,
static struct ceu_platform_data ceu_pdata = {
.num_subdevs = 1,
.subdevs = {
{ /* [0] = rj54n1cb0c */
.flags = 0,
.bus_width = 8,
.bus_shift = 0,
.i2c_adapter_id = 1,
.i2c_address = 0x50,
},
},
};
static struct resource kfr2r09_ceu_resources[] = {
......@@ -246,109 +267,35 @@ static struct resource kfr2r09_ceu_resources[] = {
.end = evt2irq(0x880),
.flags = IORESOURCE_IRQ,
},
[2] = {
/* place holder for contiguous memory */
},
};
static struct platform_device kfr2r09_ceu_device = {
.name = "sh_mobile_ceu",
.name = "renesas-ceu",
.id = 0, /* "ceu0" clock */
.num_resources = ARRAY_SIZE(kfr2r09_ceu_resources),
.resource = kfr2r09_ceu_resources,
.dev = {
.platform_data = &sh_mobile_ceu_info,
.platform_data = &ceu_pdata,
},
};
static struct i2c_board_info kfr2r09_i2c_camera = {
I2C_BOARD_INFO("rj54n1cb0c", 0x50),
};
static struct clk *camera_clk;
/* set VIO_CKO clock to 25MHz */
#define CEU_MCLK_FREQ 25000000
#define DRVCRB 0xA405018C
static int camera_power(struct device *dev, int mode)
{
int ret;
if (mode) {
long rate;
camera_clk = clk_get(NULL, "video_clk");
if (IS_ERR(camera_clk))
return PTR_ERR(camera_clk);
rate = clk_round_rate(camera_clk, CEU_MCLK_FREQ);
ret = clk_set_rate(camera_clk, rate);
if (ret < 0)
goto eclkrate;
/* set DRVCRB
*
* use 1.8 V for VccQ_VIO
* use 2.85V for VccQ_SR
*/
__raw_writew((__raw_readw(DRVCRB) & ~0x0003) | 0x0001, DRVCRB);
/* reset clear */
ret = gpio_request(GPIO_PTB4, NULL);
if (ret < 0)
goto eptb4;
ret = gpio_request(GPIO_PTB7, NULL);
if (ret < 0)
goto eptb7;
ret = gpio_direction_output(GPIO_PTB4, 1);
if (!ret)
ret = gpio_direction_output(GPIO_PTB7, 1);
if (ret < 0)
goto egpioout;
msleep(1);
ret = clk_enable(camera_clk); /* start VIO_CKO */
if (ret < 0)
goto eclkon;
return 0;
}
ret = 0;
clk_disable(camera_clk);
eclkon:
gpio_set_value(GPIO_PTB7, 0);
egpioout:
gpio_set_value(GPIO_PTB4, 0);
gpio_free(GPIO_PTB7);
eptb7:
gpio_free(GPIO_PTB4);
eptb4:
eclkrate:
clk_put(camera_clk);
return ret;
}
static struct rj54n1_pdata rj54n1_priv = {
.mclk_freq = CEU_MCLK_FREQ,
.ioctl_high = false,
};
static struct soc_camera_link rj54n1_link = {
.power = camera_power,
.board_info = &kfr2r09_i2c_camera,
.i2c_adapter_id = 1,
.priv = &rj54n1_priv,
static struct i2c_board_info kfr2r09_i2c_camera = {
I2C_BOARD_INFO("rj54n1cb0c", 0x50),
.platform_data = &rj54n1_priv,
};
static struct platform_device kfr2r09_camera = {
.name = "soc-camera-pdrv",
.id = 0,
.dev = {
.platform_data = &rj54n1_link,
static struct gpiod_lookup_table rj54n1_gpios = {
.dev_id = "1-0050",
.table = {
GPIO_LOOKUP("sh7724_pfc", GPIO_PTB4, "poweron",
GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("sh7724_pfc", GPIO_PTB7, "enable",
GPIO_ACTIVE_HIGH),
},
};
......@@ -393,8 +340,6 @@ static struct platform_device *kfr2r09_devices[] __initdata = {
&kfr2r09_nand_flash_device,
&kfr2r09_sh_keysc_device,
&kfr2r09_sh_lcdc_device,
&kfr2r09_ceu_device,
&kfr2r09_camera,
&kfr2r09_sh_sdhi0_device,
};
......@@ -533,6 +478,8 @@ extern char kfr2r09_sdram_leave_end;
static int __init kfr2r09_devices_setup(void)
{
static struct clk *camera_clk;
/* register board specific self-refresh code */
sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
SUSP_SH_RSTANDBY,
......@@ -622,8 +569,6 @@ static int __init kfr2r09_devices_setup(void)
gpio_request(GPIO_FN_VIO0_D1, NULL);
gpio_request(GPIO_FN_VIO0_D0, NULL);
platform_resource_setup_memory(&kfr2r09_ceu_device, "ceu", 4 << 20);
/* SDHI0 connected to yc304 */
gpio_request(GPIO_FN_SDHI0CD, NULL);
gpio_request(GPIO_FN_SDHI0D3, NULL);
......@@ -635,6 +580,36 @@ static int __init kfr2r09_devices_setup(void)
i2c_register_board_info(0, &kfr2r09_backlight_board_info, 1);
/* Set camera clock frequency and register and alias for rj54n1. */
camera_clk = clk_get(NULL, "video_clk");
if (!IS_ERR(camera_clk)) {
clk_set_rate(camera_clk,
clk_round_rate(camera_clk, CEU_MCLK_FREQ));
clk_put(camera_clk);
}
clk_add_alias(NULL, "1-0050", "video_clk", NULL);
/* set DRVCRB
*
* use 1.8 V for VccQ_VIO
* use 2.85V for VccQ_SR
*/
__raw_writew((__raw_readw(DRVCRB) & ~0x0003) | 0x0001, DRVCRB);
gpiod_add_lookup_table(&rj54n1_gpios);
i2c_register_board_info(1, &kfr2r09_i2c_camera, 1);
/* Initialize CEU platform device separately to map memory first */
device_initialize(&kfr2r09_ceu_device.dev);
arch_setup_pdev_archdata(&kfr2r09_ceu_device);
dma_declare_coherent_memory(&kfr2r09_ceu_device.dev,
ceu_dma_membase, ceu_dma_membase,
ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1,
DMA_MEMORY_EXCLUSIVE);
platform_device_add(&kfr2r09_ceu_device);
return platform_add_devices(kfr2r09_devices,
ARRAY_SIZE(kfr2r09_devices));
}
......@@ -651,10 +626,24 @@ static int kfr2r09_mode_pins(void)
return MODE_PIN0 | MODE_PIN1 | MODE_PIN5 | MODE_PIN8;
}
/* Reserve a portion of memory for CEU buffers */
static void __init kfr2r09_mv_mem_reserve(void)
{
phys_addr_t phys;
phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
phys = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_ALLOC_ANYWHERE);
memblock_free(phys, size);
memblock_remove(phys, size);
ceu_dma_membase = phys;
}
/*
* The Machine Vector
*/
static struct sh_machine_vector mv_kfr2r09 __initmv = {
.mv_name = "kfr2r09",
.mv_mode_pins = kfr2r09_mode_pins,
.mv_mem_reserve = kfr2r09_mv_mem_reserve,
};
......@@ -28,7 +28,6 @@
#include <video/sh_mobile_lcdc.h>
#include <media/drv-intf/renesas-ceu.h>
#include <media/i2c/ov772x.h>
#include <media/soc_camera.h>
#include <media/i2c/tw9910.h>
#include <asm/clock.h>
#include <asm/machvec.h>
......@@ -351,8 +350,9 @@ static struct platform_device migor_ceu_device = {
static struct gpiod_lookup_table ov7725_gpios = {
.dev_id = "0-0021",
.table = {
GPIO_LOOKUP("sh7722_pfc", GPIO_PTT0, "pwdn", GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("sh7722_pfc", GPIO_PTT3, "rstb", GPIO_ACTIVE_LOW),
GPIO_LOOKUP("sh7722_pfc", GPIO_PTT0, "powerdown",
GPIO_ACTIVE_HIGH),
GPIO_LOOKUP("sh7722_pfc", GPIO_PTT3, "reset", GPIO_ACTIVE_LOW),
},
};
......@@ -592,7 +592,7 @@ static int __init migor_devices_setup(void)
}
/* Add a clock alias for ov7725 xclk source. */
clk_add_alias("xclk", "0-0021", "video_clk", NULL);
clk_add_alias(NULL, "0-0021", "video_clk", NULL);
/* Register GPIOs for video sources. */
gpiod_add_lookup_table(&ov7725_gpios);
......
// SPDX-License-Identifier: GPL-2.0
/*
* linux/arch/sh/boards/se/7724/setup.c
*
* Copyright (C) 2009 Renesas Solutions Corp.
*
* Kuninori Morimoto <morimoto.kuninori@renesas.com>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <asm/clock.h>
#include <asm/heartbeat.h>
#include <asm/io.h>
#include <asm/suspend.h>
#include <linux/init.h>
#include <cpu/sh7724.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/input/sh_keysc.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/mmc/host.h>
#include <linux/memblock.h>
#include <linux/mfd/tmio.h>
#include <linux/mmc/host.h>
#include <linux/mtd/physmap.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/smc91x.h>
#include <linux/gpio.h>
#include <linux/input.h>
#include <linux/input/sh_keysc.h>
#include <linux/usb/r8a66597.h>
#include <linux/sh_eth.h>
#include <linux/sh_intc.h>
#include <linux/smc91x.h>
#include <linux/usb/r8a66597.h>
#include <linux/videodev2.h>
#include <video/sh_mobile_lcdc.h>
#include <media/drv-intf/sh_mobile_ceu.h>
#include <mach-se/mach/se7724.h>
#include <media/drv-intf/renesas-ceu.h>
#include <sound/sh_fsi.h>
#include <sound/simple_card.h>
#include <asm/io.h>
#include <asm/heartbeat.h>
#include <asm/clock.h>
#include <asm/suspend.h>
#include <cpu/sh7724.h>
#include <mach-se/mach/se7724.h>
#include <video/sh_mobile_lcdc.h>
#define CEU_BUFFER_MEMORY_SIZE (4 << 20)
static phys_addr_t ceu0_dma_membase;
static phys_addr_t ceu1_dma_membase;
/*
* SWx 1234 5678
......@@ -216,8 +222,8 @@ static struct platform_device lcdc_device = {
};
/* CEU0 */
static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {
.flags = SH_CEU_FLAG_USE_8BIT_BUS,
static struct ceu_platform_data ceu0_pdata = {
.num_subdevs = 0,
};
static struct resource ceu0_resources[] = {
......@@ -231,24 +237,21 @@ static struct resource ceu0_resources[] = {
.start = evt2irq(0x880),
.flags = IORESOURCE_IRQ,
},
[2] = {
/* place holder for contiguous memory */
},
};
static struct platform_device ceu0_device = {
.name = "sh_mobile_ceu",
.id = 0, /* "ceu0" clock */
.name = "renesas-ceu",
.id = 0, /* "ceu.0" clock */
.num_resources = ARRAY_SIZE(ceu0_resources),
.resource = ceu0_resources,
.dev = {
.platform_data = &sh_mobile_ceu0_info,
.platform_data = &ceu0_pdata,
},
};
/* CEU1 */
static struct sh_mobile_ceu_info sh_mobile_ceu1_info = {
.flags = SH_CEU_FLAG_USE_8BIT_BUS,
static struct ceu_platform_data ceu1_pdata = {
.num_subdevs = 0,
};
static struct resource ceu1_resources[] = {
......@@ -262,18 +265,15 @@ static struct resource ceu1_resources[] = {
.start = evt2irq(0x9e0),
.flags = IORESOURCE_IRQ,
},
[2] = {
/* place holder for contiguous memory */
},
};
static struct platform_device ceu1_device = {
.name = "sh_mobile_ceu",
.id = 1, /* "ceu1" clock */
.name = "renesas-ceu",
.id = 1, /* "ceu.1" clock */
.num_resources = ARRAY_SIZE(ceu1_resources),
.resource = ceu1_resources,
.dev = {
.platform_data = &sh_mobile_ceu1_info,
.platform_data = &ceu1_pdata,
},
};
......@@ -574,13 +574,16 @@ static struct platform_device vou_device = {
},
};
static struct platform_device *ms7724se_ceu_devices[] __initdata = {
&ceu0_device,
&ceu1_device,
};
static struct platform_device *ms7724se_devices[] __initdata = {
&heartbeat_device,
&smc91x_eth_device,
&lcdc_device,
&nor_flash_device,
&ceu0_device,
&ceu1_device,
&keysc_device,
&sh_eth_device,
&sh7724_usb0_host_device,
......@@ -797,7 +800,6 @@ static int __init devices_setup(void)
gpio_request(GPIO_FN_VIO0_CLK, NULL);
gpio_request(GPIO_FN_VIO0_FLD, NULL);
gpio_request(GPIO_FN_VIO0_HD, NULL);
platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20);
/* enable CEU1 */
gpio_request(GPIO_FN_VIO1_D7, NULL);
......@@ -812,7 +814,6 @@ static int __init devices_setup(void)
gpio_request(GPIO_FN_VIO1_HD, NULL);
gpio_request(GPIO_FN_VIO1_VD, NULL);
gpio_request(GPIO_FN_VIO1_CLK, NULL);
platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);
/* KEYSC */
gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
......@@ -934,12 +935,49 @@ static int __init devices_setup(void)
gpio_request(GPIO_FN_DV_VSYNC, NULL);
gpio_request(GPIO_FN_DV_HSYNC, NULL);
/* Initialize CEU platform devices separately to map memory first */
device_initialize(&ms7724se_ceu_devices[0]->dev);
arch_setup_pdev_archdata(ms7724se_ceu_devices[0]);
dma_declare_coherent_memory(&ms7724se_ceu_devices[0]->dev,
ceu0_dma_membase, ceu0_dma_membase,
ceu0_dma_membase +
CEU_BUFFER_MEMORY_SIZE - 1,
DMA_MEMORY_EXCLUSIVE);
platform_device_add(ms7724se_ceu_devices[0]);
device_initialize(&ms7724se_ceu_devices[1]->dev);
arch_setup_pdev_archdata(ms7724se_ceu_devices[1]);
dma_declare_coherent_memory(&ms7724se_ceu_devices[1]->dev,
ceu1_dma_membase, ceu1_dma_membase,
ceu1_dma_membase +
CEU_BUFFER_MEMORY_SIZE - 1,
DMA_MEMORY_EXCLUSIVE);
platform_device_add(ms7724se_ceu_devices[1]);
return platform_add_devices(ms7724se_devices,
ARRAY_SIZE(ms7724se_devices));
}
device_initcall(devices_setup);
/* Reserve a portion of memory for CEU 0 and CEU 1 buffers */
static void __init ms7724se_mv_mem_reserve(void)
{
phys_addr_t phys;
phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
phys = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_ALLOC_ANYWHERE);
memblock_free(phys, size);
memblock_remove(phys, size);
ceu0_dma_membase = phys;
phys = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_ALLOC_ANYWHERE);
memblock_free(phys, size);
memblock_remove(phys, size);
ceu1_dma_membase = phys;
}
static struct sh_machine_vector mv_ms7724se __initmv = {
.mv_name = "ms7724se",
.mv_init_irq = init_se7724_IRQ,
.mv_mem_reserve = ms7724se_mv_mem_reserve,
};
......@@ -260,7 +260,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("veu1", &mstp_clks[HWBLK_VEU2H1]),
CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]),
CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU]),
CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[HWBLK_CEU]),
CLKDEV_DEV_ID("ceu.0", &mstp_clks[HWBLK_CEU]),
CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]),
CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
......
......@@ -28,6 +28,7 @@
*/
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/acpi.h>
#include <linux/slab.h>
......
......@@ -74,7 +74,7 @@ void cec_queue_event_fh(struct cec_fh *fh,
const struct cec_event *new_ev, u64 ts)
{
static const u16 max_events[CEC_NUM_EVENTS] = {
1, 1, 800, 800, 8, 8,
1, 1, 800, 800, 8, 8, 8, 8
};
struct cec_event_entry *entry;
unsigned int ev_idx = new_ev->event - 1;
......@@ -176,6 +176,22 @@ void cec_queue_pin_hpd_event(struct cec_adapter *adap, bool is_high, ktime_t ts)
}
EXPORT_SYMBOL_GPL(cec_queue_pin_hpd_event);
/* Notify userspace that the 5V pin changed state at the given time. */
void cec_queue_pin_5v_event(struct cec_adapter *adap, bool is_high, ktime_t ts)
{
struct cec_event ev = {
.event = is_high ? CEC_EVENT_PIN_5V_HIGH :
CEC_EVENT_PIN_5V_LOW,
};
struct cec_fh *fh;
mutex_lock(&adap->devnode.lock);
list_for_each_entry(fh, &adap->devnode.fhs, list)
cec_queue_event_fh(fh, &ev, ktime_to_ns(ts));
mutex_unlock(&adap->devnode.lock);
}
EXPORT_SYMBOL_GPL(cec_queue_pin_5v_event);
/*
* Queue a new message for this filehandle.
*
......
......@@ -579,6 +579,14 @@ static int cec_open(struct inode *inode, struct file *filp)
cec_queue_event_fh(fh, &ev, 0);
}
}
if (adap->pin && adap->pin->ops->read_5v) {
err = adap->pin->ops->read_5v(adap);
if (err >= 0) {
ev.event = err ? CEC_EVENT_PIN_5V_HIGH :
CEC_EVENT_PIN_5V_LOW;
cec_queue_event_fh(fh, &ev, 0);
}
}
#endif
list_add(&fh->list, &devnode->fhs);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1391,7 +1391,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
struct dvb_ca_slot *sl;
slot = info->num;
if ((slot > ca->slot_count) || (slot < 0)) {
if ((slot >= ca->slot_count) || (slot < 0)) {
err = -EINVAL;
goto out_unlock;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment