Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp436983pxm; Fri, 25 Feb 2022 10:56:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxji9HImch2eIDwVOL1cHmbqgzazZprUTkuVfPeyHhHmouJNOgmJLqc9Oytxb8h+/LZXB/P X-Received: by 2002:a17:906:3adb:b0:6b7:876c:d11b with SMTP id z27-20020a1709063adb00b006b7876cd11bmr7277530ejd.250.1645815380164; Fri, 25 Feb 2022 10:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645815380; cv=none; d=google.com; s=arc-20160816; b=TTIuiCjPX3WskECV256cNVnaZcyMxXW9XO34yq/9OrjUKohPwjoe1UOZWIKzjLZbA9 pLgR+8H1Fs9WgS29b478537EYFYGyTpkm/orrMvYvyukhLy3JsgQl2Av5C2Gw412DtdF CwsdsXLm0DBpLQdJmhjl8ZZTrhJnmOuy0LOkTmg6fI2A9Lz9kxzdmsGdTURb9tbCsWUj uRVUfhomBcRy0k2FFMoaU3mkd0NAU4WR9rRDvB1w8z+QxxeHvUK6boKT5fiLUCCXnkAz 1u2gtRp9v+deKMSsZqCw+77PkTOP+Iy9rvkZQMk/ja1/BfOKUpHGIjrMWMhbZ+nCM2WZ hErg== 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:sender:dkim-signature; bh=11tzMfBXZWTEFu0SmCPnVL2TtZRM1lacEuBs47JGN18=; b=pI7xN5o1F/XcXr9nIEw53eg370XrsLcHOGfNsaBF3m+ZHc+s35q35OC8mPs++s5FMY vmo2eZGYETpsI+8RPl2sE8WXT+UTJgx6cz2ZyuxZN17mDbecMh/CsfHcw4PCh0rMUtVn F4kpXvF4Atr1P9o027QbhOLag0U1JzLHVqXsQFXIFI0IWuOD6ZEra0QTX0P2o6ppr4EQ aZxCrdAenyuIRF2+fHx/GW3q2wHfSQPX3c1cz3bpRXDDIbxLHtGPdmx++5NmhfbjPgjv aIn1z92/1Uc0yVEGIzyRsVlV+ItcAZgz/iMp2qT3LYJ19xSppWmzFr0TbmjtbL6ebgo1 zfKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q6lPdNvW; 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 r4-20020aa7d144000000b00410a416bd64si2146309edo.519.2022.02.25.10.55.57; Fri, 25 Feb 2022 10:56:20 -0800 (PST) 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=Q6lPdNvW; 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 S243119AbiBYQkQ (ORCPT + 99 others); Fri, 25 Feb 2022 11:40:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235766AbiBYQkP (ORCPT ); Fri, 25 Feb 2022 11:40:15 -0500 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F249218CCD; Fri, 25 Feb 2022 08:39:43 -0800 (PST) Received: by mail-ot1-x32e.google.com with SMTP id k22-20020a9d4b96000000b005ad5211bd5aso3973592otf.8; Fri, 25 Feb 2022 08:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=11tzMfBXZWTEFu0SmCPnVL2TtZRM1lacEuBs47JGN18=; b=Q6lPdNvWOYVkVMB+Ob8pAsRnWU/khUVxcYPwQX0huyQVohoS8PLdmrTbEv09/SZGgp mWKO0aCv7XXrbhBVIeeoZTYYJjj1/kEp54eyn8sMmXVVFCPhmgisKe1i8788iMwVtPRb niJMPyHXbrsUwvHlnHH9vUAJv1zzsm+2G/HNwIgyDQbb4hsPhwPElKPf1jDW5U6Xsrru JkHvzTlu9ah+fW8nREllsscdRyXJoxmOhTudcQ/1DYOcG+Co+uQVAMwq1mXhb8EMOdtl gtNv6Gf4J5LD8x5Dt/RVCPiljOwBOVdCIdliwKvnSrPfV5VDHwMuoYjbN1xgzUbWonOx OW0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=11tzMfBXZWTEFu0SmCPnVL2TtZRM1lacEuBs47JGN18=; b=hR+kyNvH2Vx8ysJeuTEC7Ql8hW5tClxxOPEVLh+TAMY+eFfnrg4hXjTu3qbUrM86AT lIzm4KTrZXR4wRPtuoZ1EsC2SuO2JEuDDT6fBx5RoEgRWvIsAP9tGhoPnPY/h4Norr63 kk2qr7eL5L0CP9rjCL74ocQv5Q1EXUCN2M3X68E4zRhCAWLak5AauT9AOr8TtQPuY+wR iDsfXA+p2JWpMWEvs5h7tHwG9KZkYOWY7t1Jq1BHWIUlCjydnK8VCEfeL8LKAgtag9N7 V9TTO/Kvw55pvGga6CWiH6+zWeirhr0HJkgmrgFCmqCbUchYkXQKMrTH02zdGyIvFkQN hteA== X-Gm-Message-State: AOAM532TBiriF18NfyAWvntPGa0Blahc/jQRmg3f62cFbL9ZsS8Yc9N4 onO5fEXdmvg+r9BlqnzvV6g= X-Received: by 2002:a05:6830:4126:b0:5af:b9dd:14be with SMTP id w38-20020a056830412600b005afb9dd14bemr2864627ott.366.1645807182651; Fri, 25 Feb 2022 08:39:42 -0800 (PST) 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 s4-20020a056808208400b002d54070f170sm1416054oiw.37.2022.02.25.08.39.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Feb 2022 08:39:42 -0800 (PST) Sender: Guenter Roeck Message-ID: <8656b67c-e093-0a18-9c5f-02f5b4264bb2@roeck-us.net> Date: Fri, 25 Feb 2022 08:39:40 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 2/3] hwmon (xdpe12284): Add support for xdpe11280 Content-Language: en-US To: sylv , Jean Delvare , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Patrick Rudolph , linux-doc@vger.kernel.org References: <6103836f1116a045a25919ae3e5c18dfdc485902.1645108566.git.sylv@sylv.io> <246de83631dd5e165f95904d7f1628502f030e02.camel@sylv.io> <66d4ea0b-0377-c9ae-68eb-7303c32cf87e@roeck-us.net> <7a567823d62b6ed00cbdc2ce239dc4a69e48b411.camel@sylv.io> <337fe0598837b35ee96773339e9cdc8345a7c16e.camel@sylv.io> From: Guenter Roeck In-Reply-To: <337fe0598837b35ee96773339e9cdc8345a7c16e.camel@sylv.io> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 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, T_SCC_BODY_TEXT_LINE autolearn=no 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 2/21/22 04:13, sylv wrote: > On Thu, 2022-02-17 at 11:25 -0800, Guenter Roeck wrote: >> On 2/17/22 10:38, sylv wrote: >> [ ... ] >> >>>> >>>> That makes me wonder if the chip needs to be added to this driver >>>> in >>>> the first >>>> place, or if it could be added to pmbus.c instead. Any idea ? >>> >>> Oh, we did wrote a standalone driver too, and it works fine. >>> Maybe it's better to upsteam it instead. :) >> >> No, I meant if it would make sense to just add something like >> >>         {"xdpe11280", (kernel_ulong_t)&pmbus_info_one }, >> >> to drivers/hwmon/pmbus/pmbus.c. >> >> You only really need a standalone driver if it does something >> special, such as a workaround for some register access (like >> the xdpe12284 driver), or if support for manufacturer specific >> registers is desired or needed. That would, for example, be useful >> if the xdpe11280 supports per-phase sensors. >> >> Thanks, >> Guenter > > Hi, > > I tested if the xdpe11280 can use the generic pmbus driver. Everything > works fine except it does only detect READ_TEMPERATURE_1 on page 0. > Looking at the pmbus_find_sensor_groups function it looks like only > some commands are probed on each page (READ_VOUT, READ_IOUT, and > READ_POUT) but not READ_TEMPERATURE_1. > The PMBus spec 1.3.1 tells us: "Each page may offer the full range of > PMBus commands available for each output or non-PMBus device." How > could we adapt the generic driver so that it is possible to probe > commands for each page? > The problem is the "may". Some chips don't implement multi-page support especially for temperature sensors. So we'll have to go with adding support to the existing driver. Guenter > Furthermore, It would be great to add regulator and DT support. I > created a WIP branch on GitHub with a possible way to implement this: > https://github.com/9elements/linux/tree/upstreaming_pmbus_regulator_wip > > What do you think? > > Thanks, > Marcello >