Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1026069lqo; Thu, 9 May 2024 02:31:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6FLWf65NqNuTY5yBZlFyKbb6wiFFwLLlVTFEM/M7I3lUw23lt/Bd+VUBeRCqKv8gEcoxI3wOexKHKrsSz5LH+sAdfq96Sc37avGZVPQ== X-Google-Smtp-Source: AGHT+IGQNHYHQY5yVhyUUn9WglCz64Yh9TxAZ+Zg1B4OOcwfgeIdJhcFumG7LA4zTMAJX7B1h0S4 X-Received: by 2002:ac8:5803:0:b0:437:c847:e306 with SMTP id d75a77b69052e-43dbfba7162mr61976201cf.29.1715247088153; Thu, 09 May 2024 02:31:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715247088; cv=pass; d=google.com; s=arc-20160816; b=WZHpzkfrcRZ6lFsSPKuWSHmLjycq/kVJrtCEepYQegTJ8WzqAsETLZziUKcG0fNO49 DqHFiwIBIs3k6qqtXljBV1DtxMRT9ctaohsgqHy2jfTgp9llVD4JX3mZ6FdGl4LmQugm bmXw1xro6B4RTog9AgTBEVpPNaSSs7qIGY4qtdYX2k+S1vmlXtgPoZ8urW41oI+aPIc8 ysstGrJU6UA2imBEbkx/2rxUN1wK/q8+N36xsqYcEudPEMV65yS5oj8d6o54qgTrvxjW gT6+uaMifvbM3QIYNJwMRxA/55CjoGOLiOZGmORnWsHhcu8BtGsXVfGIy0VM0FW1Sevt vwSA== 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=rzpYOW5BAS0H9r1efRPp/YwwPMylVl80xm33C0MTb2c=; fh=yJSLPjaY75SHiuNYjgu2KTv7SxUTyH6O13TV7OQNkEs=; b=lDKjVRY2aPPWijxdCFWodf0gtYU+sMXFHQIvsNcwRuTw2Wr2sJQnye85ujma/AMJGg 5MSBrnR4p8He8+AqFuSzD/wL/BjzGLWrdmW73RXhh9XoeaIHfUHMwxEkxpuCuUZSrsjZ ppjOFyXaQKQd0QsIhMnVmtbdWKBZzW0vYi1mnXu4DFeqwhInRzBqeamqiw8aVN5P7h8n d6/Bs6NY7B4vtM7fOJNbkBUaefbadRc59RLWTgm+PSs8zWRD5JcjOsbS+endI+8VLGxt CY1aKFv/2wTk2UWH3eWkzv5XvEVFtnTcQPObGIUM9mlFqVAwrsIzSvJLJyLe2K/t7Gc5 bwjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eYGQqfJk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-174350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174350-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. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df56ac711si9809741cf.517.2024.05.09.02.31.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 02:31:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eYGQqfJk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-174350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174350-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 DB7BE1C218A2 for ; Thu, 9 May 2024 09:31:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C3C014A632; Thu, 9 May 2024 09:31:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eYGQqfJk" 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 99D3914A096; Thu, 9 May 2024 09:31:18 +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=1715247078; cv=none; b=gMKEhQ1cxS15lsNERRe0EuFgx7Tw2s5Jj6WyucgBdGWb2G+CzyZlipeICG92bj7uoJCCJmILAoNke52ZR/Dz8a5i85gNjQm0vEEkKAjBYkd70k+TT1OfvM33JlBtUQ5ee8tXbGTCvnc4VYeI9gtpyRVWwlNULxfux69jonpBnOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715247078; c=relaxed/simple; bh=yMguGKEurxhBhT2kNnn/ZtameJsGQKoLePBLTU/eYv0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GKwnqZCfF7e/lmv+ObS+4IUQf4zpb7I99Ru9MQTqFvwz0mdQiw0dBn7tzXr6IsqbmrMjlVolnEEydyGGSdN0hZYegjBjGn496GdFugkDXX1WpGjwoEH8IF1ZPO+4wnn0r1mNMnYab7Kofzml0SpYdghTjUHPKNq4s/Vil0ItfdQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eYGQqfJk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1660DC116B1; Thu, 9 May 2024 09:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715247078; bh=yMguGKEurxhBhT2kNnn/ZtameJsGQKoLePBLTU/eYv0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eYGQqfJkN1d/277imD/xsq+021aWyQqzAHzvKYlJp/XBwcAmVhermLRITV4idbxlm CKZXc+52L3i+8CV+MkhcdM4HXP5msn0L9Y+QJA8uU2EFDRjw3OyF69+vNePo2x/L+a +ekUKns829/c1CY4gcDhRYGYxkNMZW48RY03sYpNtbj/uo0/hPIv4gckyyYXJhcYtR 0pN4mdioeV4Fy+Y9XO/8fdm/UvhO0GutUU+IfSIgaddAZssxdb83x/LTWKQAaYvXz2 tS2qnyvWguA/e1mwiS0jdH96ZXfVZNn+pO5xLVwOhzkzaUtsUTlOemVobBVVem/UMK aAky732Vxw4mw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s507W-000000001L5-2a2j; Thu, 09 May 2024 11:31:22 +0200 Date: Thu, 9 May 2024 11:31:22 +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: <4468becb-dc03-4832-aa03-5f597023fcb2@linaro.org> 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. Johan