Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2533600rwi; Tue, 11 Oct 2022 09:54:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4x7AqidmU4vPLg+90+TO3Bh0giuWOciH7KAIt0nPg/GMHpS+46UO1UnrbMuwntV0gJXkib X-Received: by 2002:a05:6a00:1a4d:b0:563:a7c4:f521 with SMTP id h13-20020a056a001a4d00b00563a7c4f521mr5317412pfv.61.1665507256319; Tue, 11 Oct 2022 09:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665507256; cv=none; d=google.com; s=arc-20160816; b=vpGQKaDu1hrFnJSNe4FyRjnlfFlMBF1hvoo0Gt9JZYhDze2TlrF8cx1Yk0uvf0Elwi UGwEded7xPLdYAcOz6VvCJbhqpamH4J6e9AprBUPeLklP8R8Y0r5bwYcb/MHskw8uZbR vxwuK+s3o4mi8hPTSV+obSGgIQSjKJG6QRoiivbSm9N8e6fogUDRJAEZhLzZ/3I9bOOg w7e5g6i9xsD4cKEBXgT9pjcWdaicsnNtgfQf25btXX1KAX9ThAFUyxatGSKI6ZBq8+Z4 E48WAIyPhVc88b4hsyar+tJ88zvRr1tat560keKKP+SqJz8GCuP6T+ususVNHC5ZnL3B E7kw== 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:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:sender:dkim-signature; bh=bTbRnfl89ade6OCV6TvnorRTh5pmmrQFCO3InValYks=; b=dsbFyi9vsSGQ3mEjjBnUbhNjz2bwvKy1UhMvC+Jw6tX6UxsaWoY3Igt5z3IK+15wuV UU1KWoAYaQzMzOqdU09QD9mcvQjY8nkERvo0SyNBpfq8lqRX3TpMD9Q322+rowENOMkq xGRHBbdPwdDJPRlnA3N/NZVtl5yIeMFemKhqtWV67aWjNI1mNV1FLuMYUg/VTDe6Uk0E lYdApMUMrfld4MOfTj/PasHmFlFQp8jWXfAeGfenh+iffQ0dTwB/ooRNBNVSX1FQ1WSq e1RRobg2bj86+E5MWj77b80c5z+fD33UcS/w5VwGLndPZjwvXEoNFsaCj2TDfC3IdT8b tojA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gx+CzTle; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b00176db49b734si14273648plr.283.2022.10.11.09.54.03; Tue, 11 Oct 2022 09:54:16 -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=@gmail.com header.s=20210112 header.b=gx+CzTle; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229672AbiJKQqQ (ORCPT + 99 others); Tue, 11 Oct 2022 12:46:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiJKQqP (ORCPT ); Tue, 11 Oct 2022 12:46:15 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B91A5717; Tue, 11 Oct 2022 09:46:14 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 3so12493228pfw.4; Tue, 11 Oct 2022 09:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id:sender :from:to:cc:subject:date:message-id:reply-to; bh=bTbRnfl89ade6OCV6TvnorRTh5pmmrQFCO3InValYks=; b=gx+CzTleAu6ybh2TLBk82o/4m29LCQlY4Yi437f5iok6SdHZ2HZA+cVn8hkrjdYwZF Av7nJeCNOeAm/67BxgscaeR0r5be8waLfpvJ7nUyN1AZ2nof9olcQjCA6kDdvGSlfYc2 VjxH+TLXyTaprs4Xnnnn564ysjquhJFHbhG1yZa+UwaH7/wCYfM8ey73Q6hTh5NsrKs/ eUUOIQtvuR8r5FUaxzhJczH0a+H7eKYfd1ykZJGtPwNIOICjLQolEnVRi4Fu4S9luAQS 1/xbqzQIrV/DxDo3TUFP4ba8k9SDE5MFrWjzVMszNSaTGp7gu5Xbi34IdmjFLG4Pq7uv X8ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bTbRnfl89ade6OCV6TvnorRTh5pmmrQFCO3InValYks=; b=c4IB+m2O32U7obSMYfbJwKCsz2BBwhXQcuWIfzGTUXmNRGD1UdqoMQjiThP2hc0rnJ swKO3izI76pyHhC0zJiYldnNWKQ9Td1vSVZ+h7OQJdCf8e1a6M8qo7H6qFcSp8U0IiR7 X9iFnW6DtCFFLWKr8mZNtzO/QfzEWESgFmxZkse/+mEZIBAUKmbt7+PFimWElq7Webnz cWHHdenk7dVPnz0IpXX6S6xyAZjQjIwWSFn4e/mIWgwpTpQ8phOgW70kpn8jRB/BrZC3 jVl1gxsuWQCPAK4qRG8DyYxIHdFwmvvGpzSi9RqtZTmaYM8qPODRoA0x0iQ6SEPUv1tV yPeQ== X-Gm-Message-State: ACrzQf3bQneQ3ZuqQrZJRKijP6M89lG/bvkM3bqmp/0joQxaJT54hpIB Kl2Hm21Yn/h02ZWC8uJIEx4= X-Received: by 2002:a63:e254:0:b0:459:a2cd:cbfc with SMTP id y20-20020a63e254000000b00459a2cdcbfcmr22591603pgj.275.1665506773634; Tue, 11 Oct 2022 09:46:13 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e23-20020a17090a119700b00200461cfa99sm11297619pja.11.2022.10.11.09.46.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Oct 2022 09:46:10 -0700 (PDT) Sender: Guenter Roeck Message-ID: <8d2e905b-8669-b7ec-c7c0-1b0d78fded92@roeck-us.net> Date: Tue, 11 Oct 2022 09:46:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: Naresh Solanki Cc: devicetree@vger.kernel.org, Jean Delvare , Rob Herring , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Patrick Rudolph References: <20221011104739.53262-1-Naresh.Solanki@9elements.com> <20221011104739.53262-2-Naresh.Solanki@9elements.com> From: Guenter Roeck Subject: Re: [PATCH v2 1/3] dt-bindings: hwmon: fan: Add fan binding to schema In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 10/11/22 09:12, Naresh Solanki wrote: > Hi Guenter, > > fan-common is intended for fan properties. i.e., those derived from > fan datasheets. > For min-rpm, some fans have minimum non zero rpm like 1900rpm below which > the fan cannot run. > I would argue the properties are for fan controllers, not for fans. Fans don't have or depend on specific pwm frequencies. Fan controllers do. Fans don't have a configurable pwm polarity. Fan controllers do, to match the hardware on a board. Fans don't have or rely on a target rpm. That is a system property, configured into the fan controller. And so on. If this is for fans, we'll need another set of properties for fan controllers. The driver for max6639, being a fan controller, would need to implement those properties. Also, as implemented in the MAX6639, max-rpm is the fan's rpm range, not the actual rpm. Your implementation is just confusing, including the example in the bindings. Valid values should be what the chip accepts, not some random value. Really, I don't understand where you are going with this. Guenter > But not sure what the best approach is but for chip specific setting > it should be in > chip specific DT schema. Suggestion? > > Regards, > Naresh Solanki > > > > 9elements GmbH, Kortumstraße 19-21, 44787 Bochum, Germany > Email: naresh.solanki@9elements.com > Mobile: +91 9538631477 > > Sitz der Gesellschaft: Bochum > Handelsregister: Amtsgericht Bochum, HRB 17519 > Geschäftsführung: Sebastian Deutsch, Eray Basar > > Datenschutzhinweise nach Art. 13 DSGVO > > On Tue, 11 Oct 2022 at 20:30, Guenter Roeck wrote: >> >> On 10/11/22 03:47, Naresh Solanki wrote: >>> Add common fan properties bindings to a schema. >>> >>> Bindings for fan controllers can reference the common schema for the >>> fan >>> >>> child nodes: >>> >>> patternProperties: >>> "^fan@[0-2]": >>> type: object >>> allOf: >>> - $ref: fan-common.yaml# >>> >>> Signed-off-by: Naresh Solanki >>> --- >>> .../devicetree/bindings/hwmon/fan-common.yaml | 80 +++++++++++++++++++ >>> 1 file changed, 80 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/hwmon/fan-common.yaml >>> >>> diff --git a/Documentation/devicetree/bindings/hwmon/fan-common.yaml b/Documentation/devicetree/bindings/hwmon/fan-common.yaml >>> new file mode 100644 >>> index 000000000000..abc8375da646 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/hwmon/fan-common.yaml >>> @@ -0,0 +1,80 @@ >>> +# SPDX-License-Identifier: GPL-2.0-only >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/hwmon/fan-common.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Common fan properties >>> + >>> +maintainers: >>> + - Naresh Solanki >>> + >>> +properties: >>> + max-rpm: >>> + description: >>> + Max RPM supported by fan >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + >>> + pulse-per-revolution: >>> + description: >>> + The number of pulse from fan sensor per revolution. >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + >>> + target-rpm: >>> + description: >>> + Target RPM the fan should be configured during driver probe. >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + >>> + pwm-frequency: >>> + description: >>> + PWM frequency for fan. >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + >>> + pwm-polarity-inverse: >>> + description: >>> + PWM polarity for fan. >>> + type: boolean >>> + >>> + label: >>> + description: >>> + Optional fan label >>> + $ref: /schemas/types.yaml#/definitions/string >>> + >> >> Same question as before: >> >> How are additional common bindings, such as min-rpm or fan-divider >> (also sometimes called fan-prescale) supposed to be handled ? >> As additions to this schema, or individually in each driver needing/ >> using them ? >> >> Thanks, >> Guenter