Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9120487pxu; Mon, 28 Dec 2020 07:08:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6OrEq1snBll6WsALdZVgA2DVaTxmQnrhRp1zg1evvSgwlEHOAIxUv0VeePW/4SX5RZZfa X-Received: by 2002:a50:d60f:: with SMTP id x15mr41733160edi.224.1609168102139; Mon, 28 Dec 2020 07:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168102; cv=none; d=google.com; s=arc-20160816; b=KFGqhj0/O+PgSODDjQkiEV9OjnE30V7NpadptEPdIZ1LG9l1xXmsQa+pahitM7ycLg 4UXO+TCL5VrZExPHMH+MOGc9TrEuxeEL665cdtiHx+hpxIqjIM5OGkwFyGcluPBzLbwv mgCxw/kkn2Mpq6F4RClXnB6wBy6GVPIh4q5MSnhPZ/KiPlHeCewNzrFkW0/kkeUd3IOn BRzspcTWrDHSsyXHuKdcBa1SKJOkYQpSh/vz0TNfl3Vf3SS9FehZRhcbU1W7X/qIYn4d TOxpcvwm5jl8LgDXumJMzAOHzSHFjYOeML15ToOR2YU6XrTg7fH+S7pY8T3JhIdJBUsJ pwdA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pr3mLSpq0PbYiYSMB/WzVXqoLpwxhjHJPHqZGa+Dt+I=; b=DVbu6Dq65PiIvJ2j64fABWohI3WieClGODntcHlG1eJrX0cOa6tmIvz5If1ZSE57Lr b5oX/a+6qEpYiwifjheaJa2/NI4wGxRPJmGGevOC7xQtzLhaVhD7K6oY14kNqM63a1uY jYFBVj1MU/RDdmtzZr3HqWzm1ewuKXu1xt05IioZRa2eqbJGobq4XEDWOn26HgMGYtIa qfBJmbDLK7mRWE0G++7ZjV2ca+qjsBBBO6cIZj6U0lLlN0JBUdmT18cMtqsmLMJtk3dR l5FaFrtZ0J7xCLp9/255GXJbabtLH1QnqUpnXPI0niFzR04W/dpo2bTwEDkg5/H5Itbu i81w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nqW8KME+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z27si11260110eja.582.2020.12.28.07.07.56; Mon, 28 Dec 2020 07:08:22 -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 header.i=@linuxfoundation.org header.s=korg header.b=nqW8KME+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439460AbgL1PEf (ORCPT + 99 others); Mon, 28 Dec 2020 10:04:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:45720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439662AbgL1OL2 (ORCPT ); Mon, 28 Dec 2020 09:11:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 786F5206C3; Mon, 28 Dec 2020 14:11:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164673; bh=vBw9+IFViTIYA9khFT88QgqE0Qv6VUs7SbrIJE8IiJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nqW8KME+2Rv6Kj3d492E8McWRFEILTvxRRSfMu0+Fyl1YOhJbgXBUcg/MIz660Ort RMsxV1z/KjPng9IGbhotgiYP7QrT4cAlyVLO9y8EU+3DFncQ4TkCy9Emh6nGkHLVRv P03q7EouX2dHCTgEk30ZJ+hWssDrbHtuuyxNy4Qo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacopo Mondi , Kieran Bingham , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 258/717] media: rdacm20: Enable GPIO1 explicitly Date: Mon, 28 Dec 2020 13:44:16 +0100 Message-Id: <20201228125033.355269920@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jacopo Mondi [ Upstream commit 7fe1d4453fb6bf103d668a19d957a7b2fc21887c ] The MAX9271 GPIO1 line that controls the sensor reset is by default enabled after a serializer chip reset. As rdacm20 does not go through an explicit serializer reset, make sure GPIO1 is enabled to make the camera module driver more robust. Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver") Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/i2c/rdacm20.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c index 1ed928c4ca70f..16bcb764b0e0d 100644 --- a/drivers/media/i2c/rdacm20.c +++ b/drivers/media/i2c/rdacm20.c @@ -487,9 +487,18 @@ static int rdacm20_initialize(struct rdacm20_device *dev) * Reset the sensor by cycling the OV10635 reset signal connected to the * MAX9271 GPIO1 and verify communication with the OV10635. */ - max9271_clear_gpios(dev->serializer, MAX9271_GPIO1OUT); + 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); - max9271_set_gpios(dev->serializer, MAX9271_GPIO1OUT); + + ret = max9271_set_gpios(dev->serializer, MAX9271_GPIO1OUT); + if (ret) + return ret; usleep_range(10000, 15000); again: -- 2.27.0