cron job: media_tree daily build: ERRORS
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Wed Jan 4 05:00:10 CET 2017 media-tree git hash:40eca140c404505c09773d1c6685d818cb55ab1a media_build git hash: 1606032398b1d79149c1507be2029e1a00d8dff0 v4l-utils git hash: 951c4878a93f4722146f8bc6515a47fba6470bb3 gcc version:i686-linux-gcc (GCC) 6.2.0 sparse version: v0.5.0-3553-g78b2ea6 smatch version: v0.5.0-3553-g78b2ea6 host hardware: x86_64 host os:4.8.0-164 linux-git-arm-at91: OK linux-git-arm-davinci: OK linux-git-arm-multi: OK linux-git-arm-pxa: OK linux-git-blackfin-bf561: OK linux-git-i686: OK linux-git-m32r: OK linux-git-mips: OK linux-git-powerpc64: OK linux-git-sh: OK linux-git-x86_64: OK linux-2.6.36.4-i686: ERRORS linux-2.6.37.6-i686: ERRORS linux-2.6.38.8-i686: ERRORS linux-2.6.39.4-i686: ERRORS linux-3.0.60-i686: ERRORS linux-3.1.10-i686: ERRORS linux-3.2.37-i686: ERRORS linux-3.3.8-i686: ERRORS linux-3.4.27-i686: ERRORS linux-3.5.7-i686: ERRORS linux-3.6.11-i686: ERRORS linux-3.7.4-i686: ERRORS linux-3.8-i686: ERRORS linux-3.9.2-i686: ERRORS linux-3.10.1-i686: ERRORS linux-3.11.1-i686: ERRORS linux-3.12.67-i686: ERRORS linux-3.13.11-i686: ERRORS linux-3.14.9-i686: ERRORS linux-3.15.2-i686: ERRORS linux-3.16.7-i686: ERRORS linux-3.17.8-i686: ERRORS linux-3.18.7-i686: ERRORS linux-3.19-i686: ERRORS linux-4.0.9-i686: ERRORS linux-4.1.33-i686: ERRORS linux-4.2.8-i686: ERRORS linux-4.3.6-i686: ERRORS linux-4.4.22-i686: ERRORS linux-4.5.7-i686: ERRORS linux-4.6.7-i686: ERRORS linux-4.7.5-i686: ERRORS linux-4.8-i686: ERRORS linux-4.9-i686: ERRORS linux-2.6.36.4-x86_64: ERRORS linux-2.6.37.6-x86_64: ERRORS linux-2.6.38.8-x86_64: ERRORS linux-2.6.39.4-x86_64: ERRORS linux-3.0.60-x86_64: ERRORS linux-3.1.10-x86_64: ERRORS linux-3.2.37-x86_64: ERRORS linux-3.3.8-x86_64: ERRORS linux-3.4.27-x86_64: ERRORS linux-3.5.7-x86_64: ERRORS linux-3.6.11-x86_64: ERRORS linux-3.7.4-x86_64: ERRORS linux-3.8-x86_64: ERRORS linux-3.9.2-x86_64: ERRORS linux-3.10.1-x86_64: ERRORS linux-3.11.1-x86_64: ERRORS linux-3.12.67-x86_64: ERRORS linux-3.13.11-x86_64: ERRORS linux-3.14.9-x86_64: ERRORS linux-3.15.2-x86_64: ERRORS linux-3.16.7-x86_64: ERRORS linux-3.17.8-x86_64: ERRORS linux-3.18.7-x86_64: ERRORS linux-3.19-x86_64: ERRORS linux-4.0.9-x86_64: ERRORS linux-4.1.33-x86_64: ERRORS linux-4.2.8-x86_64: ERRORS linux-4.3.6-x86_64: ERRORS linux-4.4.22-x86_64: ERRORS linux-4.5.7-x86_64: ERRORS linux-4.6.7-x86_64: ERRORS linux-4.7.5-x86_64: ERRORS linux-4.8-x86_64: ERRORS linux-4.9-x86_64: ERRORS apps: WARNINGS spec-git: ERRORS sparse: WARNINGS Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Wednesday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Wednesday.tar.bz2 The Media Infrastructure API from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/index.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 1/7] [media] dt-bindings: Add a binding for Video Data Order Adapter
On Mon, Jan 02, 2017 at 02:23:46PM +0100, Michael Tretter wrote: > From: Philipp Zabel> > Add a DT binding documentation for the Video Data Order Adapter (VDOA) > of the Freescale i.MX6 SoC. > > Also, add the compatible property and correct clock to the device tree > to match the documentation. > > Signed-off-by: Philipp Zabel > Signed-off-by: Michael Tretter > --- > .../devicetree/bindings/media/fsl-vdoa.txt | 21 > + > arch/arm/boot/dts/imx6qdl.dtsi | 2 ++ > 2 files changed, 23 insertions(+) > create mode 100644 Documentation/devicetree/bindings/media/fsl-vdoa.txt Acked-by: Rob Herring -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] uapi: use wildcards to list files
On Tuesday, January 3, 2017 3:35:44 PM CET Nicolas Dichtel wrote: > Regularly, when a new header is created in include/uapi/, the developer > forgets to add it in the corresponding Kbuild file. This error is usually > detected after the release is out. > > In fact, all headers under include/uapi/ should be exported, so let's > use wildcards. I think the idea makes a lot of sense: if a header is in uapi, we should really export it. However, using a wildcard expression seems a bit backwards here, I think we should make this implicit and not have the Kbuild file at all. The "header-y" syntax was originally added back when the uapi headers were mixed with the internal headers in the same directory. After David Howells introduced the separate directory for uapi, it has become a bit redundant. Can you try to modify scripts/Makefile.headersinst instead so we can simply remove the Kbuild files entirely? Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 00/19] i.MX Media Driver
On Tue, Jan 3, 2017 at 6:57 PM, Steve Longerbeamwrote: > In version 2 (no functional changes): > > - removed patch "gpio: pca953x: Add optional reset gpio control", it > has been submitted separately. > - fixed some whitespace errors. > - added a few missing Signed-off-by's. Tested the series on a mx6qsabresd, so: Tested-by: Fabio Estevam -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 11/20] media: Add i.MX media core driver
On Thu, Dec 29, 2016 at 02:27:26PM -0800, Steve Longerbeam wrote: > Add the core media driver for i.MX SOC. > > Signed-off-by: Steve Longerbeam> --- > Documentation/devicetree/bindings/media/imx.txt | 205 + > Documentation/media/v4l-drivers/imx.rst | 429 ++ > drivers/staging/media/Kconfig | 2 + > drivers/staging/media/Makefile| 1 + > drivers/staging/media/imx/Kconfig | 8 + > drivers/staging/media/imx/Makefile| 6 + > drivers/staging/media/imx/TODO| 18 + > drivers/staging/media/imx/imx-media-common.c | 981 > ++ > drivers/staging/media/imx/imx-media-dev.c | 479 +++ > drivers/staging/media/imx/imx-media-fim.c | 508 +++ > drivers/staging/media/imx/imx-media-internal-sd.c | 456 ++ > drivers/staging/media/imx/imx-media-of.c | 291 +++ > drivers/staging/media/imx/imx-media-of.h | 25 + > drivers/staging/media/imx/imx-media.h | 290 +++ > include/media/imx.h | 15 + > include/uapi/Kbuild | 1 + > include/uapi/linux/v4l2-controls.h| 4 + > include/uapi/media/Kbuild | 2 + > include/uapi/media/imx.h | 30 + > 19 files changed, 3751 insertions(+) > create mode 100644 Documentation/devicetree/bindings/media/imx.txt > create mode 100644 Documentation/media/v4l-drivers/imx.rst > create mode 100644 drivers/staging/media/imx/Kconfig > create mode 100644 drivers/staging/media/imx/Makefile > create mode 100644 drivers/staging/media/imx/TODO > create mode 100644 drivers/staging/media/imx/imx-media-common.c > create mode 100644 drivers/staging/media/imx/imx-media-dev.c > create mode 100644 drivers/staging/media/imx/imx-media-fim.c > create mode 100644 drivers/staging/media/imx/imx-media-internal-sd.c > create mode 100644 drivers/staging/media/imx/imx-media-of.c > create mode 100644 drivers/staging/media/imx/imx-media-of.h > create mode 100644 drivers/staging/media/imx/imx-media.h > create mode 100644 include/media/imx.h > create mode 100644 include/uapi/media/Kbuild > create mode 100644 include/uapi/media/imx.h > > diff --git a/Documentation/devicetree/bindings/media/imx.txt > b/Documentation/devicetree/bindings/media/imx.txt > new file mode 100644 > index 000..3593354 > --- /dev/null > +++ b/Documentation/devicetree/bindings/media/imx.txt > @@ -0,0 +1,205 @@ > +Freescale i.MX Media Video Devices > + > +Video Media Controller node > +--- > + > +This is the parent media controller node for video capture support. > + > +Required properties: > +- compatible : "fsl,imx-media"; > +- ports : Should contain a list of phandles pointing to camera > +sensor interface ports of IPU devices > + > + > +fim child node > +-- > + > +This is an optional child node of the ipu_csi port nodes. It can be used > +to modify the default control values for the video capture Frame > +Interval Monitor. Refer to Documentation/media/v4l-drivers/imx.rst for > +more info on the Frame Interval Monitor. > + > +Optional properties: > +- enable : enable (1) or disable (0) the FIM; "status" property doesn't work for you? > +- num-avg : how many frame intervals the FIM will average; > +- num-skip: how many frames the FIM will skip after a video > + capture restart before beginning to sample frame > + intervals; > +- tolerance-range : a range of tolerances for the averaged frame > + interval error, specified as , in usec. > + The FIM will signal a frame interval error if > + min < error < max. If the max is <= min, then > + tolerance range is disabled (interval error if > + error > min). Needs a unit suffix (see property-units.txt). > +- input-capture-channel: an input capture channel and channel flags, These all need vendor prefix. > + specified as . The channel number > + must be 0 or 1. The flags can be > + IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, or > + IRQ_TYPE_EDGE_BOTH, and specify which input > + capture signal edge will trigger the event. If > + an input capture channel is specified, the FIM > + will use this method to measure frame intervals > + instead of via the EOF interrupt. The input capture > + method is much preferred over EOF as it is not > + subject to interrupt latency errors. However it > + requires routing the VSYNC or FIELD output > + signals of the camera sensor to one of the >
[PATCH v2 19/19] ARM: imx_v6_v7_defconfig: Enable staging video4linux drivers
Enable imx v4l2 staging drivers. For video capture on the SabreAuto, the ADV7180 video decoder also requires the i2c-mux-gpio and the max7310 port expander. The Sabrelite requires PWM clocks for the OV5640. Signed-off-by: Steve Longerbeam--- arch/arm/configs/imx_v6_v7_defconfig | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index cbe7faf..5da4d8e 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -51,6 +51,7 @@ CONFIG_PREEMPT_VOLUNTARY=y CONFIG_AEABI=y CONFIG_HIGHMEM=y CONFIG_CMA=y +CONFIG_FORCE_MAX_ZONEORDER=14 CONFIG_CMDLINE="noinitrd console=ttymxc0,115200" CONFIG_KEXEC=y CONFIG_CPU_FREQ=y @@ -181,6 +182,7 @@ CONFIG_SERIAL_FSL_LPUART=y CONFIG_SERIAL_FSL_LPUART_CONSOLE=y # CONFIG_I2C_COMPAT is not set CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MUX=y CONFIG_I2C_MUX_GPIO=y # CONFIG_I2C_HELPER_AUTO is not set CONFIG_I2C_ALGOPCF=m @@ -194,11 +196,11 @@ CONFIG_GPIO_SYSFS=y CONFIG_GPIO_MC9S08DZ60=y CONFIG_GPIO_PCA953X=y CONFIG_GPIO_STMPE=y -CONFIG_POWER_SUPPLY=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_IMX=y CONFIG_POWER_RESET_SYSCON=y CONFIG_POWER_RESET_SYSCON_POWEROFF=y +CONFIG_POWER_SUPPLY=y CONFIG_SENSORS_GPIO_FAN=y CONFIG_SENSORS_IIO_HWMON=y CONFIG_THERMAL=y @@ -221,6 +223,8 @@ CONFIG_REGULATOR_PFUZE100=y CONFIG_MEDIA_SUPPORT=y CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_RC_SUPPORT=y +CONFIG_MEDIA_CONTROLLER=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y CONFIG_RC_DEVICES=y CONFIG_IR_GPIO_CIR=y CONFIG_MEDIA_USB_SUPPORT=y @@ -229,6 +233,8 @@ CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_SOC_CAMERA=y CONFIG_V4L_MEM2MEM_DRIVERS=y CONFIG_VIDEO_CODA=y +# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set +CONFIG_VIDEO_ADV7180=m CONFIG_SOC_CAMERA_OV2640=y CONFIG_IMX_IPUV3_CORE=y CONFIG_DRM=y @@ -338,6 +344,8 @@ CONFIG_FSL_EDMA=y CONFIG_IMX_SDMA=y CONFIG_MXS_DMA=y CONFIG_STAGING=y +CONFIG_STAGING_MEDIA=y +CONFIG_COMMON_CLK_PWM=y CONFIG_IIO=y CONFIG_VF610_ADC=y CONFIG_MPL3115=y -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 11/19] media: imx: Add CSI subdev driver
This is a media entity subdevice for the i.MX Camera Serial Interface module. Signed-off-by: Steve Longerbeam--- drivers/staging/media/imx/Kconfig | 13 + drivers/staging/media/imx/Makefile | 2 + drivers/staging/media/imx/imx-csi.c | 638 3 files changed, 653 insertions(+) create mode 100644 drivers/staging/media/imx/imx-csi.c diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index bfde58d..ce2d2c8 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -6,3 +6,16 @@ config VIDEO_IMX_MEDIA Say yes here to enable support for video4linux media controller driver for the i.MX5/6 SOC. +if VIDEO_IMX_MEDIA +menu "i.MX5/6 Media Sub devices" + +config VIDEO_IMX_CAMERA + tristate "i.MX5/6 Camera driver" + depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C + select VIDEOBUF2_DMA_CONTIG + default y + ---help--- + A video4linux camera capture driver for i.MX5/6. + +endmenu +endif diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index ef9f11b..133672a 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -4,3 +4,5 @@ imx-media-objs := imx-media-dev.o imx-media-fim.o imx-media-internal-sd.o \ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o + diff --git a/drivers/staging/media/imx/imx-csi.c b/drivers/staging/media/imx/imx-csi.c new file mode 100644 index 000..975eafb --- /dev/null +++ b/drivers/staging/media/imx/imx-csi.c @@ -0,0 +1,638 @@ +/* + * V4L2 Capture CSI Subdev for Freescale i.MX5/6 SOC + * + * Copyright (c) 2014-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +#define CSI_NUM_PADS 2 + +struct csi_priv { + struct device *dev; + struct ipu_soc *ipu; + struct imx_media_dev *md; + struct v4l2_subdev sd; + struct media_pad pad[CSI_NUM_PADS]; + struct v4l2_mbus_framefmt format_mbus[CSI_NUM_PADS]; + struct v4l2_mbus_config sensor_mbus_cfg; + struct v4l2_rect crop; + struct ipu_csi *csi; + int csi_id; + int input_pad; + int output_pad; + bool power_on; /* power is on */ + bool stream_on; /* streaming is on */ + + /* the sink for the captured frames */ + struct v4l2_subdev *sink_sd; + enum ipu_csi_dest dest; + struct v4l2_subdev *src_sd; + + struct v4l2_ctrl_handler ctrl_hdlr; + struct imx_media_fim *fim; + + /* the attached sensor at stream on */ + struct imx_media_subdev *sensor; +}; + +static inline struct csi_priv *sd_to_dev(struct v4l2_subdev *sdev) +{ + return container_of(sdev, struct csi_priv, sd); +} + +/* Update the CSI whole sensor and active windows */ +static int csi_setup(struct csi_priv *priv) +{ + struct v4l2_mbus_framefmt infmt; + + ipu_csi_set_window(priv->csi, >crop); + + /* +* the ipu-csi doesn't understand ALTERNATE, but it only +* needs to know whether the stream is interlaced, so set +* to INTERLACED if infmt field is ALTERNATE. +*/ + infmt = priv->format_mbus[priv->input_pad]; + if (infmt.field == V4L2_FIELD_ALTERNATE) + infmt.field = V4L2_FIELD_INTERLACED; + + ipu_csi_init_interface(priv->csi, >sensor_mbus_cfg, ); + + ipu_csi_set_dest(priv->csi, priv->dest); + + ipu_csi_dump(priv->csi); + + return 0; +} + +static int csi_start(struct csi_priv *priv) +{ + int ret; + + if (!priv->sensor) { + v4l2_err(>sd, "no sensor attached\n"); + return -EINVAL; + } + + ret = csi_setup(priv); + if (ret) + return ret; + + /* start the frame interval monitor */ + ret = imx_media_fim_set_stream(priv->fim, priv->sensor, true); + if (ret) + return ret; + + ret = ipu_csi_enable(priv->csi); + if (ret) { + v4l2_err(>sd, "CSI enable error: %d\n", ret); + return ret; + } + + return 0; +} + +static void csi_stop(struct csi_priv *priv) +{ + /* stop the frame interval monitor */ + imx_media_fim_set_stream(priv->fim, priv->sensor, false); + + ipu_csi_disable(priv->csi); +} + +static int csi_s_stream(struct v4l2_subdev *sd, int enable) +{ + struct csi_priv *priv = v4l2_get_subdevdata(sd); + int ret = 0; + + if (!priv->src_sd || !priv->sink_sd) + return -EPIPE; + +
[PATCH v2 03/19] ARM: dts: imx6qdl: add media device
Signed-off-by: Steve Longerbeam--- arch/arm/boot/dts/imx6q.dtsi | 4 arch/arm/boot/dts/imx6qdl.dtsi | 8 2 files changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 56a314f..2fbe0b3 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -454,3 +454,7 @@ { compatible = "fsl,imx6q-vpu", "cnm,coda960"; }; + + { + ports = <_csi0>, <_csi1>, <_csi0>, <_csi1>; +}; diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 89218a4..12ae045 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -1296,5 +1296,13 @@ }; }; }; + + media0: media@0 { + compatible = "fsl,imx-media"; + ports = <_csi0>, <_csi1>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + }; }; }; -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 01/19] ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node
Add to the MIPI CSI2 receiver node: compatible string, interrupt sources, clocks. Signed-off-by: Steve Longerbeam--- arch/arm/boot/dts/imx6qdl.dtsi | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 53e6e63..7b546e3 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -1125,7 +1125,14 @@ }; mipi_csi: mipi@021dc000 { + compatible = "fsl,imx-mipi-csi2"; reg = <0x021dc000 0x4000>; + interrupts = <0 100 0x04>, <0 101 0x04>; + clocks = < IMX6QDL_CLK_HSI_TX>, +< IMX6QDL_CLK_VIDEO_27M>, +< IMX6QDL_CLK_EIM_SEL>; + clock-names = "dphy_clk", "cfg_clk", "pix_clk"; + status = "disabled"; }; mipi_dsi: mipi@021e { -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 05/19] ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors
Enables the OV5642 parallel-bus sensor, and the OV5640 MIPI CSI-2 sensor. The OV5642 connects to the parallel-bus mux input port on ipu1_csi0_mux. The OV5640 connects to the input port on the MIPI CSI-2 receiver on mipi_csi. It is set to transmit over MIPI virtual channel 1. Until the OV5652 sensor module compatible with the SabreSD becomes available for testing, the ov5642 node is currently disabled. Signed-off-by: Steve Longerbeam--- arch/arm/boot/dts/imx6dl-sabresd.dts | 5 ++ arch/arm/boot/dts/imx6q-sabresd.dts| 5 ++ arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 114 - 3 files changed, 123 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6dl-sabresd.dts b/arch/arm/boot/dts/imx6dl-sabresd.dts index 1e45f2f..6cf7a50 100644 --- a/arch/arm/boot/dts/imx6dl-sabresd.dts +++ b/arch/arm/boot/dts/imx6dl-sabresd.dts @@ -15,3 +15,8 @@ model = "Freescale i.MX6 DualLite SABRE Smart Device Board"; compatible = "fsl,imx6dl-sabresd", "fsl,imx6dl"; }; + +_csi1_from_ipu1_csi1_mux { + data-lanes = <0 1>; + clock-lanes = <2>; +}; diff --git a/arch/arm/boot/dts/imx6q-sabresd.dts b/arch/arm/boot/dts/imx6q-sabresd.dts index 9cbdfe7..8c1d7ad 100644 --- a/arch/arm/boot/dts/imx6q-sabresd.dts +++ b/arch/arm/boot/dts/imx6q-sabresd.dts @@ -23,3 +23,8 @@ { status = "okay"; }; + +_csi1_from_mipi_vc1 { + data-lanes = <0 1>; + clock-lanes = <2>; +}; diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi index 55ef535..39b4228 100644 --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi @@ -10,6 +10,7 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include #include #include @@ -146,6 +147,33 @@ }; }; +_csi0_from_ipu1_csi0_mux { + bus-width = <8>; + data-shift = <12>; /* Lines 19:12 used */ + hsync-active = <1>; + vsync-active = <1>; +}; + +_csi0_mux_from_parallel_sensor { + remote-endpoint = <_to_ipu1_csi0_mux>; +}; + +_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <_ipu1_csi0>; +}; + +_csi { + status = "okay"; +}; + +/* Incoming port from sensor */ +_csi_from_mipi_sensor { + remote-endpoint = <_to_mipi_csi>; + data-lanes = <0 1>; + clock-lanes = <2>; +}; + { pinctrl-names = "default"; pinctrl-0 = <_audmux>; @@ -214,7 +242,33 @@ 0x8014 /* 4:FN_DMICCDAT */ 0x /* 5:Default */ >; - }; + }; + + camera: ov5642@3c { + compatible = "ovti,ov5642"; + pinctrl-names = "default"; + pinctrl-0 = <_ov5642>; + clocks = < IMX6QDL_CLK_CKO>; + clock-names = "xclk"; + reg = <0x3c>; + xclk = <2400>; + DOVDD-supply = <_reg>; /* 1.8v */ + AVDD-supply = <_reg>; /* 2.8v, rev C board is VGEN3 + rev B board is VGEN5 */ + DVDD-supply = <_reg>; /* 1.5v*/ + pwdn-gpios = < 16 GPIO_ACTIVE_HIGH>; /* SD1_DAT0 */ + reset-gpios = < 17 GPIO_ACTIVE_LOW>; /* SD1_DAT1 */ + status = "disabled"; + + port { + ov5642_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + hsync-active = <1>; + vsync-active = <1>; + }; + }; + }; }; { @@ -322,6 +376,34 @@ }; }; }; + + mipi_camera: ov5640@3c { + compatible = "ovti,ov5640_mipi"; + pinctrl-names = "default"; + pinctrl-0 = <_ov5640>; + reg = <0x3c>; + clocks = < IMX6QDL_CLK_CKO>; + clock-names = "xclk"; + xclk = <2400>; + DOVDD-supply = <_reg>; /* 1.8v */ + AVDD-supply = <_reg>; /* 2.8v, rev C board is VGEN3 + rev B board is VGEN5 */ + DVDD-supply = <_reg>; /* 1.5v*/ + pwdn-gpios = < 19 GPIO_ACTIVE_HIGH>; /* SD1_DAT2 */ + reset-gpios = < 20 GPIO_ACTIVE_LOW>; /* SD1_CLK */ + + port { + #address-cells = <1>; + #size-cells = <0>; + + ov5640_to_mipi_csi: endpoint@1 { + reg = <1>; + remote-endpoint = <_csi_from_mipi_sensor>; + data-lanes = <0 1>; + clock-lanes = <2>; + }; + }; + }; }; { @@ -426,6 +508,36 @@ >;
[PATCH v2 06/19] ARM: dts: imx6-sabreauto: create i2cmux for i2c3
The sabreauto uses a steering pin to select between the SDA signal on i2c3 bus, and a data-in pin for an SPI NOR chip. Use i2cmux to control this steering pin. Idle state of the i2cmux selects SPI NOR. This is not a classic way to use i2cmux, since one side of the mux selects something other than an i2c bus, but it works and is probably the cleanest solution. Note that if one thread is attempting to access SPI NOR while another thread is accessing i2c3, the SPI NOR access will fail since the i2cmux has selected the SDA pin rather than SPI NOR data-in. This couldn't be avoided in any case, the board is not designed to allow concurrent i2c3 and SPI NOR functions (and the default device-tree does not enable SPI NOR anyway). Devices hanging off i2c3 should now be defined under i2cmux, so that the steering pin can be properly controlled to access those devices. The port expanders (MAX7310) are thus moved into i2cmux. Signed-off-by: Steve Longerbeam--- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 65 +--- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 52390ba..4a6d038 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -108,6 +108,44 @@ default-brightness-level = <7>; status = "okay"; }; + + i2cmux { + compatible = "i2c-mux-gpio"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <_i2c3mux>; + mux-gpios = < 4 0>; + i2c-parent = <>; + idle-state = <0>; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + max7310_a: gpio@30 { + compatible = "maxim,max7310"; + reg = <0x30>; + gpio-controller; + #gpio-cells = <2>; + }; + + max7310_b: gpio@32 { + compatible = "maxim,max7310"; + reg = <0x32>; + gpio-controller; + #gpio-cells = <2>; + }; + + max7310_c: gpio@34 { + compatible = "maxim,max7310"; + reg = <0x34>; + gpio-controller; + #gpio-cells = <2>; + }; + }; + }; }; { @@ -291,27 +329,6 @@ pinctrl-names = "default"; pinctrl-0 = <_i2c3>; status = "okay"; - - max7310_a: gpio@30 { - compatible = "maxim,max7310"; - reg = <0x30>; - gpio-controller; - #gpio-cells = <2>; - }; - - max7310_b: gpio@32 { - compatible = "maxim,max7310"; - reg = <0x32>; - gpio-controller; - #gpio-cells = <2>; - }; - - max7310_c: gpio@34 { - compatible = "maxim,max7310"; - reg = <0x34>; - gpio-controller; - #gpio-cells = <2>; - }; }; { @@ -419,6 +436,12 @@ >; }; + pinctrl_i2c3mux: i2c3muxgrp { + fsl,pins = < + MX6QDL_PAD_EIM_A24__GPIO5_IO04 0x8000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1 -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 12/19] media: imx: Add SMFC subdev driver
This is a media entity subdevice driver for the i.MX Sensor Multi-FIFO Controller module. Video frames are received from the CSI and can be routed to various sinks including the i.MX Image Converter for scaling, color-space conversion, motion compensated deinterlacing, and image rotation. Signed-off-by: Steve Longerbeam--- drivers/staging/media/imx/Makefile | 1 + drivers/staging/media/imx/imx-smfc.c | 739 +++ 2 files changed, 740 insertions(+) create mode 100644 drivers/staging/media/imx/imx-smfc.c diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 133672a..3559d7b 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -5,4 +5,5 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o diff --git a/drivers/staging/media/imx/imx-smfc.c b/drivers/staging/media/imx/imx-smfc.c new file mode 100644 index 000..565048c --- /dev/null +++ b/drivers/staging/media/imx/imx-smfc.c @@ -0,0 +1,739 @@ +/* + * V4L2 Capture SMFC Subdev for Freescale i.MX5/6 SOC + * + * This subdevice handles capture of raw/unconverted video frames + * from the CSI, directly to memory via the Sensor Multi-FIFO Controller. + * + * Copyright (c) 2012-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +/* + * Min/Max supported width and heights. + * + * We allow planar output from the SMFC, so we have to align + * output width by 16 pixels to meet IDMAC alignment requirements, + * which also means input width must have the same alignment. + */ +#define MIN_W 176 +#define MIN_H 144 +#define MAX_W 8192 +#define MAX_H 4096 +#define W_ALIGN4 /* multiple of 16 pixels */ +#define H_ALIGN1 /* multiple of 2 lines */ +#define S_ALIGN1 /* multiple of 2 */ + +#define SMFC_NUM_PADS 2 + +struct imx_smfc_priv { + struct device*dev; + struct ipu_soc *ipu; + struct imx_media_dev *md; + struct v4l2_subdev sd; + struct media_pad pad[SMFC_NUM_PADS]; + int ipu_id; + int smfc_id; + int input_pad; + int output_pad; + + struct ipuv3_channel *smfc_ch; + struct ipu_smfc *smfc; + + struct v4l2_mbus_framefmt format_mbus[SMFC_NUM_PADS]; + const struct imx_media_pixfmt *cc[SMFC_NUM_PADS]; + + struct v4l2_mbus_config sensor_mbus_cfg; + + /* the dma buffer ring to send to sink */ + struct imx_media_dma_buf_ring *out_ring; + struct imx_media_dma_buf *next; + + int ipu_buf_num; /* ipu double buffer index: 0-1 */ + + /* the sink that will receive the dma buffers */ + struct v4l2_subdev *sink_sd; + struct v4l2_subdev *src_sd; + + /* +* the CSI id and mipi virtual channel number at +* link validate +*/ + int csi_id; + int vc_num; + + /* the attached sensor at stream on */ + struct imx_media_subdev *sensor; + + spinlock_t irqlock; + struct timer_list eof_timeout_timer; + int eof_irq; + int nfb4eof_irq; + + bool stream_on; /* streaming is on */ + bool last_eof; /* waiting for last EOF at stream off */ + struct completion last_eof_comp; +}; + +static void imx_smfc_put_ipu_resources(struct imx_smfc_priv *priv) +{ + if (!IS_ERR_OR_NULL(priv->smfc_ch)) + ipu_idmac_put(priv->smfc_ch); + priv->smfc_ch = NULL; + + if (!IS_ERR_OR_NULL(priv->smfc)) + ipu_smfc_put(priv->smfc); + priv->smfc = NULL; +} + +static int imx_smfc_get_ipu_resources(struct imx_smfc_priv *priv) +{ + int ch_num, ret; + + priv->ipu = priv->md->ipu[priv->ipu_id]; + + ch_num = IPUV3_CHANNEL_CSI0 + priv->smfc_id; + + priv->smfc = ipu_smfc_get(priv->ipu, ch_num); + if (IS_ERR(priv->smfc)) { + v4l2_err(>sd, "failed to get SMFC\n"); + ret = PTR_ERR(priv->smfc); + goto out; + } + + priv->smfc_ch = ipu_idmac_get(priv->ipu, ch_num); + if (IS_ERR(priv->smfc_ch)) { + v4l2_err(>sd, "could not get IDMAC channel %u\n", ch_num); + ret = PTR_ERR(priv->smfc_ch); + goto out; + } + + return 0; +out: + imx_smfc_put_ipu_resources(priv); + return ret; +} + +static irqreturn_t imx_smfc_eof_interrupt(int irq, void *dev_id) +{ +
[PATCH v2 16/19] media: imx: Add video switch subdev driver
From: Philipp ZabelThis driver can handle SoC internal and extern video bus multiplexers, controlled either by register bit fields or by GPIO. Signed-off-by: Sascha Hauer Signed-off-by: Philipp Zabel Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/Makefile | 1 + drivers/staging/media/imx/imx-video-switch.c | 351 +++ 2 files changed, 352 insertions(+) create mode 100644 drivers/staging/media/imx/imx-video-switch.c diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 0decef7..e3d6d8d 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -10,3 +10,4 @@ obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-video-switch.o diff --git a/drivers/staging/media/imx/imx-video-switch.c b/drivers/staging/media/imx/imx-video-switch.c new file mode 100644 index 000..79d3837 --- /dev/null +++ b/drivers/staging/media/imx/imx-video-switch.c @@ -0,0 +1,351 @@ +/* + * devicetree probed mediacontrol video multiplexer. + * + * Copyright (C) 2013 Sascha Hauer, Pengutronix + * Copyright (c) 2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +struct vidsw { + struct device *dev; + struct imx_media_dev *md; + struct v4l2_subdev subdev; + struct media_pad *pads; + struct v4l2_mbus_framefmt *format_mbus; + struct v4l2_of_endpoint *endpoint; + struct regmap_field *field; + struct gpio_desc *gpio; + int output_pad; + int numpads; + int active; +}; + +#define to_vidsw(sd) container_of(sd, struct vidsw, subdev) + +static int vidsw_set_mux(struct vidsw *vidsw, int input_index) +{ + if (vidsw->active >= 0) { + if (vidsw->active == input_index) + return 0; + else + return -EBUSY; + } + + vidsw->active = input_index; + + dev_dbg(vidsw->dev, "setting %d active\n", vidsw->active); + + if (vidsw->field) + regmap_field_write(vidsw->field, vidsw->active); + else if (vidsw->gpio) + gpiod_set_value(vidsw->gpio, vidsw->active); + + return 0; +} + +static int vidsw_link_setup(struct media_entity *entity, + const struct media_pad *local, + const struct media_pad *remote, u32 flags) +{ + struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); + struct vidsw *vidsw = to_vidsw(sd); + + dev_dbg(vidsw->dev, "link setup %s -> %s", remote->entity->name, + local->entity->name); + + if (local->flags & MEDIA_PAD_FL_SINK) { + if (!(flags & MEDIA_LNK_FL_ENABLED)) { + if (local->index == vidsw->active) { + dev_dbg(vidsw->dev, "going inactive\n"); + vidsw->active = -1; + } + return 0; + } + + return vidsw_set_mux(vidsw, local->index); + } + + return 0; +} + +static struct media_entity_operations vidsw_ops = { + .link_setup = vidsw_link_setup, + .link_validate = v4l2_subdev_link_validate, +}; + +/* + * retrieve our pads parsed from the OF graph by the media device + */ +static int vidsw_registered(struct v4l2_subdev *sd) +{ + struct vidsw *vidsw = container_of(sd, struct vidsw, subdev); + struct device_node *np = vidsw->dev->of_node; + struct imx_media_subdev *imxsd; + struct device_node *epnode; + struct imx_media_pad *pad; + int i, ret; + + vidsw->md = dev_get_drvdata(sd->v4l2_dev->dev); + + imxsd = imx_media_find_subdev_by_sd(vidsw->md, sd); + if (IS_ERR(imxsd)) + return PTR_ERR(imxsd); + + if (imxsd->num_sink_pads < 2 || imxsd->num_src_pads != 1) + return -EINVAL; + + vidsw->numpads = imxsd->num_sink_pads + imxsd->num_src_pads; + + vidsw->pads = devm_kzalloc(vidsw->dev, + vidsw->numpads * sizeof(*vidsw->pads), +
[PATCH v2 09/19] ARM: dts: imx6-sabreauto: add the ADV7180 video decoder
Enables the ADV7180 decoder sensor. The ADV7180 connects to the parallel-bus mux input on ipu1_csi0_mux. On the sabreauto, two analog video inputs are routed to the ADV7180, composite on Ain1, and composite on Ain3. Those inputs are defined via inputs and input-names under the ADV7180 node. The ADV7180 power pin is via max7310_b port expander. Signed-off-by: Steve Longerbeam--- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 56 1 file changed, 56 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 83ac2ff..30ee378 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -147,10 +147,42 @@ gpio-controller; #gpio-cells = <2>; }; + + camera: adv7180@21 { + compatible = "adi,adv7180"; + reg = <0x21>; + powerdown-gpios = <_b 2 GPIO_ACTIVE_LOW>; + interrupt-parent = <>; + interrupts = <27 0x8>; + inputs = <0x00 0x02>; + input-names = "ADV7180 Composite on Ain1", + "ADV7180 Composite on Ain3"; + + port { + adv7180_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; }; }; }; +_csi0_from_ipu1_csi0_mux { + bus-width = <8>; +}; + +_csi0_mux_from_parallel_sensor { + remote-endpoint = <_to_ipu1_csi0_mux>; + bus-width = <8>; +}; + +_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <_ipu1_csi0>; +}; + { assigned-clocks = < IMX6QDL_PLL4_BYPASS_SRC>, < IMX6QDL_PLL4_BYPASS>, @@ -451,6 +483,30 @@ >; }; + pinctrl_ipu1_csi0: ipu1grp-csi0 { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04 0x8000 + MX6QDL_PAD_CSI0_DAT5__IPU1_CSI0_DATA05 0x8000 + MX6QDL_PAD_CSI0_DAT6__IPU1_CSI0_DATA06 0x8000 + MX6QDL_PAD_CSI0_DAT7__IPU1_CSI0_DATA07 0x8000 + MX6QDL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08 0x8000 + MX6QDL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09 0x8000 + MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10 0x8000 + MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11 0x8000 + MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x8000 + MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x8000 + MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x8000 + MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x8000 + MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x8000 + MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x8000 + MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x8000 + MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x8000 + MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x8000 + MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC 0x8000 + MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC 0x8000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1 -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 15/19] media: imx: Add MIPI CSI-2 Receiver subdev driver
Adds MIPI CSI-2 Receiver subdev driver. This subdev is required for sensors with a MIPI CSI2 interface. Signed-off-by: Steve Longerbeam--- drivers/staging/media/imx/Makefile| 1 + drivers/staging/media/imx/imx-mipi-csi2.c | 509 ++ 2 files changed, 510 insertions(+) create mode 100644 drivers/staging/media/imx/imx-mipi-csi2.c diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index fe9e992..0decef7 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o diff --git a/drivers/staging/media/imx/imx-mipi-csi2.c b/drivers/staging/media/imx/imx-mipi-csi2.c new file mode 100644 index 000..84df16e --- /dev/null +++ b/drivers/staging/media/imx/imx-mipi-csi2.c @@ -0,0 +1,509 @@ +/* + * MIPI CSI-2 Receiver Subdev for Freescale i.MX5/6 SOC. + * + * Copyright (c) 2012-2014 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +/* + * there must be 5 pads: 1 input pad from sensor, and + * the 4 virtual channel output pads + */ +#define CSI2_NUM_SINK_PADS 1 +#define CSI2_NUM_SRC_PADS 4 +#define CSI2_NUM_PADS 5 + +struct imxcsi2_dev { + struct device *dev; + struct imx_media_dev *md; + struct v4l2_subdev sd; + struct media_pad pad[CSI2_NUM_PADS]; + struct v4l2_mbus_framefmt format_mbus; + struct v4l2_subdev *src_sd; + struct v4l2_subdev *sink_sd[CSI2_NUM_SRC_PADS]; + intinput_pad; + struct clk *dphy_clk; + struct clk *cfg_clk; + struct clk *pix_clk; /* what is this? */ + void __iomem *base; + int intr1; + int intr2; + struct v4l2_of_bus_mipi_csi2 bus; + boolon; + boolstream_on; +}; + +#define DEVICE_NAME "imx-mipi-csi2" + +/* Register offsets */ +#define CSI2_VERSION0x000 +#define CSI2_N_LANES0x004 +#define CSI2_PHY_SHUTDOWNZ 0x008 +#define CSI2_DPHY_RSTZ 0x00c +#define CSI2_RESETN 0x010 +#define CSI2_PHY_STATE 0x014 +#define CSI2_DATA_IDS_1 0x018 +#define CSI2_DATA_IDS_2 0x01c +#define CSI2_ERR1 0x020 +#define CSI2_ERR2 0x024 +#define CSI2_MSK1 0x028 +#define CSI2_MSK2 0x02c +#define CSI2_PHY_TST_CTRL0 0x030 +#define CSI2_PHY_TST_CTRL1 0x034 +#define CSI2_SFT_RESET 0xf00 + +static inline struct imxcsi2_dev *sd_to_dev(struct v4l2_subdev *sdev) +{ + return container_of(sdev, struct imxcsi2_dev, sd); +} + +static inline u32 imxcsi2_read(struct imxcsi2_dev *csi2, unsigned int regoff) +{ + return readl(csi2->base + regoff); +} + +static inline void imxcsi2_write(struct imxcsi2_dev *csi2, u32 val, +unsigned int regoff) +{ + writel(val, csi2->base + regoff); +} + +static void imxcsi2_set_lanes(struct imxcsi2_dev *csi2) +{ + int lanes = csi2->bus.num_data_lanes; + + imxcsi2_write(csi2, lanes - 1, CSI2_N_LANES); +} + +static void imxcsi2_enable(struct imxcsi2_dev *csi2, bool enable) +{ + if (enable) { + imxcsi2_write(csi2, 0x, CSI2_PHY_SHUTDOWNZ); + imxcsi2_write(csi2, 0x, CSI2_DPHY_RSTZ); + imxcsi2_write(csi2, 0x, CSI2_RESETN); + } else { + imxcsi2_write(csi2, 0x0, CSI2_PHY_SHUTDOWNZ); + imxcsi2_write(csi2, 0x0, CSI2_DPHY_RSTZ); + imxcsi2_write(csi2, 0x0, CSI2_RESETN); + } +} + +static void imxcsi2_reset(struct imxcsi2_dev *csi2) +{ + imxcsi2_enable(csi2, false); + + imxcsi2_write(csi2, 0x0001, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x, CSI2_PHY_TST_CTRL1); + imxcsi2_write(csi2, 0x, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x0002, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x00010044, CSI2_PHY_TST_CTRL1); + imxcsi2_write(csi2, 0x, CSI2_PHY_TST_CTRL0); + imxcsi2_write(csi2, 0x0014, CSI2_PHY_TST_CTRL1); + imxcsi2_write(csi2, 0x0002, CSI2_PHY_TST_CTRL0); +
[PATCH v2 17/19] media: imx: Add MIPI CSI-2 OV5640 sensor subdev driver
This driver is based on ov5640_mipi.c from Freescale imx_3.10.17_1.0.0_beta branch, modified heavily to bring forward to latest interfaces and code cleanup. Signed-off-by: Steve Longerbeam--- drivers/staging/media/imx/Kconfig |8 + drivers/staging/media/imx/Makefile |2 + drivers/staging/media/imx/ov5640-mipi.c | 2349 +++ 3 files changed, 2359 insertions(+) create mode 100644 drivers/staging/media/imx/ov5640-mipi.c diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index ce2d2c8..09f373d 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -17,5 +17,13 @@ config VIDEO_IMX_CAMERA ---help--- A video4linux camera capture driver for i.MX5/6. +config IMX_OV5640_MIPI + tristate "OmniVision OV5640 MIPI CSI-2 camera support" + depends on GPIOLIB && VIDEO_IMX_CAMERA + select IMX_MIPI_CSI2 + default y + ---help--- + MIPI CSI-2 OV5640 Camera support. + endmenu endif diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index e3d6d8d..f96e623 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -11,3 +11,5 @@ obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-mipi-csi2.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-video-switch.o + +obj-$(CONFIG_IMX_OV5640_MIPI) += ov5640-mipi.o diff --git a/drivers/staging/media/imx/ov5640-mipi.c b/drivers/staging/media/imx/ov5640-mipi.c new file mode 100644 index 000..a83b581 --- /dev/null +++ b/drivers/staging/media/imx/ov5640-mipi.c @@ -0,0 +1,2349 @@ +/* + * Copyright (c) 2014 Mentor Graphics Inc. + * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define OV5640_VOLTAGE_ANALOG 280 +#define OV5640_VOLTAGE_DIGITAL_CORE 150 +#define OV5640_VOLTAGE_DIGITAL_IO 180 + +#define MIN_FPS 15 +#define MAX_FPS 30 +#define DEFAULT_FPS 30 + +/* min/typical/max system clock (xclk) frequencies */ +#define OV5640_XCLK_MIN 600 +#define OV5640_XCLK_TYP 2400 +#define OV5640_XCLK_MAX 5400 + +/* min/typical/max pixel clock (mclk) frequencies */ +#define OV5640_MCLK_MIN 4800 +#define OV5640_MCLK_TYP 4800 +#define OV5640_MCLK_MAX 9600 + +#define OV5640_CHIP_ID 0x300A +#define OV5640_SLAVE_ID 0x3100 +#define OV5640_DEFAULT_SLAVE_ID 0x3c + +#define OV5640_MAX_CONTROLS 64 + +enum ov5640_mode { + ov5640_mode_MIN = 0, + ov5640_mode_QCIF_176_144 = 0, + ov5640_mode_QVGA_320_240, + ov5640_mode_VGA_640_480, + ov5640_mode_NTSC_720_480, + ov5640_mode_PAL_720_576, + ov5640_mode_XGA_1024_768, + ov5640_mode_720P_1280_720, + ov5640_mode_1080P_1920_1080, + ov5640_mode_QSXGA_2592_1944, + ov5640_num_modes, + ov5640_mode_INIT = 0xff, /*only for sensor init*/ +}; + +enum ov5640_frame_rate { + ov5640_15_fps, + ov5640_30_fps +}; + +static int ov5640_framerates[] = { + [ov5640_15_fps] = 15, + [ov5640_30_fps] = 30, +}; +#define ov5640_num_framerates ARRAY_SIZE(ov5640_framerates) + +/* image size under 1280 * 960 are SUBSAMPLING + * image size upper 1280 * 960 are SCALING + */ +enum ov5640_downsize_mode { + SUBSAMPLING, + SCALING, +}; + +struct reg_value { + u16 reg_addr; + u8 val; + u8 mask; + u32 delay_ms; +}; + +struct ov5640_mode_info { + enum ov5640_mode mode; + enum ov5640_downsize_mode dn_mode; + u32 width; + u32 height; + struct reg_value *init_data_ptr; + u32 init_data_size; +}; + +struct ov5640_dev { + struct i2c_client *i2c_client; + struct device *dev; + struct v4l2_subdev sd; + struct media_pad pad; + struct v4l2_ctrl_handler ctrl_hdl; + struct v4l2_of_endpoint ep; /* the parsed DT endpoint info */ + struct v4l2_mbus_framefmt fmt; + struct v4l2_captureparm streamcap; + struct clk *xclk; /* system clock to OV5640 */ + int xclk_freq;/* requested xclk freq from devicetree */ + + enum ov5640_mode current_mode; + enum ov5640_frame_rate current_fr; + + bool on; + bool awb_on; + bool agc_on; + + /* cached control settings */ + int ctrl_cache[OV5640_MAX_CONTROLS]; + + struct gpio_desc *reset_gpio; + struct gpio_desc
[PATCH v2 10/19] media: Add i.MX media core driver
Add the core media driver for i.MX SOC. Signed-off-by: Steve Longerbeam--- Documentation/devicetree/bindings/media/imx.txt | 205 + Documentation/media/v4l-drivers/imx.rst | 430 ++ drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile| 1 + drivers/staging/media/imx/Kconfig | 8 + drivers/staging/media/imx/Makefile| 6 + drivers/staging/media/imx/TODO| 18 + drivers/staging/media/imx/imx-media-common.c | 985 ++ drivers/staging/media/imx/imx-media-dev.c | 479 +++ drivers/staging/media/imx/imx-media-fim.c | 509 +++ drivers/staging/media/imx/imx-media-internal-sd.c | 457 ++ drivers/staging/media/imx/imx-media-of.c | 291 +++ drivers/staging/media/imx/imx-media-of.h | 25 + drivers/staging/media/imx/imx-media.h | 299 +++ include/media/imx.h | 15 + include/uapi/Kbuild | 1 + include/uapi/linux/v4l2-controls.h| 4 + include/uapi/media/Kbuild | 2 + include/uapi/media/imx.h | 30 + 19 files changed, 3767 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/imx.txt create mode 100644 Documentation/media/v4l-drivers/imx.rst create mode 100644 drivers/staging/media/imx/Kconfig create mode 100644 drivers/staging/media/imx/Makefile create mode 100644 drivers/staging/media/imx/TODO create mode 100644 drivers/staging/media/imx/imx-media-common.c create mode 100644 drivers/staging/media/imx/imx-media-dev.c create mode 100644 drivers/staging/media/imx/imx-media-fim.c create mode 100644 drivers/staging/media/imx/imx-media-internal-sd.c create mode 100644 drivers/staging/media/imx/imx-media-of.c create mode 100644 drivers/staging/media/imx/imx-media-of.h create mode 100644 drivers/staging/media/imx/imx-media.h create mode 100644 include/media/imx.h create mode 100644 include/uapi/media/Kbuild create mode 100644 include/uapi/media/imx.h diff --git a/Documentation/devicetree/bindings/media/imx.txt b/Documentation/devicetree/bindings/media/imx.txt new file mode 100644 index 000..3593354 --- /dev/null +++ b/Documentation/devicetree/bindings/media/imx.txt @@ -0,0 +1,205 @@ +Freescale i.MX Media Video Devices + +Video Media Controller node +--- + +This is the parent media controller node for video capture support. + +Required properties: +- compatible : "fsl,imx-media"; +- ports : Should contain a list of phandles pointing to camera + sensor interface ports of IPU devices + + +fim child node +-- + +This is an optional child node of the ipu_csi port nodes. It can be used +to modify the default control values for the video capture Frame +Interval Monitor. Refer to Documentation/media/v4l-drivers/imx.rst for +more info on the Frame Interval Monitor. + +Optional properties: +- enable : enable (1) or disable (0) the FIM; +- num-avg : how many frame intervals the FIM will average; +- num-skip: how many frames the FIM will skip after a video + capture restart before beginning to sample frame + intervals; +- tolerance-range : a range of tolerances for the averaged frame + interval error, specified as , in usec. + The FIM will signal a frame interval error if + min < error < max. If the max is <= min, then + tolerance range is disabled (interval error if + error > min). +- input-capture-channel: an input capture channel and channel flags, +specified as . The channel number +must be 0 or 1. The flags can be +IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING, or +IRQ_TYPE_EDGE_BOTH, and specify which input +capture signal edge will trigger the event. If +an input capture channel is specified, the FIM +will use this method to measure frame intervals +instead of via the EOF interrupt. The input capture +method is much preferred over EOF as it is not +subject to interrupt latency errors. However it +requires routing the VSYNC or FIELD output +signals of the camera sensor to one of the +i.MX input capture pads (SD1_DAT0, SD1_DAT1), +which also gives up support for SD1. + + +mipi_csi2 node +-- + +This is the device node for the MIPI CSI-2 Receiver, required for MIPI +CSI-2 sensors. + +Required properties: +- compatible : "fsl,imx-mipi-csi2"; +- reg
[PATCH v2 04/19] ARM: dts: imx6-sabrelite: add OV5642 and OV5640 camera sensors
Enables the OV5642 parallel-bus sensor, and the OV5640 MIPI CSI-2 sensor. Both hang off the same i2c2 bus, so they require different (and non- default) i2c slave addresses. The OV5642 connects to the parallel-bus mux input port on ipu1_csi0_mux. The OV5640 connects to the input port on the MIPI CSI-2 receiver on mipi_csi. It is set to transmit over MIPI virtual channel 1. Note there is a pin conflict with GPIO6. This pin functions as a power input pin to the OV5642, but ENET uses it as the h/w workaround for erratum ERR006687, to wake-up the ARM cores on normal RX and TX packet done events (see 6261c4c8). So workaround 6261c4c8 is reverted here to support the OV5642, and the "fsl,err006687-workaround-present" boolean also must be removed. The result is that the CPUidle driver will no longer allow entering the deep idle states on the sabrelite. Signed-off-by: Steve Longerbeam--- arch/arm/boot/dts/imx6dl-sabrelite.dts | 5 ++ arch/arm/boot/dts/imx6q-sabrelite.dts| 6 ++ arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 122 ++- 3 files changed, 129 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/imx6dl-sabrelite.dts b/arch/arm/boot/dts/imx6dl-sabrelite.dts index 0f06ca5..fec2524 100644 --- a/arch/arm/boot/dts/imx6dl-sabrelite.dts +++ b/arch/arm/boot/dts/imx6dl-sabrelite.dts @@ -48,3 +48,8 @@ model = "Freescale i.MX6 DualLite SABRE Lite Board"; compatible = "fsl,imx6dl-sabrelite", "fsl,imx6dl"; }; + +_csi1_from_ipu1_csi1_mux { + data-lanes = <0 1>; + clock-lanes = <2>; +}; diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts index 66d10d8..9e2d26d 100644 --- a/arch/arm/boot/dts/imx6q-sabrelite.dts +++ b/arch/arm/boot/dts/imx6q-sabrelite.dts @@ -52,3 +52,9 @@ { status = "okay"; }; + +_csi1_from_mipi_vc1 { + data-lanes = <0 1>; + clock-lanes = <2>; +}; + diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi index 1f9076e..4a50bb1 100644 --- a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi @@ -39,6 +39,8 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ + +#include #include #include @@ -96,6 +98,15 @@ }; }; + mipi_xclk: mipi_xclk { + compatible = "pwm-clock"; + #clock-cells = <0>; + clock-frequency = <2200>; + clock-output-names = "mipi_pwm3"; + pwms = < 0 45>; /* 1 / 45 ns = 22 MHz */ + status = "okay"; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -220,6 +231,22 @@ }; }; +_csi0_from_ipu1_csi0_mux { + bus-width = <8>; + data-shift = <12>; /* Lines 19:12 used */ + hsync-active = <1>; + vync-active = <1>; +}; + +_csi0_mux_from_parallel_sensor { + remote-endpoint = <_to_ipu1_csi0_mux>; +}; + +_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <_ipu1_csi0>; +}; + { pinctrl-names = "default"; pinctrl-0 = <_audmux>; @@ -271,9 +298,6 @@ txd1-skew-ps = <0>; txd2-skew-ps = <0>; txd3-skew-ps = <0>; - interrupts-extended = < 6 IRQ_TYPE_LEVEL_HIGH>, - < 0 119 IRQ_TYPE_LEVEL_HIGH>; - fsl,err006687-workaround-present; status = "okay"; }; @@ -302,6 +326,52 @@ pinctrl-names = "default"; pinctrl-0 = <_i2c2>; status = "okay"; + + camera: ov5642@42 { + compatible = "ovti,ov5642"; + pinctrl-names = "default"; + pinctrl-0 = <_ov5642>; + clocks = < IMX6QDL_CLK_CKO2>; + clock-names = "xclk"; + reg = <0x42>; + xclk = <2400>; + reset-gpios = < 8 GPIO_ACTIVE_LOW>; + pwdn-gpios = < 6 GPIO_ACTIVE_HIGH>; + gp-gpios = < 16 GPIO_ACTIVE_HIGH>; + + port { + ov5642_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + hsync-active = <1>; + vsync-active = <1>; + }; + }; + }; + + mipi_camera: ov5640@40 { + compatible = "ovti,ov5640_mipi"; + pinctrl-names = "default"; + pinctrl-0 = <_ov5640>; + clocks = <_xclk>; + clock-names = "xclk"; + reg = <0x40>; + xclk = <2200>; + reset-gpios = < 5 GPIO_ACTIVE_LOW>; /* NANDF_D5 */ + pwdn-gpios = < 9 GPIO_ACTIVE_HIGH>; /* NANDF_WP_B */ + + port { + #address-cells
[PATCH v2 13/19] media: imx: Add IC subdev drivers
This is a set of three media entity subdevice drivers for the i.MX Image Converter. The i.MX IC module contains three independent "tasks": - Pre-processing Encode task: video frames are routed directly from the CSI and can be scaled, color-space converted, and rotated. Scaled output is limited to 1024x1024 resolution. Output frames are routed to the camera interface entities (camif). - Pre-processing Viewfinder task: this task can perform the same conversions as the pre-process encode task, but in addition can be used for hardware motion compensated deinterlacing. Frames can come either directly from the CSI or from the SMFC entities (memory buffers via IDMAC channels). Scaled output is limited to 1024x1024 resolution. Output frames can be routed to various sinks including the post-processing task entities. - Post-processing task: same conversions as pre-process encode. However this entity sends frames to the i.MX IPU image converter which supports image tiling, which allows scaled output up to 4096x4096 resolution. Output frames can be routed to the camera interfaces. Signed-off-by: Steve Longerbeam--- drivers/staging/media/imx/Makefile|2 + drivers/staging/media/imx/imx-ic-common.c | 113 +++ drivers/staging/media/imx/imx-ic-pp.c | 636 drivers/staging/media/imx/imx-ic-prpenc.c | 1037 + drivers/staging/media/imx/imx-ic-prpvf.c | 1180 + drivers/staging/media/imx/imx-ic.h| 36 + 6 files changed, 3004 insertions(+) create mode 100644 drivers/staging/media/imx/imx-ic-common.c create mode 100644 drivers/staging/media/imx/imx-ic-pp.c create mode 100644 drivers/staging/media/imx/imx-ic-prpenc.c create mode 100644 drivers/staging/media/imx/imx-ic-prpvf.c create mode 100644 drivers/staging/media/imx/imx-ic.h diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 3559d7b..d2a962c 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -1,8 +1,10 @@ imx-media-objs := imx-media-dev.o imx-media-fim.o imx-media-internal-sd.o \ imx-media-of.o +imx-ic-objs := imx-ic-common.o imx-ic-prpenc.o imx-ic-prpvf.o imx-ic-pp.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o +obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o diff --git a/drivers/staging/media/imx/imx-ic-common.c b/drivers/staging/media/imx/imx-ic-common.c new file mode 100644 index 000..1b40558 --- /dev/null +++ b/drivers/staging/media/imx/imx-ic-common.c @@ -0,0 +1,113 @@ +/* + * V4L2 Image Converter Subdev for Freescale i.MX5/6 SOC + * + * Copyright (c) 2014-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include "imx-media.h" +#include "imx-ic.h" + +static struct imx_ic_ops *ic_ops[IC_NUM_TASKS] = { + [IC_TASK_ENCODER]= _ic_prpenc_ops, + [IC_TASK_VIEWFINDER] = _ic_prpvf_ops, + [IC_TASK_POST_PROCESSOR] = _ic_pp_ops, +}; + +static int imx_ic_probe(struct platform_device *pdev) +{ + struct imx_media_internal_sd_platformdata *pdata; + struct imx_ic_priv *priv; + int ret; + + priv = devm_kzalloc(>dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + platform_set_drvdata(pdev, >sd); + priv->dev = >dev; + + /* get our ipu_id, grp_id and IC task id */ + pdata = priv->dev->platform_data; + priv->ipu_id = pdata->ipu_id; + switch (pdata->grp_id) { + case IMX_MEDIA_GRP_ID_IC_PRPENC: + priv->task_id = IC_TASK_ENCODER; + break; + case IMX_MEDIA_GRP_ID_IC_PRPVF: + priv->task_id = IC_TASK_VIEWFINDER; + break; + case IMX_MEDIA_GRP_ID_IC_PP0...IMX_MEDIA_GRP_ID_IC_PP3: + priv->task_id = IC_TASK_POST_PROCESSOR; + break; + default: + return -EINVAL; + } + + v4l2_subdev_init(>sd, ic_ops[priv->task_id]->subdev_ops); + v4l2_set_subdevdata(>sd, priv); + priv->sd.internal_ops = ic_ops[priv->task_id]->internal_ops; + priv->sd.entity.ops = ic_ops[priv->task_id]->entity_ops; + priv->sd.entity.function = MEDIA_ENT_F_PROC_VIDEO_SCALER; + priv->sd.dev = >dev; + priv->sd.owner = THIS_MODULE; + priv->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; + priv->sd.grp_id = pdata->grp_id; + strncpy(priv->sd.name, pdata->sd_name, sizeof(priv->sd.name)); + + ret = ic_ops[priv->task_id]->init(priv); +
[PATCH v2 07/19] ARM: dts: imx6-sabreauto: add reset-gpios property for max7310_b
The reset pin to the port expander chip (MAX7310) is controlled by a gpio, so define a reset-gpios property to control it. There are three MAX7310's on the SabreAuto CPU card (max7310_[abc]), but all use the same pin for their reset. Since all can't acquire the same pin, assign it to max7310_b, that chip is needed by more functions (usb and adv7180). Signed-off-by: Steve Longerbeam--- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 4a6d038..516bac6 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -136,6 +136,9 @@ reg = <0x32>; gpio-controller; #gpio-cells = <2>; + pinctrl-names = "default"; + pinctrl-0 = <_max7310>; + reset-gpios = < 15 GPIO_ACTIVE_LOW>; }; max7310_c: gpio@34 { @@ -442,6 +445,12 @@ >; }; + pinctrl_max7310: max7310grp { + fsl,pins = < + MX6QDL_PAD_SD2_DAT0__GPIO1_IO15 0x8000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1 -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 08/19] ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture
Add pinctrl groups for both GPT input capture channels. Signed-off-by: Steve Longerbeam--- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 12 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 516bac6..83ac2ff 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -457,6 +457,18 @@ >; }; + pinctrl_gpt_input_capture0: gptinputcapture0grp { + fsl,pins = < + MX6QDL_PAD_SD1_DAT0__GPT_CAPTURE1 0x8000 + >; + }; + + pinctrl_gpt_input_capture1: gptinputcapture1grp { + fsl,pins = < + MX6QDL_PAD_SD1_DAT1__GPT_CAPTURE2 0x8000 + >; + }; + pinctrl_spdif: spdifgrp { fsl,pins = < MX6QDL_PAD_KEY_COL3__SPDIF_IN 0x1b0b0 -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 14/19] media: imx: Add Camera Interface subdev driver
This is the camera interface driver that provides the v4l2 user interface. Frames can be received from various sources: - directly from SMFC for capturing unconverted images directly from camera sensors. - from the IC pre-process encode task. - from the IC pre-process viewfinder task. - from the IC post-process task. Signed-off-by: Steve Longerbeam--- drivers/staging/media/imx/Makefile|2 +- drivers/staging/media/imx/imx-camif.c | 1010 + 2 files changed, 1011 insertions(+), 1 deletion(-) create mode 100644 drivers/staging/media/imx/imx-camif.c diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index d2a962c..fe9e992 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -8,4 +8,4 @@ obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-ic.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-csi.o obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-smfc.o - +obj-$(CONFIG_VIDEO_IMX_CAMERA) += imx-camif.o diff --git a/drivers/staging/media/imx/imx-camif.c b/drivers/staging/media/imx/imx-camif.c new file mode 100644 index 000..3cf167e --- /dev/null +++ b/drivers/staging/media/imx/imx-camif.c @@ -0,0 +1,1010 @@ +/* + * Video Camera Capture Subdev for Freescale i.MX5/6 SOC + * + * Copyright (c) 2012-2016 Mentor Graphics Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "imx-media.h" + +#define DEVICE_NAME "imx-media-camif" + +#define CAMIF_NUM_PADS 2 + +#define CAMIF_DQ_TIMEOUT5000 + +struct camif_priv; + +struct camif_priv { + struct device *dev; + struct video_devicevfd; + struct media_pipeline mp; + struct imx_media_dev *md; + struct v4l2_subdev sd; + struct media_pad pad[CAMIF_NUM_PADS]; + struct media_pad vd_pad; + int id; + int input_pad; + int output_pad; + + struct v4l2_mbus_framefmt format_mbus[CAMIF_NUM_PADS]; + const struct imx_media_pixfmt *cc[CAMIF_NUM_PADS]; + + /* dma buffer ring */ + struct imx_media_dma_buf_ring *in_ring; + struct v4l2_subdev *src_sd; + + struct mutex mutex; /* capture device mutex */ + spinlock_t q_lock; /* protect ready_q */ + + /* buffer queue used in videobuf2 */ + struct vb2_queue buffer_queue; + + /* streaming buffer queue */ + struct list_head ready_q; + + /* controls inherited from subdevs */ + struct v4l2_ctrl_handler ctrl_hdlr; + + /* misc status */ + intcurrent_input; /* the current input */ + v4l2_std_idcurrent_std; /* current standard */ + bool stop; /* streaming is stopping */ +}; + +/* In bytes, per queue */ +#define VID_MEM_LIMIT SZ_64M + +static struct vb2_ops camif_qops; + +/* + * Video ioctls follow + */ + +static int vidioc_querycap(struct file *file, void *fh, + struct v4l2_capability *cap) +{ + strncpy(cap->driver, DEVICE_NAME, sizeof(cap->driver) - 1); + strncpy(cap->card, DEVICE_NAME, sizeof(cap->card) - 1); + cap->bus_info[0] = 0; + cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; + + return 0; +} + +static int camif_enum_fmt_vid_cap(struct file *file, void *fh, + struct v4l2_fmtdesc *f) +{ + const struct imx_media_pixfmt *cc; + u32 code; + int ret; + + ret = imx_media_enum_format(, f->index, true, true); + if (ret) + return ret; + cc = imx_media_find_format(0, code, true, true); + if (!cc) + return -EINVAL; + + f->pixelformat = cc->fourcc; + + return 0; +} + +static int camif_g_fmt_vid_cap(struct file *file, void *fh, + struct v4l2_format *f) +{ + struct camif_priv *priv = video_drvdata(file); + struct v4l2_mbus_framefmt *outfmt; + + /* user format is the same as the format from output pad */ + outfmt = >format_mbus[priv->output_pad]; + return imx_media_mbus_fmt_to_pix_fmt(>fmt.pix, outfmt); +} + +static int camif_try_fmt_vid_cap(struct file *file, void *fh, +struct v4l2_format *f) +{ + return camif_g_fmt_vid_cap(file, fh, f); +} + +static int camif_s_fmt_vid_cap(struct file *file, void *fh, + struct v4l2_format *f) +{ +
[PATCH v2 00/19] i.MX Media Driver
In version 2 (no functional changes): - removed patch "gpio: pca953x: Add optional reset gpio control", it has been submitted separately. - fixed some whitespace errors. - added a few missing Signed-off-by's. Philipp Zabel (2): ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their connections media: imx: Add video switch subdev driver Steve Longerbeam (17): ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node ARM: dts: imx6qdl: add media device ARM: dts: imx6-sabrelite: add OV5642 and OV5640 camera sensors ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors ARM: dts: imx6-sabreauto: create i2cmux for i2c3 ARM: dts: imx6-sabreauto: add reset-gpios property for max7310_b ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture ARM: dts: imx6-sabreauto: add the ADV7180 video decoder media: Add i.MX media core driver media: imx: Add CSI subdev driver media: imx: Add SMFC subdev driver media: imx: Add IC subdev drivers media: imx: Add Camera Interface subdev driver media: imx: Add MIPI CSI-2 Receiver subdev driver media: imx: Add MIPI CSI-2 OV5640 sensor subdev driver media: imx: Add Parallel OV5642 sensor subdev driver ARM: imx_v6_v7_defconfig: Enable staging video4linux drivers Documentation/devicetree/bindings/media/imx.txt | 205 + Documentation/media/v4l-drivers/imx.rst | 430 ++ arch/arm/boot/dts/imx6dl-sabrelite.dts|5 + arch/arm/boot/dts/imx6dl-sabresd.dts |5 + arch/arm/boot/dts/imx6dl.dtsi | 183 + arch/arm/boot/dts/imx6q-sabrelite.dts |6 + arch/arm/boot/dts/imx6q-sabresd.dts |5 + arch/arm/boot/dts/imx6q.dtsi | 123 + arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 142 +- arch/arm/boot/dts/imx6qdl-sabrelite.dtsi | 122 +- arch/arm/boot/dts/imx6qdl-sabresd.dtsi| 114 +- arch/arm/boot/dts/imx6qdl.dtsi| 25 +- arch/arm/configs/imx_v6_v7_defconfig | 10 +- drivers/staging/media/Kconfig |2 + drivers/staging/media/Makefile|1 + drivers/staging/media/imx/Kconfig | 36 + drivers/staging/media/imx/Makefile| 16 + drivers/staging/media/imx/TODO| 18 + drivers/staging/media/imx/imx-camif.c | 1010 + drivers/staging/media/imx/imx-csi.c | 638 +++ drivers/staging/media/imx/imx-ic-common.c | 113 + drivers/staging/media/imx/imx-ic-pp.c | 636 +++ drivers/staging/media/imx/imx-ic-prpenc.c | 1037 + drivers/staging/media/imx/imx-ic-prpvf.c | 1180 ++ drivers/staging/media/imx/imx-ic.h| 36 + drivers/staging/media/imx/imx-media-common.c | 985 + drivers/staging/media/imx/imx-media-dev.c | 479 +++ drivers/staging/media/imx/imx-media-fim.c | 509 +++ drivers/staging/media/imx/imx-media-internal-sd.c | 457 +++ drivers/staging/media/imx/imx-media-of.c | 291 ++ drivers/staging/media/imx/imx-media-of.h | 25 + drivers/staging/media/imx/imx-media.h | 299 ++ drivers/staging/media/imx/imx-mipi-csi2.c | 509 +++ drivers/staging/media/imx/imx-smfc.c | 739 drivers/staging/media/imx/imx-video-switch.c | 351 ++ drivers/staging/media/imx/ov5640-mipi.c | 2349 +++ drivers/staging/media/imx/ov5642.c| 4364 + include/media/imx.h | 15 + include/uapi/Kbuild |1 + include/uapi/linux/v4l2-controls.h|4 + include/uapi/media/Kbuild |2 + include/uapi/media/imx.h | 30 + 42 files changed, 17479 insertions(+), 28 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/imx.txt create mode 100644 Documentation/media/v4l-drivers/imx.rst create mode 100644 drivers/staging/media/imx/Kconfig create mode 100644 drivers/staging/media/imx/Makefile create mode 100644 drivers/staging/media/imx/TODO create mode 100644 drivers/staging/media/imx/imx-camif.c create mode 100644 drivers/staging/media/imx/imx-csi.c create mode 100644 drivers/staging/media/imx/imx-ic-common.c create mode 100644 drivers/staging/media/imx/imx-ic-pp.c create mode 100644 drivers/staging/media/imx/imx-ic-prpenc.c create mode 100644 drivers/staging/media/imx/imx-ic-prpvf.c create mode 100644 drivers/staging/media/imx/imx-ic.h create mode 100644 drivers/staging/media/imx/imx-media-common.c create mode 100644 drivers/staging/media/imx/imx-media-dev.c create mode 100644 drivers/staging/media/imx/imx-media-fim.c create mode 100644 drivers/staging/media/imx/imx-media-internal-sd.c create mode 100644 drivers/staging/media/imx/imx-media-of.c create mode 100644
[PATCH v2 02/19] ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their connections
From: Philipp ZabelThis patch adds the device tree graph connecting the input multiplexers to the IPU CSIs and the MIPI-CSI2 gasket on i.MX6. The MIPI_IPU multiplexers are added as children of the iomuxc-gpr syscon device node. On i.MX6Q/D two two-input multiplexers in front of IPU1 CSI0 and IPU2 CSI1 allow to select between CSI0/1 parallel input pads and the MIPI CSI-2 virtual channels 0/3. On i.MX6DL/S two five-input multiplexers in front of IPU1 CSI0 and IPU1 CSI1 allow to select between CSI0/1 parallel input pads and any of the four MIPI CSI-2 virtual channels. Signed-off-by: Philipp Zabel - Removed some dangling/unused endpoints (ipu2_csi0_from_csi2ipu) - Renamed the mipi virtual channel endpoint labels, from "mipi_csiX_..." to "mipi_vcX...". - Added input endpoints to the video muxes for the connections from parallel sensors. - Added input endpoints to the mipi_csi for the connections from mipi csi-2 sensors. - The video multiplexer node has compatible string "imx-video-mux" instead of "video-multiplexer". - The video multiplexer node indicates GPR register via reg propert only, (register offset and bitmask), instead of specifying with "bit-mask" and "bit-shift" properties. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6dl.dtsi | 183 + arch/arm/boot/dts/imx6q.dtsi | 119 +++ arch/arm/boot/dts/imx6qdl.dtsi | 10 ++- 3 files changed, 311 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi index 1ade195..0a1718c 100644 --- a/arch/arm/boot/dts/imx6dl.dtsi +++ b/arch/arm/boot/dts/imx6dl.dtsi @@ -181,6 +181,189 @@ "di0", "di1"; }; + { + ipu1_csi0_mux: ipu1_csi0_mux@34 { + compatible = "imx-video-mux"; + reg = <0x34 0x07>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port@0 { + reg = <0>; + + ipu1_csi0_mux_from_mipi_vc0: endpoint { + remote-endpoint = <_vc0_to_ipu1_csi0_mux>; + }; + }; + + port@1 { + reg = <1>; + + ipu1_csi0_mux_from_mipi_vc1: endpoint { + remote-endpoint = <_vc1_to_ipu1_csi0_mux>; + }; + }; + + port@2 { + reg = <2>; + + ipu1_csi0_mux_from_mipi_vc2: endpoint { + remote-endpoint = <_vc2_to_ipu1_csi0_mux>; + }; + }; + + port@3 { + reg = <3>; + + ipu1_csi0_mux_from_mipi_vc3: endpoint { + remote-endpoint = <_vc3_to_ipu1_csi0_mux>; + }; + }; + + port@4 { + reg = <4>; + + ipu1_csi0_mux_from_parallel_sensor: endpoint { + }; + }; + + port@5 { + reg = <5>; + + ipu1_csi0_mux_to_ipu1_csi0: endpoint { + remote-endpoint = <_csi0_from_ipu1_csi0_mux>; + }; + }; + }; + + ipu1_csi1_mux: ipu1_csi1_mux@34 { + compatible = "imx-video-mux"; + reg = <0x34 0x38>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port@0 { + reg = <0>; + + ipu1_csi1_mux_from_mipi_vc0: endpoint { + remote-endpoint = <_vc0_to_ipu1_csi1_mux>; + }; + }; + + port@1 { + reg = <1>; + + ipu1_csi1_mux_from_mipi_vc1: endpoint { + remote-endpoint = <_vc1_to_ipu1_csi1_mux>; + }; + }; + + port@2 { + reg = <2>; + + ipu1_csi1_mux_from_mipi_vc2: endpoint { + remote-endpoint = <_vc2_to_ipu1_csi1_mux>; + }; + }; + + port@3 { + reg = <3>; + + ipu1_csi1_mux_from_mipi_vc3: endpoint { + remote-endpoint = <_vc3_to_ipu1_csi1_mux>; + }; + }; + + port@4 { + reg = <4>; + + ipu1_csi1_mux_from_parallel_sensor: endpoint { + }; + }; + + port@5 { + reg = <5>; + +
Re: [PATCH 00/20] i.MX Media Driver
Hi Fabio, On 01/02/2017 01:09 PM, Fabio Estevam wrote: Hi Steve, On Thu, Dec 29, 2016 at 8:27 PM, Steve Longerbeamwrote: This is a media driver for video capture on i.MX. Refer to Documentation/media/v4l-drivers/imx.rst for example capture pipelines on SabreSD, SabreAuto, and SabreLite reference platforms. This patchset includes the OF graph layout as proposed by Philipp Zabel, with only minor changes which are enumerated in the patch header. Patches 13, 14 and 19 miss your Signed-off-by tag. thanks for catching. I've added them to version 2. Steve Tested the whole series on a mx6qsabresd: Tested-by: Fabio Estevam -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] dt: bindings: Add support for CSI1 bus
On Wed, Dec 28, 2016 at 07:30:36PM +0100, Pavel Machek wrote: > From: Sakari Ailus> > In the vast majority of cases the bus type is known to the driver(s) > since a receiver or transmitter can only support a single one. There > are cases however where different options are possible. What cases specifically? > Document the CSI1/CCP2 properties strobe_clk_inv and strobe_clock > properties. The former tells whether the strobe/clock signal is > inverted, while the latter signifies the clock or strobe mode. > > Signed-off-by: Sakari Ailus > Signed-off-by: Ivaylo Dimitrov > Signed-off-by: Pavel Machek > > diff --git a/Documentation/devicetree/bindings/media/video-interfaces.txt > b/Documentation/devicetree/bindings/media/video-interfaces.txt > index 9cd2a36..f0523f7 100644 > --- a/Documentation/devicetree/bindings/media/video-interfaces.txt > +++ b/Documentation/devicetree/bindings/media/video-interfaces.txt > @@ -76,6 +76,10 @@ Optional endpoint properties >mode horizontal and vertical synchronization signals are provided to the >slave device (data source) by the master device (data sink). In the master >mode the data source device is also the source of the synchronization > signals. > +- bus-type: data bus type. Possible values are: > + 0 - CSI2 As in MIPI CSI2? > + 1 - parallel / Bt656 > + 2 - CCP2 > - bus-width: number of data lines actively used, valid for the parallel > busses. > - data-shift: on the parallel data busses, if bus-width is used to specify > the >number of data lines, data-shift can be used to specify which data lines > are > @@ -110,9 +114,10 @@ Optional endpoint properties >lane and followed by the data lanes in the same order as in data-lanes. >Valid values are 0 (normal) and 1 (inverted). The length of the array >should be the combined length of data-lanes and clock-lanes properties. > - If the lane-polarities property is omitted, the value must be interpreted > - as 0 (normal). This property is valid for serial busses only. Why is this removed? > - > +- clock-inv: Clock or strobe signal inversion. > + Possible values: 0 -- not inverted; 1 -- inverted "invert" assumes I know what is normal and I do not. Define what is "normal" and name the property the opposite of that. If normal is data shifted on clock rising edge, then call the the property "clock-shift-falling-edge" for example.. > +- strobe: Whether the clock signal is used as clock or strobe. Used > + with CCP2, for instance. > > Example > --- > > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [media] adv7170: drop redundant ret local
Simplifies return value logic of adv7170_set_fmt(). Signed-off-by: Baruch Siach--- drivers/media/i2c/adv7170.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/adv7170.c b/drivers/media/i2c/adv7170.c index fc9ec0f3679c..9b0d6a4973c0 100644 --- a/drivers/media/i2c/adv7170.c +++ b/drivers/media/i2c/adv7170.c @@ -302,7 +302,6 @@ static int adv7170_set_fmt(struct v4l2_subdev *sd, { struct v4l2_mbus_framefmt *mf = >format; u8 val = adv7170_read(sd, 0x7); - int ret = 0; if (format->pad) return -EINVAL; @@ -323,9 +322,9 @@ static int adv7170_set_fmt(struct v4l2_subdev *sd, } if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) - ret = adv7170_write(sd, 0x7, val); + return adv7170_write(sd, 0x7, val); - return ret; + return 0; } /* --- */ -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] [media] ov2659: remove NOP assignment
The loop over the ov2659_formats[] array just a few line above verifies that mf->code matches the selected array entry. Signed-off-by: Baruch Siach--- drivers/media/i2c/ov2659.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c index 1f999e9c0118..6e6367214d40 100644 --- a/drivers/media/i2c/ov2659.c +++ b/drivers/media/i2c/ov2659.c @@ -1121,7 +1121,6 @@ static int ov2659_set_fmt(struct v4l2_subdev *sd, return -EINVAL; mf->colorspace = V4L2_COLORSPACE_SRGB; - mf->code = ov2659_formats[index].code; mf->field = V4L2_FIELD_NONE; mutex_lock(>lock); -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v7 1/2] Add OV5647 device tree documentation
On Tue, Dec 27, 2016 at 01:59:02PM +, Ramiro Oliveira wrote: > Create device tree bindings documentation. > > Signed-off-by: Ramiro Oliveira> --- > .../devicetree/bindings/media/i2c/ov5647.txt | 35 > ++ > 1 file changed, 35 insertions(+) > create mode 100644 Documentation/devicetree/bindings/media/i2c/ov5647.txt Acked-by: Rob Herring -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] media: entity: Catch unbalanced media_pipeline_stop calls
On 03/01/17 13:36, Laurent Pinchart wrote: > Hi Kieran, > > Thank you for the patch. > > On Tuesday 03 Jan 2017 13:12:11 Kieran Bingham wrote: >> Drivers must not perform unbalanced calls to stop the entity pipeline, >> however if they do they will fault in the core media code, as the >> entity->pipe will be set as NULL. We handle this gracefully in the core >> with a WARN for the developer. >> >> Replace the erroneous check on zero streaming counts, with a check on >> NULL pipe elements instead, as this is the symptom of unbalanced >> media_pipeline_stop calls. >> >> Signed-off-by: Kieran Bingham> > This looks good to me, > > Acked-by: Laurent Pinchart > > I'll let Sakari review and merge the patch. Ahh, yes - I forgot to mention, although perhaps it will be obvious for Sakari - but this patch is based on top of Sakari's pending media pipeline and graph walk cleanup series :D -- Regards Kieran > >> --- >> drivers/media/media-entity.c | 7 ++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c >> index caa13e6f09f5..cb1fb2c17f85 100644 >> --- a/drivers/media/media-entity.c >> +++ b/drivers/media/media-entity.c >> @@ -534,8 +534,13 @@ void __media_pipeline_stop(struct media_entity *entity) >> struct media_graph *graph = >pipe->graph; >> struct media_pipeline *pipe = entity->pipe; >> >> +/* >> + * If the following check fails, the driver has performed an >> + * unbalanced call to media_pipeline_stop() >> + */ >> +if (WARN_ON(!pipe)) >> +return; >> >> -WARN_ON(!pipe->streaming_count); >> media_graph_walk_start(graph, entity); >> >> while ((entity = media_graph_walk_next(graph))) { > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] uapi: use wildcards to list files
From: Nicolas DichtelDate: Tue, 3 Jan 2017 15:35:44 +0100 > Regularly, when a new header is created in include/uapi/, the developer > forgets to add it in the corresponding Kbuild file. This error is usually > detected after the release is out. > > In fact, all headers under include/uapi/ should be exported, so let's > use wildcards. > > After this patch, the following files, which were not exported, are now > exported: ... > > Signed-off-by: Nicolas Dichtel Acked-by: David S. Miller -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v2 6/7] dt-bindings: media: Add Renesas R-Car DRIF binding
Hi Laurent, Geert, Thanks for the review comments. > > On Wednesday 21 Dec 2016 08:10:37 Ramesh Shanmugasundaram wrote: > >> Add binding documentation for Renesas R-Car Digital Radio Interface > >> (DRIF) controller. > >> > >> Signed-off-by: Ramesh Shanmugasundaram > >>--- > >> .../devicetree/bindings/media/renesas,drif.txt | 202 > ++ > >> 1 file changed, 202 insertions(+) > >> create mode 100644 > >> Documentation/devicetree/bindings/media/renesas,drif.txt > >> > >> diff --git a/Documentation/devicetree/bindings/media/renesas,drif.txt > >> b/Documentation/devicetree/bindings/media/renesas,drif.txt new file > >> mode > >> 100644 > >> index 000..1f3feaf > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/media/renesas,drif.txt > > >> +Optional properties of an internal channel when: > >> + - It is the only enabled channel of the bond (or) > >> + - If it acts as primary among enabled bonds > >> + > >> +- renesas,syncmd : sync mode > >> + 0 (Frame start sync pulse mode. 1-bit width > pulse > >> + indicates start of a frame) > >> + 1 (L/R sync or I2S mode) (default) > >> +- renesas,lsb-first: empty property indicates lsb bit is received > >> first. > >> + When not defined msb bit is received first > >> +(default) > >> +- renesas,syncac-active: Indicates sync signal polarity, 0/1 for > low/high > >> + respectively. The default is 1 (active high) > >> +- renesas,dtdl : delay between sync signal and start of > reception. > >> + The possible values are represented in 0.5 clock > >> + cycle units and the range is 0 to 4. The default > >> + value is 2 (i.e.) 1 clock cycle delay. > >> +- renesas,syncdl : delay between end of reception and sync > signal > >> edge. > >> + The possible values are represented in 0.5 clock > >> + cycle units and the range is 0 to 4 & 6. The > default > >> + value is 0 (i.e.) no delay. > > > > Most of these properties are pretty similar to the video bus > > properties defined at the endpoint level in > > Documentation/devicetree/bindings/media/video-interfaces.txt. I > > believe it would make sense to use OF graph and try to standardize > > these properties similarly. > > Note that the last two properties match the those in > Documentation/devicetree/bindings/spi/sh-msiof.txt. > We may want to use one DRIF channel as a plain SPI slave with the > (modified) MSIOF driver in the future. Should I leave it as it is or modify these as in video-interfaces.txt? Shall we conclude on this please? Thanks, Ramesh
Re: [PATCH v3 4/4] uvcvideo: add a metadata device node
Hi Laurent, On Fri, 30 Dec 2016, Laurent Pinchart wrote: > Hi Guennadi, > > On Friday 30 Dec 2016 14:04:34 Guennadi Liakhovetski wrote: > > On Fri, 30 Dec 2016, Laurent Pinchart wrote: > > > On Friday 30 Dec 2016 11:43:02 Guennadi Liakhovetski wrote: > > >> Hi Laurent, > > >> > > >> I'd like to discuss extending this patch a bit, preferably as an > > >> incremental patch. > > >> > > >> First let me confirm my current understanding of the way the UVC driver > > >> creates its media device topology. Do I understand it correctly, that > > >> the driver allocates UVC entities (not media controller entities) for all > > >> UVC units and terminals, but then uses subdevices for all such UVC > > >> entities, except terminals, i.e. only for UVC units? struct uvc_entity > > >> has an embedded struct v4l2_subdev object, but it's unused for UVC > > >> terminals. Instead terminals are associated to video devices, which are > > >> then linked into the MC topology? Is this my understanding correct? > > > > > > That's correct, but looking at the code now, I think the driver should use > > > a struct media_entity directly instead of a struct v4l2_subdev as it > > > doesn't need any of the infrastructure provided by subdevs. > > > > > >> I have a problem with the current version of this patch, that there is > > >> no way to associate video device nodes with respepctive metadata nodes. > > >> Would it be acceptable to use an MC link for this association? > > > > > > No, links describe data connections. > > > > Well, it is data - it's metadata, extracted from USB buffers. A further argument to this cause: currently the metadata node isn't connected to anything, it's "floating freely," which is wrong too. It does stream data and we have to bind it somewhere. I see 2 possibilities: either link them to the same entity, as the actual video data, adding more endpoints to it, or link them to video nodes. The latter way would allow for easy matching. If we use the former approach, we could still agree to have pad #2*n and #2*n+1 to be matching video and metadata pads, but that would be less straight-forward. Thanks Guennadi > > >> Is it allowed for video device MC entities to have source pads > > >> additionally to their (usually single) sink pad(s) (in case of input > > >> video devices)? If that would be acceptable, I could create an additional > > >> patch to add a source pad to output terminal video nodes to link it to > > >> metadata nodes. > > > > > > That's a hack, I don't think it's a good idea. > > > > Ok, would a completely specialised one-off sysfs solution be better? Maybe > > a link under the metadata node to the main node? > > Come on, I know you're better than that. Stop thinking short term about the > quickest hack that can provide the feature you need. > > -- > Regards, > > Laurent Pinchart > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 3/3] arm: sti: update sti-cec for HPD notifier support
To use HPD notifier sti CEC driver needs to get phandle of the hdmi device. Signed-off-by: Benjamin Gaignard--- arch/arm/boot/dts/stih407-family.dtsi | 12 arch/arm/boot/dts/stih410.dtsi| 13 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi index c8b2944..592d235 100644 --- a/arch/arm/boot/dts/stih407-family.dtsi +++ b/arch/arm/boot/dts/stih407-family.dtsi @@ -756,18 +756,6 @@ <_s_c0_flexgen CLK_ETH_PHY>; }; - cec: sti-cec@094a087c { - compatible = "st,stih-cec"; - reg = <0x94a087c 0x64>; - clocks = <_sysin>; - clock-names = "cec-clk"; - interrupts = ; - interrupt-names = "cec-irq"; - pinctrl-names = "default"; - pinctrl-0 = <_cec0_default>; - resets = < STIH407_LPM_SOFTRESET>; - }; - rng10: rng@08a89000 { compatible = "st,rng"; reg = <0x08a89000 0x1000>; diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi index 281a124..e8c01f7 100644 --- a/arch/arm/boot/dts/stih410.dtsi +++ b/arch/arm/boot/dts/stih410.dtsi @@ -259,5 +259,18 @@ clocks = <_sysin>; interrupts = ; }; + + sti-cec@094a087c { + compatible = "st,stih-cec"; + reg = <0x94a087c 0x64>; + clocks = <_sysin>; + clock-names = "cec-clk"; + interrupts = ; + interrupt-names = "cec-irq"; + pinctrl-names = "default"; + pinctrl-0 = <_cec0_default>; + resets = < STIH407_LPM_SOFTRESET>; + st,hdmi-handle = <_hdmi>; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 2/3] stih-cec: add HPD notifier support
By using the HPD notifier framework there is no longer any reason to manually set the physical address. This was the one blocking issue that prevented this driver from going out of staging, so do this move as well. Update the bindings documentation the new hdmi phandle. Signed-off-by: Benjamin Gaignard--- version 2: - use HPD notifier - move stih-cec out of staging - split driver code and devicetree change in two patches --- .../devicetree/bindings/media/stih-cec.txt | 2 + drivers/media/platform/Kconfig | 10 + drivers/media/platform/Makefile| 1 + drivers/media/platform/sti/cec/Makefile| 1 + drivers/media/platform/sti/cec/stih-cec.c | 404 + drivers/staging/media/Kconfig | 2 - drivers/staging/media/Makefile | 1 - drivers/staging/media/st-cec/Kconfig | 8 - drivers/staging/media/st-cec/Makefile | 1 - drivers/staging/media/st-cec/TODO | 7 - drivers/staging/media/st-cec/stih-cec.c| 379 --- 11 files changed, 418 insertions(+), 398 deletions(-) create mode 100644 drivers/media/platform/sti/cec/Makefile create mode 100644 drivers/media/platform/sti/cec/stih-cec.c delete mode 100644 drivers/staging/media/st-cec/Kconfig delete mode 100644 drivers/staging/media/st-cec/Makefile delete mode 100644 drivers/staging/media/st-cec/TODO delete mode 100644 drivers/staging/media/st-cec/stih-cec.c diff --git a/Documentation/devicetree/bindings/media/stih-cec.txt b/Documentation/devicetree/bindings/media/stih-cec.txt index 71c4b2f..7d82121 100644 --- a/Documentation/devicetree/bindings/media/stih-cec.txt +++ b/Documentation/devicetree/bindings/media/stih-cec.txt @@ -9,6 +9,7 @@ Required properties: - pinctrl-names: Contains only one value - "default" - pinctrl-0: Specifies the pin control groups used for CEC hardware. - resets: Reference to a reset controller + - st,hdmi-handle: Phandle to the HMDI controller Example for STIH407: @@ -22,4 +23,5 @@ sti-cec@094a087c { pinctrl-names = "default"; pinctrl-0 = <_cec0_default>; resets = < STIH407_LPM_SOFTRESET>; + st,hdmi-handle = <>; }; diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig index 0d7acf1..e5f680e 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -408,6 +408,16 @@ config VIDEO_SAMSUNG_S5P_CEC CEC bus is present in the HDMI connector and enables communication between compatible devices. +config VIDEO_STI_HDMI_CEC + tristate "STMicroelectronics STiH4xx HDMI CEC driver" + depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (ARCH_STI || COMPILE_TEST) + select HPD_NOTIFIER + ---help--- + This is a driver for STIH4xx HDMI CEC interface. It uses the + generic CEC framework interface. + CEC bus is present in the HDMI connector and enables communication + between compatible devices. + endif #V4L_CEC_DRIVERS menuconfig V4L_TEST_DRIVERS diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile index ad3bf22..01b689c 100644 --- a/drivers/media/platform/Makefile +++ b/drivers/media/platform/Makefile @@ -39,6 +39,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC)+= exynos-gsc/ obj-$(CONFIG_VIDEO_STI_BDISP) += sti/bdisp/ obj-$(CONFIG_VIDEO_STI_HVA)+= sti/hva/ obj-$(CONFIG_DVB_C8SECTPFE)+= sti/c8sectpfe/ +obj-$(CONFIG_VIDEO_STI_HDMI_CEC) += sti/cec/ obj-$(CONFIG_BLACKFIN) += blackfin/ diff --git a/drivers/media/platform/sti/cec/Makefile b/drivers/media/platform/sti/cec/Makefile new file mode 100644 index 000..f07905e --- /dev/null +++ b/drivers/media/platform/sti/cec/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_VIDEO_STI_HDMI_CEC) += stih-cec.o diff --git a/drivers/media/platform/sti/cec/stih-cec.c b/drivers/media/platform/sti/cec/stih-cec.c new file mode 100644 index 000..e50e916 --- /dev/null +++ b/drivers/media/platform/sti/cec/stih-cec.c @@ -0,0 +1,404 @@ +/* + * STIH4xx CEC driver + * Copyright (C) STMicroelectronic SA 2016 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define CEC_NAME "stih-cec" + +/* CEC registers */ +#define CEC_CLK_DIV 0x0 +#define CEC_CTRL 0x4 +#define CEC_IRQ_CTRL 0x8 +#define CEC_STATUS0xC +#define CEC_EXT_STATUS0x10 +#define CEC_TX_CTRL 0x14 +#define CEC_FREE_TIME_THRESH 0x18 +#define CEC_BIT_TOUT_THRESH 0x1C +#define
[PATCH v2 1/3] sti: hdmi: add HPD notifier support
Implement the HPD notifier support to allow CEC drivers to be informed when there is a new EDID and when a connect or disconnect happens. Signed-off-by: Benjamin Gaignard--- version 2: - use HPD notifier instead of HDMI notifier --- drivers/gpu/drm/sti/Kconfig| 1 + drivers/gpu/drm/sti/sti_hdmi.c | 14 ++ drivers/gpu/drm/sti/sti_hdmi.h | 3 +++ 3 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/sti/Kconfig b/drivers/gpu/drm/sti/Kconfig index acd7286..f5c9572 100644 --- a/drivers/gpu/drm/sti/Kconfig +++ b/drivers/gpu/drm/sti/Kconfig @@ -8,5 +8,6 @@ config DRM_STI select DRM_PANEL select FW_LOADER select SND_SOC_HDMI_CODEC if SND_SOC + select HPD_NOTIFIER help Choose this option to enable DRM on STM stiH4xx chipset diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 376b076..d32a383 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -786,6 +786,8 @@ static void sti_hdmi_disable(struct drm_bridge *bridge) clk_disable_unprepare(hdmi->clk_pix); hdmi->enabled = false; + + hpd_event_disconnect(hdmi->notifier); } static void sti_hdmi_pre_enable(struct drm_bridge *bridge) @@ -892,6 +894,9 @@ static int sti_hdmi_connector_get_modes(struct drm_connector *connector) if (!edid) goto fail; + hpd_event_new_edid(hdmi->notifier, edid, + EDID_LENGTH * (edid->extensions + 1)); + count = drm_add_edid_modes(connector, edid); drm_mode_connector_update_edid_property(connector, edid); drm_edid_to_eld(connector, edid); @@ -949,10 +954,12 @@ struct drm_connector_helper_funcs sti_hdmi_connector_helper_funcs = { if (hdmi->hpd) { DRM_DEBUG_DRIVER("hdmi cable connected\n"); + hpd_event_connect(hdmi->notifier); return connector_status_connected; } DRM_DEBUG_DRIVER("hdmi cable disconnected\n"); + hpd_event_disconnect(hdmi->notifier); return connector_status_disconnected; } @@ -1464,6 +1471,10 @@ static int sti_hdmi_probe(struct platform_device *pdev) goto release_adapter; } + hdmi->notifier = hpd_notifier_get(>dev); + if (!hdmi->notifier) + goto release_adapter; + hdmi->reset = devm_reset_control_get(dev, "hdmi"); /* Take hdmi out of reset */ if (!IS_ERR(hdmi->reset)) @@ -1483,11 +1494,14 @@ static int sti_hdmi_remove(struct platform_device *pdev) { struct sti_hdmi *hdmi = dev_get_drvdata(>dev); + hpd_event_disconnect(hdmi->notifier); + i2c_put_adapter(hdmi->ddc_adapt); if (hdmi->audio_pdev) platform_device_unregister(hdmi->audio_pdev); component_del(>dev, _hdmi_ops); + hpd_notifier_put(hdmi->notifier); return 0; } diff --git a/drivers/gpu/drm/sti/sti_hdmi.h b/drivers/gpu/drm/sti/sti_hdmi.h index 119bc35..2109c97 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.h +++ b/drivers/gpu/drm/sti/sti_hdmi.h @@ -8,6 +8,7 @@ #define _STI_HDMI_H_ #include +#include #include #include @@ -77,6 +78,7 @@ enum sti_hdmi_modes { * @audio_pdev: ASoC hdmi-codec platform device * @audio: hdmi audio parameters. * @drm_connector: hdmi connector + * @notifier: hotplug detect notifier */ struct sti_hdmi { struct device dev; @@ -102,6 +104,7 @@ struct sti_hdmi { struct platform_device *audio_pdev; struct hdmi_audio_params audio; struct drm_connector *drm_connector; + struct hpd_notifier *notifier; }; u32 hdmi_read(struct sti_hdmi *hdmi, int offset); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/3] video/sti/cec: add HPD notifier support
This patch series following what Hans is doing on exynos to support hotplug detect notifier code. It add support of HPD in sti_hdmi drm driver and stih-cec driver which move out of staging. Those patches should be applied on top of Hans branch exynos4-cec. I have tested hdmi notifier by pluging/unpluging HDMI cable and check the value of the physical address with "cec-ctl --tuner". "cec-compliance -A" is also functional. version 2: - use HPD notifier instead of HDMI notifier - move stih-cec out of staging - rebase code on top of git://linuxtv.org/hverkuil/media_tree.git exynos4-cec branch - split DT modifications in a separate patch Regards, Benjamin Benjamin Gaignard (3): sti: hdmi: add HPD notifier support stih-cec: add HPD notifier support arm: sti: update sti-cec for HPD notifier support .../devicetree/bindings/media/stih-cec.txt | 2 + arch/arm/boot/dts/stih407-family.dtsi | 12 - arch/arm/boot/dts/stih410.dtsi | 13 + drivers/gpu/drm/sti/Kconfig| 1 + drivers/gpu/drm/sti/sti_hdmi.c | 14 + drivers/gpu/drm/sti/sti_hdmi.h | 3 + drivers/media/platform/Kconfig | 10 + drivers/media/platform/Makefile| 1 + drivers/media/platform/sti/cec/Makefile| 1 + drivers/media/platform/sti/cec/stih-cec.c | 404 + drivers/staging/media/Kconfig | 2 - drivers/staging/media/Makefile | 1 - drivers/staging/media/st-cec/Kconfig | 8 - drivers/staging/media/st-cec/Makefile | 1 - drivers/staging/media/st-cec/TODO | 7 - drivers/staging/media/st-cec/stih-cec.c| 379 --- 16 files changed, 449 insertions(+), 410 deletions(-) create mode 100644 drivers/media/platform/sti/cec/Makefile create mode 100644 drivers/media/platform/sti/cec/stih-cec.c delete mode 100644 drivers/staging/media/st-cec/Kconfig delete mode 100644 drivers/staging/media/st-cec/Makefile delete mode 100644 drivers/staging/media/st-cec/TODO delete mode 100644 drivers/staging/media/st-cec/stih-cec.c -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] uapi: use wildcards to list files
Regularly, when a new header is created in include/uapi/, the developer forgets to add it in the corresponding Kbuild file. This error is usually detected after the release is out. In fact, all headers under include/uapi/ should be exported, so let's use wildcards. After this patch, the following files, which were not exported, are now exported: drm/vgem_drm.h drm/armada_drm.h drm/omap_drm.h drm/etnaviv_drm.h rdma/qedr-abi.h linux/bcache.h linux/kfd_ioctl.h linux/cryptouser.h linux/kcm.h linux/kcov.h linux/seg6_iptunnel.h linux/stm.h linux/seg6.h linux/auto_dev-ioctl.h linux/userio.h linux/pr.h linux/wil6210_uapi.h linux/nilfs2_ondisk.h linux/hash_info.h linux/seg6_genl.h linux/seg6_hmac.h linux/batman_adv.h linux/nsfs.h linux/qrtr.h linux/btrfs_tree.h linux/coresight-stm.h linux/dma-buf.h linux/module.h linux/lightnvm.h linux/nilfs2_api.h Signed-off-by: Nicolas Dichtel--- This patch is built against linus tree. I don't know if it should be done against antoher tree. Comments are welcomed, Nicolas include/uapi/asm-generic/Kbuild| 36 +-- include/uapi/drm/Kbuild| 22 +- include/uapi/linux/Kbuild | 463 + include/uapi/linux/android/Kbuild | 2 +- include/uapi/linux/byteorder/Kbuild| 3 +- include/uapi/linux/caif/Kbuild | 3 +- include/uapi/linux/can/Kbuild | 6 +- include/uapi/linux/dvb/Kbuild | 9 +- include/uapi/linux/hdlc/Kbuild | 2 +- include/uapi/linux/hsi/Kbuild | 2 +- include/uapi/linux/iio/Kbuild | 3 +- include/uapi/linux/isdn/Kbuild | 2 +- include/uapi/linux/mmc/Kbuild | 2 +- include/uapi/linux/netfilter/Kbuild| 88 +- include/uapi/linux/netfilter/ipset/Kbuild | 5 +- include/uapi/linux/netfilter_arp/Kbuild| 3 +- include/uapi/linux/netfilter_bridge/Kbuild | 18 +- include/uapi/linux/netfilter_ipv4/Kbuild | 10 +- include/uapi/linux/netfilter_ipv6/Kbuild | 13 +- include/uapi/linux/nfsd/Kbuild | 6 +- include/uapi/linux/raid/Kbuild | 3 +- include/uapi/linux/spi/Kbuild | 2 +- include/uapi/linux/sunrpc/Kbuild | 2 +- include/uapi/linux/tc_act/Kbuild | 15 +- include/uapi/linux/tc_ematch/Kbuild| 5 +- include/uapi/linux/usb/Kbuild | 12 +- include/uapi/linux/wimax/Kbuild| 2 +- include/uapi/misc/Kbuild | 2 +- include/uapi/mtd/Kbuild| 6 +- include/uapi/rdma/Kbuild | 17 +- include/uapi/rdma/hfi/Kbuild | 2 +- include/uapi/scsi/Kbuild | 5 +- include/uapi/scsi/fc/Kbuild| 5 +- include/uapi/sound/Kbuild | 16 +- include/uapi/video/Kbuild | 4 +- include/uapi/xen/Kbuild| 5 +- 36 files changed, 47 insertions(+), 754 deletions(-) diff --git a/include/uapi/asm-generic/Kbuild b/include/uapi/asm-generic/Kbuild index b73de7bb7a62..8e52cdc3d941 100644 --- a/include/uapi/asm-generic/Kbuild +++ b/include/uapi/asm-generic/Kbuild @@ -1,36 +1,2 @@ # UAPI Header export list -header-y += auxvec.h -header-y += bitsperlong.h -header-y += errno-base.h -header-y += errno.h -header-y += fcntl.h -header-y += int-l64.h -header-y += int-ll64.h -header-y += ioctl.h -header-y += ioctls.h -header-y += ipcbuf.h -header-y += kvm_para.h -header-y += mman-common.h -header-y += mman.h -header-y += msgbuf.h -header-y += param.h -header-y += poll.h -header-y += posix_types.h -header-y += resource.h -header-y += sembuf.h -header-y += setup.h -header-y += shmbuf.h -header-y += shmparam.h -header-y += siginfo.h -header-y += signal-defs.h -header-y += signal.h -header-y += socket.h -header-y += sockios.h -header-y += stat.h -header-y += statfs.h -header-y += swab.h -header-y += termbits.h -header-y += termios.h -header-y += types.h -header-y += ucontext.h -header-y += unistd.h +header-y += $(notdir $(wildcard $(srctree)/include/uapi/asm-generic/*.h)) diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild index 9355dd8eff3b..75f4cde6d9ba 100644 --- a/include/uapi/drm/Kbuild +++ b/include/uapi/drm/Kbuild @@ -1,22 +1,2 @@ # UAPI Header export list -header-y += drm.h -header-y += drm_fourcc.h -header-y += drm_mode.h -header-y += drm_sarea.h -header-y += amdgpu_drm.h -header-y += exynos_drm.h -header-y += i810_drm.h -header-y += i915_drm.h -header-y += mga_drm.h -header-y += nouveau_drm.h -header-y += qxl_drm.h -header-y += r128_drm.h -header-y += radeon_drm.h -header-y += savage_drm.h -header-y += sis_drm.h -header-y += tegra_drm.h -header-y += via_drm.h -header-y += vmwgfx_drm.h -header-y += msm_drm.h -header-y += vc4_drm.h -header-y += virtgpu_drm.h +header-y += $(notdir $(wildcard $(srctree)/include/uapi/drm/*.h)) diff --git a/include/uapi/linux/Kbuild
Re: [PATCH] media: entity: Catch unbalanced media_pipeline_stop calls
Hi Kieran, Thank you for the patch. On Tuesday 03 Jan 2017 13:12:11 Kieran Bingham wrote: > Drivers must not perform unbalanced calls to stop the entity pipeline, > however if they do they will fault in the core media code, as the > entity->pipe will be set as NULL. We handle this gracefully in the core > with a WARN for the developer. > > Replace the erroneous check on zero streaming counts, with a check on > NULL pipe elements instead, as this is the symptom of unbalanced > media_pipeline_stop calls. > > Signed-off-by: Kieran BinghamThis looks good to me, Acked-by: Laurent Pinchart I'll let Sakari review and merge the patch. > --- > drivers/media/media-entity.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c > index caa13e6f09f5..cb1fb2c17f85 100644 > --- a/drivers/media/media-entity.c > +++ b/drivers/media/media-entity.c > @@ -534,8 +534,13 @@ void __media_pipeline_stop(struct media_entity *entity) > struct media_graph *graph = >pipe->graph; > struct media_pipeline *pipe = entity->pipe; > > + /* > + * If the following check fails, the driver has performed an > + * unbalanced call to media_pipeline_stop() > + */ > + if (WARN_ON(!pipe)) > + return; > > - WARN_ON(!pipe->streaming_count); > media_graph_walk_start(graph, entity); > > while ((entity = media_graph_walk_next(graph))) { -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] media: entity: Catch unbalanced media_pipeline_stop calls
Drivers must not perform unbalanced calls to stop the entity pipeline, however if they do they will fault in the core media code, as the entity->pipe will be set as NULL. We handle this gracefully in the core with a WARN for the developer. Replace the erroneous check on zero streaming counts, with a check on NULL pipe elements instead, as this is the symptom of unbalanced media_pipeline_stop calls. Signed-off-by: Kieran Bingham--- drivers/media/media-entity.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index caa13e6f09f5..cb1fb2c17f85 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -534,8 +534,13 @@ void __media_pipeline_stop(struct media_entity *entity) struct media_graph *graph = >pipe->graph; struct media_pipeline *pipe = entity->pipe; + /* +* If the following check fails, the driver has performed an +* unbalanced call to media_pipeline_stop() +*/ + if (WARN_ON(!pipe)) + return; - WARN_ON(!pipe->streaming_count); media_graph_walk_start(graph, entity); while ((entity = media_graph_walk_next(graph))) { -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC] [sur40] mapping of sensor parameters to V4L2?
Hi everyone, next chapter in the neverending story of reverse-engineering the SUR40: I've identified a couple of internal LCD panel registers which control some aspects of the built-in image sensor. In particular, these are called "Video Voltage", "Video Bias", and "IR Illumination Level". Now, I have two questions: - Video Voltage & Bias seem to affect the sensor gain. Does anyone with extensive background knowledge of image sensors want to venture a guess what the exact relation is? My own interpretation would be that Video Voltage is the actual amplifier gain and Video Bias is the black level... - Is there a sensible mapping of these values to V4L2 controls? Should I pick something from the USER class, or from CAMERA, or FLASH, or ... Thanks & best regards, Florian -- "_Nothing_ brightens up my morning. Coffee simply provides a shade of grey just above the pitch-black of the infinite depths of the _abyss_." -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] drm_fourcc: Add new P010 video format
Hi Randy, On 2 January 2017 at 09:50, Randy Liwrote: > P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits > per channel video format. Rockchip's vop support this > video format(little endian only) as the input video format. > > Signed-off-by: Randy Li > --- > include/uapi/drm/drm_fourcc.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h > index 9e1bb7f..d2721da 100644 > --- a/include/uapi/drm/drm_fourcc.h > +++ b/include/uapi/drm/drm_fourcc.h > @@ -119,6 +119,7 @@ extern "C" { > #define DRM_FORMAT_NV61fourcc_code('N', 'V', '6', '1') /* > 2x1 subsampled Cb:Cr plane */ > #define DRM_FORMAT_NV24fourcc_code('N', 'V', '2', '4') /* > non-subsampled Cr:Cb plane */ > #define DRM_FORMAT_NV42fourcc_code('N', 'V', '4', '2') /* > non-subsampled Cb:Cr plane */ > +#define DRM_FORMAT_P010fourcc_code('P', '0', '1', '0') /* > 2x2 subsampled Cr:Cb plane 10 bits per channel */ Thanks, this looks good, but I have two requests. Firstly, the Microsoft page here also mentions that P016 is a preferred format along P010, so please add P016 as well: https://msdn.microsoft.com/en-us/library/windows/desktop/bb970578(v=vs.85).aspx I don't see much use of the other (P21x/P41x/Yxxx) formats defined there, so there's probably no use going wild and adding them just yet. Secondly, please update the format_info table in drm_fourcc.c for these two formats, to avoid throwing a WARN_ON every time they are used. Cheers, Daniel -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] [media] v4l: Add 10-bits per channel YUV pixel formats
Hi all, On 2 January 2017 at 13:03, ayakawrote: > On 01/02/2017 07:07 PM, Sakari Ailus wrote: >> On Mon, Jan 02, 2017 at 06:53:16PM +0800, ayaka wrote: >>> On 01/02/2017 05:10 PM, Sakari Ailus wrote: If the format resembles the existing formats but on a different bit depth, it should be named in similar fashion. >>> >>> Do you mean it would be better if it is called as NV12_10? >> >> If it otherwise resembles NV12 but just has 10 bits per pixel, I think >> NV12_10 is a good name for it. > > The main reason I don't like it is that there is a various of software > having used the P010 for this kind of pixel format. It would leadi a > conflict between them(and I never saw it is used as NV12_10), as the P010 is > more common to be used. Indeed; GStreamer, FFmpeg and Microsoft all call this P010: https://msdn.microsoft.com/en-us/library/windows/desktop/bb970578(v=vs.85).aspx fourcc.org is supposed to reflect Microsoft's registry, but seems to not be actively maintained anymore. Cheers, Daniel -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v1] [media] v4l2-common: fix aligned value calculation
Hi Sakari, Thank you for your answer. You're right: the modification that I proposed, is not correct (I misunderstood the aim of the function); the current clamp_align() is correct and doesn't need any modification. Thus, the patch that I sent, must be ignored. Sorry for the disruption. Regards, Jean-Christophe. On 12/16/2016 02:56 PM, Sakari Ailus wrote: > Hi Jean-Christophe, > > On Fri, Dec 16, 2016 at 02:32:15PM +0100, Jean-Christophe Trotin wrote: >> Correct the calculation of the rounding to nearest aligned value in >> the clamp_align() function. For example, clamp_align(1277, 1, 9600, 2) >> returns 1276, while it should return 1280. > > Why should the function return 1280 instead of 1276, which is closer to > 1277? > >> >> Signed-off-by: Jean-Christophe Trotin>> --- >> drivers/media/v4l2-core/v4l2-common.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/media/v4l2-core/v4l2-common.c >> b/drivers/media/v4l2-core/v4l2-common.c >> index 57cfe26a..2970ce7 100644 >> --- a/drivers/media/v4l2-core/v4l2-common.c >> +++ b/drivers/media/v4l2-core/v4l2-common.c >> @@ -315,7 +315,7 @@ static unsigned int clamp_align(unsigned int x, unsigned >> int min, >> >> /* Round to nearest aligned value */ >> if (align) >> -x = (x + (1 << (align - 1))) & mask; >> +x = (x + ((1 << align) - 1)) & mask; >> >> return x; >> } >-- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 0/5] davinci: VPIF: add DT support
Hi Sekhar, On Tuesday 03 Jan 2017 14:33:00 Sekhar Nori wrote: > On Friday 16 December 2016 03:17 PM, Hans Verkuil wrote: > > On 07/12/16 19:30, Kevin Hilman wrote: > >> Prepare the groundwork for adding DT support for davinci VPIF drivers. > >> This series does some fixups/cleanups and then adds the DT binding and > >> DT compatible string matching for DT probing. > >> > >> The controversial part from previous versions around async subdev > >> parsing, and specifically hard-coding the input/output routing of > >> subdevs, has been left out of this series. That part can be done as a > >> follow-on step after agreement has been reached on the path forward. > >> With this version, platforms can still use the VPIF capture/display > >> drivers, but must provide platform_data for the subdevs and subdev > >> routing. > >> > >> Tested video capture to memory on da850-lcdk board using composite > >> input. > > > > Other than the comment for the first patch this series looks good. > > > > So once that's addressed I'll queue it up for 4.11. > > Can you provide an immutable commit (as it will reach v4.11) with with > this series applied? I have some platform changes to queue for v4.11 > that depend on the driver updates. I don't think that's possible, given that Mauro rewrites all patches when handling pull requests to prepend [media] to the subject line and to add his SoB. Only Mauro can thus provide a stable branch, Hans can't. -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 0/5] davinci: VPIF: add DT support
Hi Hans, On Friday 16 December 2016 03:17 PM, Hans Verkuil wrote: > On 07/12/16 19:30, Kevin Hilman wrote: >> Prepare the groundwork for adding DT support for davinci VPIF drivers. >> This series does some fixups/cleanups and then adds the DT binding and >> DT compatible string matching for DT probing. >> >> The controversial part from previous versions around async subdev >> parsing, and specifically hard-coding the input/output routing of >> subdevs, has been left out of this series. That part can be done as a >> follow-on step after agreement has been reached on the path forward. >> With this version, platforms can still use the VPIF capture/display >> drivers, but must provide platform_data for the subdevs and subdev >> routing. >> >> Tested video capture to memory on da850-lcdk board using composite >> input. > > Other than the comment for the first patch this series looks good. > > So once that's addressed I'll queue it up for 4.11. Can you provide an immutable commit (as it will reach v4.11) with with this series applied? I have some platform changes to queue for v4.11 that depend on the driver updates. Thanks, Sekhar -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL FOR v4.10] Update cec documentation
Two cec doc updates for 4.10. Regards, Hans The following changes since commit 40eca140c404505c09773d1c6685d818cb55ab1a: [media] mn88473: add DVB-T2 PLP support (2016-12-27 14:00:15 -0200) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git for-v4.10f for you to fetch changes up to f9bc1dfdf63abb2653e10294619c3fae877a08b4: cec-intro.rst: mention the v4l-utils package and CEC utilities (2017-01-02 12:54:24 +0100) Hans Verkuil (2): cec rst: remove "This API is not yet finalized" notice cec-intro.rst: mention the v4l-utils package and CEC utilities Documentation/media/uapi/cec/cec-func-close.rst | 5 - Documentation/media/uapi/cec/cec-func-ioctl.rst | 5 - Documentation/media/uapi/cec/cec-func-open.rst| 5 - Documentation/media/uapi/cec/cec-func-poll.rst| 5 - Documentation/media/uapi/cec/cec-intro.rst| 17 - Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst | 5 - Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 5 - Documentation/media/uapi/cec/cec-ioc-adap-g-phys-addr.rst | 5 - Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 5 - Documentation/media/uapi/cec/cec-ioc-g-mode.rst | 5 - Documentation/media/uapi/cec/cec-ioc-receive.rst | 5 - 11 files changed, 12 insertions(+), 55 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 2/4] exynos_hdmi: add HPD notifier support
On 01/03/2017 08:55 AM, Andrzej Hajda wrote: > On 02.01.2017 15:19, Hans Verkuil wrote: >> From: Hans Verkuil>> >> Implement the HPD notifier support to allow CEC drivers to >> be informed when there is a new EDID and when a connect or >> disconnect happens. >> >> Signed-off-by: Hans Verkuil >> Tested-by: Marek Szyprowski >> --- >> drivers/gpu/drm/exynos/Kconfig | 1 + >> drivers/gpu/drm/exynos/exynos_hdmi.c | 24 +--- >> 2 files changed, 22 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig >> index d706ca4..80bfd1d 100644 >> --- a/drivers/gpu/drm/exynos/Kconfig >> +++ b/drivers/gpu/drm/exynos/Kconfig >> @@ -77,6 +77,7 @@ config DRM_EXYNOS_DP >> config DRM_EXYNOS_HDMI >> bool "HDMI" >> depends on DRM_EXYNOS_MIXER || DRM_EXYNOS5433_DECON >> +select HPD_NOTIFIERS >> help >>Choose this option if you want to use Exynos HDMI for DRM. >> >> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c >> b/drivers/gpu/drm/exynos/exynos_hdmi.c >> index 5ed8b1e..28bf609 100644 >> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c >> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c >> @@ -31,6 +31,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -118,6 +119,7 @@ struct hdmi_context { >> booldvi_mode; >> struct delayed_work hotplug_work; >> struct drm_display_mode current_mode; >> +struct hpd_notifier *notifier; >> const struct hdmi_driver_data *drv_data; >> >> void __iomem*regs; >> @@ -807,9 +809,12 @@ static enum drm_connector_status hdmi_detect(struct >> drm_connector *connector, >> { >> struct hdmi_context *hdata = connector_to_hdmi(connector); >> >> -if (gpiod_get_value(hdata->hpd_gpio)) >> +if (gpiod_get_value(hdata->hpd_gpio)) { >> +hpd_event_connect(hdata->notifier); >> return connector_status_connected; >> +} >> >> +hpd_event_disconnect(hdata->notifier); >> return connector_status_disconnected; >> } >> >> @@ -848,6 +853,9 @@ static int hdmi_get_modes(struct drm_connector >> *connector) >> edid->width_cm, edid->height_cm); >> >> drm_mode_connector_update_edid_property(connector, edid); >> +hpd_event_connect(hdata->notifier); > > Is there a reason to call hpd_event_connect here? It was called already > from hdmi_detect. True. Will drop this. Hans > > Regards > Andrzej > >> +hpd_event_new_edid(hdata->notifier, edid, >> +EDID_LENGTH * (1 + edid->extensions)); >> >> ret = drm_add_edid_modes(connector, edid); >> >> @@ -1483,6 +1491,7 @@ static void hdmi_disable(struct drm_encoder *encoder) >> if (funcs && funcs->disable) >> (*funcs->disable)(crtc); >> >> +hpd_event_disconnect(hdata->notifier); >> cancel_delayed_work(>hotplug_work); >> >> hdmiphy_disable(hdata); >> @@ -1832,15 +1841,22 @@ static int hdmi_probe(struct platform_device *pdev) >> } >> } >> >> +hdata->notifier = hpd_notifier_get(>dev); >> +if (hdata->notifier == NULL) { >> +ret = -ENOMEM; >> +goto err_hdmiphy; >> +} >> + >> pm_runtime_enable(dev); >> >> ret = component_add(>dev, _component_ops); >> if (ret) >> -goto err_disable_pm_runtime; >> +goto err_notifier_put; >> >> return ret; >> >> -err_disable_pm_runtime: >> +err_notifier_put: >> +hpd_notifier_put(hdata->notifier); >> pm_runtime_disable(dev); >> >> err_hdmiphy: >> @@ -1859,9 +1875,11 @@ static int hdmi_remove(struct platform_device *pdev) >> struct hdmi_context *hdata = platform_get_drvdata(pdev); >> >> cancel_delayed_work_sync(>hotplug_work); >> +hpd_event_disconnect(hdata->notifier); >> >> component_del(>dev, _component_ops); >> >> +hpd_notifier_put(hdata->notifier); >> pm_runtime_disable(>dev); >> >> if (!IS_ERR(hdata->reg_hdmi_en)) > > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 4/4] s5p-cec: add hpd-notifier support, move out of staging
On 01/03/2017 09:00 AM, Andrzej Hajda wrote: > On 02.01.2017 15:19, Hans Verkuil wrote: >> From: Hans Verkuil>> >> By using the HPD notifier framework there is no longer any reason >> to manually set the physical address. This was the one blocking >> issue that prevented this driver from going out of staging, so do >> this move as well. >> >> Update the bindings documenting the new hdmi phandle and >> update exynos4.dtsi accordingly. >> >> Tested with my Odroid U3. >> >> Signed-off-by: Hans Verkuil >> Tested-by: Marek Szyprowski >> --- >> .../devicetree/bindings/media/s5p-cec.txt | 2 ++ >> arch/arm/boot/dts/exynos4.dtsi | 1 + >> drivers/media/platform/Kconfig | 18 +++ >> drivers/media/platform/Makefile| 1 + >> .../media => media/platform}/s5p-cec/Makefile | 0 >> .../platform}/s5p-cec/exynos_hdmi_cec.h| 0 >> .../platform}/s5p-cec/exynos_hdmi_cecctrl.c| 0 >> .../media => media/platform}/s5p-cec/regs-cec.h| 0 >> .../media => media/platform}/s5p-cec/s5p_cec.c | 35 >> ++ >> .../media => media/platform}/s5p-cec/s5p_cec.h | 3 ++ >> drivers/staging/media/Kconfig | 2 -- >> drivers/staging/media/Makefile | 1 - >> drivers/staging/media/s5p-cec/Kconfig | 9 -- >> drivers/staging/media/s5p-cec/TODO | 7 - >> 14 files changed, 55 insertions(+), 24 deletions(-) >> rename drivers/{staging/media => media/platform}/s5p-cec/Makefile (100%) >> rename drivers/{staging/media => media/platform}/s5p-cec/exynos_hdmi_cec.h >> (100%) >> rename drivers/{staging/media => >> media/platform}/s5p-cec/exynos_hdmi_cecctrl.c (100%) >> rename drivers/{staging/media => media/platform}/s5p-cec/regs-cec.h (100%) >> rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.c (89%) >> rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.h (97%) >> delete mode 100644 drivers/staging/media/s5p-cec/Kconfig >> delete mode 100644 drivers/staging/media/s5p-cec/TODO >> >> diff --git a/Documentation/devicetree/bindings/media/s5p-cec.txt >> b/Documentation/devicetree/bindings/media/s5p-cec.txt >> index 925ab4d..710fc00 100644 >> --- a/Documentation/devicetree/bindings/media/s5p-cec.txt >> +++ b/Documentation/devicetree/bindings/media/s5p-cec.txt >> @@ -15,6 +15,7 @@ Required properties: >>- clock-names : from common clock binding: must contain "hdmicec", >>corresponding to entry in the clocks property. >>- samsung,syscon-phandle - phandle to the PMU system controller >> + - samsung,hdmi-phandle - phandle to the HDMI controller >> >> Example: >> >> @@ -25,6 +26,7 @@ hdmicec: cec@100B { >> clocks = < CLK_HDMI_CEC>; >> clock-names = "hdmicec"; >> samsung,syscon-phandle = <_system_controller>; >> +samsung,hdmi-phandle = <>; >> pinctrl-names = "default"; >> pinctrl-0 = <_cec>; >> status = "okay"; >> diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi >> index c64737b..51dfcbb 100644 >> --- a/arch/arm/boot/dts/exynos4.dtsi >> +++ b/arch/arm/boot/dts/exynos4.dtsi >> @@ -762,6 +762,7 @@ >> clocks = < CLK_HDMI_CEC>; >> clock-names = "hdmicec"; >> samsung,syscon-phandle = <_system_controller>; >> +samsung,hdmi-phandle = <>; >> pinctrl-names = "default"; >> pinctrl-0 = <_cec>; >> status = "disabled"; >> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig >> index d944421..cab1637 100644 >> --- a/drivers/media/platform/Kconfig >> +++ b/drivers/media/platform/Kconfig >> @@ -392,6 +392,24 @@ config VIDEO_TI_SC >> config VIDEO_TI_CSC >> tristate >> >> +menuconfig V4L_CEC_DRIVERS >> +bool "Platform HDMI CEC drivers" >> +depends on MEDIA_CEC_SUPPORT >> + >> +if V4L_CEC_DRIVERS >> + >> +config VIDEO_SAMSUNG_S5P_CEC >> + tristate "Samsung S5P CEC driver" >> + depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (PLAT_S5P || >> ARCH_EXYNOS || COMPILE_TEST) >> + select HPD_NOTIFIERS >> + ---help--- >> + This is a driver for Samsung S5P HDMI CEC interface. It uses the >> + generic CEC framework interface. >> + CEC bus is present in the HDMI connector and enables communication >> + between compatible devices. >> + >> +endif #V4L_CEC_DRIVERS >> + >> menuconfig V4L_TEST_DRIVERS >> bool "Media test drivers" >> depends on MEDIA_CAMERA_SUPPORT >> diff --git a/drivers/media/platform/Makefile >> b/drivers/media/platform/Makefile >> index 5b3cb27..ad3bf22 100644 >> --- a/drivers/media/platform/Makefile >> +++ b/drivers/media/platform/Makefile >> @@ -33,6 +33,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG) += s5p-jpeg/ >> obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC) +=
Re: [PATCHv2 4/4] s5p-cec: add hpd-notifier support, move out of staging
On 02.01.2017 15:19, Hans Verkuil wrote: > From: Hans Verkuil> > By using the HPD notifier framework there is no longer any reason > to manually set the physical address. This was the one blocking > issue that prevented this driver from going out of staging, so do > this move as well. > > Update the bindings documenting the new hdmi phandle and > update exynos4.dtsi accordingly. > > Tested with my Odroid U3. > > Signed-off-by: Hans Verkuil > Tested-by: Marek Szyprowski > --- > .../devicetree/bindings/media/s5p-cec.txt | 2 ++ > arch/arm/boot/dts/exynos4.dtsi | 1 + > drivers/media/platform/Kconfig | 18 +++ > drivers/media/platform/Makefile| 1 + > .../media => media/platform}/s5p-cec/Makefile | 0 > .../platform}/s5p-cec/exynos_hdmi_cec.h| 0 > .../platform}/s5p-cec/exynos_hdmi_cecctrl.c| 0 > .../media => media/platform}/s5p-cec/regs-cec.h| 0 > .../media => media/platform}/s5p-cec/s5p_cec.c | 35 > ++ > .../media => media/platform}/s5p-cec/s5p_cec.h | 3 ++ > drivers/staging/media/Kconfig | 2 -- > drivers/staging/media/Makefile | 1 - > drivers/staging/media/s5p-cec/Kconfig | 9 -- > drivers/staging/media/s5p-cec/TODO | 7 - > 14 files changed, 55 insertions(+), 24 deletions(-) > rename drivers/{staging/media => media/platform}/s5p-cec/Makefile (100%) > rename drivers/{staging/media => media/platform}/s5p-cec/exynos_hdmi_cec.h > (100%) > rename drivers/{staging/media => > media/platform}/s5p-cec/exynos_hdmi_cecctrl.c (100%) > rename drivers/{staging/media => media/platform}/s5p-cec/regs-cec.h (100%) > rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.c (89%) > rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.h (97%) > delete mode 100644 drivers/staging/media/s5p-cec/Kconfig > delete mode 100644 drivers/staging/media/s5p-cec/TODO > > diff --git a/Documentation/devicetree/bindings/media/s5p-cec.txt > b/Documentation/devicetree/bindings/media/s5p-cec.txt > index 925ab4d..710fc00 100644 > --- a/Documentation/devicetree/bindings/media/s5p-cec.txt > +++ b/Documentation/devicetree/bindings/media/s5p-cec.txt > @@ -15,6 +15,7 @@ Required properties: >- clock-names : from common clock binding: must contain "hdmicec", > corresponding to entry in the clocks property. >- samsung,syscon-phandle - phandle to the PMU system controller > + - samsung,hdmi-phandle - phandle to the HDMI controller > > Example: > > @@ -25,6 +26,7 @@ hdmicec: cec@100B { > clocks = < CLK_HDMI_CEC>; > clock-names = "hdmicec"; > samsung,syscon-phandle = <_system_controller>; > + samsung,hdmi-phandle = <>; > pinctrl-names = "default"; > pinctrl-0 = <_cec>; > status = "okay"; > diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi > index c64737b..51dfcbb 100644 > --- a/arch/arm/boot/dts/exynos4.dtsi > +++ b/arch/arm/boot/dts/exynos4.dtsi > @@ -762,6 +762,7 @@ > clocks = < CLK_HDMI_CEC>; > clock-names = "hdmicec"; > samsung,syscon-phandle = <_system_controller>; > + samsung,hdmi-phandle = <>; > pinctrl-names = "default"; > pinctrl-0 = <_cec>; > status = "disabled"; > diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig > index d944421..cab1637 100644 > --- a/drivers/media/platform/Kconfig > +++ b/drivers/media/platform/Kconfig > @@ -392,6 +392,24 @@ config VIDEO_TI_SC > config VIDEO_TI_CSC > tristate > > +menuconfig V4L_CEC_DRIVERS > + bool "Platform HDMI CEC drivers" > + depends on MEDIA_CEC_SUPPORT > + > +if V4L_CEC_DRIVERS > + > +config VIDEO_SAMSUNG_S5P_CEC > + tristate "Samsung S5P CEC driver" > + depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (PLAT_S5P || ARCH_EXYNOS > || COMPILE_TEST) > + select HPD_NOTIFIERS > + ---help--- > + This is a driver for Samsung S5P HDMI CEC interface. It uses the > + generic CEC framework interface. > + CEC bus is present in the HDMI connector and enables communication > + between compatible devices. > + > +endif #V4L_CEC_DRIVERS > + > menuconfig V4L_TEST_DRIVERS > bool "Media test drivers" > depends on MEDIA_CAMERA_SUPPORT > diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile > index 5b3cb27..ad3bf22 100644 > --- a/drivers/media/platform/Makefile > +++ b/drivers/media/platform/Makefile > @@ -33,6 +33,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG)+= s5p-jpeg/ > obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC) += s5p-mfc/ > > obj-$(CONFIG_VIDEO_SAMSUNG_S5P_G2D) += s5p-g2d/ > +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_CEC) += s5p-cec/ >