From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83E70C282DD for ; Thu, 23 May 2019 19:34:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5E15320881 for ; Thu, 23 May 2019 19:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558640040; bh=WvP96BCSKZf3JJUOFKLAgwBKF3BH3RagTLnxSEgUhNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=u7zAvOBnvCQZZJ+UeOTsC/sbiZDVYF7ebamhOA0ba2icncyfJa0f3iM2pjHmr3CpA fZ5gegM1M+z0O/nfsfhqNOHFQKFhnGuOzz0tjLa2N6MYuN1HXn3nF/7SbiPOm798Cn MGjdY1fodohxDVLe9NTZ7lX6czgbyiSUwMfnwVSs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403754AbfEWTdz (ORCPT ); Thu, 23 May 2019 15:33:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:41092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391323AbfEWT22 (ORCPT ); Thu, 23 May 2019 15:28:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3DAD9217D7; Thu, 23 May 2019 19:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558639707; bh=WvP96BCSKZf3JJUOFKLAgwBKF3BH3RagTLnxSEgUhNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Np+m4A/IIe4dcJlf2PI8XhxkopSKbTsTWrvz/kMFCsGdH0dV3Zn/TCcOPCilDGWrw mS8+wrzyxatdVS9b2/m0aEZmGKNWCI+FC3ciEseIITt/ZXMKEJPk5FqXqVOvoMs8AJ DRIahLGEgfKqWrrt11/Gu0aMqOWSuMyu/63v+0Go= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Janusz Krzysztofik , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 5.1 049/122] media: ov6650: Fix sensor possibly not detected on probe Date: Thu, 23 May 2019 21:06:11 +0200 Message-Id: <20190523181711.201007708@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181705.091418060@linuxfoundation.org> References: <20190523181705.091418060@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Janusz Krzysztofik commit 933c1320847f5ed6b61a7d10f0a948aa98ccd7b0 upstream. 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 Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/i2c/ov6650.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/media/i2c/ov6650.c +++ b/drivers/media/i2c/ov6650.c @@ -814,6 +814,8 @@ static int ov6650_video_probe(struct i2c if (ret < 0) return ret; + msleep(20); + /* * check and show product ID and manufacturer ID */