Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3257875yba; Mon, 8 Apr 2019 14:45:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTaaMVsz5/TREY/Eam6q7p7qABeD6l5xWALQC4TXqNKeWQNkoaGvwOTpIx2jUEcgNZv3Fg X-Received: by 2002:a17:902:31c3:: with SMTP id x61mr31584223plb.143.1554759942113; Mon, 08 Apr 2019 14:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554759942; cv=none; d=google.com; s=arc-20160816; b=C/FD8R/EIoJget1/v/vx0iRW/YO28JsJQ8twe7gYZx/F5Dn+TtJaIkLDY+QMxemgsr HxIfavSZFP9AjCkmfM0e+QaITRMoEyrrkXjMP2iJLnfECpYeksnOz3b24DgWrWTMXj9/ rtf4hBZFW8OFrnTUXtNiicdoSLNaEJEELfNZWkihaCwjEc9XfBgQ6x4rR0UeNzmbpKln E/CoZx84d76ofc1yw8bdnWxIUpca+Jkur1NvB9fGYiUslnbSY+tAC1WW7dTI8WcjoSpD gnxviJuHabzUFP3ha1DFpweV9mVL36SPieBg/EBcbOivPwTkEMXSOX+n6Z5/D/5ivV5p BXUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jt3SeGFqkjvpf0KDzystQKves66Jxmw/RGatgrGKn4Y=; b=LG2hJMsKFrAnrfv/9pZDeubYdXHApenmmgWOxvw272fShalpAMjM1DCHqF7uJMM+yf YLsDdxKSYqiMbY6vF+ChihRLtcAyxnJQYzmdfrHidEgVhx+R+S8zmri+0B2g9BXboASw GtlU7BnoYQeIPWYlB23KEI7ZAH1dqEi1/PEkmuJVB5pmei3IsWzFDtsg0vqC/Y+tfmxv ZOB4sje5JSOB6zwMixG77DHc3KQWpUmKeY3peY8+JWizYpQmLjq/cGCvmEXXjlUWZM88 qNJ+hruT/h0t58dPYlv5Sh+eqUqlNoYvuLlfOkV9lTohEyM5PEWmJOE/8RwLRRaZ8Ux/ iu2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iA9bWOQu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r39si28425505pld.10.2019.04.08.14.45.27; Mon, 08 Apr 2019 14:45:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iA9bWOQu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726507AbfDHVnw (ORCPT + 99 others); Mon, 8 Apr 2019 17:43:52 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:40612 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727197AbfDHVnX (ORCPT ); Mon, 8 Apr 2019 17:43:23 -0400 Received: by mail-lf1-f68.google.com with SMTP id a28so10627648lfo.7; Mon, 08 Apr 2019 14:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jt3SeGFqkjvpf0KDzystQKves66Jxmw/RGatgrGKn4Y=; b=iA9bWOQuNvDMWOdo2jgDFys0mxYtOymkJEjF1UN9A6cO4mGbPzJ+alLYUwmeo99WGG kb07/WnBPfSHDR6CepfnVesd45dlxYLqL6g+9THwb01CB50MVo9/pphyy3zjYF6NPoc1 TAF8KZifqgNavKnrSHHFqn3iRoLqKLv62UkDhtPN+bAzqkUlnxmH2UjkwFPSiQWASaIC Q31jLWQwvZ7NjeUD5M/nk2l27/ZoqKK44Hq5cCKOjmYvYGTs29Fl2zH9krKbVE3OLKBo /aUL8oKAbvxI6dp41gWG96FetC+jzxTKt9QNCEd2CSdnXyAhDYR756+jGqJzHzecbsTu JSGg== 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:mime-version:content-transfer-encoding; bh=jt3SeGFqkjvpf0KDzystQKves66Jxmw/RGatgrGKn4Y=; b=MZiJDmBr1UXiB43X34Zc1Ur3gwC0XOScmf6XA2e3nuSrWMRFkTe39kRTa+j4pHI0zL dGLjvYu5BfHNIfuOruXm/CnyQ7Mm/P8zm5x+dmljA9SdEHpAuWGbXjd1tqCgpDX/SLOl FFobBV1S5l3usGZ1nlld6v0tCEWqbzavfCZjbVoMJ1R0DlxE5T3hSIz3t0qqD3rV8SjT rFupqEMpGy+owf1Fy3vFINUmEKDgiCmKXkJHd9GPKyGUg54apWXf4CH9GKN7VpUTqO3h SUELx1j0OiLrakEwwsLaApHj/IJk3UHQLHZ7gHjphX+z56dqdDjDg/T9DreEO9vmy2fk 5ECg== X-Gm-Message-State: APjAAAWAZsGN6v0ZXjAPSzsBSD4pHwu/cVg8wxjq2BSVv3UU6dqP0gt4 eWi4poey3DEJAcIMu6rq18I= X-Received: by 2002:ac2:495c:: with SMTP id o28mr17749542lfi.16.1554759801505; Mon, 08 Apr 2019 14:43:21 -0700 (PDT) Received: from z50.gdansk-morena.vectranet.pl (109241207190.gdansk.vectranet.pl. [109.241.207.190]) by smtp.gmail.com with ESMTPSA id j6sm5286048ljc.0.2019.04.08.14.43.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Apr 2019 14:43:20 -0700 (PDT) From: Janusz Krzysztofik To: Mauro Carvalho Chehab Cc: Sakari Ailus , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Janusz Krzysztofik Subject: [PATCH 12/14] media: ov6650: Fix default format not applied on device probe Date: Mon, 8 Apr 2019 23:42:40 +0200 Message-Id: <20190408214242.9603-13-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190408214242.9603-1-jmkrzyszt@gmail.com> References: <20190408214242.9603-1-jmkrzyszt@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is not clear what pixel format is actually configured in hardware on reset. MEDIA_BUS_FMT_YUYV8_2X8, assumed on device probe since the driver was intiially submitted, is for sure not the one. Fix it by explicitly applying a known, driver default frame format just after initial device reset. Fixes: 2f6e2404799a ("[media] SoC Camera: add driver for OV6650 sensor") Signed-off-by: Janusz Krzysztofik Cc: stable@vger.kernel.org --- drivers/media/i2c/ov6650.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov6650.c b/drivers/media/i2c/ov6650.c index e72210653f55..8013afea0c02 100644 --- a/drivers/media/i2c/ov6650.c +++ b/drivers/media/i2c/ov6650.c @@ -920,6 +920,11 @@ static int ov6650_video_probe(struct v4l2_subdev *sd) ret = ov6650_reset(client); if (!ret) ret = ov6650_prog_dflt(client); + if (!ret) { + struct v4l2_mbus_framefmt mf = ov6650_def_fmt; + + ret = ov6650_s_fmt(sd, &mf); + } if (!ret) ret = v4l2_ctrl_handler_setup(&priv->hdl); @@ -1074,8 +1079,6 @@ static int ov6650_probe(struct i2c_client *client, priv->rect.top = DEF_VSTRT << 1; priv->rect.width = W_CIF; priv->rect.height = H_CIF; - priv->half_scale = false; - priv->code = MEDIA_BUS_FMT_YUYV8_2X8; priv->subdev.internal_ops = &ov6650_internal_ops; priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; -- 2.21.0