Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp405664pxx; Mon, 26 Oct 2020 11:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwodbsUp3GKY3/dfPjfCL9TiQ5SLkxpWRU7URvdElDR8Rm+eLknTxMyF1x0DMWbGRraIbmt X-Received: by 2002:aa7:cd90:: with SMTP id x16mr16483849edv.302.1603735786821; Mon, 26 Oct 2020 11:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603735786; cv=none; d=google.com; s=arc-20160816; b=WhVCQ2JnwyHkpPzbbpoNkR7hrXs1nC4hS4KrJfG+9h7bONXzJbY2Pt2oTHlfdVUZkO sdwVnzaRRq3F0ZMqI94rYPxK7iImq5m0Jpu1wdnngN5gX2zZ5S/2eHRn3nB55paLJNef O+8538oqxHpCNKa3niRwhmdxfL+vYhKh6P3PQM4YBQ+cZZJSoRCva3JNRXVvcmK5GFaI wj05qtI5aOjeiiz2gdpJKi72qgYzpRWoVNM0uUC6/nO5FngL1OKWHvY6kyq69BG6PDdU 33GtiFQHEd6yt3mNSfYTaOgUUtZzu29/rKQ2nuXs7j1jKgjsXTbiMZbRkT7eWxVOTgMT 52oA== 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=buOSgYj8nesBJduFGburfbQ47xwt4bpG9JY6+8gKov4=; b=DgpC5qGE0mB3kJc+DSjeCh1AEKomJXPDTGYnS3tIhwD6bc57z1yY3teEzaPJvQ8qZ9 8Cfe11jwuybN8zS9QQjYxairgIw/2yFh7uAYj8tn99up50n7/5Z3rSeRjOzKzRdG+TjK h2xGGhgJPkItlKU/UEsu0sS7fJ9SaiHambaBO4UVjc1Q+MrxNO94hi+MtkrW3AyGJhKq Rg/MeEipVgSiArOvGY1UbTqSlru7IJKwJtqWYEAy8PniOSyOqlrIa4H0xGi7VEn2tquk e4b7wzmlu82Bk3vG/yf838Az2gJ87kI2upAJMvahO1yxZOx3533VdGaI7uDEbR7h0fWc qolw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@0x0f.com header.s=google header.b=iYn35eWa; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lf20si7688311ejb.332.2020.10.26.11.09.24; Mon, 26 Oct 2020 11:09:46 -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=@0x0f.com header.s=google header.b=iYn35eWa; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1783519AbgJZPQA (ORCPT + 99 others); Mon, 26 Oct 2020 11:16:00 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:36580 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1783522AbgJZPP6 (ORCPT ); Mon, 26 Oct 2020 11:15:58 -0400 Received: by mail-qk1-f194.google.com with SMTP id r7so8635999qkf.3 for ; Mon, 26 Oct 2020 08:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=0x0f.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=buOSgYj8nesBJduFGburfbQ47xwt4bpG9JY6+8gKov4=; b=iYn35eWa/XewaG2MxDAW6amkL78yH6RaWqiOQTAYYuFqpJstL0IazZysjd93a39Y60 BCv/crpm3lNlkyYlvFrts8btSTlJCkJQ1n2hiZ9ZPp7p4sxQG9cSQ8hOfKH3QHPYsJrm 2tEB1TEGjR2Zlgdl5lNZbjMCenXSZGLfcnoFc= 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=buOSgYj8nesBJduFGburfbQ47xwt4bpG9JY6+8gKov4=; b=IaoXQzkK7s/FHG+ckE/SSKw53FrPABkYtvuTN55GGuIT53BDSwH8DNQRsWjWI8uewa CQGMiy355V+z38yKZ0V3CrSFoJxLFL6JnAq0d1NzqC8HLP94h7hr1xJXW1veu8yf3tHY IhudwegegVaCssEQd5gCY4A3DYzWdTonPEepEqksa8+mWZQggFpybWgOTrfz+k2WMY66 nak4jMfdRMleQUOT6md6A3MHcuJxuvEds03lsG8k/6c5DflvlHzaCQQ4ADhHMpzm8p99 T6FII6w5+V72Cw8ks3/GlBO7nyVA7vXPx/rRBnWSeBWEg5DCIrNIxvf1B+Z15cfTV0R6 NWtA== X-Gm-Message-State: AOAM530ahDcJvu5X6CLNPsKgz8TAR7Ykr/nWR+HdphOVTUiqNrmw+Iu1 eF7H5Qw3UwMFegcsbaGWCGqvzqgcPkDfOmYGbT6Q/g== X-Received: by 2002:ae9:e807:: with SMTP id a7mr1269594qkg.443.1603725355881; Mon, 26 Oct 2020 08:15:55 -0700 (PDT) MIME-Version: 1.0 References: <20201019141008.871177-1-daniel@0x0f.com> <20201019141008.871177-2-daniel@0x0f.com> <20201026134604.GA43947@bogus> In-Reply-To: <20201026134604.GA43947@bogus> From: Daniel Palmer Date: Tue, 27 Oct 2020 00:15:45 +0900 Message-ID: Subject: Re: [PATCH v2 1/5] dt-bindings: gpio: Add a binding header for the MSC313 GPIO driver To: Rob Herring Cc: "open list:GPIO SUBSYSTEM" , DTML , Linux Kernel Mailing List , Linus Walleij Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On Mon, 26 Oct 2020 at 22:46, Rob Herring wrote: > > On Mon, Oct 19, 2020 at 11:10:04PM +0900, Daniel Palmer wrote: > > Header adds defines for the gpio number of each pin > > from the driver view. The gpio block seems to support 128 lines > > but what line is mapped to a physical pin depends on the chip. > > The driver itself uses the index of a pin's offset in an array > > of the possible offsets for a chip as the gpio number. > > > > The defines remove the need to work out that index to consume > > a pin in the device tree. > > I'd expect the DT to have 0-127 numbering... If you need to map that to > another number, then an array property in DT could handle that. > Thank you for the comments on this header and the binding description. Thinking about this again I'm thinking about having the GPIO numbers be 0-127 like you say but supplying the valid offsets for that specific chip and the pad/pin names to make visible to the user via an array/arrays that contains the pin register offsets and the pin names. Basically my per-chip table moves out of the driver and into the DT. Does that sound acceptable? The main thing I want to avoid is presenting the user with 128 gpios when the actually chip only has <10 of them wired up. Thanks, Daniel