Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1747405pxj; Sun, 9 May 2021 03:55:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSy3bs2HWXepyL72tQ2ZMLw/RtXu7ep+fBvXTJqQ4+3dFe9TK4RjXuY3iTiQNaBjKvnPtg X-Received: by 2002:a02:90cd:: with SMTP id c13mr16738469jag.18.1620557737990; Sun, 09 May 2021 03:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620557737; cv=none; d=google.com; s=arc-20160816; b=nTXNKGBQcLJoV9u1Qq4KdvFNqRGm96zOfqBX9fcKa+2nS+JCpz8HmfbMfvPqkvJGm+ YLzdJYbMY6ybqrYIYrG3ldaO+fELbwzfa/ZroOrw7hj+ruzE7MgtR43tprGGSuQOJPE7 E31JtCnyWmuykyJwJ4hwWK7G8EKBDVQUq0e8Ac248rr4GCSZ2thif5mG6qk4fqNmHjm+ 3SibGqckSdAmS54U2wbib/OJt1JBi+leqSskhyH39e489CkF2JCMb4gT6m9LF4USwl42 xwVPI8m8HXp2Aw5/qWM0ud7mW896pa7BOa87jtbw8jLFEIZkkQLX0rqtijLbylYevucs Rlow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mQafJtBEfmRTcgozALwkE9M1nF4kym6hXG0iG0sUNgY=; b=J6vayNJFdmboH5VhHIj0A0pa04ZHAE9IhG9YPPNSMZknd9f78K2KYQnd/Mi9xGv6DW J1uSnwe1+8BoLA9oQ9ma94uwFw+rF7965W8OhqOicqprjrxDNepHUDD+5jeYQ0m+3RZ5 1kyvRDOnT1+lbTgROe4T4Ts4bqe+tNVuZqA/i4QkUho8sRhVYIKqbcILZrmd7niSwrbA DSNyofM9iq01oWK7IqQsM3Xw2+FvoBMl1MbHFJ3eXxsRNs3+Bajf4GEWR+LIvATZEMSg 52ch7eqI5XHPEuXZ56aWEFspNGClM8kdGjym8zA3FOJ9xS2q+PxQiXEqbtqZDn5+hrXK io+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W2SlqBum; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si11816266jaq.84.2021.05.09.03.55.03; Sun, 09 May 2021 03:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W2SlqBum; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229616AbhEIKuu (ORCPT + 99 others); Sun, 9 May 2021 06:50:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbhEIKuu (ORCPT ); Sun, 9 May 2021 06:50:50 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8066C06175F for ; Sun, 9 May 2021 03:49:46 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id c15so2675974ljr.7 for ; Sun, 09 May 2021 03:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mQafJtBEfmRTcgozALwkE9M1nF4kym6hXG0iG0sUNgY=; b=W2SlqBumDyfZmBDebluEBm0aD61vrqdgA+9lfx0m+eDN2ySYr4WoOetQRyABotFRmV ukH8eRgS+44+3xw1sWPdQxS045PpSc74KRsKhyLCwb1Y0nbmZsdvzLEKp/GSwLWNn1Ce Q9WlXY56TT/vi/Qh8or36sgc9agzph6RuzoFWWTrIyxmplxTmPJZh5zMvMymB0CHNMwQ sSZPi07BLZwtndKImXPv6nWBacfC+9wvWKIuHF/IHgL2PujYQGvJRpMR2o7xT/yHx9So et4j0uw2pJveVSzAN2k3dHlFFDwv+/tbUm228lL1gRyoRM52utJ5soaXK1LQqdtR97ws PzqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mQafJtBEfmRTcgozALwkE9M1nF4kym6hXG0iG0sUNgY=; b=TdCSvcCU6d09MHLVG+2VcFnTVTi5gFnvLxZy886w4YxShPC+if0ddOg294sLY7LKP5 AaAQE14cvSRpamN5/QFzuQe4qp8OLS3nhc79p+nyEhHRCYpiGjY7ZVwkT1yV0N0VwI9r YGlEAvuSC8HlQJ5CkmxAtiAWB/UPphLpRVNUlZAonAT315SAuE0hqeM5l6VyjrV5VtgB sBnwIFX45twVyzJ9xhkU6kJENzA81VTsDhfSb536PV98ZNQkMLOPNoGglVqXpUS1/hsB eehNnNaBLDkR5vv8ll4Tk0kpE7XnJra3WddckInqJHCGWYOoJoDNq+9o4UNUkohKJ7ih W1Mg== X-Gm-Message-State: AOAM531398wsXf9XujLpGbrmPCU2Fi3uMm6lOBKpnqxZx7pgUobq/piJ MsmYaxnAbKrmQmupTPuyKPIYZtIWi2XIxpkoVMePBQ== X-Received: by 2002:a2e:889a:: with SMTP id k26mr15716886lji.438.1620557385112; Sun, 09 May 2021 03:49:45 -0700 (PDT) MIME-Version: 1.0 References: <20210508142000.85116-1-kettenis@openbsd.org> <20210508142000.85116-2-kettenis@openbsd.org> In-Reply-To: From: Linus Walleij Date: Sun, 9 May 2021 12:49:33 +0200 Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: pinctrl: Add DT bindings for apple,pinctrl To: Mark Kettenis Cc: kettenis@openbsd.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Hector Martin , Rob Herring , Linux ARM , "open list:GPIO SUBSYSTEM" , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, I think we settle with this scheme you choose, so the following is just some hints for the future. On Sun, May 9, 2021 at 11:46 AM Mark Kettenis wrote: > Right. So far it seems we don't need to set the electrical config on > any of the pins and I don't think we've identified any bits in the > register that change the electrical configuration. Although there are > some hints in the Apple device tree that there are pins that need some > additional configuration. But I also see some evidence that the Apple > firmware on these devices already sets up most of the pins for us. This is something I think you want to look closer at soon. It will *probably* be necessary to obtain optimal power management for the devices, but I am not sure. What operating systems (especially Android devices under Linux) tend to do is to reconfigure pins at runtime in order to conserve power. When the device goes to deep sleep just waiting for an external interrupt (such as opening the lid on a laptop or pressing the power button on a phone) the OS tend to reconfigure the pins into a low power state for the duration of the sleep. A typical example is to set a bunch of lines as "floating" (tristate) in pin control terminology "bias-high-impedance". In some cases pins may be connected to ground depending on use case, but in each case this is done to avoid leak currents when sleeping. I don't know how noticeable impact this will have on standby times, but the lower micron silicon technology, the bigger the impact. If possible I'd recommend that you try to intercept what MacOS is doing with these registers when the system goes in/out of sleep mode. I think it could be key to some power savings you would otherwise miss. These two modes are standardized in pin control terms as "default" and "sleep" and each affected device driver need to actively put the pin control state to "sleep" when the device is going to sleep, so the philosophy is entirely distributed, in difference from some more sledgehammer-type OS approaches where the OS is just slamming a number of values into the pin registers at sleep (suspend) time. The upside to doing this fine-grained and per device is that the sleep modes can in best case be used at runtime to e.g. save power on an unused USB port that isn't plugged to anything (I don't know if this is a good example). In Linux we have the runtime PM concept to deal with this and there are some drivers actively saving power in this way. Yours, Linus Walleij