Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1882550imm; Mon, 3 Sep 2018 11:57:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZs03UZXIHM0NjgnKU6VRVk4HHTHNSyeYZI3UruLJHprtGfllpts3YwrleNhZungJd11zRy X-Received: by 2002:a17:902:850c:: with SMTP id bj12-v6mr30416051plb.330.1536001044379; Mon, 03 Sep 2018 11:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536001044; cv=none; d=google.com; s=arc-20160816; b=A91gisOLx2ofHAwt3gVR2vZ+L0kg1jKUjRn+4K5Nah1FeeFsqYk605YJwTQ/M8KbW/ ApuRCINZZR8twDb1DzHiLr8g+buPj5Pt4YhUaZl+FWUpcoX0Sk9vFp3hgpcOjCzGgnN1 SMwBODRAlxqTfoFNQ54J8Gy6FZgKF1CsETZVWjjOZRhXLxqZlG277RMBoOhBFm5btcc/ XkfLyVu91cjCWpbxcS0qNbqE5vrzQC2DaRewHso/H3vkxevyv9Xx9s3PKSL3cU58qj7X vrcB4bh93Hsr3+bUp2SL/bvXfP9hyjrCVoR+nap3BqErT8u2ZIX0n9vZlBEXDwRsF/nm +Riw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:arc-authentication-results; bh=00/trzC4p8Lrna3A45ZlUyFUyUnL7sT7TwrCgtxWGgc=; b=vNvYPlymWvcehgUqssynnvAp7gjvimV4afZvr8XR6uiun6JQzQ6TSwovSK6FPbOdMY UKJRT1AqBbS9YOlBLBsFjHZL1HlZyhT6RAUarLNlVNYGPdXG5JjRyIWr1lHlcDXUipCp Kj04chHi1wh9MtSRwUTWzcnayXgiRZTHfaXnWh+lrzMhVPsfwJhJEIEWTClnTEuc1yDo YjlgjleBZbPU1NAjgRn6jbdU+j3cgmvtsKH8k0BFDfv58T3wpY5MVO6gaYY1w4atv51j idbY1+DSd0xa1pFHxR++7S3VyG1W7vPMUvD9MjuvFwd7Ei+s3iey1t3ciVjQ0VHWv73O pB9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f187-v6si19472972pfg.122.2018.09.03.11.57.09; Mon, 03 Sep 2018 11:57:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728113AbeICXR0 (ORCPT + 99 others); Mon, 3 Sep 2018 19:17:26 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:38233 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727493AbeICXRZ (ORCPT ); Mon, 3 Sep 2018 19:17:25 -0400 Received: from null ([172.19.249.173]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MHYCK-1ftcDB1nx6-003MpC; Mon, 03 Sep 2018 20:55:09 +0200 Date: Mon, 3 Sep 2018 20:55:06 +0200 (CEST) From: Stefan Wahren To: Florian Fainelli , Guenter Roeck Cc: Rob Herring , serge@raspberrypi.org, linux-rpi-kernel@lists.infradead.org, Eric Anholt , Mark Rutland , bcm-kernel-feedback-list@broadcom.com, Phil Elwell , devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Jean Delvare , linux-arm-kernel@lists.infradead.org Message-ID: <698422655.399555.1536000906069@email.1und1.de> In-Reply-To: <642d46f3-7c1d-2b97-5d49-8772c75be530@gmail.com> References: <1535887251-29515-1-git-send-email-stefan.wahren@i2se.com> <99ca4f6d-d2b2-36e7-9f27-189df379cfaf@roeck-us.net> <67224834.51159.1535905604770@email.1und1.de> <829194253.51526.1535908415057@email.1und1.de> <642d46f3-7c1d-2b97-5d49-8772c75be530@gmail.com> Subject: Re: [PATCH RFC 0/2] hwmon: Add RPi PoE HAT fan driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev36 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K1:rFHsk3cf/BponRJoEb9q4NZtbCPm25NckiyxgrNiqv08YiZr39Z 2OIV9rMdsPbmjtKGk7aUuCojTjZmRNj+lDF0rEkCTbb/RA7fw8hBxYwgrAJFF4efCOCcLEO I0unmaHWPXNfzOWsAxEpYOBRJxOlGN5q2aopZnPh31rXdDMoeTQ0EcDqOyHAY6YQRhZhOnE lo0GeXl0gQFUnm1kDbzIQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:02cPqEk0lpQ=:86ZjBSnNwbQOtjYsGgQaFM wkg2vuWebNrhJiTaP/cElEnxctFiQM939LL6R3heS3VUys/agW84HkQiVgwGlEOVguY3eaK+w EHWXTlS+do134YAk+jtXDLbJoxMarvQMuVuO+NWyhSmy/ATjhNJVPuSt4UFDmxdDcmHx7fqaB YNDtAZfMkV0MBr7bDZiXSupJ63v2oc0TpylR9XcdMcqknCtslyjcpi1dITFvYSOuF5iK/f2w5 QLt4vLsfLBPuGkkvtPXB8FTTCskP0PXtIzm8GM8/2oooO30X/Lt/5qacrUf4pTbHA1EEivnfO oGgqgwOdDOlC44DXmN9R7FzzZO+o85blHaHvqif6vvrZtyCaKQ5mlU+mX0RsoSCLo3Nmeq7zi YE2en4Ibry423G8+VDrNi1axbv+ecVJvE9pFoN3drApGhXhvwOMZIVXOKRp5ESVAMv6pV16Rh WDYNEaNjINznwSKG7NgkIsd5DUDP71GO5P1wT5ppe6ba1ZmUGzhNV0CARJCuPYoBoNXHrQZBR Z4Eab/Ei48zsjuLFxp6bHVbkh6i9sQGmmYwgrIZa5aQ7BRFOPwF30WrcSK81HulgvV/+6nC9f cp4kZjeDYOsh16oDb6OxSSoxl8m+LteSywDsomNASV+O/yzhxi/G7UFV/tGvud6qUYlTdiVCe rcmGkF8EMsIFEJvlTH/AdasleYWU89iHIIYyaFcvJ8LRqd66njRRpekopU9IDDgAXg/7o2FzM D95A+Wag84i68HZ1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Florian Fainelli hat am 3. September 2018 um 20:31 geschrieben: > > > > > On 9/2/2018 10:13 AM, Stefan Wahren wrote: > > Hi Guenter, > > > >> Guenter Roeck hat am 2. September 2018 um 18:49 geschrieben: > >> > >> > >> On 09/02/2018 09:26 AM, Stefan Wahren wrote: > >>> Hi Guenter, > >>> > >>>> Guenter Roeck hat am 2. September 2018 um 16:23 geschrieben: > >>>> > >>>> > >>>> On 09/02/2018 04:20 AM, Stefan Wahren wrote: > >>>>> This series is an early stage of the hwmon driver for the fan on the > >>>>> Raspberry Pi Power over Ethernet HAT [1]. At the end this should use a > >>>>> Device Tree Overlay. > >>>>> > >>>>> Changes by Stefan based on [2]: > >>>>> - reformat the downstream patches for submission > >>>>> - drop reboot notification > >>>>> - fix remaining checkpatch issues > >>>>> - add COMPILE_TEST to Kconfig > >>>>> > >>>>> The driver is mostly copy & paste from pwm-fan, which isn't good. Personally > >>>>> i see two options: > >>>>> > >>>>> 1) integrate the driver function into the pwm-fan driver (new compatible) > >>>>> 2) implement the core function as a PWM driver and use the pwm-fan driver on top > >>>>> > >>>> > >>>> I don't really see the point of thise driver. Why not implement either of those ? > >>> > >>> i'm not sure about your question. Since the fan is placed over the SoC, the fan should takes care of the SoC temperature. AFAIK the firmware should have exclusive access to the I2C. So why we need this mailbox interface instead of a I2C driver. > >>> > >> > >> The driver sets pwm values. The pwm-fan driver sets pwm values. A pwm driver > >> sets pwm values. The pwm-fan driver uses a pwm driver to set pwm values. > >> You appear to be arguing that the pwm-fan driver for Rpi is different than > >> a pwm-fan driver for all other hardware and should _not_ use a pwm driver > >> to set pwm values. > > > > thanks for your explanation. Now i think i understand and sorry for the confusion. We need a driver which translate the pwm values into the mailbox properties. "My" RFC series is only a starting point (not intended for merge and not an option) for a discussion and i'm perfectly fine with 2). > > Both options would be feasible in general. I only wanted to know your opinion before i start to implement one of them. > > Is not there a way to expose the PWM pins directly to the kernel instead > of going through the firmware to do that for us? I am just asking > because sometimes this appears to be possible, guess not in this case? According to this blog entry (no schematics available so far) [1], this is my understanding of the fan control: | Raspberry Pi 3B+ | PoE HAT | ARM core -Mailbox-> VideoCore4 -I2C-> Atmel MCU -PWM-> FAN The only chance would be to bypass VC4 and talk to the Atmel microcontroller directly. But this would require a specification of the I2C protocol or some time of reverse engineering. Maybe the foundation guys can say something about that? [1] - https://www.raspberrypi.org/blog/introducing-power-over-ethernet-poe-hat/ > -- > Florian