From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E5B4C76196 for ; Mon, 3 Apr 2023 13:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231553AbjDCNBC (ORCPT ); Mon, 3 Apr 2023 09:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231285AbjDCNBB (ORCPT ); Mon, 3 Apr 2023 09:01:01 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B892F3A9B for ; Mon, 3 Apr 2023 06:00:59 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id b20so117016598edd.1 for ; Mon, 03 Apr 2023 06:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680526858; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=16UcNG/PukjzRElXQ0FZ/prdEavSXuL0hY9oDia7Fqw=; b=eycy1+5anorySr0EFsfJZnLN8eQhIR5TfCplDiItBZdFqBp2M6BsniseXTJiP8SoAS pSN8Bk+cdLzpMkjXTcvNgyt4LWQbT1STGcJ1VmYAFhbKbWgOACfOQDft9s7L4ueR7YUY Ppl09mPH+/NKn+33LmC/c4165oi+RSn9dJip2JCgOwhiZFWqVSx8cntBiPvFPRXwAbym VpTgJC5Wws9vHFG4EGWzl2IFCuE+i8ZdbFqGXlk+b+8ahyeKxOvCDhgr9/Ekn3DHHHc6 QZHVSsfHj/eKd1nXglpsL3+DRbzgTvcavCB1S1MuKsUrlhT0Ef8wJJmCoV2jeQq7iJ/F AWWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680526858; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=16UcNG/PukjzRElXQ0FZ/prdEavSXuL0hY9oDia7Fqw=; b=FGYOgq5bgdSm1JMEp2rpK8zSKfXetBQtza/PpH8ccWPt1N5mSdTJVL9tklm3bQbWgg RX0NGsZbfrzVLU2/tZaMybogHREMsEm1zfO9H3SfJ4ottnVrCEXdNCdHF5YTqo4lnWTd expCH6KlwrnytdNUGekzWKhrc66kmiBlUtAiJro+DSqnrN7LTMQ068kGjPYXfraU65gY naGFDp6DcOxRJFpEWMBKeXzsGpKCqNwq1K0hrXAgcL+w5TC61v0/XaYC2PE6sxp7VHgQ 57kHhMnu3YeKKGyscrEEDJWqTG2orW8LGl9wJaV/xqqzL40Bpffnz8rKFuoXo62G5/R6 pB9Q== X-Gm-Message-State: AAQBX9fTukd/uJvjEYK2fiRZaA8r49solUhh/fex/prj7XPoxaFP999m C0pWiEGzCdvyiOu4FDSS67w1jw== X-Google-Smtp-Source: AKy350b2E4l2oBqoAIHFcKHDtPoNN3TqQLCC/1CYg/oSDuyx1JvMR7UiSyE/Rixg0Bz1LHvkV/VLUw== X-Received: by 2002:a17:906:bc57:b0:933:12d1:d168 with SMTP id s23-20020a170906bc5700b0093312d1d168mr33724368ejv.10.1680526858206; Mon, 03 Apr 2023 06:00:58 -0700 (PDT) Received: from ?IPV6:2a02:810d:15c0:828:ae90:d80:1069:4805? ([2a02:810d:15c0:828:ae90:d80:1069:4805]) by smtp.gmail.com with ESMTPSA id xb7-20020a170907070700b00948c2f245a9sm672737ejb.110.2023.04.03.06.00.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Apr 2023 06:00:57 -0700 (PDT) Message-ID: Date: Mon, 3 Apr 2023 15:00:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2 00/22] arm64: dts: qcom: remove duplication in PMIC declarations Content-Language: en-US To: Konrad Dybcio , Dmitry Baryshkov , Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Johan Hovold , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org References: <20230401220810.3563708-1-dmitry.baryshkov@linaro.org> <10626c79-46da-3f66-0327-66576b3e5f2c@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 03/04/2023 12:44, Konrad Dybcio wrote: > > > On 2.04.2023 11:55, Krzysztof Kozlowski wrote: >> On 02/04/2023 00:07, Dmitry Baryshkov wrote: >>> The sc8280xp platform uses its own copy of PMIC declarations. This can >>> easily end up with the issues that are fixed in the main PMIC include >>> file, but are not fixed for sc8280xp (and vice versa). For example >>> commit c0ee8e0ba5cc ("arm64: dts: qcom: pmk8350: Use the correct PON >>> compatible") changed pmk8350 to use "qcom,pmk8350-pon" compat for the >>> PON device, while sc8280xp-pmic.dtsi still has the incorrect >>> "qcom,pm8998-pon". >>> >>> Another example is pm8280_2_temp_alarm device, which uses interrupts >>> tied to SID 2, while having SID 3. This can be easily left unnoticed. >>> >>> Employ a small amount of C preprocessor magic to make >>> sc8280xp-pmics.dtsi use standard PMIC include files >> >> Preprocessor magic is disliked in DTS. We allow only simple defines, no >> undefs. Sometimes some nodes or strings could be concatenated, but in >> obvious way. You should not parametrize it and have different, generated >> labels in DTS based on something coming external to that DTS. > This again begs the question, is it time we start moving parts of the > dts code to be autogenerated? Do we auto-generate C-code? Just a bit, but in general no. There are exceptions but coding style is here clear: https://elixir.bootlin.com/linux/v6.1-rc2/source/Documentation/process/coding-style.rst#L828 Pre-processor generated code should be narrowed to some cases or simpler structures. For DTS we actually are even stricter. Best regards, Krzysztof