Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3423842ybk; Tue, 19 May 2020 04:26:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5KWFl01Uei2tkH+KuERZCAKLKx+olBJG5Gw6udfd7qcwVnqndd8nPOyHc+UUvHbZnNT/M X-Received: by 2002:a17:907:724e:: with SMTP id ds14mr12877572ejc.260.1589887561819; Tue, 19 May 2020 04:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589887561; cv=none; d=google.com; s=arc-20160816; b=vkxTTyh0m12qSSEueY7chiiBMPgqimAkMeDetJ7ZgqTrRqWwi38p7dYSjxLIxVgYP/ uER5FzAKD8asct1BRlbR641RbRXfkHm+TKJK3DE6Bxo6K4YTbSdUda0clDkmb0+S2vzR xlRrEM8R5Z+FwWDXaMXIVW/7eBaCoRakXulyCFwYgadgH1+aTiXtTBe4Ly9z7sCUainW tdfGjNWUcf0RCE5jvoYUIClPmDzr3elajOSnESq6FBulorGcQF9czPRuc/xeqwvCZpDd p84vm/zNQPDju35hhAehgI0mqPbtI5yaxgjVQSZwgUsWXzdH2bKGvoswQRCgXQADFFuf S4xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=jaV16IaL0KMSf26xbj8mK7YuB5gPiIX5OAVUr9/pbs8=; b=uCvr9oeFekxl+5BrNZXOIuTaa0adGiyFMi6yeiET3h8ZSGEQ/n/1Sdx62igk2s6UP5 K1p0Jc8F7hHLJhy7k2hPDpLRYVowmTuOQBj885ISUkJ6mvMe5sNYKt/HlTS+Q0+FuuPT Al6HTOY8ijO1oG3tL7A1j6TT06eBqKtmx5GyaJ4k38rZWz11qm+CeWyctCQkGMB6JEpD VBXIc5OC3W49KQ6M2I4mrip+1NFh2y5TcHshYdzWFMdZQ+RGwOcqqKt1kp9PTawWHrKp jLXuBS5MuUWF7TnLotUXHz03fID1K9gHcGGRSrshTk96nWehQcqLwRz5wizdIxeRlQx8 3Z7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi20si9560206edb.233.2020.05.19.04.25.38; Tue, 19 May 2020 04:26:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728691AbgESLYK (ORCPT + 99 others); Tue, 19 May 2020 07:24:10 -0400 Received: from mga11.intel.com ([192.55.52.93]:19307 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgESLYJ (ORCPT ); Tue, 19 May 2020 07:24:09 -0400 IronPort-SDR: 2xWwAKQsABQaIgQP/t/nG8nuRoHdBE6qLIN6LapMjWui62JYeWQWCFLUSmGz5Fn6LMx+Ly9fY/ ZzTGX4p9ZJiQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 04:24:09 -0700 IronPort-SDR: oaZ8nk8yTbKOxBkv8QTVzCSAKKDxb40mum2qLj2Mjp5rgKJYNpXxQFX1l6Gbr6kVZ8lyGMZuO5 soybODBCSujA== X-IronPort-AV: E=Sophos;i="5.73,410,1583222400"; d="scan'208";a="300076326" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 04:24:05 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 322D720CEF; Tue, 19 May 2020 14:24:03 +0300 (EEST) Date: Tue, 19 May 2020 14:24:03 +0300 From: Sakari Ailus To: Roman Kovalivskyi Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Luis Oliveira , Niklas =?iso-8859-1?Q?S=F6derlund?= , Jacopo Mondi , Michael Rodin , Mauro Carvalho Chehab , Hugues Fruchet , Maxime Ripard , Adam Ford , Todor Tomov , Suresh Udipi , Andrew Gabbasov , Eugeniu Rosca , Dave Stevenson Subject: Re: [PATCH v2 1/6] media: ov5647: Add set_fmt and get_fmt calls. Message-ID: <20200519112403.GG20066@paasikivi.fi.intel.com> References: <8a4c0d157d26251c9916b32866e6a4a91c023ef9.1589850165.git.roman.kovalivskyi@globallogic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a4c0d157d26251c9916b32866e6a4a91c023ef9.1589850165.git.roman.kovalivskyi@globallogic.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dave, Thanks for the patchset. On Tue, May 19, 2020 at 04:16:16AM +0300, Roman Kovalivskyi wrote: > From: Dave Stevenson > > There's no way to query the subdevice for the supported > resolutions. Add set_fmt and get_fmt implementations. Since there's > only one format supported set_fmt does nothing and get returns single > format. > > Signed-off-by: Dave Stevenson > Signed-off-by: Roman Kovalivskyi > Reviewed-by: Jacopo Mondi > --- > drivers/media/i2c/ov5647.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c > index e7d2e5b4ad4b..3e587eb0a30e 100644 > --- a/drivers/media/i2c/ov5647.c > +++ b/drivers/media/i2c/ov5647.c > @@ -463,8 +463,30 @@ static int ov5647_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > +static int ov5647_set_get_fmt(struct v4l2_subdev *sd, > + struct v4l2_subdev_pad_config *cfg, > + struct v4l2_subdev_format *format) > +{ > + struct v4l2_mbus_framefmt *fmt = &format->format; > + > + if (format->pad != 0) > + return -EINVAL; No need to check the pad, the caller already has checked for it. > + > + /* Only one format is supported, so return that */ > + memset(fmt, 0, sizeof(*fmt)); > + fmt->code = MEDIA_BUS_FMT_SBGGR8_1X8; > + fmt->colorspace = V4L2_COLORSPACE_SRGB; > + fmt->field = V4L2_FIELD_NONE; > + fmt->width = 640; > + fmt->height = 480; > + > + return 0; > +} > + > static const struct v4l2_subdev_pad_ops ov5647_subdev_pad_ops = { > .enum_mbus_code = ov5647_enum_mbus_code, > + .set_fmt = ov5647_set_get_fmt, > + .get_fmt = ov5647_set_get_fmt, > }; > > static const struct v4l2_subdev_ops ov5647_subdev_ops = { -- Kind regards, Sakari Ailus