Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1424609rwb; Fri, 12 Aug 2022 00:09:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Iz3MlqI5KaZtvi7u7PWAQvkwo2j5RUCZGrSnQSlSDv0rmyOxooUI7Jp0sA13DcbiZNa/F X-Received: by 2002:a05:6a00:a06:b0:52d:f9fa:8fc9 with SMTP id p6-20020a056a000a0600b0052df9fa8fc9mr2655437pfh.15.1660288147385; Fri, 12 Aug 2022 00:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660288147; cv=none; d=google.com; s=arc-20160816; b=lQYPgAkS1D0oBLFGj8fRQ+pHkxYwh6E9TyAe851tPofQ4vfOklFwwxG+ZbDCt4p6J2 m6CDfswPcDf3rnOwfLY1bYpipKwvCnrc+YCmpcKDY+mkzImJNms5AZ37HO+0I5qtfgEt aeJ4ip92aoH3eQVXU7IMSvEIUpatP88plOMPplo/6zttj4O8Lw4IEKfFM9n8k0EKQ2qw dOvVm0H/LK3cT8Zj+MOWatcvihYiibFYf3GdQHZhbiRxYm/Zo7DQUq6s++RhigIiy00e RIHDQbgHEgBH93zZ/khGOEcXaLe5iO3WJsAKyq/tlJLBju4XVsdRSLgKlfJymvNUa0hi Mkqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=t3EERWAoHc/0sJzUnWIG/VXJqbeUHXe35Iq8kCfIwJ8=; b=0eazsEX2NNl5SDL5BEdolUYJ0N05avSJvtnQw4d1kNG2wShC4tR1qjLv2aydYR6LZy DhSES4m0TPvNzbIEwJK2UG4Qf3A7UaNP8n+/sh8634v2BT28oDfWehdRULq/ru3l4GMi sKsw/nbhaJFR+VlBqrtTtZE/mwZYIykvEu9eQwGqFBn2r2Nvt5SNDBvf+xW6TmF3gpk5 ETi/3fqZ30ng7ns2V5hbF/s/jdEkHvrD6mbjWxS4jdGi3kaF7TC/7hC+01kJWz336Yvs H7UAf4Z9JkUAkl4r/EVHQjDOyREPUx1gJ/azI6Sb31jWu/bGtF3mK7saAQNkvVpV9f1h Sa9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H0Rll6qO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qe2-20020a17090b4f8200b001f2c9c64006si8139396pjb.0.2022.08.12.00.08.54; Fri, 12 Aug 2022 00:09:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H0Rll6qO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234733AbiHLGyU (ORCPT + 99 others); Fri, 12 Aug 2022 02:54:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbiHLGyS (ORCPT ); Fri, 12 Aug 2022 02:54:18 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DE6BA5988 for ; Thu, 11 Aug 2022 23:54:17 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id w5so144931lfq.5 for ; Thu, 11 Aug 2022 23:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=t3EERWAoHc/0sJzUnWIG/VXJqbeUHXe35Iq8kCfIwJ8=; b=H0Rll6qOqs0V2BmA7/rXq8aEvL568CpvV8lKQ3Rn5KRJjcfJsvnHeU6JN6ie3e+jQb KqVSjL28MvNTNAeD+f9a7p92RM33993ChXnC30O2V4iPLa4A0OpxfXLo6VnZD5mVX8j9 /mMs1KTE0M5xc5WVU0k7fH5YQbXIq4fBoNpYtztfLhZSob7Gk0NpSsvY9YNaagKTiGwM I9EcusoqsELsaNje/phNRiMzW2n/gsxSKDzrAhAbT3hRUa8n5dP4+yPB2DKjvPF9yX6S VR67nq/yClD4vERkuYuOmMD9YpDMf1R7iQqS3gt/3m2V+g6B3KzEgh87FPpqJAw6wbYc Hzvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=t3EERWAoHc/0sJzUnWIG/VXJqbeUHXe35Iq8kCfIwJ8=; b=flf07/ppUlYq5lKCF/EWZAQH+uCyAwJr8wGZ4qz007aq4+6yu6omtotarDn06RTrO3 oYrKMEAw25caxhMUEJ83QsDROSwYE1U/hei5N1viNtikhn+2dwyxHpJRop6QOZER6/qt v9SiNDR1o+503fKzygkngMXg2qJqJFOE5f2mnvOVwE7cixbAicizIKWJaxNsWnDi48I1 s4jDy7FoW0272P0YoJsa82MbH1tcIRskPFkuJ3VSsOLMv4Fsn+vJ1Vm5/k/j+P3t7JB5 6s9Lp9aFEynWcZUHAzNHZc5W9eBBLO69O7xBj1sPNwU46NHsNfdZYKiv+/O/LQOXmejP qXhA== X-Gm-Message-State: ACgBeo2X3x4c4Ehb1nvjQ3MfptBC7MyH2dPLY7ddHo+2E9qLA276N+vy 98nDkQ2i2BnuMXru5PCwUcsNbQ== X-Received: by 2002:a05:6512:ac3:b0:48a:fa85:7b20 with SMTP id n3-20020a0565120ac300b0048afa857b20mr801551lfu.340.1660287255892; Thu, 11 Aug 2022 23:54:15 -0700 (PDT) Received: from [192.168.1.39] ([83.146.140.105]) by smtp.gmail.com with ESMTPSA id q30-20020ac2511e000000b0048dacaa8c36sm107895lfb.149.2022.08.11.23.54.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 23:54:15 -0700 (PDT) Message-ID: <40261b95-637a-1304-2e06-8c8ff7fc377b@linaro.org> Date: Fri, 12 Aug 2022 09:54:11 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 1/2] dt-bindings: power: supply: Add Richtek RT9471 battery charger Content-Language: en-US To: ChiYuan Huang Cc: Rob Herring , Krzysztof Kozlowski , Sebastian Reichel , =?UTF-8?B?5ri45a2Q6aao?= , cy_huang , alinayu829@gmail.com, Linux PM , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , lkml References: <1660225318-4063-1-git-send-email-u0084500@gmail.com> <1660225318-4063-2-git-send-email-u0084500@gmail.com> <3cae9d60-4012-1dfd-abd9-4d0b9379e6bb@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/08/2022 04:32, ChiYuan Huang wrote: > Krzysztof Kozlowski 於 2022年8月11日 週四 晚上10:12寫道: >> >> On 11/08/2022 16:41, cy_huang wrote: >>> From: ChiYuan Huang >>> >>> Add bindings for the Richtek RT9471 I2C controlled battery charger. >>> >> >> Thank you for your patch. There is something to discuss/improve. >> >>> +properties: >>> + compatible: >>> + const: richtek,rt9471 >>> + >>> + reg: >>> + maxItems: 1 >>> + >>> + ceb-gpios: >>> + maxItems: 1 >> >> This looks not standard, so please provide a description. > It's the external 'charge enable' pin that's used to control battery charging. > The priority is higher than the register 'CHG_EN' control. > In the word, 'b' means it's reverse logic, low to allow charging, high > to force disable charging. Isn't this standard enable-gpios property? > > description: > External charge enable pin that can force control not to charge the battery. > Low to allow charging, high to disable charging. > >> >>> + >>> + wakeup-source: true >>> + >>> + interrupts: >>> + maxItems: 1 >>> + >>> + interrupt-controller: true >>> + >>> + "#interrupt-cells": >>> + const: 1 >> >> Why a charger driver is a interrupt-controller? > There're 32 nested IRQs from RT9471. > The original thought is to make the user easy to bind the interrupt > into their driver. Bindings are not related to the driver but to hardware... > > For charger driver, does it mean legacy IRQ handler is more preferred? Who is the consumer of these interrupts? Can you show the DTS with the interrupt consumer? >> >>> + >>> + usb-otg-vbus-regulator: >>> + type: object >>> + unevaluatedProperties: false >>> + $ref: /schemas/regulator/regulator.yaml# >>> + >>> +required: >>> + - compatible >>> + - reg >>> + - wakeup-source >>> + - interrupts >>> + - interrupt-controller >>> + - "#interrupt-cells" >>> + >>> +additionalProperties: false >>> + >>> +examples: >>> + - | >>> + #include >>> + i2c { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + >>> + charger@53 { >>> + compatible = "richtek,rt9471"; >>> + reg = <0x53>; >>> + ceb-gpios = <&gpio26 1 0>; >> >> Isn't the last value a GPIO flag? If yes, use appropriate define. > I already specify GPIOD_OUT_LOW in the gpiod_request flag. It is not related to the DTS. Anyway writing "low" for a meaning of high is not correct usually... > Do I need to convert the gpio request code to GPIOD_OUT_HIGH, > and specify here as GPIO_ACTIVE_LOW? You need to properly describe the hardware. The polarity of logical signal is defined by DTS, not by driver. It does not make sense to do it in driver. What if on some board the signal is inverted? Best regards, Krzysztof