From patchwork Wed Jan 30 16:48:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 157071 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6160749jaa; Wed, 30 Jan 2019 08:48:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IaCuLEhKzdLZzWnBnF9I5H1UgLz1471MhlG171d7aCNC2pM9X/c1ldMV6qVA5ERXqpkhVOp X-Received: by 2002:a17:902:b03:: with SMTP id 3mr1253457plq.91.1548866893004; Wed, 30 Jan 2019 08:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548866892; cv=none; d=google.com; s=arc-20160816; b=kZjUyONJMU4PQxbuyt9bfCvx01nytcrnm7n/T1GZ8QSdf72+5/BP2CsFfsiWBQ9rTU Q+2QJnfGYNtul9pQDhhdBluy7OZ1tOAijmxFIW/nUSGdnEyKj7Jp2+paJaQXO81xWASH FAgtvC1GcOli7k7mIgVESIbrt4auj2oSGYewDZN1DRU8jGEpapftvTraDeBhDmODuRA2 V18emibXqjdMf87VC9TEFIqisRkiiVSjxrnDqu0ox8EMBKcZlgTi/hodwq4GW+vjg7Dn whrLdDaFnAnW4Tcai/8ttjM4srv2jAKJpNJrB4eXJLcqrbbalcCaiAxEsqC89LwBWKsy BI1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Ho+kzxYAYd4TY0kJUTb4OZYepxjGIOMJa+jl8zoC1/U=; b=Sa4Ab6rRHdC/axq2TQmtM6eYp+4u7/puDmtOV7ClwiUE85+jpKhtEMGBQuFdTG+C7O N4AIRJ3O767Uy0FfDp2xUeDntwLc04YT8VWlxQOuUVm1+tgp/Tw+DfgyJ7lJf2YvpLrD cgeuGsW83j+XmDqo0vyprg7Fiis0A4FY+Ew90PF8sBU9OJXS1lJJlKZxs0M69BrGdbWW DRzRjDCLhAyBPqlzaMsmJy0gcxw6nk/aooHISUdjbDbiiTZOsuKyzj9vbew9ipoa0EAO pF/nXZN/EgclRME/lmd0sohpJecrMJ4ZJ2QvhDiV4uIG7iv01QRTv6c1wXW8BWE4WmoI ofYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VKXiwQvD; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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. [209.132.180.67]) by mx.google.com with ESMTP id d10si1799515pgf.136.2019.01.30.08.48.12; Wed, 30 Jan 2019 08:48:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-media-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=@linaro.org header.s=google header.b=VKXiwQvD; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 S1731681AbfA3QsM (ORCPT + 4 others); Wed, 30 Jan 2019 11:48:12 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43569 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728469AbfA3QsM (ORCPT ); Wed, 30 Jan 2019 11:48:12 -0500 Received: by mail-wr1-f65.google.com with SMTP id r10so175591wrs.10 for ; Wed, 30 Jan 2019 08:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Ho+kzxYAYd4TY0kJUTb4OZYepxjGIOMJa+jl8zoC1/U=; b=VKXiwQvDltxDHVveiS7DzIyubhYlp1Fb5PS1/PkropF1UHhl4APQpwsqv8xtUG3Ges H12WtPm98ltztBOH9NbhxV5g9IxytGZ5HlnE2FiooxBBJpq9Ajzr79DG4iniv6RndA6o /LcnUWu7H3NBjB3mYCoqrw1eA45iI/1TBSAv0= 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; bh=Ho+kzxYAYd4TY0kJUTb4OZYepxjGIOMJa+jl8zoC1/U=; b=lrBbhCkoczg6o8oKsZY9TKeeSUgGtwiT6XZHb3pbnY7NXyBOBXnUqfm8BajmBX8YxY tXOliUzot/luMf4AKsq83X9jh4t3VGgBVvS9XE/wXGAcbPVPobuwnQhUOHqcIFnN+Gam YKS6ecUBTcdiKxWn4s3BO1QezAsugho1EvdwL2BFrPQQhtDqoRnFoMrVelORU0B4lACY SXDN8yQUY1LD5MzSMAEXVZg8RRAk+O5iLB6pjFuMwsljlHwSzqqPbc3rqPsJsIWShyDH L1tSlPtxG+ioyNkyE8Al7y+oRqCG2g45Z0Hp+WF88KpwIlybn+WuUvuT05UxRtW+JKjz 19PQ== X-Gm-Message-State: AJcUukd/gj6io/T9DC/Kr2idyutuPN3wkFRncJgr0LBO+tBW2dRIhmG7 DQvMhwyj/+X+V+veCpwZEqtF3A== X-Received: by 2002:adf:9323:: with SMTP id 32mr30299693wro.213.1548866890241; Wed, 30 Jan 2019 08:48:10 -0800 (PST) Received: from localhost.localdomain (lfbn-1-10571-127.w90-89.abo.wanadoo.fr. [90.89.165.127]) by smtp.gmail.com with ESMTPSA id v132sm2746033wme.20.2019.01.30.08.48.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Jan 2019 08:48:09 -0800 (PST) From: Loic Poulain To: slongerbeam@gmail.com, mchehab@kernel.org Cc: linux-media@vger.kernel.org, Loic Poulain Subject: [PATCH] media: i2c: ov5640: Fix post-reset delay Date: Wed, 30 Jan 2019 17:48:07 +0100 Message-Id: <1548866887-25746-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org According to the ov5640 specification (2.7 power up sequence), host can access the sensor's registers 20ms after reset. Trying to access them before leads to undefined behavior and result in sporadic initialization errors. Signed-off-by: Loic Poulain --- drivers/media/i2c/ov5640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 5a909ab..6415231 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -1906,7 +1906,7 @@ static void ov5640_reset(struct ov5640_dev *sensor) usleep_range(1000, 2000); gpiod_set_value_cansleep(sensor->reset_gpio, 0); - usleep_range(5000, 10000); + usleep_range(20000, 25000); } static int ov5640_set_power_on(struct ov5640_dev *sensor)