Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp592951pxb; Wed, 13 Jan 2021 10:57:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJysi8d+IQd7Me7CxlLh3d/Ev3LaHbDEpJpqf2DsFdLvkPkQ+oAn3gZpSj2yM7rdK12F2Eog X-Received: by 2002:a50:d553:: with SMTP id f19mr2864149edj.323.1610564227583; Wed, 13 Jan 2021 10:57:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610564227; cv=none; d=google.com; s=arc-20160816; b=U/XW0WQNsEvJX8fisL46nuVdPFCGy3iRUAhp/CdK0SwiuGiJd4hnkIqk0g+xTmvHqd jtYgF50ndh0apqV+OKsTKbt2zGImZlxXrYERFWpzdoNhXJRwnsgSH7O1niEyL1TNS+ge zYyKWzSniKdpArb2AI+xLcQ37IiKv/B3shkanRh/w6k0HizAmNIKux0DqP5NaU5MRife OdIzx/iPTDWFyRz0T4Z57nMgwYKfrB0AE3VPOQRD3wW4f8fHElwRQyqtUxdi7/YCVoja 71eK+MGqGoMmfJ/KwdwZ/FRIrDFoHDZ/IMPrJeR7F+vbzIx3iHx+DYMKzK5IoeYIj4gb /BpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZOkAqhhakyapRomoOnUwO/IN+4HYJt+9B+4mPVqlH28=; b=a5UEBQnRF8e9xlknYGii/Jp9gAQGVzHGVib3I/DjH6EjKVF36J+c4E71U3RzpYg8+0 54P7ao8lePBXnv1oivFlgzMwMHhU+8liCSZY6OqNSdKB6Myy+Vsex2Y5NZBjcu6SqAY7 M3sZNYCE9l+fBu3SVQRWbN0n/U4jOcWGoTDXwU1gd3RIULWgg8A+4oHoE0SsBy1fvlMz t2zYdalcmNOr9mP5pMD7caq16p7hn3zId+t5qbTpNfLicGtHkoiDZbXrmlgM67VE3srQ xLAoBGX9PqP0k20pxNXBcpgFgMd4B15ks6ksXOBS9VfImkArQLwtneLq3o8NtYCIIs2Z nj6g== ARC-Authentication-Results: i=1; mx.google.com; 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 g5si1534258edj.194.2021.01.13.10.56.43; Wed, 13 Jan 2021 10:57:07 -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; 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 S1728448AbhAMSzp (ORCPT + 99 others); Wed, 13 Jan 2021 13:55:45 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44583 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728335AbhAMSzp (ORCPT ); Wed, 13 Jan 2021 13:55:45 -0500 X-Originating-IP: 93.61.96.190 Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) (Authenticated sender: jacopo@jmondi.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 00CBF1C0003; Wed, 13 Jan 2021 18:55:00 +0000 (UTC) From: Jacopo Mondi To: kieran.bingham+renesas@ideasonboard.com, laurent.pinchart+renesas@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, geert@linux-m68k.org Cc: Jacopo Mondi , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Hyun Kwon , Manivannan Sadhasivam , sergei.shtylyov@gmail.com Subject: [PATCH v7 2/7] fixup! media: i2c: rdacm21: Fix GPIO handling Date: Wed, 13 Jan 2021 19:55:00 +0100 Message-Id: <20210113185506.119808-3-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210113185506.119808-1-jacopo+renesas@jmondi.org> References: <20210113185506.119808-1-jacopo+renesas@jmondi.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MAX9271 GPIO line connected to the OV490 RESETB line is GPIO1, not GPO. As the GPIO1 line is not enabled by default, first enable it then control the OV490 reset during the MAX9271 configuration procedure. Before this change the embedded OV490 ISP was not actually reset. Signed-off-by: Jacopo Mondi --- drivers/media/i2c/rdacm21.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c index f3841369768c..0428e3209463 100644 --- a/drivers/media/i2c/rdacm21.c +++ b/drivers/media/i2c/rdacm21.c @@ -425,27 +425,23 @@ static int rdacm21_initialize(struct rdacm21_device *dev) if (ret) return ret; - ret = max9271_configure_gmsl_link(&dev->serializer); + /* Enable GPIO1 and hold OV490 in reset during max9271 configuration. */ + ret = max9271_enable_gpios(&dev->serializer, MAX9271_GPIO1OUT); if (ret) return ret; - /* Set GPO high to hold OV490 in reset. */ - ret = max9271_set_gpios(&dev->serializer, MAX9271_GPO); + ret = max9271_clear_gpios(&dev->serializer, MAX9271_GPIO1OUT); if (ret) return ret; - ret = max9271_set_address(&dev->serializer, dev->addrs[0]); + ret = max9271_configure_gmsl_link(&dev->serializer); if (ret) return ret; - dev->serializer.client->addr = dev->addrs[0]; - /* - * Release OV490 from reset and program address translation - * before performing OV490 configuration. - */ - ret = max9271_clear_gpios(&dev->serializer, MAX9271_GPO); + ret = max9271_set_address(&dev->serializer, dev->addrs[0]); if (ret) return ret; + dev->serializer.client->addr = dev->addrs[0]; ret = max9271_set_translation(&dev->serializer, dev->addrs[1], OV490_I2C_ADDRESS); @@ -453,6 +449,12 @@ static int rdacm21_initialize(struct rdacm21_device *dev) return ret; dev->isp->addr = dev->addrs[1]; + /* Release OV490 from reset and initialize it. */ + ret = max9271_set_gpios(&dev->serializer, MAX9271_GPIO1OUT); + if (ret) + return ret; + usleep_range(3000, 5000); + ret = ov490_initialize(dev); if (ret) return ret; -- 2.29.2