Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2866478lqz; Wed, 3 Apr 2024 10:41:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXd5dV0eXo07szkNLLV3XeGW3vNGFNgeyS4AoGAfnKJGmU0t1ahOLdLdUup95ZK1UCNtQUUCUhsqWMQPctYXmjus/qMXHjQONHsJFH8ug== X-Google-Smtp-Source: AGHT+IH7XU798JuBlVU98gX+e+PdEmdUT+bvwj1tXzt+14gwEZEHx6xtVlV7qjPqV4gb4nUlgtNG X-Received: by 2002:a05:6a21:1f16:b0:1a7:1a86:2a1d with SMTP id ry22-20020a056a211f1600b001a71a862a1dmr361513pzb.32.1712166079893; Wed, 03 Apr 2024 10:41:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712166079; cv=pass; d=google.com; s=arc-20160816; b=P8WajMF3E75gQ41avZJnkIi15Fcwhi79+AvU8/ZNEUgOEj9i2vaXOK9w0Q/17hmALU cCZffIHRT3qrAFCMEljBi/5pjG36z0paEffbXGxb00TpKnkESe40OpQ+HrRIGL5JT/2d UaduNVejUK5m9im7wkGcGcBaI5mo6ZmVIMRtuk3Gpz4dUdlGvPzNu6pHJz0Bhm4nL1ms XCYLH7rp/HngH1Yt3rrndbWB8z1XAAMGAODPxHlFfL0p+TxXj0gXGgBNQ7ADNxZzLVhA wF4AHJDLFRLEEfQDTiMrbsWnbX98I5WXjUWO/q7PaTO5ynG9/5olb2Bqkktrxv/fSH7v V8Wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=xtzVGQ27iNUfGBhl2Iib9/ZWt0JnzNdpecPdgn2WIcE=; fh=UT1X2D1KZVH0qq/lz4yAjRK+qxEpqkgPD6NiQdleKAA=; b=jDIdmnfCggOjorWfk0g0svpo8Kuj61VGjhWmMulwWrLdXgq3yHduFCMSAai4mKibvQ sKZd9NgsMhdO/cj7Gm6VJSV+1vEjzZ24ISBgIBSPZFcm7ABEv2E7E2nvM09MiFrW6lk4 t+c+FfkAiSv3QzBJ9U+LioCsOGLNqyAwfhvczU3SGxo+J/hPLgI1Qw8YIaQ50eo3Enn6 +/BzbPe4uhp/8dPXwmewj21vqT9gcH7FNeSynWUnzybaAq8NTKCPip7WU6D0uMuH/hur MQiI71jGiP8+35GIDuWtBZxXfYlWez2EyzmJw/OZc3YD8xmksyi0aXICm1h8NoXEcnsc RCBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=MO0npq4t; arc=pass (i=1 spf=pass spfdomain=megous.com dkim=pass dkdomain=megous.com dmarc=pass fromdomain=megous.com); spf=pass (google.com: domain of linux-kernel+bounces-130247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b16-20020a170902e95000b001e25e585f21si4694534pll.152.2024.04.03.10.41.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 10:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=MO0npq4t; arc=pass (i=1 spf=pass spfdomain=megous.com dkim=pass dkdomain=megous.com dmarc=pass fromdomain=megous.com); spf=pass (google.com: domain of linux-kernel+bounces-130247-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D389DB29DE5 for ; Wed, 3 Apr 2024 17:04:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 738BF152DFF; Wed, 3 Apr 2024 17:03:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=megous.com header.i=@megous.com header.b="MO0npq4t" Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) (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 D326E152505; Wed, 3 Apr 2024 17:03:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.181.215.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712163821; cv=none; b=eLcThpO9FWblRYa/HqfFwe33T/IwtCb7etjlKjxD9xUBlcjbC4NRR5mixLaOh9NGl4czDdOQ2EcKPHpAPHR46lQy4yWXWU8MkcB6soo6yyNnUXCOyFfShy6mAqGxP/RHO3ED5hishINqg14lWLPlKH8J5NiYlGi6lXt+0B0bT8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712163821; c=relaxed/simple; bh=5oQ9PAIUbskmpNMMQyZgPbJVk82PwBM3Z1uyb7nioaQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JaKGG3zG8DNohxOksv5TmXW4vR7kAgUqWYTM6PmESelSX8j7p3Dr/FCT42R/lcBtBXWWLd+WrzYueXSvFcJTvDykLjZ3GsIEoWhr1D092S74mH7TelITQRbTNMy5oYcpYqvFjt1TCZ77D+7bUglDj+JH0nmhLjwli30s4bmE9ZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=megous.com; spf=pass smtp.mailfrom=megous.com; dkim=pass (1024-bit key) header.d=megous.com header.i=@megous.com header.b=MO0npq4t; arc=none smtp.client-ip=195.181.215.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=megous.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=megous.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1712163817; bh=5oQ9PAIUbskmpNMMQyZgPbJVk82PwBM3Z1uyb7nioaQ=; h=Date:From:To:Cc:Subject:X-My-GPG-KeyId:References:From; b=MO0npq4tWyuGwTaav38LDUD379CLRTbjTWXhqWWD37o4lA9WmySm+7G11xnzxBRPb Z45Lio0muMx4UnX1rh3TZ/e8jt0gHKbwnkkVk17k7CySVgjnOhhlvkOYBzN79HZ4PM vP3xXserb4s+Fr3wQRSguRa794bvKuUKqqolPs2k= Date: Wed, 3 Apr 2024 19:03:37 +0200 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Sakari Ailus Cc: git@luigi311.com, 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, 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 Subject: Re: [PATCH v3 24/25] drivers: media: i2c: imx258: Add support for reset gpio Message-ID: Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Sakari Ailus , git@luigi311.com, 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, 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 X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED References: <20240403150355.189229-1-git@luigi311.com> <20240403150355.189229-25-git@luigi311.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi, On Wed, Apr 03, 2024 at 04:28:59PM GMT, Sakari Ailus wrote: > Hi Luis, > > Could you unify the subject prefix for the driver patches, please? E.g. > "media: imx258: " would be fine. > > On Wed, Apr 03, 2024 at 09:03:53AM -0600, git@luigi311.com wrote: > > 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 163f04f6f954..4c117c4829f1 100644 > > --- a/drivers/media/i2c/imx258.c > > +++ b/drivers/media/i2c/imx258.c > > @@ -680,6 +680,7 @@ struct imx258 { > > unsigned int csi2_flags; > > > > struct gpio_desc *powerdown_gpio; > > + struct gpio_desc *reset_gpio; > > > > /* > > * Mutex for serialized access: > > @@ -1232,7 +1233,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); > > You could mention this at least in the commit message. This is T6 in the datasheet: https://megous.com/dl/tmp/92c9223ce877216e.png > > + > > + return 0; > > } > > > > static int imx258_power_off(struct device *dev) > > @@ -1243,6 +1248,7 @@ static int imx258_power_off(struct device *dev) > > clk_disable_unprepare(imx258->clk); > > regulator_bulk_disable(IMX258_NUM_SUPPLIES, imx258->supplies); > > > > + gpiod_set_value_cansleep(imx258->reset_gpio, 1); > > Same question than on the other GPIO: does this belong here? No, this should be before the regulator_bulk_disable. See: https://megous.com/dl/tmp/c96180b23d7ce63a.png kind regards, o. > > gpiod_set_value_cansleep(imx258->powerdown_gpio, 1); > > > > return 0; > > @@ -1554,6 +1560,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); > > > > -- > Regards, > > Sakari Ailus