Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1550705lqp; Mon, 15 Apr 2024 09:31:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbyU0WeEPBiW9qn4FY1f37s2G31yif2TnlUXd8VeTEYwGBwmEsT/WPHWEfb+QNWYdYnQilDEZkGMTmc648tkFT6ynOehyqbJ4voPV4lg== X-Google-Smtp-Source: AGHT+IF9SjbNC3HgsxNYbNVyUhaf/wp4agOp/W5CMzRPp8kEkGOed0A+SltVL5rogDS+12yosSUB X-Received: by 2002:a50:a41d:0:b0:568:9d31:2a75 with SMTP id u29-20020a50a41d000000b005689d312a75mr8511718edb.4.1713198679953; Mon, 15 Apr 2024 09:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713198679; cv=pass; d=google.com; s=arc-20160816; b=weqXNlojfSmLCKEig998Fe+EKAdq5KP6c88CzTvoo8Q+vi/yl4AG2EvaeIFFX0bi01 o0TOzRUJZS5QL0MSzt4ZjNdQnKWjDVxGp/mQMP99wHnDYcuAt2+fN0PdNSDWi363mHjF obX2GLmKiwvDKXfqugKnr93erltnujTeun3bIt/RlIx9XTE9zXhHj6kRPAISdL+mWhXm oyNE6lxHQrz6mmpJydreo6rPFh3ZppidxqdVsJn+l6+9N2/hX2d5yKINIB2YU8QLGPb9 dqpWqBe1iohqJexqfeZHQz0Z0emWfN+rnemDaSIvklmZwO5QsFYf6NLQnOSBiDVpi/5n ostQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=EeroMja+ZItjTmUV/LiM4Dif6wjYVEF3i+Px4jMWoko=; fh=tX9t3un0F26AuOOGa7ikqn+t3ZpysiiOrUh3zs7QVzA=; b=Dgd6MRXh3aRcJo97l/zXe2uzsEqIYn5BCX5XKZ0nY2QSro0h2x7M3NMy2pzjXdZbV6 itOMm6RwUmUAp6NSLFtecZwlsLR/3kUx6AtjneIpmIXb8BCgI1ikX8I0EjbhbsbYVUGw OmzUfoVHqVkK/9DI9TyF2mhehA0ci7oZoelLU0IjdXeL/kN/BrkO++tk/yqcLhxdViju 7FHT6T3y/FzVr5gfl+rtk5+q8TtwauFMtvfXmysD1o2xpKJifXuJNbiqNaciVGC30b0J 2uXTZTxc9KVjOHYtTXoZreuIv9zCKoKtY+p6Do+cANOlpubWJeH17pavUYdhcYfjW4IV zWkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=WGAOoYrP; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-145553-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145553-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a27-20020a509b5b000000b0056715a786ffsi4542533edj.544.2024.04.15.09.31.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:31:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145553-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=WGAOoYrP; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-145553-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145553-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 76CFE1F22DE0 for ; Mon, 15 Apr 2024 16:31:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF03A8175E; Mon, 15 Apr 2024 16:31:12 +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="WGAOoYrP" Received: from mail-108-mta44.mxroute.com (mail-108-mta44.mxroute.com [136.175.108.44]) (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 7E9971E4B2 for ; Mon, 15 Apr 2024 16:31:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713198672; cv=none; b=K/1X+U20Qfl0bvJti9Sbs35kqI3tXAxJ9L07QDUKDnn+Q+C1FYy9sRjagZqYzUl5E4+3xb2PwPtwwlRZvjQvTJTKWDswFj38Yyga7Au5XKWWfbDCLCyOT02nkNFnoU132kUHi9+RjqM8iR5G7d4tQTTy/ZBpLDywKZ/1e78EurY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713198672; c=relaxed/simple; bh=hECP6aSG5NyyHc09a/D8NbQZI5fHlXRYAsk0oB3jcak=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cp8i5PLGHmyyj6aUY+HCMBUJW+LB3+sPvl5XNJgud5Oc3xFNyI6HlBUTojh6GVQkhUfUAG4bKpAxtXTfKd1iUH78TeOp0pS/erltWXLh/toe2Bps9zRqYPpwWsRVX03WkbaQutwWc//KeTba947bNPb7Dmmo+EN/3tzOD7712eI= 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=WGAOoYrP; arc=none smtp.client-ip=136.175.108.44 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-mta44.mxroute.com (ZoneMTA) with ESMTPSA id 18ee29461060003bea.012 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 15 Apr 2024 16:25:58 +0000 X-Zone-Loop: 8a3335c4bb1ab2d6327c0b9729090ead1064b028757f DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=luigi311.com; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=EeroMja+ZItjTmUV/LiM4Dif6wjYVEF3i+Px4jMWoko=; b=WGAOoYrPSrZIZpOzwO9/8m6IsT jFgda5cI2L8O63zRp+jF5ly1Oc6cCuoPEQ+ZTMGLEPL6dkPyMjVHYXTd6V1Rx5uUn+xzx5BRk+n9a qoCA2na8ZKWhNFdkwh1iaJZemj14U4uCi81jqisYPw+Orb5XcN26pwZRb4d7wWw0+I28Q1j3kS8Mq S3mG52BRYTAyJQTWRo/rL2xmG1Ht6ie/3NYA07ZmK0m8ryEHvf0QAN5EOoZYS/Q6EE5jPuDq5EuYS keRLp+VbKClX5vc6eLRe8O65EKbdYTiAaGZgvFnEXLEm1JkgzHmHwH7S3yh55ZGPOdhnwvg/N5QUq LPokbfSA==; Message-ID: Date: Mon, 15 Apr 2024 10:25:53 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 23/25] media: i2c: imx258: Add support for reset gpio To: Tommaso Merciai Cc: linux-media@vger.kernel.org, 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, Ondrej Jirman References: <20240414203503.18402-1-git@luigi311.com> <20240414203503.18402-24-git@luigi311.com> Content-Language: en-US From: Luis Garcia In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authenticated-Id: git@luigi311.com On 4/15/24 10:00, Tommaso Merciai wrote: > Hi Luis, > > On Sun, Apr 14, 2024 at 02:35:01PM -0600, git@luigi311.com wrote: >> From: Luis Garcia >> >> It was documented in DT, but not implemented. > > Good catch :-) > >> >> 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); >> + > > I think you can remove this new line here. > Done >> + 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); >> > > Looks good to me. > Reviewed-by: Tommaso Merciai > Thanks! >> -- >> 2.44.0 >> >>