Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3109622ybk; Mon, 18 May 2020 18:18:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwikAr5EWt7aCp69VSgCLV/vfgiRfBCzJNcWE8t+D7VCbFou06M8L8oF1EJbxSNXhkJ0m1F X-Received: by 2002:a50:99de:: with SMTP id n30mr8302201edb.248.1589851116627; Mon, 18 May 2020 18:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589851116; cv=none; d=google.com; s=arc-20160816; b=RSAe/Nnrp2gkqMGPozpiTwPlyGCEG1G42PN65Muu3UQCn8NUOJ7rKw0dwQI8M8zLSR cch0PC5Ezsdjje67cCbB/4Ajxf8kSd/J3w/lrlNl6bSHYjpfaZlhDS2FasQeaOhzrgir ja5qcxjYdTq+3JsnFZ3SkxG65BHHdP3bt0ZSG3OJKjRSS6tmG2W9M6VpsOe7ldXhNiGU zFMejJt5mCwske3ng1dDyoLDwQme7Kd7c8UQVrFJPjXmSME8Y8/lv8F5kilPCSEgn3ld kchjsjBsU+HYLAC/mZvRtaK+OJbPiCIPjZDpSlTDo84ac1qxjpHgOgqjW7ITPCmK3L4t ODSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=iNtkjLBofdH+4f64nkDpx4VziClnAaPL36XhTHv5QzU=; b=wkjbu3MtLtwhkrCJMURmS3cgbJ1NxsLmSIHwyOlYqCshlsSrcK0bdZW9I8WU9GpJuS PYmz1YDniQwbSEokHZciwwQ3U+uLvKnVXfgI5cFnEUGQQBIDs1AknOwiuCjvGlbSUcYe Zs7Iz3RMRwQtLDz+Ec7DvL+i7EYKIaxnOtAAh8KyR0PZwkCvZnU1LUiPkyFiIc5HRIU3 vvwj644PVAfXU6mSwg9wSz5PRXXeQ/2eaVb+bboLjI7oMVvwGndMxvH1F2emw5/4c3BZ ABcKgmIFFzb2He6oBTMj3J3A9aQPDIDDOoMPO8tOteNRaQ6AISEmB8mv4F3qXr7TGp2p Ab9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@globallogic.com header.s=google header.b=W8CqP3lM; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=globallogic.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si7783780edj.559.2020.05.18.18.18.13; Mon, 18 May 2020 18:18:36 -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; dkim=pass header.i=@globallogic.com header.s=google header.b=W8CqP3lM; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=globallogic.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728003AbgESBQw (ORCPT + 99 others); Mon, 18 May 2020 21:16:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbgESBQv (ORCPT ); Mon, 18 May 2020 21:16:51 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 678CBC05BD0A for ; Mon, 18 May 2020 18:16:51 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id a4so9743672lfh.12 for ; Mon, 18 May 2020 18:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=globallogic.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=iNtkjLBofdH+4f64nkDpx4VziClnAaPL36XhTHv5QzU=; b=W8CqP3lMPScdIK6wIrmeT3P/nb87MaSjC2kmNctZJ5viIvGgB48mlnUCoGMa+JFxgw cFJE8Ime/RLaYAU+N+vk5UGBE44yFuZK7NQn/afZArp+f4a2nPYxZDRRKTe0yW2MBN5x 5Z80Ftp/ZYoMOA58mSpEmDUkUu8sTz5kgZj/GQKFjV/wmFIsK7EBAfQo/t0wAXEtx2EN NosGoAbeXUKde2bZu2eeZY3Ok75YdM/LptpD+HC1lZx3V/bJ0G05LDU1Gxv3Q+10Raq+ fzJmQc8cVouEOgW6GqbMjFg6jpKT8OMwNhQD6T+lbhlhSLhkxNYt6Yl0JTyKcSrWhhCu w+oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=iNtkjLBofdH+4f64nkDpx4VziClnAaPL36XhTHv5QzU=; b=mN08gtKhmnMZmpz+DgXER4NzjaDfRjX6iMw9mjkJUZHenbfIy8b/pMrl6VxapVMcn3 y/qowofiWYceNaXClefC6q221k13z/WEfFUrmOL0X80tB4j84lqtmIId5b9rCy+YGEoE o4SQCfevLp7terAb7UfAth9Duh/Rg9JN2Vud/3vkf02gz4bUmwM6fydCDCF6vI/giLTU pz7i6O2EKlQPxzrnx5nYFRoMn86GW7ZAK7UqTLe5u/lBRAd8RXJK9PN4t2VWRyK30fdf Q+oMffWc76toVcE34yfKWyAC3aVw2k2z72EVy1KWzmNqqXC7PmdAMxwOtEk2Yw0bze/x DkXw== X-Gm-Message-State: AOAM532UcW/vT+zzpIy2zEmOksbJhXKo/fUsCRT4ai5KlddT7BP9TAxC xZizv07E49I/eCQPGIInPlhfSViNv7CnWg== X-Received: by 2002:a19:c016:: with SMTP id q22mr5245316lff.191.1589851009299; Mon, 18 May 2020 18:16:49 -0700 (PDT) Received: from localhost.localdomain ([159.224.5.60]) by smtp.googlemail.com with ESMTPSA id i8sm4764244lfl.72.2020.05.18.18.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 18:16:48 -0700 (PDT) From: Roman Kovalivskyi To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Luis Oliveira , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Jacopo Mondi , Michael Rodin , Mauro Carvalho Chehab , Sakari Ailus , Hugues Fruchet , Maxime Ripard , Adam Ford , Todor Tomov , Suresh Udipi , Andrew Gabbasov , Eugeniu Rosca , Dave Stevenson , Roman Kovalivskyi Subject: [PATCH v2 1/6] media: ov5647: Add set_fmt and get_fmt calls. Date: Tue, 19 May 2020 04:16:16 +0300 Message-Id: <8a4c0d157d26251c9916b32866e6a4a91c023ef9.1589850165.git.roman.kovalivskyi@globallogic.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; + + /* 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 = { -- 2.17.1