Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1529757lqp; Mon, 15 Apr 2024 09:00:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXaeSWQoTIrvQXDBK47gautMYYHBX+lWQ4S/MjKZNa0OTAbM27hw2Tjv83/qETQQ0L0AmHi7HPERZR0/iMvSvia1AgAZ2T+GovwWKOIeg== X-Google-Smtp-Source: AGHT+IFmupl5RYJti5vzgclhvY4tB9ZWJmNNbpHE3X0r1P9XfhxNuWCotyLsBQZlcisSxzvjXXdQ X-Received: by 2002:a05:6a20:3941:b0:1a7:8a02:3058 with SMTP id r1-20020a056a20394100b001a78a023058mr10177354pzg.12.1713196844232; Mon, 15 Apr 2024 09:00:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713196844; cv=pass; d=google.com; s=arc-20160816; b=v6xHUh8kpz1yJRAOQUUbn82XHGX/3t+JSX8Ke4+S2QWZVZKd/1q0D4b46uZSHAoV6P Jk4X4UoFX0d9sb2/q+nqqkjXrLV8/3rpUN+BHdq5BC6ZsN2DjWXKLi8q35EWHdlvwb1K 9vKMNXMEWf/W+r51yMVAYhF2eCaDkfdMV5GRMsi5S0sekb5qGye94jvcNR2jXDnTH2gL pGFvsDO2RxTAihijdUu/thfm65+J5drDAaM97mvEEl8PV8eLj18tBfsOn+Rb2Sx0QTG+ qslNWmzmi9s1oUtkdK7fnni4ds9n9pK6bPG6DPnDL0DgeE7vt+SzpOwk/s/Hf8qqoRSs P77g== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=WonYqSzvWT83jIX0IgNtkReYkS7CHkadpcuSarICRPQ=; fh=zVjln4Pqh0Dk1QkI0qrqcOKRK10gr+1gkhWLUCMTRC0=; b=nOcjFnvaVubOME71REWJir9cRHNWTrlau1WlnvyvalDnMAIuhEWriSsP/c48Uf5mmW +eiDjdm4w6o1UyCf/YrruM52eT3yeKveam8WpDkk2NWfk4KalJIDOEoarEszOwnXxWiy 1fqbOkHRYY7XDdHguk4u5nrDag3nu+7jDBxXoSj0nJoVtx2Q7NMc95kQPxc7ZWOLykup VdDzApyQPELO1dShHYBrvKtQs+9uZdzRAbPTdv2bzTqkQqaSo/ahmsDk1FOLuGKDWzYX jaqAJNOaYajygIXcWmlUBuh6Bv+FyqZwcmWaFkDNHgiTHnbfUBPdniB3PbqnsxG6GvHV +/rA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="iR5RKTz/"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-145493-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h23-20020a63f917000000b005dc7f609bb8si7768768pgi.644.2024.04.15.09.00.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145493-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=pass header.i=@gmail.com header.s=20230601 header.b="iR5RKTz/"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-145493-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E398E284561 for ; Mon, 15 Apr 2024 16:00:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2424F7F7FA; Mon, 15 Apr 2024 16:00:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iR5RKTz/" Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 AED3D2837D; Mon, 15 Apr 2024 16:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713196834; cv=none; b=nZMyIL1cKxW9MM3r8RlneDiX0VZvQu/3OgcxgaPEuo3Ryw13JMUtRkhZJGfN6YWztk1X6bR3ibP81myuqwsoddUCdRxp+uw8Kk60S6XdXfxYHhao6Y0drUms3/Zv6EUG/+6VaeZPdxVOHslPKgUP4/5csZc64AD75o5olQYjYBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713196834; c=relaxed/simple; bh=AIurx8M7UROIIHeLqraX05WDHOH/h7A8uObPQDPI2ng=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BP+wJzznuJihIcfA93AFlvinMyml+89RrE9SXZ87a5xHiC/JRXKDvXIKOpFgByJqGUWmyeNi0coiDVF+VhXSIkQaAFaY5s7/QZPlgYNAITNMpOirR23Is79qZ41SA/V7t0OVsmEqYJS6YCRIxc0qNu6Jz5KSFY4yFAEE3RrbzS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iR5RKTz/; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2da01cb187cso61665341fa.0; Mon, 15 Apr 2024 09:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713196830; x=1713801630; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=WonYqSzvWT83jIX0IgNtkReYkS7CHkadpcuSarICRPQ=; b=iR5RKTz/yrvZ9nCboAo1nWXktPhapgHwq0JWB5kPflUer7S2Z7FbX/d3BxqZPV6Cmt Msyz1SIsXwgG4Y/0GMFxFX1OZXIrOgsCMZuG02PGvnGLQtML11+9yhopk7vaQEzyQuF+ iML4sO0SUkhgv/2S5mf191ce6u+gyS6E/2AqVoOUlns3jhqiOGKl7Y3FowQlUr5LDiGt YKbTC9wvuBu+ibflf6cTlR0Xmr+DNkzEbzd9So0xC+xlcyZ1g39ovDk07OYmef5OImGr MI6K2uXOBEoz8++cpEmZuTX9SUfbCtPZSEkn48K8Jnl6GgZ9gmi2tSwjaTXY1NRS3mvR 7S3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713196830; x=1713801630; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WonYqSzvWT83jIX0IgNtkReYkS7CHkadpcuSarICRPQ=; b=Tk+e8xcTORGpYEffGGxiIv++pOGbQs2BPIdN1yDeMdGDO+0Gn2yPXLTJhPJ8P23vVc 7lYW7+NYWzqo5Tazm4WQ3nVMY35YHG8IvZSekeaCRYbvs7yXKPk04bP9Fcd50zENfxj8 CxL7njXzMNdmsd30WmbilXIOd3ec3fN7pGN+DFe+u/2wRcddDCoiofuwrV+RVnnMvlMh Al6kKuCM7sMXZ1y+uAsfP7G0JZUJ5GovOkrXdTJt2t3N7W+aTUi5HJSLvf3k5ROfNwHQ 3LN6DjgqgjwQBI86vwYsN6ImfC1fI8x/cnwoaRJudOheO72N32um4eacFzE1/coBWl9P k0RA== X-Forwarded-Encrypted: i=1; AJvYcCUYWsDqROxSpRv//vZncK4w+sGCDLl7ShqwgU685pUFJq8M7gUPHt5MOixMaM6xPIoFa5vnWARtWZk2g+W+INBLEtU/6W9xBMVt+4d9BW4qI7rw0fq93bTYSXgZdCkjAMNY2t2HazRFBZfg9ARR9Z+5TR3gydRiP31X/+Aaq+3zlkLhgp1P X-Gm-Message-State: AOJu0YxlqHjGBBo1ha1PNAz7x9uGnTKQ5MO+PLCiYJVrvMNUfpAaGuQJ p59W2HTKi58A/z9Bpt/bSQFQQPLNpTR7XauRcToizHDppIwtUWMD X-Received: by 2002:a05:651c:b0b:b0:2d4:7455:89f6 with SMTP id b11-20020a05651c0b0b00b002d4745589f6mr9666567ljr.40.1713196829400; Mon, 15 Apr 2024 09:00:29 -0700 (PDT) Received: from tom-HP-ZBook-Fury-15-G7-Mobile-Workstation (net-188-217-57-233.cust.vodafonedsl.it. [188.217.57.233]) by smtp.gmail.com with ESMTPSA id n21-20020a170906701500b00a53d6b895ddsm783830ejj.200.2024.04.15.09.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:00:29 -0700 (PDT) Date: Mon, 15 Apr 2024 18:00:26 +0200 From: Tommaso Merciai To: git@luigi311.com 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 Subject: Re: [PATCH v4 23/25] media: i2c: imx258: Add support for reset gpio Message-ID: References: <20240414203503.18402-1-git@luigi311.com> <20240414203503.18402-24-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: <20240414203503.18402-24-git@luigi311.com> 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. > + 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 > -- > 2.44.0 > >