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 5E579C83F11 for ; Mon, 28 Aug 2023 19:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbjH1TMO (ORCPT ); Mon, 28 Aug 2023 15:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233383AbjH1TME (ORCPT ); Mon, 28 Aug 2023 15:12:04 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF513129 for ; Mon, 28 Aug 2023 12:11:38 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-99cdb0fd093so465092366b.1 for ; Mon, 28 Aug 2023 12:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693249897; x=1693854697; 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=bJpk0152nUK7MAn+YHkTbH/h73b7L0QzmLeU7H8QQVw=; b=BMHlkVU7vOt8RhnhlNEUEQzhKuwUno5YJ5C8yTDb2SMAZ4ImaLh9xAQMSudCjWyjCU nErdsiSar1QqN3KvJmtYDNs/19kXyCbx5kqTHC5RkkeBlxMrJ2IyF6IQ3qmswiKKgPPV Mg9LpGGGeS6Eb87m4ewNlPtmQ6LLCjPzzn8hSdtD65Z2G40Lbz8OYzgIJUujZESPkxJ1 xwgxm0GoX5wBkKUhYh/fIz1gwNRK9NKHtwAFNMPvE2IqGxXycGUg+ysfJSiS6kOGEVon KeF3Tad1LzUerju5/ZtCnGjKQ9VICYuE7+P16eL6+buPA827pUrPBAnxiQ9J1S4wAiLT 2AZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693249897; x=1693854697; 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=bJpk0152nUK7MAn+YHkTbH/h73b7L0QzmLeU7H8QQVw=; b=H/j1EQVdkpbLjbEYb/iBLtXI0DiMyk5UzD9FaEPDGBaP4symBXCDFXXziRyeiXl2Ya WKFy7o0xC/OCQdIsPXtS3XD6LaxdAlAUS6eoMm86MuYzH5MqQFngOUZY5BP7PcIMDOKY TrhCNHsMNlvbymMgQM/R23SZFqsvVGHxNp3uMF02xOwcaU1MWMSRso3sd3WLDRQFLejE eREhRVzvZ00tv9EOAAfJJvjfN9noodEMIK40Zw4/rA/zgKg8dfxHY6iMj4a/g1O4KsG/ WhvJIPj4uz161qBRQf79SwcatBzxMzy314RU/UpYqwgUAQ/BgcB1WytqLx7NSC7Az5iP gSMQ== X-Gm-Message-State: AOJu0Yy8w+I1+x7CbVW8jF52CBf3jHur5fMmgwmxtznNm3OYF3gUWVMN G/1c6XhbppfZdk7IUKbnVtF1zA== X-Google-Smtp-Source: AGHT+IFAlLZZ7/DQKN9k+MBu0E+BaiPGpFYDLSfsZbH5elEegq7maUi4CQhGqVXz5H6zpB+iEWMoug== X-Received: by 2002:a17:907:770f:b0:9a5:7759:19c0 with SMTP id kw15-20020a170907770f00b009a5775919c0mr6873428ejc.64.1693249897414; Mon, 28 Aug 2023 12:11:37 -0700 (PDT) Received: from [192.168.0.22] ([77.252.47.225]) by smtp.gmail.com with ESMTPSA id l21-20020a1709061c5500b009882e53a42csm4947462ejg.81.2023.08.28.12.11.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Aug 2023 12:11:36 -0700 (PDT) Message-ID: <465e61a0-895d-54b9-d1b9-424265c82855@linaro.org> Date: Mon, 28 Aug 2023 21:11:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH 1/2] dt-bindings: power: Add regulator-pd yaml file To: Shenwei Wang , Ulf Hansson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown , "imx@lists.linux.dev" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , dl-linux-imx References: <20230818153446.1076027-1-shenwei.wang@nxp.com> <4e2c18e3-b1ed-6361-3998-5de060d2bcf0@linaro.org> <51fe3126-16ba-ade6-b106-e3683f96ad26@linaro.org> <154b36de-652b-3931-96e6-04e99253a09f@linaro.org> Content-Language: en-US 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 28/08/2023 21:09, Shenwei Wang wrote: > > >> -----Original Message----- >> From: Krzysztof Kozlowski >> Sent: Monday, August 28, 2023 1:53 PM >> To: Shenwei Wang ; Ulf Hansson >> >> Cc: Rob Herring ; Krzysztof Kozlowski >> ; Conor Dooley ; >> Liam Girdwood ; Mark Brown ; >> imx@lists.linux.dev; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; >> dl-linux-imx >> Subject: [EXT] Re: [PATCH 1/2] dt-bindings: power: Add regulator-pd yaml file >>>>>>>>> Are you suggesting to move the regulator-pd to the imx directory >>>>>>>>> and add a company prefix to the compatible string? >>>>>>>> >>>>>>>> There is no such part of iMX processor as such >>>>>>>> regulator-power-domain, so I don't recommend that approach. DTS >>>>>>>> nodes represent hardware, not your SW layers. >>>>>>>> >>>>>>> >>>>>>> That's not always the case, as we do sometimes need a virtual device. >>>>>>> As an example, the "regulator-fixed" acts as a software >>>>>>> abstraction layer to create virtual regulator devices by >>>>>>> interfacing with the underlying >>>>>> GPIO drivers. >>>>>> >>>>>> Not true. This is a real regulator device. Real hardware on the board. >>>>>> You can even see and touch it. >>>>>> >>>>> >>>>> The physical hardware component is the GPIO pin, which is what you >>>>> can only >>>> touch. >>>> >>>> No. The regulator is the chip. >>>> >>> >>> In the definition of dts node below, where is the chip? The real hardware is just >> a GPIO Pin. >>> reg1: regulator-1 { >>> compatible = "regulator-fixed"; >>> regulator-name = "REG1"; >>> regulator-min-microvolt = <3000000>; >>> regulator-max-microvolt = <3000000>; >>> gpio = <&lsio_gpio4 19 GPIO_ACTIVE_HIGH>; >>> enable-active-high; >>> }; >> >> There is a chip. This is the chip. If you have there only GPIO pin, then your DTS is >> just wrong. Drop it. If you learn from wrong DTS, then sure, power-domain- >> regulator seems like great idea... >> > > When you talk about the chip, can you please be more specific? What to say more? The device node you quoted above is the regulator. You brought specific example and now claim this is not a regulator, but just GPIO. Please fix your DTS. > > Regarding the dts node, how about the example in the fixed-regulator.yaml under the bindings directory. That's an example, how is it related to anything? > > reg_1v8: regulator-1v8 { > compatible = "regulator-fixed"; > regulator-name = "1v8"; > regulator-min-microvolt = <1800000>; > regulator-max-microvolt = <1800000>; > gpio = <&gpio1 16 0>; > startup-delay-us = <70000>; > enable-active-high; > regulator-boot-on; > gpio-open-drain; > vin-supply = <&parent_reg>; > }; > > If you take a look at the fixed regulator driver (fixed.c), I don't think you'll find anything related to a hardware > component (chip) other than the GPIO Pin. That's a driver. How is it related to this discussion? Bindings are not about drivers. Best regards, Krzysztof