Re: [PATCH] [media] exynos-gsc: remove an always false condition
On 04/13/2016 09:32 PM, Mauro Carvalho Chehab wrote: > As reported by smatch: > drivers/media/platform/exynos-gsc/gsc-core.c:1073 gsc_probe() warn: > impossible condition '(gsc->id < 0) => (0-65535 < 0)' > drivers/media/platform/exynos-gsc/gsc-core.c: In function 'gsc_probe': > drivers/media/platform/exynos-gsc/gsc-core.c:1073:51: warning: comparison is > always false due to limited range of data type [-Wtype-limits] > if (gsc->id >= drv_data->num_entities || gsc->id < 0) { >^ > > gsc->id is an u16, so it can never be a negative number. So, > remove the always false condition. > > Fixes: c1ac057173ba "[media] exynos-gsc: remove non-device-tree init code" > Cc: Sylwester Nawrocki > Signed-off-by: Mauro Carvalho Chehab Thanks for fixing this. Acked-by: Sylwester Nawrocki -- Regards, Sylwester -- 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: tvp5150 regression after commit 9f924169c035
> I'll write what I found so far in case someone with better knowledge about > the runtime PM API and the OMAP I2C controller driver can have an idea of > what could be causing this. Thanks for the summary. I got no other reports like this, I wonder about that. That being said, can you try this patch if it makes a change? http://patchwork.ozlabs.org/patch/609280/ signature.asc Description: PGP signature
Re: tvp5150 regression after commit 9f924169c035
Hello Wolfram, On 04/14/2016 07:12 AM, Wolfram Sang wrote: > >> I'll write what I found so far in case someone with better knowledge about >> the runtime PM API and the OMAP I2C controller driver can have an idea of >> what could be causing this. > > Thanks for the summary. I got no other reports like this, I wonder about Yes, I also wonder why I'm the only one facing this issue... maybe no one else is using the tvp5150 driver on an OMAP board with mainline? > that. That being said, can you try this patch if it makes a change? > > http://patchwork.ozlabs.org/patch/609280/ > Unfortunately it doesn't help, I just tried today's -next (next-20160414) that already has the mentioned patch but the issue is still present. Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America -- 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] [media] atmel-isc: add the Image Sensor Controller code
Hello Songjun, On Thursday 14 Apr 2016 13:44:27 Wu, Songjun wrote: > The option 'CONFIG_COMMON_CLK=y' is needed to add to '.config'. > But I do not validate, '.config' will be generated automatically and > overwritten when it is changed. Your driver's Kconfig entry should then contain "depends on COMMON_CLK". > On 4/14/2016 00:01, kbuild test robot wrote: > > Hi Songjun, > > > > [auto build test ERROR on linuxtv-media/master] > > [also build test ERROR on v4.6-rc3 next-20160413] > > [if your patch is applied to the wrong git tree, please drop us a note to > > help improving the system] > > > > url: > > https://github.com/0day-ci/linux/commits/Songjun-Wu/atmel-isc-add-driver-> > > > for-Atmel-ISC/20160413-155337 base: git://linuxtv.org/media_tree.git > > master > > config: powerpc-allyesconfig (attached as .config) > > > > reproduce: > > wget > > https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/p > > lain/sbin/make.cross -O ~/bin/make.cross chmod +x > > ~/bin/make.cross > > # save the attached .config to linux build tree > > make.cross ARCH=powerpc > > > > All errors (new ones prefixed by >>): > > from include/linux/of.h:21, > > > > from drivers/media/platform/atmel/atmel-isc.c:27: > > drivers/media/platform/atmel/atmel-isc.c: In function > > 'isc_clk_enable': > > include/linux/kernel.h:824:48: error: initialization from incompatible > > pointer type [-Werror=incompatible-pointer-types]> > > const typeof( ((type *)0)->member ) *__mptr = (ptr); \ > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:55:24: note: in expansion of > > macro 'container_of'> > > #define to_isc_clk(hw) container_of(hw, struct isc_clk, hw) > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:247:28: note: in expansion of > > macro 'to_isc_clk'> > > struct isc_clk *isc_clk = to_isc_clk(hw); > > > > ^ > > > > include/linux/kernel.h:824:48: note: (near initialization for > > 'isc_clk') > > > > const typeof( ((type *)0)->member ) *__mptr = (ptr); \ > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:55:24: note: in expansion of > > macro 'container_of'> > > #define to_isc_clk(hw) container_of(hw, struct isc_clk, hw) > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:247:28: note: in expansion of > > macro 'to_isc_clk'> > > struct isc_clk *isc_clk = to_isc_clk(hw); > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c: In function > > 'isc_clk_disable': > > include/linux/kernel.h:824:48: error: initialization from incompatible > > pointer type [-Werror=incompatible-pointer-types]> > > const typeof( ((type *)0)->member ) *__mptr = (ptr); \ > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:55:24: note: in expansion of > > macro 'container_of'> > > #define to_isc_clk(hw) container_of(hw, struct isc_clk, hw) > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:280:28: note: in expansion of > > macro 'to_isc_clk'> > > struct isc_clk *isc_clk = to_isc_clk(hw); > > > > ^ > > > > include/linux/kernel.h:824:48: note: (near initialization for > > 'isc_clk') > > > > const typeof( ((type *)0)->member ) *__mptr = (ptr); \ > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:55:24: note: in expansion of > > macro 'container_of'> > > #define to_isc_clk(hw) container_of(hw, struct isc_clk, hw) > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:280:28: note: in expansion of > > macro 'to_isc_clk'> > > struct isc_clk *isc_clk = to_isc_clk(hw); > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c: In function > > 'isc_clk_is_enabled': > > include/linux/kernel.h:824:48: error: initialization from incompatible > > pointer type [-Werror=incompatible-pointer-types]> > > const typeof( ((type *)0)->member ) *__mptr = (ptr); \ > > > > ^ > > > > drivers/media/platform/atmel/atmel-isc.c:55:24: note: in expansion of > > macro 'container_of'> > > #define to_isc_clk(hw) container_of(hw, struct isc_clk, hw) > > > > ^ > >
Re: [PATCH 0/2] [media] atmel-isc: add driver for Atmel ISC
Hello Songjun, On Wednesday 13 Apr 2016 15:44:18 Songjun Wu wrote: > The Image Sensor Controller driver includes two parts. > 1) Driver code to implement the ISC function. > 2) Device tree binding documentation, it describes how >to add the ISC in device tree. > > > Songjun Wu (2): > [media] atmel-isc: add the Image Sensor Controller code > [media] atmel-isc: DT binding for Image Sensor Controller driver I can't see the second patch in the linux-media mailing list archives, could you please resend it ? > .../devicetree/bindings/media/atmel-isc.txt| 84 ++ > drivers/media/platform/Kconfig |1 + > drivers/media/platform/Makefile|2 + > drivers/media/platform/atmel/Kconfig |9 + > drivers/media/platform/atmel/Makefile |3 + > drivers/media/platform/atmel/atmel-isc-regs.h | 280 > drivers/media/platform/atmel/atmel-isc.c | 1537 > 7 files changed, 1916 insertions(+) > create mode 100644 Documentation/devicetree/bindings/media/atmel-isc.txt > create mode 100644 drivers/media/platform/atmel/Kconfig > create mode 100644 drivers/media/platform/atmel/Makefile > create mode 100644 drivers/media/platform/atmel/atmel-isc-regs.h > create mode 100644 drivers/media/platform/atmel/atmel-isc.c -- 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: tvp5150 regression after commit 9f924169c035
> Yes, I also wonder why I'm the only one facing this issue... maybe no one > else is using the tvp5150 driver on an OMAP board with mainline? I wonder why it only affects tvp5150. I don't see the connection yet. signature.asc Description: PGP signature
Re: tvp5150 regression after commit 9f924169c035
Hello Wofram, On 04/14/2016 10:19 AM, Wolfram Sang wrote: > >> Yes, I also wonder why I'm the only one facing this issue... maybe no one >> else is using the tvp5150 driver on an OMAP board with mainline? > > I wonder why it only affects tvp5150. I don't see the connection yet. > Yes, me neither. All other I2C devices are working properly on this board. The only thing I can think, is that the tvp5150 needs a reset sequence in order to be operative. It basically toggles two pins in the chip, this is done in tvp5150_init() [0] and is needed before accessing I2C registers. Maybe runtime pm has an effect on this and the chip is not reset correctly? [0]: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/i2c/tvp5150.c#n1311 Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America -- 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: tvp5150 regression after commit 9f924169c035
Hi, * Javier Martinez Canillas [160414 07:28]: > Hello Wofram, > > On 04/14/2016 10:19 AM, Wolfram Sang wrote: > > > >> Yes, I also wonder why I'm the only one facing this issue... maybe no one > >> else is using the tvp5150 driver on an OMAP board with mainline? > > > > I wonder why it only affects tvp5150. I don't see the connection yet. > > > > Yes, me neither. All other I2C devices are working properly on this board. > > The only thing I can think, is that the tvp5150 needs a reset sequence in > order to be operative. It basically toggles two pins in the chip, this is > done in tvp5150_init() [0] and is needed before accessing I2C registers. > > Maybe runtime pm has an effect on this and the chip is not reset correctly? Is this with omap3 and does tvp5150 have a reset GPIO pin? If so, you could be hitting the GPIO errata where a glitch can happen when restoring the GPIO state coming back from off mode in idle. This happes for GPIO pins that are not in GPIO bank1 and have an external pull down resistor on the line. The short term workaround is to mux the reset pin to use the internal pulls by using PIN_INPUT_PULLUP | MUX_MODE7, or depending on the direction, PIN_INPUT_PULLDOWN | MUX_MODE7. The long term workaround is tho have gpio-omap.c do this dynamically with pinctrl-single.c using gpio-ranges, but that's going to take a while.. You can search for erratum 1.158 for more info. Regards, Tony > [0]: > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/i2c/tvp5150.c#n1311 -- 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/7] dt-bindings: Add a binding for Mediatek Video Decoder
On Wed, Apr 13, 2016 at 08:01:50PM +0800, Tiffany Lin wrote: > Add a DT binding documentation of Video Decoder for the > MT8173 SoC from Mediatek. > > Signed-off-by: Tiffany Lin > --- > .../devicetree/bindings/media/mediatek-vcodec.txt | 50 > ++-- > 1 file changed, 46 insertions(+), 4 deletions(-) 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
[PATCH v3 0/7] Lager board HDMI input support
Hi! This series implements Lager HDMI input support on top of version 4 of Niklas's rcar-vin rewrite ("[PATCHv4] [media] rcar-vin: add Renesas R-Car VIN driver"). Apart from rebasing, this revision removes one patch that has since been picked up, squashes the DT changes into one patch and adjusts its subject line slightly. CU Uli Changes since v2: - rebased on top of rcar-vin driver v4 - removed "adv7604: fix SPA register location for ADV7612" (picked up) - changed prefix of dts patch to "ARM: dts: lager: " Laurent Pinchart (1): v4l: subdev: Add pad config allocator and init Ulrich Hecht (4): media: rcar_vin: Use correct pad number in try_fmt media: rcar-vin: pad-aware driver initialisation media: rcar-vin: add DV timings support media: rcar-vin: initialize EDID data William Towle (2): media: adv7604: automatic "default-input" selection ARM: dts: lager: Add entries for VIN HDMI input support arch/arm/boot/dts/r8a7790-lager.dts | 41 +++- drivers/media/i2c/adv7604.c | 18 +++- drivers/media/platform/rcar-vin/rcar-v4l2.c | 145 +++- drivers/media/platform/rcar-vin/rcar-vin.h | 2 + drivers/media/v4l2-core/v4l2-subdev.c | 19 +++- include/media/v4l2-subdev.h | 10 ++ 6 files changed, 229 insertions(+), 6 deletions(-) -- 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 v3 2/7] media: adv7604: automatic "default-input" selection
From: William Towle Add logic such that the "default-input" property becomes unnecessary for chips that only have one suitable input (ADV7611 by design, and ADV7612 due to commit 7111cddd518f ("[media] media: adv7604: reduce support to first (digital) input"). Additionally, Ian's documentation in commit bf9c82278c34 ("[media] media: adv7604: ability to read default input port from DT") states that the "default-input" property should reside directly in the node for adv7612. Hence, also adjust the parsing to make the implementation consistent with this. Signed-off-by: William Towle Signed-off-by: Ulrich Hecht --- drivers/media/i2c/adv7604.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 41a1bfc..d722c16 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -2788,7 +2788,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state) struct device_node *np; unsigned int flags; int ret; - u32 v; + u32 v = -1; np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node; @@ -2810,6 +2810,22 @@ static int adv76xx_parse_dt(struct adv76xx_state *state) of_node_put(endpoint); + if (of_property_read_u32(np, "default-input", &v)) { + /* not specified ... can we choose automatically? */ + switch (state->info->type) { + case ADV7611: + v = 0; + break; + case ADV7612: + if (state->info->max_port == ADV76XX_PAD_HDMI_PORT_A) + v = 0; + /* else is unhobbled, leave unspecified */ + default: + break; + } + } + state->pdata.default_input = v; + flags = bus_cfg.bus.parallel.flags; if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) -- 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 v3 1/7] v4l: subdev: Add pad config allocator and init
From: Laurent Pinchart Add a new subdev operation to initialize a subdev pad config array, and a helper function to allocate and initialize the array. This can be used by bridge drivers to implement try format based on subdev pad operations. Signed-off-by: Laurent Pinchart Acked-by: Vaibhav Hiremath Acked-by: Hans Verkuil --- drivers/media/v4l2-core/v4l2-subdev.c | 19 ++- include/media/v4l2-subdev.h | 10 ++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index d630838..f32ac0d 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -35,7 +35,7 @@ static int subdev_fh_init(struct v4l2_subdev_fh *fh, struct v4l2_subdev *sd) { #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) - fh->pad = kzalloc(sizeof(*fh->pad) * sd->entity.num_pads, GFP_KERNEL); + fh->pad = v4l2_subdev_alloc_pad_config(sd); if (fh->pad == NULL) return -ENOMEM; #endif @@ -569,6 +569,23 @@ int v4l2_subdev_link_validate(struct media_link *link) sink, link, &source_fmt, &sink_fmt); } EXPORT_SYMBOL_GPL(v4l2_subdev_link_validate); + +struct v4l2_subdev_pad_config *v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd) +{ + struct v4l2_subdev_pad_config *cfg; + + if (!sd->entity.num_pads) + return NULL; + + cfg = kcalloc(sd->entity.num_pads, sizeof(*cfg), GFP_KERNEL); + if (!cfg) + return NULL; + + v4l2_subdev_call(sd, pad, init_cfg, cfg); + + return cfg; +} +EXPORT_SYMBOL_GPL(v4l2_subdev_alloc_pad_config); #endif /* CONFIG_MEDIA_CONTROLLER */ void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops) diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 11e2dfe..6c47cdd 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -607,6 +607,8 @@ struct v4l2_subdev_pad_config { * may be adjusted by the subdev driver to device capabilities. */ struct v4l2_subdev_pad_ops { + void (*init_cfg)(struct v4l2_subdev *sd, +struct v4l2_subdev_pad_config *cfg); int (*enum_mbus_code)(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_mbus_code_enum *code); @@ -801,7 +803,15 @@ int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd, struct v4l2_subdev_format *source_fmt, struct v4l2_subdev_format *sink_fmt); int v4l2_subdev_link_validate(struct media_link *link); + +struct v4l2_subdev_pad_config *v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd); + +static inline void v4l2_subdev_free_pad_config(struct v4l2_subdev_pad_config *cfg) +{ + kfree(cfg); +} #endif /* CONFIG_MEDIA_CONTROLLER */ + void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops); -- 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 v3 7/7] ARM: dts: lager: Add entries for VIN HDMI input support
From: William Towle Add DT entries for vin0, vin0_pins, and adv7612. Sets the 'default-input' property for ADV7612, enabling image and video capture without the need to have userspace specifying routing. Signed-off-by: William Towle Signed-off-by: Rob Taylor [uli: added interrupt, renamed endpoint, merged default-input] Signed-off-by: Ulrich Hecht --- arch/arm/boot/dts/r8a7790-lager.dts | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts index aa6ca92..eed0974 100644 --- a/arch/arm/boot/dts/r8a7790-lager.dts +++ b/arch/arm/boot/dts/r8a7790-lager.dts @@ -414,7 +414,12 @@ renesas,function = "usb2"; }; - vin1_pins: vin { + vin0_pins: vin0 { + renesas,groups = "vin0_data24", "vin0_sync", "vin0_clkenb", "vin0_clk"; + renesas,function = "vin0"; + }; + + vin1_pins: vin1 { renesas,groups = "vin1_data8", "vin1_clk"; renesas,function = "vin1"; }; @@ -590,6 +595,21 @@ reg = <0x12>; }; + hdmi-in@4c { + compatible = "adi,adv7612"; + reg = <0x4c>; + interrupt-parent = <&gpio1>; + interrupts = <20 IRQ_TYPE_LEVEL_LOW>; + remote = <&vin0>; + default-input = <0>; + + port { + adv7612: endpoint { + remote-endpoint = <&vin0ep0>; + }; + }; + }; + composite-in@20 { compatible = "adi,adv7180"; reg = <0x20>; @@ -705,6 +725,25 @@ status = "okay"; }; +/* HDMI video input */ +&vin0 { + pinctrl-0 = <&vin0_pins>; + pinctrl-names = "default"; + + status = "ok"; + + port { + vin0ep0: endpoint { + remote-endpoint = <&adv7612>; + bus-width = <24>; + hsync-active = <0>; + vsync-active = <0>; + pclk-sample = <1>; + data-active = <1>; + }; + }; +}; + /* composite video input */ &vin1 { pinctrl-0 = <&vin1_pins>; -- 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 v3 6/7] media: rcar-vin: initialize EDID data
Initializes the decoder subdevice with a fixed EDID blob. Signed-off-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 46 + 1 file changed, 46 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index ba2ed4e..5b32105 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -720,6 +720,41 @@ void rvin_v4l2_remove(struct rvin_dev *vin) video_unregister_device(&vin->vdev); } +static u8 edid[256] = { + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x48, 0xAE, 0x9C, 0x27, 0x00, 0x00, 0x00, 0x00, + 0x19, 0x12, 0x01, 0x03, 0x80, 0x00, 0x00, 0x78, + 0x0E, 0x00, 0xB2, 0xA0, 0x57, 0x49, 0x9B, 0x26, + 0x10, 0x48, 0x4F, 0x2F, 0xCF, 0x00, 0x31, 0x59, + 0x45, 0x59, 0x61, 0x59, 0x81, 0x99, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3A, + 0x80, 0x18, 0x71, 0x38, 0x2D, 0x40, 0x58, 0x2C, + 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, + 0x00, 0x00, 0x00, 0xFD, 0x00, 0x31, 0x55, 0x18, + 0x5E, 0x11, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x43, + 0x20, 0x39, 0x30, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, + 0x0A, 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x68, + 0x02, 0x03, 0x1a, 0xc0, 0x48, 0xa2, 0x10, 0x04, + 0x02, 0x01, 0x21, 0x14, 0x13, 0x23, 0x09, 0x07, + 0x07, 0x65, 0x03, 0x0c, 0x00, 0x10, 0x00, 0xe2, + 0x00, 0x2a, 0x01, 0x1d, 0x00, 0x80, 0x51, 0xd0, + 0x1c, 0x20, 0x40, 0x80, 0x35, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1e, 0x8c, 0x0a, 0xd0, 0x8a, + 0x20, 0xe0, 0x2d, 0x10, 0x10, 0x3e, 0x96, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7 +}; + int rvin_v4l2_probe(struct rvin_dev *vin) { struct v4l2_subdev_format fmt = { @@ -821,5 +856,16 @@ int rvin_v4l2_probe(struct rvin_dev *vin) v4l2_info(&vin->v4l2_dev, "Device registered as %s\n", video_device_node_name(&vin->vdev)); + { + struct v4l2_subdev_edid rvin_edid = { + .pad = 0, + .start_block = 0, + .blocks = 2, + .edid = edid, + }; + v4l2_subdev_call(sd, pad, set_edid, + &rvin_edid); + } + return ret; } -- 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 v3 4/7] media: rcar-vin: pad-aware driver initialisation
Add detection of source pad number for drivers aware of the media controller API, so that rcar-vin can create device nodes to support modern drivers such as adv7604.c (for HDMI on Lager) and the converted adv7180.c (for composite) underneath. Building rcar_vin gains a dependency on CONFIG_MEDIA_CONTROLLER, in line with requirements for building the drivers associated with it. Signed-off-by: William Towle Signed-off-by: Rob Taylor [uli: adapted to rcar-vin rewrite] Signed-off-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 16 drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 43aec3c..d8d5f3a 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -659,6 +659,9 @@ int rvin_v4l2_probe(struct rvin_dev *vin) struct v4l2_mbus_framefmt *mf = &fmt.format; struct video_device *vdev = &vin->vdev; struct v4l2_subdev *sd = vin_to_sd(vin); +#if defined(CONFIG_MEDIA_CONTROLLER) + int pad_idx; +#endif int ret; v4l2_set_subdev_hostdata(sd, vin); @@ -701,6 +704,19 @@ int rvin_v4l2_probe(struct rvin_dev *vin) vdev->lock = &vin->lock; vdev->ctrl_handler = &vin->ctrl_handler; + vin->src_pad_idx = 0; +#if defined(CONFIG_MEDIA_CONTROLLER) + for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++) + if (sd->entity.pads[pad_idx].flags + == MEDIA_PAD_FL_SOURCE) + break; + if (pad_idx >= sd->entity.num_pads) + return -EINVAL; + + vin->src_pad_idx = pad_idx; +#endif + fmt.pad = vin->src_pad_idx; + /* Try to improve our guess of a reasonable window format */ ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, &fmt); if (ret) { diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h b/drivers/media/platform/rcar-vin/rcar-vin.h index 01c5086..959f5da 100644 --- a/drivers/media/platform/rcar-vin/rcar-vin.h +++ b/drivers/media/platform/rcar-vin/rcar-vin.h @@ -87,6 +87,7 @@ struct rvin_graph_entity { * * @vdev: V4L2 video device associated with VIN * @v4l2_dev: V4L2 device + * @src_pad_idx: source pad index for media controller drivers * @ctrl_handler: V4L2 control handler * @notifier: V4L2 asynchronous subdevs notifier * @entity:entity in the DT for subdevice @@ -118,6 +119,7 @@ struct rvin_dev { struct video_device vdev; struct v4l2_device v4l2_dev; + int src_pad_idx; struct v4l2_ctrl_handler ctrl_handler; struct v4l2_async_notifier notifier; struct rvin_graph_entity entity; -- 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 v3 5/7] media: rcar-vin: add DV timings support
Adds ioctls DV_TIMINGS_CAP, ENUM_DV_TIMINGS, G_DV_TIMINGS, S_DV_TIMINGS, and QUERY_DV_TIMINGS. Signed-off-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 69 + 1 file changed, 69 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index d8d5f3a..ba2ed4e 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -413,12 +413,17 @@ static int rvin_enum_input(struct file *file, void *priv, struct v4l2_input *i) { struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); if (i->index != 0) return -EINVAL; i->type = V4L2_INPUT_TYPE_CAMERA; i->std = vin->vdev.tvnorms; + + if (v4l2_subdev_has_op(sd, pad, dv_timings_cap)) + i->capabilities = V4L2_IN_CAP_DV_TIMINGS; + strlcpy(i->name, "Camera", sizeof(i->name)); return 0; @@ -461,6 +466,64 @@ static int rvin_g_std(struct file *file, void *priv, v4l2_std_id *a) return v4l2_subdev_call(sd, video, g_std, a); } +static int rvin_enum_dv_timings(struct file *file, void *priv_fh, + struct v4l2_enum_dv_timings *timings) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + + timings->pad = 0; + return v4l2_subdev_call(sd, + pad, enum_dv_timings, timings); +} + +static int rvin_s_dv_timings(struct file *file, void *priv_fh, + struct v4l2_dv_timings *timings) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + int err; + + err = v4l2_subdev_call(sd, + video, s_dv_timings, timings); + if (!err) { + vin->sensor.width = timings->bt.width; + vin->sensor.height = timings->bt.height; + } + return err; +} + +static int rvin_g_dv_timings(struct file *file, void *priv_fh, + struct v4l2_dv_timings *timings) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + + return v4l2_subdev_call(sd, + video, g_dv_timings, timings); +} + +static int rvin_query_dv_timings(struct file *file, void *priv_fh, + struct v4l2_dv_timings *timings) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + + return v4l2_subdev_call(sd, + video, query_dv_timings, timings); +} + +static int rvin_dv_timings_cap(struct file *file, void *priv_fh, + struct v4l2_dv_timings_cap *cap) +{ + struct rvin_dev *vin = video_drvdata(file); + struct v4l2_subdev *sd = vin_to_sd(vin); + + cap->pad = 0; + return v4l2_subdev_call(sd, + pad, dv_timings_cap, cap); +} + static const struct v4l2_ioctl_ops rvin_ioctl_ops = { .vidioc_querycap= rvin_querycap, .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap, @@ -477,6 +540,12 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = { .vidioc_g_input = rvin_g_input, .vidioc_s_input = rvin_s_input, + .vidioc_dv_timings_cap = rvin_dv_timings_cap, + .vidioc_enum_dv_timings = rvin_enum_dv_timings, + .vidioc_g_dv_timings= rvin_g_dv_timings, + .vidioc_s_dv_timings= rvin_s_dv_timings, + .vidioc_query_dv_timings= rvin_query_dv_timings, + .vidioc_querystd= rvin_querystd, .vidioc_g_std = rvin_g_std, .vidioc_s_std = rvin_s_std, -- 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 v3 3/7] media: rcar_vin: Use correct pad number in try_fmt
Fix rcar_vin_try_fmt's use of an inappropriate pad number when calling the subdev set_fmt function - for the ADV7612, IDs should be non-zero. Signed-off-by: William Towle Reviewed-by: Rob Taylor Acked-by: Hans Verkuil [uli: adapted to rcar-vin rewrite] Signed-off-by: Ulrich Hecht --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index a752171..43aec3c 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -97,7 +97,7 @@ static int __rvin_try_format_sensor(struct rvin_dev *vin, struct rvin_sensor *sensor) { struct v4l2_subdev *sd; - struct v4l2_subdev_pad_config pad_cfg; + struct v4l2_subdev_pad_config *pad_cfg; struct v4l2_subdev_format format = { .which = which, }; @@ -105,12 +105,18 @@ static int __rvin_try_format_sensor(struct rvin_dev *vin, sd = vin_to_sd(vin); + pad_cfg = v4l2_subdev_alloc_pad_config(sd); + if (pad_cfg == NULL) + return -ENOMEM; + v4l2_fill_mbus_format(&format.format, pix, vin->sensor.code); + format.pad = vin->src_pad_idx; + ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, pad, set_fmt, -&pad_cfg, &format); +pad_cfg, &format); if (ret < 0) - return ret; + goto cleanup; v4l2_fill_pix_format(pix, &format.format); @@ -119,6 +125,8 @@ static int __rvin_try_format_sensor(struct rvin_dev *vin, vin_dbg(vin, "Sensor format: %ux%u\n", sensor->width, sensor->height); +cleanup: + v4l2_subdev_free_pad_config(pad_cfg); return 0; } -- 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
Re: [PATCH 1/2] [media] atmel-isc: add the Image Sensor Controller code
Hello Songjun, Thank you for the patch. On Wednesday 13 Apr 2016 15:44:19 Songjun Wu wrote: > Add driver for the Image Sensor Controller. It manages > incoming data from a parallel based CMOS/CCD sensor. > It has an internal image processor, also integrates a > triple channel direct memory access controller master > interface. > > Signed-off-by: Songjun Wu > --- > > drivers/media/platform/Kconfig|1 + > drivers/media/platform/Makefile |2 + > drivers/media/platform/atmel/Kconfig |9 + > drivers/media/platform/atmel/Makefile |3 + > drivers/media/platform/atmel/atmel-isc-regs.h | 280 + > drivers/media/platform/atmel/atmel-isc.c | 1537 ++ > 6 files changed, 1832 insertions(+) > create mode 100644 drivers/media/platform/atmel/Kconfig > create mode 100644 drivers/media/platform/atmel/Makefile > create mode 100644 drivers/media/platform/atmel/atmel-isc-regs.h > create mode 100644 drivers/media/platform/atmel/atmel-isc.c > > diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig > index 201f5c2..1b50ed1 100644 > --- a/drivers/media/platform/Kconfig > +++ b/drivers/media/platform/Kconfig > @@ -110,6 +110,7 @@ source "drivers/media/platform/exynos4-is/Kconfig" > source "drivers/media/platform/s5p-tv/Kconfig" > source "drivers/media/platform/am437x/Kconfig" > source "drivers/media/platform/xilinx/Kconfig" > +source "drivers/media/platform/atmel/Kconfig" > > config VIDEO_TI_CAL > tristate "TI CAL (Camera Adaptation Layer) driver" > diff --git a/drivers/media/platform/Makefile > b/drivers/media/platform/Makefile index bbb7bd1..ad8f471 100644 > --- a/drivers/media/platform/Makefile > +++ b/drivers/media/platform/Makefile > @@ -55,4 +55,6 @@ obj-$(CONFIG_VIDEO_AM437X_VPFE) += am437x/ > > obj-$(CONFIG_VIDEO_XILINX) += xilinx/ > > +obj-$(CONFIG_VIDEO_ATMEL_ISC)+= atmel/ > + > ccflags-y += -I$(srctree)/drivers/media/i2c > diff --git a/drivers/media/platform/atmel/Kconfig > b/drivers/media/platform/atmel/Kconfig new file mode 100644 > index 000..5ebc4a6 > --- /dev/null > +++ b/drivers/media/platform/atmel/Kconfig > @@ -0,0 +1,9 @@ > +config VIDEO_ATMEL_ISC > + tristate "ATMEL Image Sensor Controller (ISC) support" > + depends on VIDEO_V4L2 && HAS_DMA > + depends on ARCH_AT91 || COMPILE_TEST As commented separately, you're missing "depends on COMMON_CLK". > + select VIDEOBUF2_DMA_CONTIG > + select REGMAP_MMIO > + help > +This module makes the ATMEL Image Sensor Controller available > +as a v4l2 device. > \ No newline at end of file > diff --git a/drivers/media/platform/atmel/Makefile > b/drivers/media/platform/atmel/Makefile new file mode 100644 > index 000..eb8cdbb > --- /dev/null > +++ b/drivers/media/platform/atmel/Makefile > @@ -0,0 +1,3 @@ > +# Makefile for ATMEL ISC driver The makefile isn't limited to the ISC driver, even if that's the only one currently located in the atmel directory. The atmel-isi driver should be placed here when it will move away from soc-camera. I would just write "Makefile for Atmel drivers", or even remove the comment completely. > +obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel-isc.o > diff --git a/drivers/media/platform/atmel/atmel-isc-regs.h > b/drivers/media/platform/atmel/atmel-isc-regs.h new file mode 100644 > index 000..8be9e4a > --- /dev/null > +++ b/drivers/media/platform/atmel/atmel-isc-regs.h > @@ -0,0 +1,280 @@ > + No need for a blank line here. > +#ifndef __ATMEL_ISC_REGS_H > +#define __ATMEL_ISC_REGS_H > + > +#include [snip] > +/* ISC Clock Configuration Register */ > +#define ISC_CLKCFG 0x0024 > +#define ISC_CLKCFG_DIV_SHIFT(n) (n*16) As n can be an expression, you should enclose it in parentheses, ((n)*16). Same for tall the macros below. > +#define ISC_CLKCFG_DIV_MASK(n) GENMASK((n*16 + 7), n*16) > +#define ISC_CLKCFG_SEL_SHIFT(n) (n*16 + 8) > +#define ISC_CLKCFG_SEL_MASK(n) GENMASK((n*17 + 8), (n*16 + 8)) > + [snip] > diff --git a/drivers/media/platform/atmel/atmel-isc.c > b/drivers/media/platform/atmel/atmel-isc.c new file mode 100644 > index 000..4ffbfc9 > --- /dev/null > +++ b/drivers/media/platform/atmel/atmel-isc.c > @@ -0,0 +1,1537 @@ > +/* > + * Atmel Image Sensor Controller (ISC) driver > + * > + * Copyright (C) 2016 Atmel > + * > + * Author: Songjun Wu > + * > + * This program is free software; you may redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; version 2 of the License. > + * > + * Sensor-->PFE-->WB-->CFA-->CC-->GAM-->CSC-->CBC-->SUB-->RLP-->DMA > + * > + * ISC video pipeline integrates the following submodules: > + * PFE: Parallel Front End to sample the camera sensor input stream > + * WB: Programmable white balance in the Bayer domain > + * CFA: Color filter array interpolation module > + * CC: Programmab
[PATCH] media: saa7134 fix media_dev alloc error path to not free when alloc fails
media_dev alloc error path does kfree when alloc fails. Fix it to not call kfree when media_dev alloc fails. Signed-off-by: Shuah Khan --- drivers/media/pci/saa7134/saa7134-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/saa7134/saa7134-core.c b/drivers/media/pci/saa7134/saa7134-core.c index c0e1780..eab2684 100644 --- a/drivers/media/pci/saa7134/saa7134-core.c +++ b/drivers/media/pci/saa7134/saa7134-core.c @@ -1046,7 +1046,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, dev->media_dev = kzalloc(sizeof(*dev->media_dev), GFP_KERNEL); if (!dev->media_dev) { err = -ENOMEM; - goto fail0; + goto media_dev_alloc_fail; } media_device_pci_init(dev->media_dev, pci_dev, dev->name); dev->v4l2_dev.mdev = dev->media_dev; @@ -1309,6 +1309,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, fail0: #ifdef CONFIG_MEDIA_CONTROLLER kfree(dev->media_dev); + media_dev_alloc_fail: #endif kfree(dev); return err; -- 2.5.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] uvc: Fix bytesperline calculation for planar YUV
Hi Nicolas, On Wednesday 13 Apr 2016 11:57:34 Nicolas Dufresne wrote: > Le mercredi 13 avril 2016 à 17:36 +0300, Laurent Pinchart a écrit : > > Hi Nicolas, > > > > Thank you for the patch. > > > > On Thursday 07 Jan 2016 15:43:48 Nicolas Dufresne wrote: > > > The formula used to calculate bytesperline only works for packed > > > format. > > > So far, all planar format we support have their bytesperline equal > > > to > > > the image width (stride of the Y plane or a line of Y for M420). > > > > > > Signed-off-by: Nicolas Dufresne > > > --- > > > drivers/media/usb/uvc/uvc_v4l2.c | 18 -- > > > 1 file changed, 16 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/media/usb/uvc/uvc_v4l2.c > > > b/drivers/media/usb/uvc/uvc_v4l2.c index d7723ce..ceb1d1b 100644 > > > --- a/drivers/media/usb/uvc/uvc_v4l2.c > > > +++ b/drivers/media/usb/uvc/uvc_v4l2.c > > > @@ -142,6 +142,20 @@ static __u32 uvc_try_frame_interval(struct > > > uvc_frame > > > *frame, __u32 interval) return interval; > > > } > > > > > > +static __u32 uvc_v4l2_get_bytesperline(struct uvc_format *format, > > > + struct uvc_frame *frame) > > > > I'd make the two parameters const. > > I agree. > > > > +{ > > > + switch (format->fcc) { > > > + case V4L2_PIX_FMT_NV12: > > > + case V4L2_PIX_FMT_YVU420: > > > + case V4L2_PIX_FMT_YUV420: > > > + case V4L2_PIX_FMT_M420: > > > + return frame->wWidth; > > > + default: > > > + return format->bpp * frame->wWidth / 8; > > > + } > > > +} > > > + > > > static int uvc_v4l2_try_format(struct uvc_streaming *stream, > > > struct v4l2_format *fmt, struct uvc_streaming_control > > > *probe, > > > struct uvc_format **uvc_format, struct uvc_frame > > > **uvc_frame) > > > @@ -245,7 +259,7 @@ static int uvc_v4l2_try_format(struct > > > uvc_streaming > > > *stream, fmt->fmt.pix.width = frame->wWidth; > > > fmt->fmt.pix.height = frame->wHeight; > > > fmt->fmt.pix.field = V4L2_FIELD_NONE; > > > - fmt->fmt.pix.bytesperline = format->bpp * frame->wWidth / > > > 8; > > > + fmt->fmt.pix.bytesperline = > > > uvc_v4l2_get_bytesperline(format, frame); > > > fmt->fmt.pix.sizeimage = probe->dwMaxVideoFrameSize; > > > fmt->fmt.pix.colorspace = format->colorspace; > > > fmt->fmt.pix.priv = 0; > > > @@ -282,7 +296,7 @@ static int uvc_v4l2_get_format(struct > > > uvc_streaming > > > *stream, fmt->fmt.pix.width = frame->wWidth; > > > fmt->fmt.pix.height = frame->wHeight; > > > fmt->fmt.pix.field = V4L2_FIELD_NONE; > > > - fmt->fmt.pix.bytesperline = format->bpp * frame->wWidth / > > > 8; > > > + fmt->fmt.pix.bytesperline = > > > uvc_v4l2_get_bytesperline(format, frame); > > > fmt->fmt.pix.sizeimage = stream->ctrl.dwMaxVideoFrameSize; > > > fmt->fmt.pix.colorspace = format->colorspace; > > > fmt->fmt.pix.priv = 0; > > > > This looks good to me otherwise. > > > > If it's fine with you I can fix the above issue while applying. > > That would be really nice. Applied to my tree with the above changes, thank you. -- 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] [media] vsp1: make vsp1_drm_frame_end static
Hi Mauro, On Wednesday 13 Apr 2016 17:42:24 Mauro Carvalho Chehab wrote: > As reported by smatch: > drivers/media/platform/vsp1/vsp1_drm.c:39:6: warning: no previous > prototype > for 'vsp1_drm_frame_end' [-Wmissing-prototypes] void > vsp1_drm_frame_end(struct vsp1_pipeline *pipe) > > Fixes: ef9621bcd664 ("[media] v4l: vsp1: Store the display list manager in > the WPF") Signed-off-by: Mauro Carvalho Chehab Given that patch "[media] v4l: vsp1: Use display lists with the userspace API" from the same series removes the function, that's most likely overkill, but it won't hurt. I would have squashed it into the original commit though, as all this brings is a smatch warning fix that could only be noticed during bisection without any runtime impact, so a separate patch doesn't help much. > --- > drivers/media/platform/vsp1/vsp1_drm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/vsp1/vsp1_drm.c > b/drivers/media/platform/vsp1/vsp1_drm.c index 22f67360b750..1f08da4b933b > 100644 > --- a/drivers/media/platform/vsp1/vsp1_drm.c > +++ b/drivers/media/platform/vsp1/vsp1_drm.c > @@ -36,7 +36,7 @@ void vsp1_drm_display_start(struct vsp1_device *vsp1) > vsp1_dlm_irq_display_start(vsp1->drm->pipe.output->dlm); > } > > -void vsp1_drm_frame_end(struct vsp1_pipeline *pipe) > +static void vsp1_drm_frame_end(struct vsp1_pipeline *pipe) > { > vsp1_dlm_irq_frame_end(pipe->output->dlm); > } -- 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 2/2] [media] mceusb: remove pointless mce_flush_rx_buffer function
This function just submits the urb much like mceusb_dev_resume; removing it simplifies mce_request_packet. Also add missing usb_kill_urb to mce_dev_probe. Signed-off-by: Sean Young --- drivers/media/rc/mceusb.c | 77 +++ 1 file changed, 31 insertions(+), 46 deletions(-) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 85823e8..18a6e6c 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -153,9 +153,6 @@ #define MCE_COMMAND_IRDATA 0x80 #define MCE_PACKET_LENGTH_MASK 0x1f /* Packet length mask */ -#define MCEUSB_RX 1 -#define MCEUSB_TX 2 - #define VENDOR_PHILIPS 0x0471 #define VENDOR_SMK 0x0609 #define VENDOR_TATUNG 0x1460 @@ -726,50 +723,40 @@ static void mce_async_callback(struct urb *urb) /* request incoming or send outgoing usb packet - used to initialize remote */ static void mce_request_packet(struct mceusb_dev *ir, unsigned char *data, - int size, int urb_type) + int size) { int res, pipe; struct urb *async_urb; struct device *dev = ir->dev; unsigned char *async_buf; - if (urb_type == MCEUSB_TX) { - async_urb = usb_alloc_urb(0, GFP_KERNEL); - if (unlikely(!async_urb)) { - dev_err(dev, "Error, couldn't allocate urb!\n"); - return; - } - - async_buf = kzalloc(size, GFP_KERNEL); - if (!async_buf) { - dev_err(dev, "Error, couldn't allocate buf!\n"); - usb_free_urb(async_urb); - return; - } + async_urb = usb_alloc_urb(0, GFP_KERNEL); + if (unlikely(!async_urb)) { + dev_err(dev, "Error, couldn't allocate urb!\n"); + return; + } - /* outbound data */ - if (usb_endpoint_xfer_int(ir->usb_ep_out)) { - pipe = usb_sndintpipe(ir->usbdev, -ir->usb_ep_out->bEndpointAddress); - usb_fill_int_urb(async_urb, ir->usbdev, pipe, async_buf, -size, mce_async_callback, ir, -ir->usb_ep_out->bInterval); - } else { - pipe = usb_sndbulkpipe(ir->usbdev, -ir->usb_ep_out->bEndpointAddress); - usb_fill_bulk_urb(async_urb, ir->usbdev, pipe, -async_buf, size, mce_async_callback, -ir); - } - memcpy(async_buf, data, size); + async_buf = kmalloc(size, GFP_KERNEL); + if (!async_buf) { + usb_free_urb(async_urb); + return; + } - } else if (urb_type == MCEUSB_RX) { - /* standard request */ - async_urb = ir->urb_in; + /* outbound data */ + if (usb_endpoint_xfer_int(ir->usb_ep_out)) { + pipe = usb_sndintpipe(ir->usbdev, +ir->usb_ep_out->bEndpointAddress); + usb_fill_int_urb(async_urb, ir->usbdev, pipe, async_buf, +size, mce_async_callback, ir, +ir->usb_ep_out->bInterval); } else { - dev_err(dev, "Error! Unknown urb type %d\n", urb_type); - return; + pipe = usb_sndbulkpipe(ir->usbdev, +ir->usb_ep_out->bEndpointAddress); + usb_fill_bulk_urb(async_urb, ir->usbdev, pipe, +async_buf, size, mce_async_callback, +ir); } + memcpy(async_buf, data, size); dev_dbg(dev, "receive request called (size=%#x)", size); @@ -790,19 +777,14 @@ static void mce_async_out(struct mceusb_dev *ir, unsigned char *data, int size) if (ir->need_reset) { ir->need_reset = false; - mce_request_packet(ir, DEVICE_RESUME, rsize, MCEUSB_TX); + mce_request_packet(ir, DEVICE_RESUME, rsize); msleep(10); } - mce_request_packet(ir, data, size, MCEUSB_TX); + mce_request_packet(ir, data, size); msleep(10); } -static void mce_flush_rx_buffer(struct mceusb_dev *ir, int size) -{ - mce_request_packet(ir, NULL, size, MCEUSB_RX); -} - /* Send data out the IR blaster port(s) */ static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count) { @@ -1254,7 +1236,7 @@ static int mceusb_dev_probe(struct usb_interface *intf, struct usb_endpoint_descriptor *ep_in = NULL; struct usb_endpoint_descriptor *ep_out = NULL; struct mceusb_dev *ir = N
[PATCH 1/2] [media] mceusb: remove useless debug message
Signed-off-by: Sean Young --- drivers/media/rc/mceusb.c | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 35155ae..85823e8 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -153,12 +153,6 @@ #define MCE_COMMAND_IRDATA 0x80 #define MCE_PACKET_LENGTH_MASK 0x1f /* Packet length mask */ -/* general constants */ -#define SEND_FLAG_IN_PROGRESS 1 -#define SEND_FLAG_COMPLETE 2 -#define RECV_FLAG_IN_PROGRESS 3 -#define RECV_FLAG_COMPLETE 4 - #define MCEUSB_RX 1 #define MCEUSB_TX 2 @@ -416,7 +410,6 @@ struct mceusb_dev { struct rc_dev *rc; /* optional features we can enable */ - bool carrier_report_enabled; bool learning_enabled; /* core device bits */ @@ -449,7 +442,6 @@ struct mceusb_dev { } flags; /* transmit support */ - int send_flags; u32 carrier; unsigned char tx_mask; @@ -774,8 +766,6 @@ static void mce_request_packet(struct mceusb_dev *ir, unsigned char *data, } else if (urb_type == MCEUSB_RX) { /* standard request */ async_urb = ir->urb_in; - ir->send_flags = RECV_FLAG_IN_PROGRESS; - } else { dev_err(dev, "Error! Unknown urb type %d\n", urb_type); return; @@ -1050,7 +1040,6 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) static void mceusb_dev_recv(struct urb *urb) { struct mceusb_dev *ir; - int buf_len; if (!urb) return; @@ -1061,18 +1050,10 @@ static void mceusb_dev_recv(struct urb *urb) return; } - buf_len = urb->actual_length; - - if (ir->send_flags == RECV_FLAG_IN_PROGRESS) { - ir->send_flags = SEND_FLAG_COMPLETE; - dev_dbg(ir->dev, "setup answer received %d bytes\n", - buf_len); - } - switch (urb->status) { /* success */ case 0: - mceusb_process_ir_data(ir, buf_len); + mceusb_process_ir_data(ir, urb->actual_length); break; case -ECONNRESET: -- 2.5.5 -- 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: saa7134 fix media_dev alloc error path to not free when alloc fails
Em Thu, 14 Apr 2016 10:31:20 -0600 Shuah Khan escreveu: > media_dev alloc error path does kfree when alloc fails. Fix it to not call > kfree when media_dev alloc fails. No need. kfree(NULL) is OK. Adding a label inside a conditional block is ugly. > > Signed-off-by: Shuah Khan > --- > drivers/media/pci/saa7134/saa7134-core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/pci/saa7134/saa7134-core.c > b/drivers/media/pci/saa7134/saa7134-core.c > index c0e1780..eab2684 100644 > --- a/drivers/media/pci/saa7134/saa7134-core.c > +++ b/drivers/media/pci/saa7134/saa7134-core.c > @@ -1046,7 +1046,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, > dev->media_dev = kzalloc(sizeof(*dev->media_dev), GFP_KERNEL); > if (!dev->media_dev) { > err = -ENOMEM; > - goto fail0; > + goto media_dev_alloc_fail; > } > media_device_pci_init(dev->media_dev, pci_dev, dev->name); > dev->v4l2_dev.mdev = dev->media_dev; > @@ -1309,6 +1309,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, > fail0: > #ifdef CONFIG_MEDIA_CONTROLLER > kfree(dev->media_dev); > + media_dev_alloc_fail: > #endif > kfree(dev); > return err; -- Thanks, Mauro -- 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: saa7134 fix media_dev alloc error path to not free when alloc fails
On 04/14/2016 03:08 PM, Mauro Carvalho Chehab wrote: > Em Thu, 14 Apr 2016 10:31:20 -0600 > Shuah Khan escreveu: > >> media_dev alloc error path does kfree when alloc fails. Fix it to not call >> kfree when media_dev alloc fails. > > No need. kfree(NULL) is OK. Agreed. > > Adding a label inside a conditional block is ugly. In this case, if label is in normal path, we will see defined, but not used warnings when condition isn't defined. We seem to have many such cases for CONFIG_MEDIA_CONTROLLER :( thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America(Silicon Valley) shuah...@samsung.com | (970) 217-8978 -- 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: tvp5150 regression after commit 9f924169c035
Hello Tony, On 04/14/2016 11:12 AM, Tony Lindgren wrote: > Hi, > > * Javier Martinez Canillas [160414 07:28]: >> Hello Wofram, >> >> On 04/14/2016 10:19 AM, Wolfram Sang wrote: >>> Yes, I also wonder why I'm the only one facing this issue... maybe no one else is using the tvp5150 driver on an OMAP board with mainline? >>> >>> I wonder why it only affects tvp5150. I don't see the connection yet. >>> >> >> Yes, me neither. All other I2C devices are working properly on this board. >> >> The only thing I can think, is that the tvp5150 needs a reset sequence in >> order to be operative. It basically toggles two pins in the chip, this is >> done in tvp5150_init() [0] and is needed before accessing I2C registers. >> >> Maybe runtime pm has an effect on this and the chip is not reset correctly? > > Is this with omap3 and does tvp5150 have a reset GPIO pin? > Yes, it's a DM3730 (OMAP3) and yes the tvp5150 (actually it's a tvp5151) has a reset pin that has to be toggled, along with a power-down pin for the chip to be in an operative state before accessing the I2C registers. That is the power/reset sequence I mentioned before. > If so, you could be hitting the GPIO errata where a glitch can happen > when restoring the GPIO state coming back from off mode in idle. This > happes for GPIO pins that are not in GPIO bank1 and have an external > pull down resistor on the line. > The GPIO lines connected to these pins are: GPIO126 (bank4 pin 30) -> tvp5150 power-down pin GPIO167 (bank6 pin 7) -> tvp5150 reset pin Neither are in GPIO bank1 so they could be affected by the errata you mention but there isn't external pull down (or up) resistors on these lines AFAICT by looking at the board schematics. I've added to the cc list to other people that are familiar with the board in case I missed something. > The short term workaround is to mux the reset pin to use the internal > pulls by using PIN_INPUT_PULLUP | MUX_MODE7, or depending on the direction, > PIN_INPUT_PULLDOWN | MUX_MODE7. > I guess you meant MUX_MODE4 here since the pin has to be in GPIO mode? Also, I wonder how the issue could be related to the GPIO controller since is when enabling runtime PM for the I2C controller that things fail. IOW, disabling runtime PM for the I2C adapter shouldn't make things to work if the problem was caused by the mentioned GPIO errata. In any case, I've tried to use the internal pulls as you suggested but that didn't solve the issue. > The long term workaround is tho have gpio-omap.c do this dynamically > with pinctrl-single.c using gpio-ranges, but that's going to take a > while.. You can search for erratum 1.158 for more info. > > Regards, > > Tony > >> [0]: >> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/i2c/tvp5150.c#n1311 I'm really out of ideas on this, I don't think that Wolfram change has to be reverted since it seems I'm the only one facing this issue and also the DTS for the board I'm using is not even in mainline yet. I'm waiting for some discussions about the Media Controller input connectors DT bindings to settle before posting the board DTS patches. Best regards, -- Javier Martinez Canillas Open Source Group Samsung Research America -- 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 2/2] [media] tvp5150: propagate I2C write error in .s_register callback
The tvp5150_write() function can fail so don't return 0 unconditionally in tvp5150_s_register() but propagate what's returned by tvp5150_write(). Signed-off-by: Javier Martinez Canillas --- drivers/media/i2c/tvp5150.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 4a2e851b6a3b..7be456d1b071 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -1161,8 +1161,7 @@ static int tvp5150_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register * static int tvp5150_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) { - tvp5150_write(sd, reg->reg & 0xff, reg->val & 0xff); - return 0; + return tvp5150_write(sd, reg->reg & 0xff, reg->val & 0xff); } #endif -- 2.5.5 -- 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 1/2] [media] tvp5150: return I2C write operation failure to callers
The tvp5150_write() function calls i2c_smbus_write_byte_data() that can fail but does not propagate the error to the caller. Instead it just prints a debug, so callers can't know if the operation failed. So change the function to return the error code to the caller so it knows that the write failed and also print an error instead of just printing a debug information. While being there remove the inline keyword from tvp5150_write() to make it consistent with tvp5150_read() and also because it's called in a lot of places, so making inline is in fact counter productive since it makes the kernel image size to be much bigger (~16 KiB). Signed-off-by: Javier Martinez Canillas --- drivers/media/i2c/tvp5150.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index e5003d94f262..4a2e851b6a3b 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -83,7 +83,7 @@ static int tvp5150_read(struct v4l2_subdev *sd, unsigned char addr) return rc; } -static inline void tvp5150_write(struct v4l2_subdev *sd, unsigned char addr, +static int tvp5150_write(struct v4l2_subdev *sd, unsigned char addr, unsigned char value) { struct i2c_client *c = v4l2_get_subdevdata(sd); @@ -92,7 +92,9 @@ static inline void tvp5150_write(struct v4l2_subdev *sd, unsigned char addr, v4l2_dbg(2, debug, sd, "tvp5150: writing 0x%02x 0x%02x\n", addr, value); rc = i2c_smbus_write_byte_data(c, addr, value); if (rc < 0) - v4l2_dbg(0, debug, sd, "i2c i/o error: rc == %d\n", rc); + v4l2_err(sd, "i2c i/o error: rc == %d\n", rc); + + return rc; } static void dump_reg_range(struct v4l2_subdev *sd, char *s, u8 init, -- 2.5.5 -- 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
cron job: media_tree daily build: OK
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: Fri Apr 15 04:00:21 CEST 2016 git branch: test git hash: ecb7b0183a89613c154d1bea48b494907efbf8f9 gcc version:i686-linux-gcc (GCC) 5.3.0 sparse version: v0.5.0-56-g7647c77 smatch version: v0.5.0-3413-g618cd5c host hardware: x86_64 host os:4.4.0-164 linux-git-arm-at91: OK linux-git-arm-davinci: OK linux-git-arm-exynos: OK linux-git-arm-mx: OK linux-git-arm-omap: OK linux-git-arm-omap1: 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: OK linux-2.6.37.6-i686: OK linux-2.6.38.8-i686: OK linux-2.6.39.4-i686: OK linux-3.0.60-i686: OK linux-3.1.10-i686: OK linux-3.2.37-i686: OK linux-3.3.8-i686: OK linux-3.4.27-i686: OK linux-3.5.7-i686: OK linux-3.6.11-i686: OK linux-3.7.4-i686: OK linux-3.8-i686: OK linux-3.9.2-i686: OK linux-3.10.1-i686: OK linux-3.11.1-i686: OK linux-3.12.23-i686: OK linux-3.13.11-i686: OK linux-3.14.9-i686: OK linux-3.15.2-i686: OK linux-3.16.7-i686: OK linux-3.17.8-i686: OK linux-3.18.7-i686: OK linux-3.19-i686: OK linux-4.0-i686: OK linux-4.1.1-i686: OK linux-4.2-i686: OK linux-4.3-i686: OK linux-4.4-i686: OK linux-4.5-i686: OK linux-4.6-rc1-i686: OK linux-2.6.36.4-x86_64: OK linux-2.6.37.6-x86_64: OK linux-2.6.38.8-x86_64: OK linux-2.6.39.4-x86_64: OK linux-3.0.60-x86_64: OK linux-3.1.10-x86_64: OK linux-3.2.37-x86_64: OK linux-3.3.8-x86_64: OK linux-3.4.27-x86_64: OK linux-3.5.7-x86_64: OK linux-3.6.11-x86_64: OK linux-3.7.4-x86_64: OK linux-3.8-x86_64: OK linux-3.9.2-x86_64: OK linux-3.10.1-x86_64: OK linux-3.11.1-x86_64: OK linux-3.12.23-x86_64: OK linux-3.13.11-x86_64: OK linux-3.14.9-x86_64: OK linux-3.15.2-x86_64: OK linux-3.16.7-x86_64: OK linux-3.17.8-x86_64: OK linux-3.18.7-x86_64: OK linux-3.19-x86_64: OK linux-4.0-x86_64: OK linux-4.1.1-x86_64: OK linux-4.2-x86_64: OK linux-4.3-x86_64: OK linux-4.4-x86_64: OK linux-4.5-x86_64: OK linux-4.6-rc1-x86_64: OK apps: OK spec-git: OK sparse: WARNINGS smatch: ERRORS Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Friday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Friday.tar.bz2 The Media Infrastructure API from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/media.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