Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp489234ybg; Fri, 12 Jun 2020 06:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcizLY68vtJuGgL3zReWSa5XcOv7leliYF3GIZ4olTQ4SQcIMAvoKfKjsuY/2qErl1ZI8z X-Received: by 2002:a17:906:1116:: with SMTP id h22mr12897659eja.350.1591970216626; Fri, 12 Jun 2020 06:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591970216; cv=none; d=google.com; s=arc-20160816; b=whtqe9FEzltuSevF+d06RNpiGhWEmSS+YG8phlep483+WMCdoHZ9QTPV12o6ZNjW2O NqK+19Ze2YTx9k7wzGXFNB5u39YZw126VG67q1YsIyISzBP2vNurBLaVFJOLVUM3TZPl prCA9/Ao+P0eBgf5ll48ffALy1wqwkDW19ipZe5GPilCkWdf+R5Wa11Zc59HHhfRHBxU EuXpE4BRH9ylgKiDiecJX2SORZKA8J8zXKT4U8XU8xwcHIP+yv29rFlXCYVY3ps8MdZ9 AFkUQ7vbyLUwEDPwCNfUxwxVcLwNOJXIRK8+UqT/Z8h3RbKCkvPLD+RHJOJk4DAnT1co vGmQ== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=xeJmQRJvkh8fRKHXAH/W536lRiSffIGCx+R099ed5PQ=; b=aOZpbDG8lhVs4uTb0651760Z1QzNgL+sB9uSwcRVeAseAyYUHf1OFP3SMGICXhUUHd wOXfmkct8ZSiHixJJOpceum+HigedtXdKIYb2f7952+2QG0ArCL76VqvbZ5ZWCebCE1T qDl3xSXnT402VQVKH81Fa2GbHiaBP76D+KJeSSH2duTzHIiDWX26j4Ptnth+q+PQ+g5/ TbIhkfRjU6wbHkq/HciFj6vE5Mj07UCo2xORxVdKuO+Q07w1E+fulouzTPT0LhKiOGy+ WpPLLUMI8lVioYV5VwqhtKu0rDHZL4it/4lT1iUSYC8l61dKzTh7Wne1Dd4/aJ2zRPkw 2y1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hiiHVTh1; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b17si3716957ejb.626.2020.06.12.06.56.33; Fri, 12 Jun 2020 06:56:56 -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=@linaro.org header.s=google header.b=hiiHVTh1; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbgFLNye (ORCPT + 99 others); Fri, 12 Jun 2020 09:54:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbgFLNyU (ORCPT ); Fri, 12 Jun 2020 09:54:20 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69A6BC03E96F for ; Fri, 12 Jun 2020 06:54:18 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id x18so11159522lji.1 for ; Fri, 12 Jun 2020 06:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xeJmQRJvkh8fRKHXAH/W536lRiSffIGCx+R099ed5PQ=; b=hiiHVTh1koKECwgkQFOYluvaR28/5xxQvqOjadxCulwyJAffd2ZpYXFjRWW1GzXVU0 nomzxfGeylZ5u440WHBdRkGLZgok5eypFL+YQPilPO3CGrehGubk6rraAt64TSwIsJSe yoXR8k2FXymqMEqV+1cz4eaNbor9pimWSgDqjiRhRi8sHXkx+0HQezDhVNe4TygLUJQ0 ftjs0JrFoSH+fnIq/YijvScx0OXsSbgEIYGNKa97Ei5JeWJNg9gIh4QEs9y9H6sOQ9Rp irk26liCEIf59CE2Ly8HkxSzVUgwP7NRijj7rokcaQu/kuCGVOP9smOd7pMii0QvDRpo hBhg== 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; bh=xeJmQRJvkh8fRKHXAH/W536lRiSffIGCx+R099ed5PQ=; b=F6rx0+7nHBOkJf6xUtEobk1FiEnvqLhzfc2xSsM2we6zsB+FavZWHkUDhhWr2Ag2/9 94RIGuciC67YruwsrYX5q5rzEz2gonTnYkzX1zjXochrds6rliJWe6LfHWS1di0g6/J+ 0E0LeASI3AuGCxEpvk0pE0t1CGQo22otQPGHS+16MtI58RAGREWtI34F7/Q3lfHDrMM8 bB3jwFPWsMk5Y2XwUEJxz9TpbkKTPArYihGVqYF+rK2i54yw1zoJ8RSuTEjjyyKclqQM /UVzcEhrlWbbIN1esBCRyS6G+/T0r46AOdx+IcD3ld+hdtKRe+Lf7a/xpQuN5+rWlAOI lByg== X-Gm-Message-State: AOAM530KxUHXk+or6uOZr05uvS8PI5AHL8Kc6iPDgPsJo3PoIxZTbSL1 CcoL/CuoSrFa+qJ+in8edjM9Gg== X-Received: by 2002:a05:651c:108:: with SMTP id a8mr7069531ljb.326.1591970056778; Fri, 12 Jun 2020 06:54:16 -0700 (PDT) Received: from localhost.localdomain (37-144-159-139.broadband.corbina.ru. [37.144.159.139]) by smtp.googlemail.com with ESMTPSA id a1sm2414415lfi.36.2020.06.12.06.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2020 06:54:16 -0700 (PDT) From: Andrey Konovalov To: mchehab@kernel.org, sakari.ailus@iki.fi, manivannan.sadhasivam@linaro.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, c.barrett@framos.com, a.brela@framos.com, peter.griffin@linaro.org, Andrey Konovalov Subject: [PATCH v5 01/10] media: i2c: imx290: set the format before VIDIOC_SUBDEV_G_FMT is called Date: Fri, 12 Jun 2020 16:53:46 +0300 Message-Id: <20200612135355.30286-2-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200612135355.30286-1-andrey.konovalov@linaro.org> References: <20200612135355.30286-1-andrey.konovalov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the current driver 'media-ctl -p' issued right after the imx290 driver is loaded prints: pad0: Source [fmt:unknown/0x0] The format value of zero is due to the current_format field of the imx290 struct not being initialized yet. As imx290_entity_init_cfg() calls imx290_set_fmt(), the current_mode field is also initialized, so the line which set current_mode to a default value in driver's probe() function is no longer needed. Signed-off-by: Andrey Konovalov Reviewed-by: Manivannan Sadhasivam --- drivers/media/i2c/imx290.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index f7678e5a5d87..2d8c38ffe2f0 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -722,9 +722,6 @@ static int imx290_probe(struct i2c_client *client) goto free_err; } - /* Set default mode to max resolution */ - imx290->current_mode = &imx290_modes[0]; - /* get system clock (xclk) */ imx290->xclk = devm_clk_get(dev, "xclk"); if (IS_ERR(imx290->xclk)) { @@ -809,6 +806,9 @@ static int imx290_probe(struct i2c_client *client) goto free_ctrl; } + /* Initialize the frame format (this also sets imx290->current_mode) */ + imx290_entity_init_cfg(&imx290->sd, NULL); + ret = v4l2_async_register_subdev(&imx290->sd); if (ret < 0) { dev_err(dev, "Could not register v4l2 device\n"); -- 2.17.1