Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp605000lqo; Wed, 8 May 2024 09:13:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeI+RLkr6viz5ukHgdEQS1daATCL3d5/rSXMMvhbnsiCVe1hW7diTE6PwTaDW1fgQWrXzbNAbp1r6ptJBdD9dyitlckas9Y7rTzNfabA== X-Google-Smtp-Source: AGHT+IELz4V8fE2S/AA9Q21F+vPlvYfzg3Axfv+smWxXbWKDZM3ZFOcfJunRfFMUUCobji6RsJbL X-Received: by 2002:a05:6a00:270a:b0:6f4:4319:4cea with SMTP id d2e1a72fcca58-6f49c2afdb1mr3597419b3a.33.1715184787522; Wed, 08 May 2024 09:13:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715184787; cv=pass; d=google.com; s=arc-20160816; b=l/R5bWtKQqfm4I/YmNuXmy5gsuITQ+kGAfNjbjFxXLdzO8+DrJjJWIHkricf+EPFVt k4T1t2BEa3DORPCT/iw31vKkP3yQ9ZlpU8z5Q98Bg4b1Lx4gDNhqvX77bYtZlRDkH7uL BqDVy2VQfwYGQohx7rklQ/GzeQt6beuSEoFFlTnrkR0dx8312dIx75VaQr+aC3kXHL4L tCmfsWuYgDXARRw94jAzYz5Tx4pfXBNoskMRcnNTJsB8rbUj2xsAq0dreL2g7gCmXJYL sB0MGzGR0aldw+S1bKc4tciKr8DsxNePFbiCvY8OxhVZQKjhJGwpjevaOHoUD06f3UIx BCwA== 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:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4GjzdAdHEKtNKnAx1lGW3dqaD5snc+8WTy5ik2iGruw=; fh=wRg0SnFT9BJu8iW9RhG3ZOQnMoP/K/QeeC106iQZPiM=; b=PKJz/1SSKe6DHYzIfURntbtT1V2xycgUyQ+Dbfisg4YfQgwaWSn9LtARe9Vbq2EANc v49NlhRBDYq87q4H5swxX6TahV/WQlG7JaYGmmlswGLMN0xDQcvoVCM/CfUqex/DYlz1 taiZu6T7AIqI9JHOfMHxbbvvq4MLMGYVJULomZH3a0LAfd1dzqiQDnJq1np2r+rMH8F6 reM81YyDwt0K1cJIcJ8Q2hGfnAuH9UdDyPTr7HgCkX1w2rV25pLlnTgwNW9ZSh+3MHjj UweRsw0n1HPD8nb11bOcfp+c2JDBcVtcyq9+zUWUQ0GpajXUZhJqC6rmElfVaHy4m2R1 aivQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jw4txY8l; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-173526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e16-20020a656890000000b0061b9c89042esi11067518pgt.324.2024.05.08.09.13.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 09:13:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jw4txY8l; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-173526-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C3FFC28B62F for ; Wed, 8 May 2024 16:13:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CB7F1292C3; Wed, 8 May 2024 16:12:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jw4txY8l" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 D473F85633 for ; Wed, 8 May 2024 16:12:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715184777; cv=none; b=VXAJpBkBs/pvPEDxEXDgnH8SE5+1BOnNe31hBlXQsmXj5Pxko0NU8Db76LCDhoP4yeENXW1w+OJMyMrb+T4XxSpr3DFJh3tUW5a1025lcW+E8U3wL2bq1yXpOmLni910HgACBm5aEpUua+2fXuSLHhQDQfyZ3J0pSTfWFTBawHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715184777; c=relaxed/simple; bh=3RC/slltpYapY2F0z6uYYs46/YRPjHS6+iJKdyjPMSI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=H3wu3z2ZnXKUx5F7BmfcE4x2PBfXkwtxE6oQaRGQZrV6YmmLh69s4yBiFNToAlf4efNKo1pg5Ow260voGDj/vYf59dawuIqh0ZdN//XSjPULNGiBn5jE2Nq9kmHANCkYLyOFV3uImW5MRYBItan9Z5gKDOi7nsC6ICYUU3rn3yg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jw4txY8l; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-41dc9c83e57so6088205e9.0 for ; Wed, 08 May 2024 09:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715184773; x=1715789573; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4GjzdAdHEKtNKnAx1lGW3dqaD5snc+8WTy5ik2iGruw=; b=jw4txY8lnQNVRM41kVyo00Z0nAwO/j6Dhyjv1JktTUcmmA/j6YyC5hWVI98gzIzSra offBNSVRC1N8MwLFCBaARTuBjPmu2qZgqBHbNQp2wKMOqOzJm++cj/NPH2UIPpukachN 2h9mm7i8fupyJk/il8SXSGuP0Tz4gJcdgvU5z2PlBxlpEr6Z1L0hbxsxSkP+OWQmSiTD U4fVrf67hMHsSG9iH+no3WWxWFgbE7/udcw2LfphO8UUVLgLFtiUea73kNQ5naT0IzhB eJUD/RYfmVCFV2zvXUrEuNrr09Txcu/W+Ja5Tva5/vVOMMncTi8v/3HzW+v6nplnrBJq nIbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715184773; x=1715789573; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4GjzdAdHEKtNKnAx1lGW3dqaD5snc+8WTy5ik2iGruw=; b=xJQzwyAxZg+ZzVHLPXiCbJp8qI0sOzs/bDAebxV2kF5YPEFZPn3vJzD1Sp3qnLrguL bwKLQKBPBq7MrUPyLfgWQMKtmvCZmG4nlp+KMF3VHMIhkFRSdVbR4vieeUOlCQGXTKLo IgwsGfFtXtghEJHobLCs4BQJSVxf5JHEFv6lsSN+1ZIHNdzkS4ogmoeKcqwIt2n2VS/c V+/ZK6lG0ADdf+nyCGNTkV98leeC81J8W79Ym2wEI7WAYiSUYzllvhHw8Oh4GM40Hi8X vw68ZbJ77rQOPQlSjuFz8zv8U+Yzt9BsP35d5lJ778H970ZIYJQkdHMvYvy82Ipr2ao8 vBMw== X-Forwarded-Encrypted: i=1; AJvYcCVBRdfS+zIw+TI+kHYmfLE67BjzZ+EruxuHLSA2Ttrw+4gEGJlQVw7OBUSOJjsjLZ4vmN+0rA2NjFXYtHigZ5Ix2D8dxhwa9zMw5k4I X-Gm-Message-State: AOJu0Yyc2azi2Xkv06ep7sP+Bx3YKqtI8E4c0FGIdB9i3J/Ul3cDcpYy V+9Bh0gHXxHoqZW1JUekhCoqF/aO4fWKbT92gLf/auZ79mmJ+/EN3v9R1z5/CA4= X-Received: by 2002:a05:600c:3585:b0:418:2ab6:7123 with SMTP id 5b1f17b1804b1-41fbcc5f63bmr1147015e9.10.1715184773147; Wed, 08 May 2024 09:12:53 -0700 (PDT) Received: from [192.168.0.3] ([176.61.106.227]) by smtp.gmail.com with ESMTPSA id g18-20020a5d5412000000b00346bda84bf9sm15725249wrv.78.2024.05.08.09.12.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 May 2024 09:12:52 -0700 (PDT) Message-ID: <4468becb-dc03-4832-aa03-5f597023fcb2@linaro.org> Date: Wed, 8 May 2024 17:12:51 +0100 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 03/13] mfd: pm8008: deassert reset on probe To: Johan Hovold , Lee Jones , Mark Brown , Linus Walleij , Bjorn Andersson Cc: 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 References: <20240506150830.23709-1-johan+linaro@kernel.org> <20240506150830.23709-4-johan+linaro@kernel.org> Content-Language: en-US From: Bryan O'Donoghue In-Reply-To: <20240506150830.23709-4-johan+linaro@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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. > > Signed-off-by: Johan Hovold > --- > drivers/mfd/qcom-pm8008.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c > index d53c987b0d49..d0f190c2ea2b 100644 > --- a/drivers/mfd/qcom-pm8008.c > +++ b/drivers/mfd/qcom-pm8008.c > @@ -4,6 +4,7 @@ > */ > > #include > +#include > #include > #include > #include > @@ -158,6 +159,7 @@ static struct regmap_config qcom_mfd_regmap_cfg = { > static int pm8008_probe(struct i2c_client *client) > { > struct regmap_irq_chip_data *irq_data; > + struct gpio_desc *reset; > int rc; > struct device *dev; > struct regmap *regmap; > @@ -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. You can add this now Tested-by: Bryan O'Donoghue 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. A common pattern with i2c devices is take the device out of reset then read back an identity register as a smoke test. Take drivers/media/i2c/ov8856.c::ov8856_identify_module() as an example. 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) You can then add my Reviewed-by: Bryan O'Donoghue --- bod