Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp888470pxk; Sat, 12 Sep 2020 03:52:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtGC+cM3g87HuJQqWANyvWHaKJslbFH5ujI6NFiOGfXk6jQlPJFUzq45Rvp/VYOrqhV43E X-Received: by 2002:a17:906:fa01:: with SMTP id lo1mr5793050ejb.394.1599907930060; Sat, 12 Sep 2020 03:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599907930; cv=none; d=google.com; s=arc-20160816; b=qH6lz+f+oJwrrY7Uoln07VgRbUTcwebLGhFLah0K5jKRUxz8vkoSXQlg8nAMn9BTFc DvUX4VKy+D+pZlN7RhTvbBxPLBeiaelgJMgQfYK4q4Ir4zREE9OpS/CgdZgyMaLftZCW q1PpqkNzfSBL8oAO+JP3a2pYbjMsO4rsw5xQ8tujQvoKO9ufItMBiC9vs03F+XgX/AHw ZE6FGMrkK+g002gj6hULGWVA3tG4wuAj/NPoQgOgNvzKFW36q5jLSIoDb5K2AP5ejsy7 f63K1HFiGZhT4Y772OuDSLaH72pAC6NJV2qIDhcd7FWeyZ2qOCBCU9Yb8XXpV+juPHSi B44Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Wg0fr0Xi3XkN+YWO9v5UT+RzHkdd/M+Kasz4B3DfYQg=; b=Q3kdv8JPGpJnY01mST8YiUVawDePO4Hnn5onzo1+VvjTG1tdMbGL3qcURw6IxRtHjk lQ01zPN7cVsCvovzolsRCjWmIkoGYYKVlPvh6oJaUlbNRracj03qge7CSicSel33S7UC uMX82EQAGlWP20lyDaaSNqYQh04zYmBdBcJE6kA2myYqILnpXUluK8dRMF0Hq2nMOZiR LQfQNBdolQl1jdiKexzzseDMkPZLVetQsLSAqAu4ozrdj2j57yeWVwThBMRHwWCEKCXD ZOLR+NnA9d6O9/M2Ngx/LkHV7eInjgJjP/nP8vRUYrkj/JwKV6AKpkxGj/dd20GOk+4m c3ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zR0tBZ2M; 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 nz19si2795217ejb.516.2020.09.12.03.51.47; Sat, 12 Sep 2020 03:52:10 -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=zR0tBZ2M; 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 S1725875AbgILKvB (ORCPT + 99 others); Sat, 12 Sep 2020 06:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbgILKux (ORCPT ); Sat, 12 Sep 2020 06:50:53 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E6FEC061573 for ; Sat, 12 Sep 2020 03:50:52 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id u4so14544476ljd.10 for ; Sat, 12 Sep 2020 03:50:52 -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=Wg0fr0Xi3XkN+YWO9v5UT+RzHkdd/M+Kasz4B3DfYQg=; b=zR0tBZ2My4K92cIteSx5alzLJ32K3bYdevLiA8UGJqStIU+KJq9DJfMtO7LDzh/ZkT 2GLXtXQ1lZb+XkYiG69fIvar6Zzkh0EvJfTth6FZ2xAlGtnkmuxQJ39TsWv6N6JHWKmi wMP7qd8M8G+OePycMmPeFZTk8FpMKH9hYkKkGwTIzh1YIH6o5u9fGNfwnpmF+vYbdZFM B6ZYHe9Qq594ZZoBNaokzOhVqvZGfMbR++p8BaJ1m5Jy49KRL+qoPVGgkvlSjaVgeqqW xNMqh3/2zGfmRTvbU+YZVtGYdWxlwaxJefH1x53q6B97BBUbtI9rzOcdichmwdlmrwuF 2cQA== 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=Wg0fr0Xi3XkN+YWO9v5UT+RzHkdd/M+Kasz4B3DfYQg=; b=OxvkYG5bVGlabJj0xrNFiNy/FpGo0DzJn0rUnTYUaDOSFZGqzTxiVSkJ6spziZ+E/S Y6UizEk5JxF8K3fef35efCqf8M5s0munsyMPPCPIcZrTvD68M8cqpi4ftTX3mOhev8Yh +cnRkCeniBiAC8YiYuiKfJARoZI342SPvU12YQ153MIhSoMy7BAZGRpdEXyw+ZrGVqWG xglmTXgqsSlldIZwH92P2Xq8am3f41yIXBThGtEioeWdg4SKiPGL5y0++25BXITOh8a6 A3C/V2aAED7dXF5tkQKKtnWz7LG/u/cddPgKDAhOMXFrA4v6JL98Mk7LvUyFI4HbAvpQ YF3A== X-Gm-Message-State: AOAM5319nFb76+J8WD1HkJTMNPxTIkArdDbG7SScKhRqS/ZSZRE0EbLh YLl0DbjazgMNko1onttfFENOZo/2EDAqZmd4wooa7g== X-Received: by 2002:a05:651c:28c:: with SMTP id b12mr2286938ljo.293.1599907851023; Sat, 12 Sep 2020 03:50:51 -0700 (PDT) MIME-Version: 1.0 References: <20200903133528.8595-1-lars.povlsen@microchip.com> <20200903133528.8595-2-lars.povlsen@microchip.com> In-Reply-To: <20200903133528.8595-2-lars.povlsen@microchip.com> From: Linus Walleij Date: Sat, 12 Sep 2020 12:50:40 +0200 Message-ID: Subject: Re: [PATCH v2 1/3] dt-bindings: pinctrl: Add bindings for pinctrl-mchp-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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lars, thanks for your patch! On Thu, Sep 3, 2020 at 3:35 PM Lars Povlsen wrote: > This adds DT bindings for the Microsemi/Microchip SGPIO controller, What I do not understand is why this GPIO controller is placed in the bindings of the pin controllers? Do you plan to add pin control properties to the bindings in the future? > +description: | > + By using a serial interface, the SIO controller significantly extend > + the number of available GPIOs with a minimum number of additional > + pins on the device. The primary purpose of the SIO controllers is to > + connect control signals from SFP modules and to act as an LED > + controller. This doesn't sound like it will ever be pin control? > + gpio-controller: true > + > + '#gpio-cells': > + description: GPIO consumers must specify four arguments, first the > + port number, then the bit number, then a input/output flag and > + finally the GPIO flags (from include/dt-bindings/gpio/gpio.h). > + The dt-bindings/gpio/mchp-sgpio.h file define manifest constants > + PIN_INPUT and PIN_OUTPUT. > + const: 4 I do not follow this new third input/output flag at all. - If it is a property of the hardware, it is something the driver should handle by determining which hardware it is from the compatible string. - If it is a configuration it should be turned into something that is generic and useful for *all* GPIO controllers. If it is pin config it should use the pinconf bindings rather than shortcuts like this, but I think it is something the driver can do as an effect of the pin being requested as input or output in the operating system, depending on who the consumer is. Linux for example has GPIOD_OUT_LOW, GPIOD_OUT_HIGH, GPIOD_IN, GPIOD_ASIS... - Is it not just a hog? We have bindings for those. > + microchip,sgpio-port-ranges: > + description: This is a sequence of tuples, defining intervals of > + enabled ports in the serial input stream. The enabled ports must > + match the hardware configuration in order for signals to be > + properly written/read to/from the controller holding > + registers. Being tuples, then number of arguments must be > + even. The tuples mast be ordered (low, high) and are > + inclusive. Arguments must be between 0 and 31. > + $ref: /schemas/types.yaml#/definitions/uint32-array > + minItems: 2 > + maxItems: 64 And you are *absolutely sure* that you can't just figure this out from the compatible string? Or add a few compatible strings for the existing variants? > + microchip,sgpio-frequency: > + description: The sgpio controller frequency (Hz). This dictates > + the serial bitstream speed, which again affects the latency in > + getting control signals back and forth between external shift > + registers. The speed must be no larger than half the system > + clock, and larger than zero. > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 1 > + default: 12500000 I understand why you need this binding now, OK. > +/* mchp-sgpio specific pin type defines */ > +#undef PIN_OUTPUT > +#undef PIN_INPUT > +#define PIN_OUTPUT 0 > +#define PIN_INPUT 1 I'm not a fan of this. It seems like something that should be set in response to the gpiochip callbacks .direction_input and .direction_output callbacks. Yours, Linus Walleij