Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1085762lqp; Sun, 14 Apr 2024 13:44:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWagIwRbVhXdOta+ix9p7F6rmvoYtctT4m59KobNmgynmkgs4pwD2o5zdIpz/LoIGhXvY76VJgeCw86nh7dqXtBKbjYm9IdGCinxgbGSQ== X-Google-Smtp-Source: AGHT+IEiPVmom088sP+M+7G6PdZOmnHMBHAk4fWCMTqqTsb2hxwDeSGKH34Qi17BKDyQkwaiN0+1 X-Received: by 2002:a05:6e02:1e0d:b0:36a:3ee8:b9ea with SMTP id g13-20020a056e021e0d00b0036a3ee8b9eamr11750665ila.2.1713127453843; Sun, 14 Apr 2024 13:44:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713127453; cv=pass; d=google.com; s=arc-20160816; b=zN1PI+D7A2SzAJW7OezzBWTpZAB+pYM1xfC/Hk1QckyGaHw265zRd6MACLoOHY1zDp 4KhX3lVp75bHdYdXc07SF6smTnqbo+8leIFJZRXRb5ZeE2Rp+lBckyu1JGc0Pg4A7K0C 0IQCeRigKRnKGTsh8znNw1qxc4kt0Trgdg/etNlevPBtveo9vt39BHktt6lZA/fK6mz1 vh6qjNEBpiayrh4GKENbx7seqsGfS0vOyLy7IMWRVaEmm5zOzJjRO8Df6nWJRI+bTdk2 F6kKvLO7XD5CcKHtfJAFhuMQbYA28oOyLwyLL0zGOR0Xzb1+wazgXFTBuw85gRlqpHEw gbLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RhPK9nK9EKfKLg4i6+hTwf+Rau4stoc3Ghdd7Jp7wTo=; fh=I2Vm/G0+6lKI3zj1XNBhPa8YuL32N+c4AUoXBcGUkqU=; b=sP7kqlRm0zyk1Khcs59ef2zNlBNd8opEViDQFv7MosgKybFZPno2a4HHEjdtQfQ06+ 7BrE7Jf4TDx5746EUmkkjV1dL5q5mzxJxRP/BzKRkhLdvhpaei3b5K5zZMsl213FA6kw yWHXoRby+KOsjzhjh5e1FDRzz7KjLc3cvNaXGI8iAZIu/s0MQNDYvrPIVb7PjmwpOjPq dCA2DOFb9c3+9vIafGTDzBKXMorRCrImXVgUd9dhdL0qUHQbybgESsDCVc2WgwMcvUU9 dOLls4s4S9xAgLFmw96pGZf44cZrO0vSZ4J1K4ntPD/eBxlexZ/gZw/RfAM2iB+vBcdT A2eQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b="s3iY/3u7"; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-144395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144395-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j187-20020a638bc4000000b005dc97ac8afesi6617998pge.37.2024.04.14.13.44.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Apr 2024 13:44:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b="s3iY/3u7"; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-144395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144395-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 772DB2810BD for ; Sun, 14 Apr 2024 20:44:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5D89137907; Sun, 14 Apr 2024 20:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b="s3iY/3u7" Received: from mail-108-mta35.mxroute.com (mail-108-mta35.mxroute.com [136.175.108.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F553136E39 for ; Sun, 14 Apr 2024 20:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713127343; cv=none; b=ZjteEUwxUfR8LNJPEHQCHKJJK9TfwF4NJYpdndk22ta5Z2p01FNQrlmEW+hE6S1CHKeYD+IPmrmJdNWljig68m76Bbh79nSmYRMG7dAhlvkBwXEXdTpiBbFk+Jlkjk0kuWHj1rQNPRgP943Vfe/sCeLoDJXzEkDvEir52eJ3cww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713127343; c=relaxed/simple; bh=txI7nLQ7SaAgPbFprDJdTC4+aOlNavya5MDukH1ErMc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TjUS0+nVN+kc4gmR0gBGZLJYCdaLmI5BbvvntDBkz/omMuXoJqv5KymplKZ9laMTDFyUpBGZE1V7/WMaAiLTnEIQrmCCpxa5PkZUXgHVzPr6ytQGu6ez6hbNy3A31vdL4e2MuhOmOhI6xoo/hCkZGBw1YWTgH3gwqwQgpovJ5Co= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com; spf=pass smtp.mailfrom=luigi311.com; dkim=pass (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b=s3iY/3u7; arc=none smtp.client-ip=136.175.108.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=luigi311.com Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta35.mxroute.com (ZoneMTA) with ESMTPSA id 18ede52eec30003bea.011 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 14 Apr 2024 20:36:00 +0000 X-Zone-Loop: ceff8413917515c092fbee310c7b86b388772a8ecdbb DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=luigi311.com; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=RhPK9nK9EKfKLg4i6+hTwf+Rau4stoc3Ghdd7Jp7wTo=; b=s3iY/3u7znzblaOimEAMVdeBOh XB5s2xOeMtrEPhCYtzrK0Pp50YupnAzGidF0n3upIKxuo4AZVFPiRX+8NEbqdIEiKACZWBQfWMkqL 46/wUAnvsh0rv2b8yR+X2PUIiy/z6RhpBMAqypwaSLcuPDdgBrxAxyVI6hDeqAHEAJXszu8TfqeKq +7HJH73F0EMMLVEBsCuf0b/opZAv+5ZS74JZao+dKl21NwnSWQKPz4d/C12Kx1tagPSHh6UpDsmcB BulwlbNx4B54j3RnZvENv4o1jEhQjufzkVo77hz3jelmrsQrnbNlI5wN/l+f8rXS/8d21Qej/Hkb8 2MlXFbuA==; From: git@luigi311.com To: linux-media@vger.kernel.org Cc: dave.stevenson@raspberrypi.com, jacopo.mondi@ideasonboard.com, mchehab@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, sakari.ailus@linux.intel.com, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pavel@ucw.cz, phone-devel@vger.kernel.org, Luis Garcia , Ondrej Jirman Subject: [PATCH v4 23/25] media: i2c: imx258: Add support for reset gpio Date: Sun, 14 Apr 2024 14:35:01 -0600 Message-ID: <20240414203503.18402-24-git@luigi311.com> In-Reply-To: <20240414203503.18402-1-git@luigi311.com> References: <20240414203503.18402-1-git@luigi311.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: personal@luigi311.com From: Luis Garcia It was documented in DT, but not implemented. Signed-off-by: Ondrej Jirman Signed-off-by: Luis Garcia --- drivers/media/i2c/imx258.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index f0bd72f241e4..5de71cb7c1ae 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -699,6 +699,7 @@ struct imx258 { unsigned int csi2_flags; struct gpio_desc *powerdown_gpio; + struct gpio_desc *reset_gpio; /* * Mutex for serialized access: @@ -1250,7 +1251,11 @@ static int imx258_power_on(struct device *dev) regulator_bulk_disable(IMX258_NUM_SUPPLIES, imx258->supplies); } - return ret; + gpiod_set_value_cansleep(imx258->reset_gpio, 0); + + usleep_range(400, 500); + + return 0; } static int imx258_power_off(struct device *dev) @@ -1260,6 +1265,7 @@ static int imx258_power_off(struct device *dev) clk_disable_unprepare(imx258->clk); + gpiod_set_value_cansleep(imx258->reset_gpio, 1); gpiod_set_value_cansleep(imx258->powerdown_gpio, 1); regulator_bulk_disable(IMX258_NUM_SUPPLIES, imx258->supplies); @@ -1573,6 +1579,12 @@ static int imx258_probe(struct i2c_client *client) if (IS_ERR(imx258->powerdown_gpio)) return PTR_ERR(imx258->powerdown_gpio); + /* request optional reset pin */ + imx258->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", + GPIOD_OUT_HIGH); + if (IS_ERR(imx258->reset_gpio)) + return PTR_ERR(imx258->reset_gpio); + /* Initialize subdev */ v4l2_i2c_subdev_init(&imx258->sd, client, &imx258_subdev_ops); -- 2.44.0