From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B25014C92; Fri, 14 Mar 2025 15:17:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741965436; cv=none; b=sTu3bdlZDqQ9L2+3yndJYGOyhGOKqlFFBuw5lxRBddTWNcJtKAyBXnuvwnr1kftnvfjDdzrQ9/31N6qQ8d9ILhIr6/CN+9Sxlcmi59pPO0eRsF0Kd2cLbs2hJ1TmZHA65fnhPaA5s0JEIgR4oth1XiznO+W8jHlerQ5jl09B34g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741965436; c=relaxed/simple; bh=9Ovcf3ZBr4VguOpgZ3LyqjraWY44XRz8PTWX0dEmfaM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pwtaknpMVXBcGNfyLWiaSqtWjhQm4nPHJxvEm81841t5u5IIYSg4cdmOljYPk52j753bDygs4fqbEPsiY6SvMh4hgSehDK+ZT7gOW62cL65CvCk/0JBmaQ7rOGEfiEJ1xY53BQpd8XF0gSY2uteNkvCkwp5SYTWhM5Y7sg0ZTlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Dh6r6abY; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Dh6r6abY" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2fec13a4067so3893294a91.2; Fri, 14 Mar 2025 08:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741965434; x=1742570234; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=ARa48UJeOnruk4y6hfaItaqVnAuMM94e4bCCTCC0nD8=; b=Dh6r6abYC1y/UAFU1RMWx5lFOXPi+OfLxSo4Vu01Sh8ekIL3SEgZP8vG6kBnhr3N78 UhErtLc+vJwQsBd4mIdXaHtylB33sgqmDiNM3QOp4l+0D1vrZPuB9l2gcv+7yygZ7wPv G16BkrW5FyugqOS2QbF45Opr+hC0MLVZIHtD4GRtppx9AVKJArTtTGVT6Jzx6u5KO+kx n+b4o3KDzI9udkGmSgmDrM/tc5DDIqp1RLLku6opWZEpx5cE8jsxmu3NFHU0bz5oTpja XXkKPsbeYGcF9zEbe/mpSnMDIJyAfHCReaHDfrMeUEMWY9ibfu8dzD7qfMnkB7cGqMGX JtSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741965434; x=1742570234; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ARa48UJeOnruk4y6hfaItaqVnAuMM94e4bCCTCC0nD8=; b=k5ocyeXSU6H7PfzFZB/bQsvxLWwhlqZs11I3D/a9QifTa7bMLsqYNBTk6SnMCk/AVo DOgvC23faOy0EIVRC5yV3E8vy/Yyrb32tjU4jf0Y2LCvs3oxF305iVzfGAiQtu8abkNM nQ/cVT839suCZ/Lqzn7DeUzSZbl93uXwQaLWdlhONUnxaxWyupvQHbe2r5aa2+ZeBVv3 MFDeuFxcw6OfxhGnsRrP0Z6L6kA5ldcgdVvyvFzPOcK9pWzw7VciR6fH0RI9JvFBrQ6C BEadUwImlC3E3ksPmRa4nhv1fgagPXHe5zwOJBo5O8SusTRy/L7finQwnZjChhTl5klN WPtg== X-Forwarded-Encrypted: i=1; AJvYcCUq5oMZpLEe9ykIyNk3O4ppfeg+1/BEjxP9fJD0DBilCM0btHdmsFeLHycY4FBuXl73qstCZWcYwNHneGY=@vger.kernel.org, AJvYcCVly6v5dVd51kUb3uKQXU1mc5UIgIxBqaumQQNyk2L4Hw+zCRlV4D3TOBVAsyb79oNIOQuJg9i5pQ81@vger.kernel.org, AJvYcCWyEoFLOO/aR8owbE7JZTUh0cPo8Hp7qWq1wPgq1Ns6VNyum9SqwikOQj+dR/jzPbCF6h/b0UamANS6PN+w@vger.kernel.org X-Gm-Message-State: AOJu0YzXpG2tDimobueGc0pYfeMVdtqp1GPHdQ0GwG6fSM+q0oZb+9o0 0p9RywMP/3TxovBHTor67W0d113SFpE4Ivflc+xIMf1O9h0CWGWE X-Gm-Gg: ASbGncuHN/egbdiVBj0H/QJ/FjgzZsVLSz3K4h9jqNdpHfW4pPqqaoTZ5NA3+mpW9+q Nu0aypmUDVixR4BtjYKaAZp2vXS5QS3Vbc324S0Ub5Ldhe1WKJQKl0bQ8lwZl0o5WPZtlWOhx8c n2QkHLzGOEdfrC+LncJ2dqGw8Wq+Ug8dk0EmDSab2v231QQEWu5QZ6QCOhBes52iXkCZVwqlggY zQOTow1FR75MBAWrRhrEw6OiYQtMxwEm0uEgJVx4j7A8/3i+1W490b8kXa27hGX7Q5hivHdLZA8 HIFhKYwnQY/k198aji8sy+c/VptwWMPncRf+W8vP47Jbh6astTREJnWAc9Tzw1kTfzHJkeLEpNM UfwOQw9zS7MGoA9wAxA== X-Google-Smtp-Source: AGHT+IG2jRdPaGI0FWtVKjiiomdk6D9DJZF/EZKSpoKP8xh69ls7UwRCiGvxWs2pkQtYbrkW+pYPKg== X-Received: by 2002:a17:90b:5608:b0:2ee:d824:b559 with SMTP id 98e67ed59e1d1-30151d9d704mr3737985a91.28.1741965433831; Fri, 14 Mar 2025 08:17:13 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:da43:aeff:fecc:bfd5? ([2600:1700:e321:62f0:da43:aeff:fecc:bfd5]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-301539ed283sm1234279a91.18.2025.03.14.08.17.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Mar 2025 08:17:13 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Fri, 14 Mar 2025 08:17:11 -0700 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 v4 1/3] dt-bindings: hwmon: Add Microchip emc2305 support To: "Florin Leotescu (OSS)" , Krzysztof Kozlowski Cc: Jean Delvare , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Shych , "linux-hwmon@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Viorel Suman , Carlos Song , "linux-arm-kernel@lists.infradead.org" , "imx@lists.linux.dev" , "festevam@gmail.com" , Florin Leotescu References: <20250313125746.2901904-1-florin.leotescu@oss.nxp.com> <20250313125746.2901904-2-florin.leotescu@oss.nxp.com> <20250314-encouraging-fabulous-ant-e1f7b0@krzk-bin> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCx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8lx9zif+v4ZY/6C9tTcUv/KNAE5leyrD4IKbnV4PnbrVhjq861it/zRQW cFpWQszZyWRwNPWUUz7ejmm9lAwPbr8xWT4qMSA43VKQ7ZCeTQJ4TC8kjqtcbw41SjkjrcTG wF52zFO4bOWyovVAPncvV9eGA/vtnd3xEZXQiSt91kBSqK28yjxAqK/c3G6i7IX2rg6pzgqh hiH3/1qM2M/LSuqAv0Rwrt/k+pZXE+B4Ud42hwmMr0TfhNxG+X7YKvjKC+SjPjqp0CaztQ0H nsDLSLElVROxCd9m8CAUuHplgmR3seYCOrT4jriMFBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/14/25 08:02, Florin Leotescu (OSS) wrote: >>> + '#size-cells': >>> + const: 0 >>> + >>> + '#pwm-cells': >>> + const: 2 >>> + >>> +patternProperties: >>> + "^fan@[0-4]$": >> >> Keep consistent quotes, either ' or " >> > > Thank you! I will correct that. > >>> + $ref: fan-common.yaml# >>> + unevaluatedProperties: false >>> + properties: >>> + reg: >>> + description: >>> + The fan number. >>> + >>> + required: >>> + - reg >>> + - pwms >>> + >>> +required: >>> + - compatible >>> + - reg >>> + >>> +additionalProperties: false >>> + >>> +examples: >>> + - | >>> + i2c { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + >>> + fan_controller: fan-controller@2f { >>> + compatible = "microchip,emc2305"; >>> + reg = <0x2f>; >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + #pwm-cells = <2>; >>> + >>> + fan@0 { >>> + #cooling-cells = <2>; >>> + reg = <0x0>; >> >> Please follow DTS coding style, so reg is here the first property. >> > > Ok, I will correct it. Thanks! > >>> + pwms = <&fan_controller 1 1>; >> >> It's the same PWM for all fans? So isn't it basically one fan? How do you exactly control them independently, if the same PWM channel is used? >> > > It is the same PWM controller, but each fan has a different PWM channel. According to datasheet, the EMC2305 could control up to five programmable fan control circuits. > The driver will parse all fan child nodes during probe and use reg to differentiate the channels, similar as it is done on max6639 hwmon driver. > The 'pwms' arguments in the example are used to select the polarity and pwm output, which will be parsed in the driver to generate the bits for the registers used to select pwm output and pwm polarity. > (... <&fan_controller [pwm_polarity] [pwm_output]> ...). Now, I realized that I should use: <&fan_controller [pwm_channel] [pwm_frequency] [pwm_polarity] [pwm_output]>. I will also document the arguments in #pwm-cells description. > Thanks! > Please also document that the channel assignment is fixed. Technically it doesn't even make sense to specify the pwm channel (it is fixed and matches "reg"). I don't know if the channel number can be omitted from pwms. All you really need is polarity, frequency, and output type. I am not really sure what to do if the channel number is mandatory. If it is, I'd suggest to document it as mandated but not needed/used, and then ignore it in the code. Thanks, Guenter