Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp745598lqb; Wed, 29 May 2024 09:17:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4MnCP/dEAS8TckIp3N40CSawKdCbbgCAHzd6xn9tx6tek9j4JITTirWivQlo41LtQnXpzt9VUSPR8J+OggXObmH5PP04ZdD+KJRkqVg== X-Google-Smtp-Source: AGHT+IF7Q1XnAps1aFqGlOzG4zuiZVsNMzperYmNkRJVoiz6SNOflaNTaurJjiMMIhxs3szA69AP X-Received: by 2002:a67:f7da:0:b0:47b:af16:39bc with SMTP id ada2fe7eead31-48b9cf1f0cdmr1975055137.17.1716999433633; Wed, 29 May 2024 09:17:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716999433; cv=pass; d=google.com; s=arc-20160816; b=02uL4PFuuQJrvUKSc7uHKpUZYfgWksZAFBwd4hiH4mhnsUOJW2VeLybwI5TvxgwYSw ab2Y2ElEqvTNNzsV4pfAOZiuBtu1AjBGa/2pgWB2GoyMXa6ZMm/99bXEc3fe7cAniSeV F4Sail4SYcu1Vx9dL+2esn2IuaWZlcQeK7OWWwwFEoScbdpnfFSevN9wgpUhb8mImzcG siS3Wfr6L/VBaKTCbHafAYxVfAq36qucZnyK/Q3y0CIcq/4qzqcEP/b5tuVddDkWw++2 KPLOZgwsj/pucL39CBgGTEcwMMjmATXUVeknJuNL3TUz4nDNYboYbUIguWvJsFv5OJcC PRHA== 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=q1Heiqfqgq1m+g7Q8OtcJxrTnrM+MsodApRQx8nup+4=; fh=yJSLPjaY75SHiuNYjgu2KTv7SxUTyH6O13TV7OQNkEs=; b=XNBjPTbi/YVBgICoXupTAytvEWDZzN1sjayu8w+eC1/qyGY+pcY9YWFqdy5N6idK5p 3YwG50r+T4vYcMIclU/PA8vrhhn7HobKiqOoo6gaSNAgMQ0Lw2BBpEV7LWJtGksXifkS DwR7v2BoQoSGkfhh4DlV2PYEfPlzZHwrI5G3qXsF38LcTmSAkOrBh1teUz/Zunj9MW1K QRBCKtZzYhA3W3FVn1BN/ZUu2vXeYKOWKu3lH+tvk4D/b9Hi/nF10NXMbFzgOf6G6PfN ayaMMw3LFfHSZ48VvCoWrTllT3xW0JXNEVz4iYjnkC6PUWTjyYyoHzftVPNaJE28/+8X Tv9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=urwF66fA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ada2fe7eead31-48b8f46f245si920851137.457.2024.05.29.09.17.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 09:17:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=urwF66fA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 82C351C24472 for ; Wed, 29 May 2024 16:17:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C25401836E7; Wed, 29 May 2024 16:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="urwF66fA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF390E576; Wed, 29 May 2024 16:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716999421; cv=none; b=LaAYWe+Eu1zPv3pY1oCv94JmOzPfmhljs3mZjaLT0WmINNQkBi2vBMRr2pFJHLscbQzTLpyUEMfxTezJYAfSeZVk4y0o2SaXBRPSCuPWnOzNZ+3zEF1jsCWkBM1Ts6RX6rrup/SjsvJchNMc5jvjn3usMFP6hTRX0/t83jZSYJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716999421; c=relaxed/simple; bh=4dpB5T2dqL+I9yVD9wiiBGyseVVp1ELP7uPP7/kIEDI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YvG08hRHU0ITcXFRpA/sOE4BAr9CrJ0t27GX61Zs3TlPACwReqVHPn/mkzj0OcYFmtRjimMxJsibws8hox5YJ450gIbk9Dn/TQ14qu6FCn963GuCMGBkeIfrFzBEMCSs56v8U1h9vdbX6iCEIluYXho3MwvAEqA51N2fNCenYoA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=urwF66fA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DA5DC113CC; Wed, 29 May 2024 16:17:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716999420; bh=4dpB5T2dqL+I9yVD9wiiBGyseVVp1ELP7uPP7/kIEDI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=urwF66fAsw7TVYLSIJZcXYWlWU3BiZRBcZ78Ifo/KW7Imd4CXhGLpdng16r/rXw1V g2+A6fn0SGNviwZ6cKgT04v7qyhjUpaRvQp5yyy+Yc2wda6R5hro1PNbX6QXRiWVBV hUwXr2LzHZ+WkNKkYIhDXpY+uo+/aEBDPPV3CSlFSE+cB9DCp/uzBqtCwtlXGJx4Fx mUabmfb/c+VlgZAMyZw61VJZ+Bq6/uTO+rxW3Z5Jho/hbAm1v0u59875nQKyq5myz8 tIUj3F8nP22QW3u1vWgvhMeSGr9aFQKpfTbBHGBAkytaUIE2I23fi4Hnbt6ec782gJ 9qjddStaUJn+Q== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sCLz2-000000004VC-0Sv0; Wed, 29 May 2024 18:17:00 +0200 Date: Wed, 29 May 2024 18:17:00 +0200 From: Johan Hovold To: Bryan O'Donoghue Cc: Johan Hovold , Lee Jones , Mark Brown , Linus Walleij , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Das Srinagesh , Satya Priya , Stephen Boyd , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH 03/13] mfd: pm8008: deassert reset on probe Message-ID: References: <20240506150830.23709-1-johan+linaro@kernel.org> <20240506150830.23709-4-johan+linaro@kernel.org> <4468becb-dc03-4832-aa03-5f597023fcb2@linaro.org> 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: On Thu, May 09, 2024 at 11:31:22AM +0200, Johan Hovold wrote: > On Wed, May 08, 2024 at 05:12:51PM +0100, Bryan O'Donoghue wrote: > > On 06/05/2024 16:08, Johan Hovold wrote: > > > Request and deassert any (optional) reset gpio during probe in case it > > > has been left asserted by the boot firmware. > > > > > > Note the reset line is not asserted to avoid reverting to the default > > > I2C address in case the firmware has configured an alternate address. > > > > @@ -169,6 +171,10 @@ static int pm8008_probe(struct i2c_client *client) > > > > > > i2c_set_clientdata(client, regmap); > > > > > > + reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); > > > + if (IS_ERR(reset)) > > > + return PTR_ERR(reset); > > > + > > > if (of_property_read_bool(dev->of_node, "interrupt-controller")) { > > > rc = devm_regmap_add_irq_chip(dev, regmap, client->irq, > > > IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data); > > > > So not resetting is fine and I understand you want to retain the address > > given by the firmware, I think that's the right thing to do. > > > In addition to adding a small delay suggested by Andy - a few > > microseconds pick a number, I think you should verify the chip is out of > > reset as we would do with many other i2c devices. > > > In this case, suggest reading REVID_PERPH_TYPE @ 0x104 and > > REVID_PERPH_SUBTYPE @ 0x105 > > > > REVID_PERPH_TYPE @ 0x104 == 0x51 (PMIC) > > REVID_PERPH_SUBYTE @ 0x105 == 0x2C (PM8008) > > I'll consider it for v2. I decided to not add any revid checks for v2 as it's not strictly needed. This is something can be added later when/if needed. The irqchip registration will also fail if there's no from reply from this address. Johan