Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2999926pxa; Tue, 25 Aug 2020 08:48:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1Pu0cRPtXPUdvonI4Va3ManOPNWmwLbJ/rWsJvTPcp0PKPCalCMy56wZCppLAxDjBQ65G X-Received: by 2002:a17:907:4277:: with SMTP id nq7mr11748403ejb.324.1598370506415; Tue, 25 Aug 2020 08:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598370506; cv=none; d=google.com; s=arc-20160816; b=LyskYu17LpWeNatzIJ6c5ZUTFCQlBqPnmaeCBsAL27YobJwCVb38wEtRdapTT1rl17 6NoBCr8OsqdUWsJH4KUUnSxrkImdJzCHi14y8CwPd0FdRNOAJiXjUrE7isKunklbH7oK 4d5tIXw5ySXZQ8Jc8O2EoYaddWx6WnQZ9bvuwLI+QJL74Z4cfcvkd//OZ+INFHeV5HoE EOYIEIUOhE7+PbeN8GZqdUt34dvKqLYe/PsHDCOEmI95dDf0B6OKdn3m57DE/vV+BEFx 2bpABpmssg9X+qT0CAtK+k540q2ftHmI1rXezgKx2a/rnD9spKoGb8OsPplpDgR7dkFj h4cw== 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=mYYDrtaHdE+5IdG9zBH+700DoXTnmmyQyxR5lkfvrfc=; b=zmSnoF9KhBwtIN8D+1WKfga2ClDJmGJzN/v3LZEb+6EGlfeVNPz3mnxXjkWV3jlmXk wxkge99B/Sc6UsNbcYIXtEZ+B/riqH8WnJyewpNoJU5LJeALdtRcZnXPWZZ/ZyNUQ8aV sdrmsU2rsjRBjkKqTvMJ5sLqusCk6o1DbRF04mRzaHoUHzZ56wZ4xo88P0ynKrgfRKZl cXuOY4bxkG8t+dF1gbSMEa7a4BHeFg2XY5DroEX0ex7uNd90O8NAORezWX/eld9RQcPD qMqTw+Q00p05XBEJYqL7yxq5ZUqid1b5sihClNa1uf8U2U+IKwkh4Gqj3PqG2XuEzEVF c+kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m3lGya4c; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t24si4190314edy.243.2020.08.25.08.48.03; Tue, 25 Aug 2020 08:48:26 -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=@kernel.org header.s=default header.b=m3lGya4c; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727020AbgHYPqk (ORCPT + 99 others); Tue, 25 Aug 2020 11:46:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:59658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbgHYPqV (ORCPT ); Tue, 25 Aug 2020 11:46:21 -0400 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 925F92076C; Tue, 25 Aug 2020 15:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598370380; bh=2igqG3uEPzuUzdqIXSzponq3YT5GudO3Gm4HYkcRAIM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=m3lGya4cWZj7kD5PKWQK7urXVreNHeORDEhN7lv7Geec1Kv/7wlFgq/SCoT086bXM fx29PdOnOXfRVPH0QWFqjiIe76/4Z9Cka4rCUQ1nW15ORTHT5yGWPc3E54EPu6NSS+ 2yKnOjF0EpCcJDaJHVG18RlyrZEYzoPGtZ4n5oL0= Received: by mail-oi1-f178.google.com with SMTP id v13so11991529oiv.13; Tue, 25 Aug 2020 08:46:20 -0700 (PDT) X-Gm-Message-State: AOAM531g7X+Q1evM2iQM4Mo1DeKuXW1WhMQRxRUxeMvJEmqfW63wtFkF DlDDIPzNZjaiLDv62TOE8VtphP5IoVkST/IHLQ== X-Received: by 2002:aca:90a:: with SMTP id 10mr1406037oij.106.1598370379890; Tue, 25 Aug 2020 08:46:19 -0700 (PDT) MIME-Version: 1.0 References: <20200812202018.49046-1-alcooperx@gmail.com> <20200812202018.49046-2-alcooperx@gmail.com> <20200824233040.GA3532378@bogus> In-Reply-To: From: Rob Herring Date: Tue, 25 Aug 2020 09:46:08 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/3] dt-bindings: Add support for Broadcom USB pin map driver To: Alan Cooper , Linus Walleij Cc: ": Linux Kernel Mailing List" , BCM Kernel Feedback , DTML , Florian Fainelli , Greg Kroah-Hartman , "moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE" , USB list 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 +Linus W On Tue, Aug 25, 2020 at 6:26 AM Alan Cooper wrote: > > On Mon, Aug 24, 2020 at 7:30 PM Rob Herring wrote: > > > > On Wed, Aug 12, 2020 at 04:20:16PM -0400, Al Cooper wrote: > > > Add DT bindings for the Broadcom USB pin map driver. This driver allows > > > some USB input and output signals to be mapped to any GPIO instead > > > of the normal dedicated pins to/from the XHCI controller. > > > > Is this a driver or h/w block because bindings are for h/w blocks? > > This is a hardware block. I'll remove "driver" from the description. Another question, this kind of looks like a pin mux controller. Is that not a fit for this? If not, why? > > > Signed-off-by: Al Cooper > > > --- > > > .../bindings/usb/brcm,usb-pinmap.yaml | 63 +++++++++++++++++++ > > > 1 file changed, 63 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml b/Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml > > > new file mode 100644 > > > index 000000000000..19cf6ad36373 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/usb/brcm,usb-pinmap.yaml > > > @@ -0,0 +1,63 @@ > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/usb/brcm,usb-pinmap.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Broadcom USB pin map Controller Device Tree Bindings > > > + > > > +maintainers: > > > + - Al Cooper > > > + > > > +properties: > > > + compatible: > > > + items: > > > + - const: brcm,usb-pinmap > > > > 2 space indentation please. > > Fixed. > > > > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + interrupts: > > > + maxItems: 1 > > > + description: Must be defined if any out-gpios are specified. > > > > 'dependencies' can express this in schema. > > Okay. > > > > > > + > > > + in-gpios: > > > + description: Array of one or more GPIO pins used for input signals. > > > > You need to define how many GPIOs are valid. > > I tried to avoid doing this because there is a possibility that future > chips will have a few more signals added and the driver was written so > new signals can be added entirely in device tree without any changes > to the driver. If this is unacceptable, I can add the current max in > and out valid gpios. A 'should be enough for a while' value is fine. The driver doesn't have to have a max. I'd expect the binding to be updated for new SoCs anyways. > > > > > + > > > + in-names: > > > + description: Array of input signal names, one per gpio in in-gpios. > > > > No, this isn't how we name GPIOs. The part before '-gpios' is how. > > This is the meant to be a description of how each gpio is being used > to help with error messages in the driver. > What if I use "brcmstb,in-functions" instead? 'brcmstb' is not a vendor. But brcm,in-functions is fine. > > > + > > > + in-masks: > > > + description: Array of enable and mask pairs, one per gpio in-gpios. > > > > Needs a vendor prefix. > > I'll change it to "brcmstb,in-masks" > > > > > > + > > > + out-gpios: > > > + description: Array of one or more GPIO pins used for output signals. > > > + > > > + out-names: > > > + description: Array of output signal names, one per gpio in out-gpios. > > > + > > > + out-masks: > > > + description: Array of enable, value, changed and clear masks, one > > > + per gpio in out-gpios. > > > + > > > +required: > > > + - compatible > > > + - reg > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + usb_pinmap: usb-pinmap@22000d0 { > > > + compatible = "brcm,usb-pinmap"; > > > + reg = <0x22000d0 0x4>; > > > + in-gpios = <&gpio 18 0>, <&gpio 19 0>; > > > + in-names = "VBUS", "PWRFLT"; > > > + in-masks = <0x8000 0x40000 0x10000 0x80000>; > > > + out-gpios = <&gpio 20 0>; > > > + out-names = "PWRON"; > > > + out-masks = <0x20000 0x800000 0x400000 0x200000>; > > > + interrupts = <0x0 0xb2 0x4>; > > > + }; > > > + > > > +... > > > -- > > > 2.17.1 > > >