Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2727711img; Sun, 24 Mar 2019 17:22:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcVkE4ZE6DK9ad79iztDj/dnHiTi1KCQVtbwU6DC+GNoEdN4+bRQoMa7VwchfTLHSki5YL X-Received: by 2002:a63:ee04:: with SMTP id e4mr20640833pgi.310.1553473352209; Sun, 24 Mar 2019 17:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553473352; cv=none; d=google.com; s=arc-20160816; b=lE1jZVjY4RtRqipmOTnzO882bLgpV8dwxNJrt3IZaNLuCSSEua5nr56xnK0AS9aJgB o1y25FpF4M6ZvMd82lM5hnLcZwsqPfkSiNjtnULpiugFm7Q9XPjV3JwjUBP4m9JITyhS oLCYkMvoyAefkNxVSAd8VEtzm7Ko+2D4OEbxuDHoi28Oy7tUS+StnBAr1ib8LVr5gRk1 A7O65p0H3uyNxGo3Cb9sr94061Vjg5MpaVMEcLP8ECLkL6bxRhn88JlbCHC0OCZdMC5H 8T9xzLXcLQ0RTfhoP0i7o8yCYBYt/SSK9BLog5o61L0+sEtBMQ95j65wyxnt9p67XUM1 sd0g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Zb4WUz8SUAA1BJCmhgFbxG1PUWXncRJQ2t7FG+GNPic=; b=vnGg22C/R+IWsQf2tUwcemgr4CviDSxUpxarf3W3iPpRw5vdfAq+oMX1farzH95sIj fwULvjT7S6fCWDwQicWr8ViwMWt3x4tKvZmgZUzbkQirThOA5O8+NEQzbjB2TA4p/EvJ lJs8ABWm/awymuhcet+q2751frq98CTJH6Kg+irxk7bjh3x5UahuaDZOff8YUjN2Y9dJ drmsSoa53A3qxm8RDfqcP+GpxNtzaU2rkXtcdQje8jEvWYdL4BQG7taSikwC7rf4yuJb nZKN2jYEJgygx1EVw9Q4fmuBdb7SOCi0IR7X+ytKAC8/iAu6h3hjasuSGFgxlQTiTDlc 5lWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CuBMbl0Z; 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 v8si2044517plz.423.2019.03.24.17.22.17; Sun, 24 Mar 2019 17:22:32 -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=CuBMbl0Z; 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 S1729221AbfCYAVe (ORCPT + 99 others); Sun, 24 Mar 2019 20:21:34 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42277 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729195AbfCYAVe (ORCPT ); Sun, 24 Mar 2019 20:21:34 -0400 Received: by mail-lj1-f195.google.com with SMTP id v22so6225235lje.9; Sun, 24 Mar 2019 17:21:32 -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:mime-version :content-transfer-encoding; bh=Zb4WUz8SUAA1BJCmhgFbxG1PUWXncRJQ2t7FG+GNPic=; b=CuBMbl0ZI4oyGtzRqCCOa1f1d/x+zZaZcRnc0utjQACGflg7wp3Poy7CcqMjJlf83k /sL3wmoWdgz0qbrI67fmESN5xii5v2tdBgNKtupwcDcKCUiLdEH2/g5hf1Z29Vqsw/sL iCP2H6/tTYuBRMs9IGDAMoPYHvENcEjNhBRTQO8TbJ9gejxs7M2MaZE6bd+7AsTAd2jT ZSkbS6/lvmvDcJmg9KvqbF1egSWmA23YM33aiDKbqEJnCF0coSSK7HxcFipoyJ3vWYFQ aaqudq4WUQxylBd6TtgBdKBl5bjXYAqU3MjuMPgGQff2ZWZo82w9FwQ1u9XcgW+Qi3wC kcVg== 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:mime-version :content-transfer-encoding; bh=Zb4WUz8SUAA1BJCmhgFbxG1PUWXncRJQ2t7FG+GNPic=; b=W5Q7mdiIQui38DbFnZ27vQuOi3PFXhsYmgVOONueVQeF0cRUnypHST96XXYyyY60Eq eOmc+oIcj2gPuEUnXOriLxpFAB4uRmLwP7ZFgSVijsn6M7vBVF3k5p+XHGoxYHMEMML1 Qrrv0f/9+CftHfR9/s3xsMY34VgWHK5+2yXAobhq1rLL4wIwegcTl8k200ROflUbcdtz m4mLGGHAWyUgMXcx9Gur4tkOj/rhyaNoZm7ulDc+EigwmThZ98xbmGvEtjkFXCArSUcG 8C+XI+6THeed/+GkkFOFx1ZOaVmjyMGa8paKbpg3huiZW1ctr2NyM/0GOnA+CKtr8wt2 Rc7g== X-Gm-Message-State: APjAAAWXLhgHmjpJKyIJLvX3CxckmCGPJA2zE7Sd1nYir0hSqmoe++JY Th6zhBdhEHdf3ORfqeRev3U= X-Received: by 2002:a2e:97d3:: with SMTP id m19mr11491968ljj.63.1553473291799; Sun, 24 Mar 2019 17:21:31 -0700 (PDT) Received: from z50.gdansk-morena.vectranet.pl (109241207190.gdansk.vectranet.pl. [109.241.207.190]) by smtp.gmail.com with ESMTPSA id r9sm3114637lff.83.2019.03.24.17.21.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 17:21:30 -0700 (PDT) From: Janusz Krzysztofik To: Mauro Carvalho Chehab Cc: Hans Verkuil , Sakari Ailus , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik , stable@vger.kernel.org Subject: [PATCH] media: ov6650: Fix sensor possibly not detected on probe Date: Mon, 25 Mar 2019 01:21:12 +0100 Message-Id: <20190325002112.6920-1-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.19.2 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 After removal of clock_start() from before soc_camera_init_i2c() in soc_camera_probe() by commit 9aea470b399d ("[media] soc-camera: switch I2C subdevice drivers to use v4l2-clk") introduced in v3.11, the ov6650 driver could no longer probe the sensor successfully because its clock was no longer turned on in advance. The issue was initially worked around by adding that missing clock_start() equivalent to OMAP1 camera interface driver - the only user of this sensor - but a propoer fix should be rather implemented in the sensor driver code itself. Fix the issue by inserting a delay between the clock is turned on and the sensor I2C registers are read for the first time. Tested on Amstrad Delta with now out of tree but still locally maintained omap1_camera host driver. Fixes: 9aea470b399d ("[media] soc-camera: switch I2C subdevice drivers to use v4l2-clk") Signed-off-by: Janusz Krzysztofik Cc: stable@vger.kernel.org --- drivers/media/i2c/ov6650.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/i2c/ov6650.c b/drivers/media/i2c/ov6650.c index c33fd584cb44..f9359b11fa5c 100644 --- a/drivers/media/i2c/ov6650.c +++ b/drivers/media/i2c/ov6650.c @@ -814,6 +814,8 @@ static int ov6650_video_probe(struct i2c_client *client) if (ret < 0) return ret; + msleep(20); + /* * check and show product ID and manufacturer ID */ -- 2.19.2