Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2953033lqz; Wed, 3 Apr 2024 13:27:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXN2N9xWVxRNpkxZWC7b+E4mFlkC3YFGtnX15nsgAQY8lM722fNgnSnYaukaZDi4vm3Jsr5iYJBmTa1aRSqPO6fPLwUHZ6lvddoX52qoQ== X-Google-Smtp-Source: AGHT+IFVxapVOo+LJUkLOgYv1MXCn6J5qrLEJMPHUMX1Y5kaypkS+FdJmumx8XAIAG3jm1RErnsZ X-Received: by 2002:a05:6830:2012:b0:6e8:a913:3928 with SMTP id e18-20020a056830201200b006e8a9133928mr326016otp.38.1712176076638; Wed, 03 Apr 2024 13:27:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712176076; cv=pass; d=google.com; s=arc-20160816; b=Xty46cV6tOu8ZasCxF/JcX+7MPPH/DYy4sZwdeTFV0/7IGKGyy9ohkAHALqeaa1Xiv aJf+mI2fRtgFw2lusGzjTpTRd3TC5oP3pskTlnz4vEupuhzgjkRCjRYw0hUw34/slTS9 mSvPzNXfvCfaDXHniXpghZMItof4WMJ0yXsL/xBhLUnlGVASn1zWKNrIy39tD+0d9Eb0 ydDAucp/7itDoBaqZGvKyuqCq/LJ9NEQKbHMdwr5aXWck92AyJvYckv6njucFXvALRoA IO3hiNnZ0uqQ77qVTcFWGullf+pVKhqkbl7e2qBZ9KyYf0aI4NwhtmC81dyv9cOAa3Tp crYQ== 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:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=WUWgE1DnjMBPuy5PLgN2/f0W38XSumLNGP2rZjB3XuA=; fh=2SZpLk0wBC6lB6KdcWc8GIda3daVIE0wJ32/Wb/rdKs=; b=hEiOR6OSX1uE/KWz1KLer9B/xY78ISwp7irHDNMqTVV8899wGLcSGupw6TpjO49huD OuBaU9uVhh010ZBr3xp1R0j4+U3cruXwEHpxmiS/U7Rr/6uA6Jmjut4/96HNHerzyoSI QyKdUKhoDSiwMB2NL56FbbtyrJ+xKyuJlghhpHuq+ixag2PGwdSr63V0cwIM4fdr5wQ9 lBLPiuCUx1Grfwtf1h+IrMBhHBU6O/UdgPviCGgtSmWUNHBVSdqrIMXU7reKxImklK1Q d+jJsCCHAdWab9pDnbglynyW03TRDNXYcjAyaQO9iTD/AoRHOi6UjjxweF9MvWbeRtfA Hduw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=wfCLRkKP; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-130520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130520-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g26-20020a63565a000000b005cfbd190e58si13090254pgm.115.2024.04.03.13.27.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 13:27:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=wfCLRkKP; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-130520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130520-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CAB7AB2535E for ; Wed, 3 Apr 2024 19:54:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3988F1553B1; Wed, 3 Apr 2024 19:54:02 +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="wfCLRkKP" Received: from mail-108-mta94.mxroute.com (mail-108-mta94.mxroute.com [136.175.108.94]) (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 DB58E155388 for ; Wed, 3 Apr 2024 19:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.94 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712174041; cv=none; b=lvFyjtePE7MksEHhDWfpZzfdDN/AFxM+iK+L9JsVtc99fM42680O/XOndCwATE0NmGgD+YFarwyAKXAOW9qvxzvx/X0BRvzV3IzS6GEa++3a61PrdE1G4zWEsJTUNphLYmYFhVNeGaNKFL39Ia/QsuDKINKE+OinRY77lKYrYfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712174041; c=relaxed/simple; bh=Kjy6x/NXd4JfxF0RWGjqpeR43/pbqZZRFhcY/LUk/Mk=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=ewta3eJxa23mPDgM+Sr+p9ykzZx3GG3tDcDtqxRKvn1KfbEIVN9YLxvbsvkKqdptQvIMj2T5Bxrte6GXiXNjktFlhtpax7XbT3BkTQ9HyXKzAjoMpmIvNC0GCqZEk6OL8Ms2Wf3hXdRzbLOA6p5iR9xS1S+kJ0QRUxhZk4k4UxY= 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=wfCLRkKP; arc=none smtp.client-ip=136.175.108.94 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-mta94.mxroute.com (ZoneMTA) with ESMTPSA id 18ea581c24b0003bea.011 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 03 Apr 2024 19:48:48 +0000 X-Zone-Loop: 505b19853a64fc195a41a5aa47bcd2f9a369aeb3b301 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:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc: 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=WUWgE1DnjMBPuy5PLgN2/f0W38XSumLNGP2rZjB3XuA=; b=wfCLRkKPVOOds6T51nt/KWinGa 4P2uvdx2JXMT+k9h6TDeiMKDal9WlFQwPToTSlyuh4s0Rc3s8sF+XjDhED3cgzvAb//vVPOoKfPs6 Cszp2qBdHJ4Pl7MT3JFlzZ6vZ7sbK19WCmdWLpMEc+CV5fty/jD2fzdPRW3DTuynVkLG4JvADrTNS GfLGYBa+Lhq+C0x5TFuiFLSJij8w+XfG3rn5kgwRkFWTgeDaDHULwyDavW/72vB3wvAj1/xdu5atj 9JP3BzEBqEJKnNYgMxj7cr8Ko6gC+GmH5AtRDwP/hf2yyL3srs4Wi3tChGvR4PbAGARtZBhmCWmco ItAsMfaA==; Message-ID: <1080d78d-73f4-41d3-ab72-f2cc1001e184@luigi311.com> Date: Wed, 3 Apr 2024 13:48:43 -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 v3 24/25] drivers: media: i2c: imx258: Add support for reset gpio To: =?UTF-8?Q?Ond=C5=99ej_Jirman?= , Sakari Ailus , 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 References: <20240403150355.189229-1-git@luigi311.com> <20240403150355.189229-25-git@luigi311.com> Content-Language: en-US From: Luigi311 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authenticated-Id: git@luigi311.com On 4/3/24 11:03, Ondřej Jirman wrote: > 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. > Since I'm supposed to move the reset up should I also move the power up with it to match your downstream driver? >>> 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