Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6663543pxb; Wed, 17 Feb 2021 10:02:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGEewlUgmCIpBSLAMdm9xiiCvRn7qTRAjgBUV+T3IgtSgF8TUM7nIkgCLx3dK/N4FFz8H9 X-Received: by 2002:a50:9d4d:: with SMTP id j13mr39333edk.83.1613584938318; Wed, 17 Feb 2021 10:02:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613584938; cv=none; d=google.com; s=arc-20160816; b=LCTTYok1tzn7KLFYCE3mn+dEB2gD6D8b8aCAzMKPcLZG5oeFrecFJWzYv1ZC3xoWNZ aVulIsY0jICJk8Z8AYA4GLs/cdAXFNf6XjVYRlfpmHg3nnN/fbNt51gvDblFbZxQLcdr JJ37WzOKtVB4aNshoKPrtMp5enZydhpD+nLQy8j0wb+yOUOjwRq1Q6R+YueE5wQ5Kh/O BCip/F4FyMriOMBwu0h11L5gjCgXzD4EQNe8+Pl3WaEzvFcpLiNssSMra+GmRkuNCjl3 Irz/WJp9L+olo1pWdYXWVMOSYMM1/hwXDv9oIGXEWXQIoK1u5rNhCTwxvzU7NFq0ddj0 e5Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:reply-to:dkim-signature; bh=kF6opYUVJfraGk2m2n/yxgm8yb6RyasRpLTq7O3nkOo=; b=JnWBqwOmnDNmz5KVIQ4cM/bCFy67D0dFQMB69XDRjtatHoBXqspDGk4FnApG6S1+ct iRmjkQVQRZoXWoLbGGn8bznAl8Xitm2fvjYWdfWWXIa6DRebw3DGkntJcFEG7p/XaKxD PZ6tSg5o9/xQWEY4o6BPLOywKcjuwmk7idJ0htTuQEnQGX7WK8hnN8HuHmu45BsIDoyJ PZC3EMKolNxNJtAzssosEMTiWbxgiBKQrMvL7DXTllm0bYBEDsLIXpVzH3bLnDdNBea3 Scz9pL+Mnw9XTGzvDMzzS94d58dCr0z9zpsJheDY4JjxUKJA7N0qb28OHFevi9P42mNE aEIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=MepW53Ez; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si2049478edd.161.2021.02.17.10.01.47; Wed, 17 Feb 2021 10:02:18 -0800 (PST) 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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=MepW53Ez; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232913AbhBQNak (ORCPT + 99 others); Wed, 17 Feb 2021 08:30:40 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:50136 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbhBQNXO (ORCPT ); Wed, 17 Feb 2021 08:23:14 -0500 Received: from [192.168.0.20] (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9267C8C4; Wed, 17 Feb 2021 14:22:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613568152; bh=i/DqpnagSZO1zcBhuqsIpOu5IQQOiJD5JpOhUCiHBus=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=MepW53EzCaRPukO1S3TfIaW391YtmosUGGRpVtHocc5ZADZKW/qUJqMyQ9WKMpDMI 74HkqupNZXB51KSo5YBMhubkZNP26MdciY6J3Nzf49K0lqigMrMWlxVW3uvC8avkXK PV1lpYQN+Zg2MMKqLmczOwG5UheuWjM0gflSFtN0= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH 06/16] media: i2c: rdacm20: Re-work ov10635 reset To: Jacopo Mondi , laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210216174146.106639-1-jacopo+renesas@jmondi.org> <20210216174146.106639-7-jacopo+renesas@jmondi.org> From: Kieran Bingham Organization: Ideas on Board Message-ID: Date: Wed, 17 Feb 2021 13:22:28 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210216174146.106639-7-jacopo+renesas@jmondi.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/02/2021 17:41, Jacopo Mondi wrote: > The OV10635 image sensor embedded in the camera module is currently > reset after the MAX9271 initialization with two long delays that were > most probably not correctly characterized. > > Re-work the image sensor reset procedure by holding the chip in reset > during the MAX9271 configuration, removing the long sleep delays and > only wait after the chip exits from reset for 350-500 microseconds > interval, which is larger than the minimum (2048 * (1 / XVCLK)) timeout > characterized in the chip manual. Holding the OV10635 in reset earlier sounds good to me, but I don't know beyond that what implications there would be. If it's working better that's good though. Reviewed-by: Kieran Bingham > Signed-off-by: Jacopo Mondi > --- > drivers/media/i2c/rdacm20.c | 25 +++++++++++-------------- > 1 file changed, 11 insertions(+), 14 deletions(-) > > diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c > index e982373908f2..ea30cc936531 100644 > --- a/drivers/media/i2c/rdacm20.c > +++ b/drivers/media/i2c/rdacm20.c > @@ -477,6 +477,15 @@ static int rdacm20_initialize(struct rdacm20_device *dev) > if (ret) > return ret; > > + /* Hold OV10635 in reset during max9271 configuration. */ > + ret = max9271_enable_gpios(&dev->serializer, MAX9271_GPIO1OUT); > + if (ret) > + return ret; > + > + ret = max9271_clear_gpios(&dev->serializer, MAX9271_GPIO1OUT); > + if (ret) > + return ret; > + > ret = max9271_configure_gmsl_link(&dev->serializer); > if (ret) > return ret; > @@ -490,23 +499,11 @@ static int rdacm20_initialize(struct rdacm20_device *dev) > return ret; > dev->serializer.client->addr = dev->addrs[0]; > > - /* > - * Reset the sensor by cycling the OV10635 reset signal connected to the > - * MAX9271 GPIO1 and verify communication with the OV10635. > - */ > - ret = max9271_enable_gpios(&dev->serializer, MAX9271_GPIO1OUT); > - if (ret) > - return ret; > - > - ret = max9271_clear_gpios(&dev->serializer, MAX9271_GPIO1OUT); > - if (ret) > - return ret; > - usleep_range(10000, 15000); > - > + /* Release ov10635 from reset and initialize it. */ > ret = max9271_set_gpios(&dev->serializer, MAX9271_GPIO1OUT); > if (ret) > return ret; > - usleep_range(10000, 15000); > + usleep_range(350, 500); > > for (i = 0; i < OV10635_PID_TIMEOUT; ++i) { > ret = ov10635_read16(dev, OV10635_PID); >