From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750895AbdAFBZm (ORCPT ); Thu, 5 Jan 2017 20:25:42 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35856 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767AbdAFBZg (ORCPT ); Thu, 5 Jan 2017 20:25:36 -0500 Subject: Re: [PATCH v2 10/19] media: Add i.MX media core driver To: Vladimir Zapolskiy , shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, mchehab@kernel.org, gregkh@linuxfoundation.org, p.zabel@pengutronix.de References: <1483477049-19056-1-git-send-email-steve_longerbeam@mentor.com> <1483477049-19056-11-git-send-email-steve_longerbeam@mentor.com> Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Steve Longerbeam From: Steve Longerbeam Message-ID: <21871007-5243-7fc8-5087-f2ce5185180a@gmail.com> Date: Thu, 5 Jan 2017 17:21:53 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/04/2017 05:33 AM, Vladimir Zapolskiy wrote: > Hi Steve, > > On 01/03/2017 10:57 PM, Steve Longerbeam wrote: >> Add the core media driver for i.MX SOC. >> >> Signed-off-by: Steve Longerbeam >> --- >> Documentation/devicetree/bindings/media/imx.txt | 205 +++++ > v2 was sent before getting Rob's review comments, but still they > should be addressed in v3. yes, those changes will be part of v3 as well. > > Also I would suggest to separate device tree binding documentation > change and place it as the first patch in the series, this should > make the following DTS changes valid. done. > >> 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 + > Probably Greg should ack the UAPI changes, you may consider > to split them into a separate patch. I split out the one-line addition to include/uapi/Kbuild with an empty include/uapi/media/Kbuild into a new patch "UAPI: Add media UAPI Kbuild file". Also added a patch "media: Add userspace header file for i.MX". > > >> + >> +struct imx_media_subdev * >> +imx_media_find_subdev_by_sd(struct imx_media_dev *imxmd, >> + struct v4l2_subdev *sd) >> +{ >> + struct imx_media_subdev *imxsd; >> + int i, ret = -ENODEV; >> + >> + for (i = 0; i < imxmd->num_subdevs; i++) { >> + imxsd = &imxmd->subdev[i]; >> + if (sd == imxsd->sd) { > This can be simplifed: > > ... > > if (sd == imxsd->sd) > return imxsd; > } > > return ERR_PTR(-ENODEV); yep, done. > >> +struct imx_media_subdev * >> +imx_media_find_subdev_by_id(struct imx_media_dev *imxmd, u32 grp_id) >> +{ >> + struct imx_media_subdev *imxsd; >> + int i, ret = -ENODEV; >> + >> + for (i = 0; i < imxmd->num_subdevs; i++) { >> + imxsd = &imxmd->subdev[i]; >> + if (imxsd->sd && imxsd->sd->grp_id == grp_id) { >> + ret = 0; >> + break; > This can be simplifed: > > ... > > if (imxsd->sd && imxsd->sd->grp_id == grp_i) > return imxsd; > } > > return ERR_PTR(-ENODEV); done. > > >> diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c >> new file mode 100644 >> index 0000000..8d22730 >> --- /dev/null >> +++ b/drivers/staging/media/imx/imx-media-dev.c >> @@ -0,0 +1,479 @@ >> +/* >> + * V4L2 Media Controller Driver for Freescale i.MX5/6 SOC >> + * >> + * 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. >> + */ >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include > Please sort out the list of headers alphabetically. done. >> +#include