Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4898358pxu; Tue, 13 Oct 2020 09:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1/EGPbIiJIW5kPsfVwVSmUyU5WQcqN5tOsZbsWMhdZp4Pa7xMPw4ixq3xSnubssXzYQ3J X-Received: by 2002:a50:cbc7:: with SMTP id l7mr445251edi.148.1602607082677; Tue, 13 Oct 2020 09:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602607082; cv=none; d=google.com; s=arc-20160816; b=GNRr89hNn3BBbb9B/U3h83ppoZLz+rzDp6UuR2mq9pTb0+5DboIAEXZaEKu2a4OFIv YuxPgCsBuGWoXrgAICjaexe04FENiUTKEGBdChHHCr4qQ+RVluVJmkpyXh6UKx7UGQ7g gcJ5z72GPuq4PdE4USLNSVoLJicXXv2sG0GE2KZbY7wf8+pd4FFC2yJULezpSx8+iKcM u8XrsVoSPIjgvhwDMLoinKVww3Rd7cwpyoAJMAkbnIxYCcvF+wOF1+v4TCla29nAyuw9 93oY/7xUfJENvjsnU/Hs+ceXH2W52fJ4iw4NxCdeAAbTchULPRqaxdRKC2BDE7vp8b4e yong== 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=b/c3jOqm5GCWbl7ngdOAvWeLYoFEl8oppVa37BrtTx0=; b=OoYDOjLPlr+nKTC0RiHaX2fFkHCYGy9b/vkHIqua6MePzqQezCG041HG+gJ4Rrxa5S aKyH093EU1Oa/ADHxh4HZeqQAxgpLrkMU1JIErHws9pH0QhjUj0iVJ5LMIsmJIT5nvBp 2g6X3AAdf7NsLGuDe4a2ILGoAvohI+Q+KA2JbIjv9/PRQqe1+5bpdYHfwOSjjyglL43R r3aHIVYl0Kf7lhNhKAN9jJirhiAlH/qAqldYNULtSWNgQv7EgtKCh63CGNmOuFStHjHD w1UobqtHRb3ijDI10e0c4C42wGJxQYv3zapNcgY/EfttL+Ye4glS502Jn2rPHrT0HYfB WtyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tJis7yua; 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 a4si135955eds.296.2020.10.13.09.37.40; Tue, 13 Oct 2020 09:38:02 -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=tJis7yua; 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 S1728233AbgJMNgn (ORCPT + 99 others); Tue, 13 Oct 2020 09:36:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727245AbgJMNgn (ORCPT ); Tue, 13 Oct 2020 09:36:43 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFE77C0613D2 for ; Tue, 13 Oct 2020 06:36:42 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id m16so20478978ljo.6 for ; Tue, 13 Oct 2020 06:36:42 -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=b/c3jOqm5GCWbl7ngdOAvWeLYoFEl8oppVa37BrtTx0=; b=tJis7yuaN1JSHsLBZLaRMxnuI3b1R3TPtaiy5wihu/GdcUvEXrgzbpveMQDkzE5tlj cbUwn/PXVvgt46YQEHILU5xNbbAhvatw8Ffn0m317aofqzuylkUQ0MlQ1hYQ1ennXije U9YeIYcSUcjRbpr0clUWhuA/RGEXkWwvBWaCZxXx/ZpKv4MKx4CWJo8Y0Qialmv9jI2i 6og/C+zO9w74Fi9vW0fgzzzf8y1XrkR8U3kVMisYcUo4S19yJmlzBps7EykhqsY2u8SQ XZDko51TwNb8aVNexQeiHg1qyJjlu8r0hsXvbyb7K+ywzcuMjaEa0yh5+bzQK4yIwf3C Rvvw== 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=b/c3jOqm5GCWbl7ngdOAvWeLYoFEl8oppVa37BrtTx0=; b=Y0Re9eCyjIQ6QCBD1kv2NsnvOOjEY4GknQ+z9hGyvzrronPNJpFqRSm95RoAzmxHAu 4x/RH15hBn+fO5Nvd/gc6eAVs++1ix7/lJpqk78XhzQ/nGCHNv9cevVDfCMnH+RuOUJq Htqf/lBv9Lz7cyFPYcRz0OdYz/i0hSTT5hN8emPEewGqOAs5UtRNXwg9Zghj+H3NuV0X eNkwHWXXnWhysvpww54yx83d6/4gnfofA76PWP8nfaq/IdDRrdgbbv96NtesAauhUBKK 1s3ShlvxiyHhOIsb+akx4t+brOjtlXfHXD4pY0S0ILYdAMYyBma5SyjKylhJUj+tIyqJ WWYw== X-Gm-Message-State: AOAM5307q7h+v0ntSYmYkD4/KDYRlh4Dlak1gGNv4Fr6SXJFFJNVvEXq sYtuaV/bTUB8ri0ODyvZE5Y3KPNNVlLcqIr5saikaw== X-Received: by 2002:a2e:86d4:: with SMTP id n20mr1183020ljj.293.1602596201115; Tue, 13 Oct 2020 06:36:41 -0700 (PDT) MIME-Version: 1.0 References: <20201008130515.2385825-1-lars.povlsen@microchip.com> <20201008130515.2385825-2-lars.povlsen@microchip.com> <87d01ryb04.fsf@soft-dev15.microsemi.net> In-Reply-To: <87d01ryb04.fsf@soft-dev15.microsemi.net> From: Linus Walleij Date: Tue, 13 Oct 2020 15:36:30 +0200 Message-ID: Subject: Re: [PATCH v5 1/3] dt-bindings: pinctrl: Add bindings for pinctrl-microchip-sgpio driver To: Lars Povlsen Cc: Rob Herring , Microchip Linux Driver Support , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:GPIO SUBSYSTEM" , Linux ARM , "linux-kernel@vger.kernel.org" , Alexandre Belloni Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 9, 2020 at 12:00 PM Lars Povlsen wrote: > > So here reg = 0 and the out port has reg 1. Isn't that what you also put > > in the second cell of the GPIO phandle? Then why? The driver > > can very well just parse its own reg property and fill that in. > > NO! The second cell is the second dimension - NOT the direction. As I > wrote previously, the direction is now inherent from the handle, ie. the > "reg" value of the handle. OK I get it ... I think :) > The hardware describe a "port" and a "bit index" addressing, where the > second cell in > > gpios = <&sgpio_in2 11 0 GPIO_OUT_LOW>; > > is the "bit index" - not the "reg" from the phandle. As long as the bindings specify exactly what is meant by bit index and the tupe (port, bit_index) is what uniquely addresses a certain GPIO line then it is fine I suppose. > In the example above, note > > ngpios = <96>; > > As the "port" is [0; 31], this defines "bit index" to be [0; 2], so the > (input) GPIO cells will be: > > p0b0, p0b1, p0b2 > ... > p31b0, p31b1, p31b2 > > being identical to > > <&sgpio_inX 0 0 GPIO_OUT_LOW> > <&sgpio_inX 0 1 GPIO_OUT_LOW> > <&sgpio_inX 0 2 GPIO_OUT_LOW> > ... > <&sgpio_inX 31 0 GPIO_OUT_LOW> > <&sgpio_inX 31 1 GPIO_OUT_LOW> > <&sgpio_inX 31 2 GPIO_OUT_LOW> > > ('X' being the SGPIO controller instance). So 32 possible ports with 3 possible bit indexes on each? This constraint should go into the bindings as well so it becomes impossible to put in illegal port numbers or bit indices. (Use the YAML min/max constraints, I suppose?) > So no, there *really* is a need for a 3-cell GPIO specifier (or whatever > its called). If that is the natural way to address the hardware lines and what is used in the documentation then it's fine, it's just so unorthodox that I have to push back on it a bit you know. Yours, Linus Walleij