Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2147495rwr; Fri, 28 Apr 2023 06:50:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5iQ+Kr4RoYJzTxR7wjiqlWsTNmXR4Dl/tsDCACYtV0H4aNpDyLwK10+eSUbukpvxoKhIov X-Received: by 2002:a17:902:ec83:b0:1a6:f93a:a135 with SMTP id x3-20020a170902ec8300b001a6f93aa135mr6013422plg.61.1682689814253; Fri, 28 Apr 2023 06:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682689814; cv=none; d=google.com; s=arc-20160816; b=otaLDto6MHaAy/TgOFTkbJ+4hTYt4/r3gy6bnHmOmvPOgWdF2Jz7TdSc43spQH7gcB LWM5Y+PsLCbVu+2JHlCPOrfX4J697jxNgw5+RIZR1lVcaO9dvKBy5C+qPTIUYDrjn+++ hEQrEWB2PTrCpoGMEKyooOvv2tnoNNnQD/26yY6cjKmTtHixjG3IYYVNHqXwmF91DTaP E2DL8AVbAvz8FYsj8YJHZwzwfbLgDiu1gUksz7AU9E41fgD7UrD43YmuioI5ilAyS6c7 t69zpGrVqIg5Df3yyX+W4rWVqOmPHcYFNCx7h+nd7NuMLZaqiUuIdpFC6es5tjdpsswz arPw== 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:to:content-language:user-agent:mime-version:date :message-id:sender:dkim-signature; bh=Ecf3y//8as8pmNBqc+FV/KL+yi6EQ2HAAYSLWqdkKMY=; b=pv2goKgnwEY6WexjqFRkZ5Gs9+4KVE5kfvQ+XAQ8AI+MCtaqAOxaQtxslj57q3/gYV qvb119ozYVT2d0Uob5lj85nYl3zJy6Wwj/Y40McI0Td/HRkRDlyFtL0dXJ1RZ2zQgpmV DF4QaOPP+a+pUzm+b+yLS88Sg529WqeClu6FT1LAHSZCw/yO2ZsuayYSeZDJamDE6eQ6 clPdMimC0snqjtomkDXX2zboOGpOq9igynCGHhyjTCxe37jD4YHs7vKKZ+KZm8fhHsy8 18CMRWdRsIgdCIkJLFKheO3ceBsNsnIbiXfb2dYMbJRLnManxRlWXJnwWoxWEOv7Buyc lY+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=S8lRCV5X; 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 s1-20020a170902ea0100b001a979e702b2si13651258plg.416.2023.04.28.06.49.58; Fri, 28 Apr 2023 06:50:14 -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=20221208 header.b=S8lRCV5X; 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 S1346303AbjD1Ncs (ORCPT + 99 others); Fri, 28 Apr 2023 09:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346298AbjD1Ncp (ORCPT ); Fri, 28 Apr 2023 09:32:45 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8B6346BB; Fri, 28 Apr 2023 06:32:43 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1a6f0d8cdfeso75793425ad.2; Fri, 28 Apr 2023 06:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682688763; x=1685280763; h=content-transfer-encoding:in-reply-to:subject:from:references:to :content-language:user-agent:mime-version:date:message-id:sender :from:to:cc:subject:date:message-id:reply-to; bh=Ecf3y//8as8pmNBqc+FV/KL+yi6EQ2HAAYSLWqdkKMY=; b=S8lRCV5XNase7pRtd37xsGAZzTDD6LYZluEpOiqWveUN07ffsE754Ypw1bTZS8+Ri3 iNhAND76FztYXHLw8cHxo3ZFPtOanPUx2/7cmTo1PIjXf3kFnF3wetAybVUNKAXg6mss nGJ8yinhECeQ0K0ehiocBmq9TSphAmxKsis/LJw7K1wKm4Kph/pweqWndZ15sk9oE6G6 IFbL5zqrXNU6KQtDAOuPZ7X+qFAVE/uhXDcV9lNvwlv+RLTNtw+Toz7AbI9Q6aoQorDt nx9g+PL/PTf1t4Yy8SZwi1BCl+aAgxQnJgjlkNiVsyOwYt9WYWHtnY7xO+RDEE/HtGo2 mQeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682688763; x=1685280763; h=content-transfer-encoding:in-reply-to:subject:from:references: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=Ecf3y//8as8pmNBqc+FV/KL+yi6EQ2HAAYSLWqdkKMY=; b=grLy7fcAEBOhv79yQC1iwDj0+XZMGx4PeoWfYZBHDL0pJw1fzYZjHhV2USi7yvEc6O IO21u7rQ4s89i79lWaru48mm8iOLGFMlOmdhnJg8CzJWXudVc8aK02FaTMNgt0ZbvHGA PKwjNLxGawf2wOmyfAWdJH0MOhA/OYc4DVQ/NHmtln5vS7OzzNanBe84HAgKMjFGde/o D8j6ZuFZNdMZ2JreLO/pEvUJtJc3Qzg+Gy/ccKyFtYHtPta7c1NcYfgj26H5sp4n2M/U emaNQuv4oe2JipqApsyuq4UN8VNjlRv/n+l/3z6A9iu+7ytxQ5V+vE2lNqYzixIjDd2i Sgjw== X-Gm-Message-State: AC+VfDygc2jNwMu8TIFdZSBIaIbFixSJeOvBnLCNGi0DirbIfWiYsXlZ T+6rV35YwPVYHlfBYVFlgHw= X-Received: by 2002:a17:902:ec83:b0:1a6:f93a:a135 with SMTP id x3-20020a170902ec8300b001a6f93aa135mr5944888plg.61.1682688763155; Fri, 28 Apr 2023 06:32:43 -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 f5-20020a170902ab8500b001991f3d85acsm13241904plr.299.2023.04.28.06.32.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Apr 2023 06:32:42 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Fri, 28 Apr 2023 06:32:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: "Hawkins, Nick" , "Verdun, Jean-Marie" , "linus.walleij@linaro.org" , "brgl@bgdev.pl" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "jdelvare@suse.com" , "linux@armlinux.org.uk" , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hwmon@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" References: <20230418152824.110823-1-nick.hawkins@hpe.com> <20230418152824.110823-2-nick.hawkins@hpe.com> From: Guenter Roeck Subject: Re: [PATCH v1 1/9] gpio: gxp: Add HPE GXP GPIO In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 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=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 4/27/23 07:53, Hawkins, Nick wrote: > > > >> This is not information which should be reported through a gpio driver. >> Besides, the functions don't exist at this point in the series, >> and there should be no extern declarations in source files. > >> If you want to model fan or psu information through gpio, drop >> the hwmon drivers and implement reading the status here, then use >> the existing gpio-fan hwmon driver to report it in the hwmon subsystem. > > Thank you for the feedback Guenter, > > I see how it is possible to use gpio-fan for the fan. As for the gxp-psu > Hwmon driver can I model the gpio-fan driver to get the necessary > gpio information for power supplies? > Sorry, I don't understand. Looking into the code again, the major problem I see is that you want to model fan install status and fan fault status as gpio pins. The same is true for psu information (installed, ac, dc flags). If you want to do this, fine, but then get the status from the gpio driver and don't export anything to the gpio driver. The kernel supports means to do that (look at gpiod_get and similar functions). It makes the code more complex, but I assume you know what you are doing. Guenter