Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1473536lqj; Tue, 4 Jun 2024 02:38:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCURtA08/gixYq816jp4R1mPfjhGxiELU3nXYdZuCH3uLsFv3lOqYmmxD3MBKV5aUA0jcNlIo/D9kKHvKbu9fu1k40BkWhw+MTYeV5Vr7A== X-Google-Smtp-Source: AGHT+IHazZcgYSWXb/9rk9TUxmFcdeHHCSd6ambqZuzT5Z0ruSiW2IrG6FynEA6n5GGXuXP/BeIF X-Received: by 2002:a9d:7492:0:b0:6f0:f239:3403 with SMTP id 46e09a7af769-6f911fcc2bamr11648619a34.34.1717493936339; Tue, 04 Jun 2024 02:38:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717493936; cv=pass; d=google.com; s=arc-20160816; b=oe0ekzT7bsOe7BZW6/TXSJqleOUzvHeuQsOOYG4ioY8d3wpghpjVysgV9oz93kNZyV MNM6kgNC56VAqrhsUl6AkXVX7BTkV1l4myCBkNg5Cq47O3RVoUm2NuiHPqu3ah/+U9dG 4krALKWbXd5TMF4g6i9x/zln9GJ07Z0+fkgFjj7zbX06BdxnkZFPbJyjejA4FpMZYmPo lAXg/z25SuGtji3cwL5gOYpq7lM4a76g6U53KH5DpfOfBEDkaEE1G32UTFxL0l4iCg+e Zyttw/G27kJpMQ7AEEl5ZZI5m8UGxeC30dR8J5NRb+NZHdimxVQYGBDxBW3hpFLSrGm9 pL1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=8ppkM8TjAn6goBdg6T3pn3M6pphlX0WobWRk75/LmOc=; fh=UiRalcB7BKX6L1GB6xaoJK8s1UjPvkWduV3rWHVwOYQ=; b=QPu798DpSi1VBa9Kv2bBbDX4xLt352dxHXoiBPZKDnq19uNa5y8EOtWV3DRwBIRPRM ckIBsoiFOVoyb6BrqhIKbvi51O3grHo0DVmcPxksa+HAnyotdSLu1KteNPfdOhsZF1tG m6NJehizyQMxH27CG1pxxSThooPH8nJ92Mfhv20TcRZ8ggUTSndIOKLkUfApyE+zRfFi S8kV7styOWbQJTRk+g7ngTTIV363DVjzEXed1Dg7jiUMYlc07aQY0GNOQs3KlZnYqlwS 8YdJMilz27J+mSxFF31lM36WFIQyREeEyuFvmuge4QBGxtS0LOlPrOHOod4o5iN5T4Km pu8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPDst1bo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-200365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200365-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35c17cfe3si7899083a12.637.2024.06.04.02.38.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 02:38:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200365-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=@kernel.org header.s=k20201202 header.b=vPDst1bo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-200365-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200365-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E246728226B for ; Tue, 4 Jun 2024 09:38:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DECB412B17B; Tue, 4 Jun 2024 09:38:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vPDst1bo" 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 CA11815E97; Tue, 4 Jun 2024 09:38:45 +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=1717493926; cv=none; b=p3YW+UppOOVmwq0m4o2uJ6G1nFDCM4L1/gKuWkFgZIc3o+El52PmrgDouGL5gzXzWDMqJOMK96AHbpycv3BGoDO71zlh3H3j+C0TlFSwmOpFoUZXSLMjlZaXveXjZzAu8F0ThS8ZGSXpTRQRRC8CmLzdiHW32bs0MljsHhwkKGw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717493926; c=relaxed/simple; bh=8WSz0b/gsOg+WRLIH5jMyiwfhs13pbW3PQyc8W3rioM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mji7JjrpsvQ1Xtb0+Xtyc/4dAF2FYXlDZpmAR+FyGYfWrfArvxryyl2RbM+j4Fmcsxz1dDeTbu5vmY2jrylH7hsN4SUQ16lvA2498cZ1UNSTSMYnPCp4BQnRsRhyaruMbyPvHbRx0doE7sbapE7hDg2pQ/qXlEYoRiLFbR3dKes= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vPDst1bo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72BABC2BBFC; Tue, 4 Jun 2024 09:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717493925; bh=8WSz0b/gsOg+WRLIH5jMyiwfhs13pbW3PQyc8W3rioM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=vPDst1booHkhgF8rUuSBd1IQeGWuK8zmNyaqa+quCrD8vu++Ai9pq1xY7ztk9IRnS JLXlNMj3kP03AHb403qaZPx4DaTmch9u6Tdx5vHW0xRMDoJgE82LlUc/xQzWZlDA/H 3eruCWGJ+TGD0l16d6UcNUmNXn6x8avPacd4DJNIbgraE/h6I7r/f9ndaOwFeMRTQG X+irrUA/ENq19mm911hBDSgfa2dm3TQU/HKmcRyvIPAmslwl1jkM9bZCQuWjib8OGT XUvpgzAT99QSGKIqQ6TVXspX6J26qRxc6b9pbmzjjwT6uanU7uFp8X4T1C5oOdGlUY 2emmyGyY/eJiA== Message-ID: <0d7d9f61-2590-4c72-9498-dc6540b571d5@kernel.org> Date: Tue, 4 Jun 2024 11:38:35 +0200 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 v1 1/4] dt-bindings: iio: adc: Add MediaTek MT6359 PMIC AUXADC To: AngeloGioacchino Del Regno , jic23@kernel.org Cc: lars@metafoo.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, matthias.bgg@gmail.com, lee@kernel.org, andy@kernel.org, nuno.sa@analog.com, bigunclemax@gmail.com, dlechner@baylibre.com, marius.cristea@microchip.com, marcelo.schmitt@analog.com, fr0st61te@gmail.com, mitrutzceclan@gmail.com, mike.looijmans@topic.nl, marcus.folkesson@gmail.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com References: <20240530093410.112716-1-angelogioacchino.delregno@collabora.com> <20240530093410.112716-2-angelogioacchino.delregno@collabora.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93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6BkRikNOs7VDEa4/HlbaSJo 7FgndGw1kWmkeL6oQh7wBvYll2buKod4qYntmNKEicoHGU+x91Gcan8mCoqhJkbqrL7+nXG2 5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/06/2024 10:55, AngeloGioacchino Del Regno wrote: > Il 01/06/24 17:32, Krzysztof Kozlowski ha scritto: >> On 30/05/2024 11:34, AngeloGioacchino Del Regno wrote: >>> Add a new binding for the MT6350 Series (MT6357/8/9) PMIC AUXADC, >>> providing various ADC channels for both internal temperatures and >>> voltages, audio accessory detection (hp/mic/hp+mic and buttons, >>> usually on a 3.5mm jack) other than some basic battery statistics >>> on boards where the battery is managed by this PMIC. >>> >>> Signed-off-by: AngeloGioacchino Del Regno >>> --- >>> .../iio/adc/mediatek,mt6359-auxadc.yaml | 43 +++++++++++++++++++ >>> .../iio/adc/mediatek,mt6357-auxadc.h | 21 +++++++++ >>> .../iio/adc/mediatek,mt6358-auxadc.h | 22 ++++++++++ >>> .../iio/adc/mediatek,mt6359-auxadc.h | 22 ++++++++++ >>> 4 files changed, 108 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/iio/adc/mediatek,mt6359-auxadc.yaml >>> create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6357-auxadc.h >>> create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6358-auxadc.h >>> create mode 100644 include/dt-bindings/iio/adc/mediatek,mt6359-auxadc.h >>> >>> diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt6359-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt6359-auxadc.yaml >>> new file mode 100644 >>> index 000000000000..dd6c331905cf >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt6359-auxadc.yaml >>> @@ -0,0 +1,43 @@ >>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/iio/adc/mediatek,mt6359-auxadc.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: MediaTek MT6350 series PMIC AUXADC >>> + >>> +maintainers: >>> + - AngeloGioacchino Del Regno >>> + >>> +description: >>> + The Auxiliary Analog/Digital Converter (AUXADC) is an ADC found >>> + in some MediaTek PMICs, performing various PMIC related measurements >>> + such as battery and PMIC internal voltage regulators temperatures, >>> + accessory detection resistance (usually, for a 3.5mm audio jack) >>> + other than voltages for various PMIC internal components. >>> + >>> +properties: >>> + compatible: >>> + enum: >>> + - mediatek,mt6357-auxadc >>> + - mediatek,mt6358-auxadc >>> + - mediatek,mt6359-auxadc >>> + >>> + "#io-channel-cells": >>> + const: 1 >>> + >>> +additionalProperties: false >> >> If there is going to be a re-spin, please move this below required: block. >> > > Yep, will do. Fixed up for v2. > >>> + >>> +required: >>> + - compatible >>> + - "#io-channel-cells" >>> + >>> +examples: >>> + - | >>> + pmic { >>> + pmic_adc: adc { >>> + compatible = "mediatek,mt6359-auxadc"; >>> + #io-channel-cells = <1>; >>> + }; >> >> This suggests that you should grow (make complete) the parent PMIC example. > > Uhm, should I instead add that to bindings/mfd/mediatek,mt6357.yaml and avoid > growing the parent example? No. You should avoid this example and grow the parent example. Not avoid parent example... > > adc: > type: object > $ref: /schemas/iio/adc/mediatek,mt6359-auxadc.yaml > unevaluatedProperties: false > >> >> Actually having this as a separate node is not really needed. Why it >> cannot be just part of the MFD/parent node? >> > > (glossary: PWRAP = PMIC [SPI] WRAPper) > > The top node is the PWRAP, an IP that is (mostly) used to dispatch commands to > the PMIC, but the AUXADC is not integrated into the PWRAP, but into the PMIC. Eh? mediatek,mt6357.yaml says it is a PMIC... > > Declaring the AUXADC as a PWRAP child would therefore be an incorrect description > of the hardware. > > P.S.: not necessary, but to "complete the circle" ... note that the PWRAP can be > skipped on some SoCs/firmwares/configurations, even though afaik that's only > mostly for debugging purposes, it's not granted that you have pwrap between > SoC and PMIC on all SoCs/fws/confs, even though, all of the boards that are > supported upstream do have it and do require it. Best regards, Krzysztof