Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1231804pxa; Fri, 28 Aug 2020 07:21:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4pASW21O7IgRgnodVGYkp+UJaKJkb/l+UlOIOmchnbhUfpsVoaKaU12H8brzQh94qynQI X-Received: by 2002:a50:b046:: with SMTP id i64mr2205040edd.9.1598624461614; Fri, 28 Aug 2020 07:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598624461; cv=none; d=google.com; s=arc-20160816; b=HZsRke4Zlxp+WR32qa58qis4OcRs5qmGWPVJ50yBSzB/reA9kVgpeSFiT8FWHip/rK ZWMM53VKv9ypxvC93rnk2PpaJtV2IQ1Cgv4H/0Nz0UmOAOR/QBqBjjKQatm5dGtq/+Py Cl3OV6+cf2OYVg1xorUGPqA3x08dNpK7CuPu93At911rcjphYWLQJ3IwmlJWGOwSWpWT n+Bpph/7KsjmlmY62k20lzu5A2ilOQr4b1q6IMx/khGqVJ9YJE9zMAlBBI034kCaPrwx 20iwk2wj4eOUjvXtODemMAZrowMatcxss2HOsStJ8nuAnu/RfHLAawVsyI74kZp8SkO+ CbbQ== 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; bh=lBq+rTLiIUXKTOPJ3t+Pb18logS9N5SHMSukF4dmdzo=; b=0ZB13U0Fwkjuumx660ArRBG9ne3JY5obAbZfKh8x5hXmkFwoFSo5WqPjD59EK/MEOp gJP12DJ3FJNE0bRZtkNlTJvPtBX7/gYV122BbYMRLPH3ZMfLgBEikkk0D/I5ogobSi1P M7dE8AaDx6liK8En/mPxgbI1vl1j2lSz8h+VCSGSByFroH8sSnIGjcWuEH5ewBt43RvD 1d0DH3HhE1k11DgcIxmoF9JX2AZ5NgFgBZ/6POQQwJqsD9NHTU1ReL04fLT9GrnaOQ44 PATcMBuiAwhBkspcVcFDaT4nHiTy+/5qpppoPt/9r5PxoNkWGcIOnHhHmu7SQp/sNdTw teig== ARC-Authentication-Results: i=1; mx.google.com; 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 za11si684423ejb.367.2020.08.28.07.20.39; Fri, 28 Aug 2020 07:21:01 -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; 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 S1726614AbgH1OS0 (ORCPT + 99 others); Fri, 28 Aug 2020 10:18:26 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:35862 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgH1OSV (ORCPT ); Fri, 28 Aug 2020 10:18:21 -0400 Received: by mail-oi1-f193.google.com with SMTP id b9so928413oiy.3; Fri, 28 Aug 2020 07:18:20 -0700 (PDT) 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=lBq+rTLiIUXKTOPJ3t+Pb18logS9N5SHMSukF4dmdzo=; b=Suof/KMb7s0f3S7I2G8CtJqW8DY6+YS/sCimDdaZKdKStLneHAfzDAPpKWpLQk7CN9 H0Pb5ZqKZ9zRMDeSP+tjI+k3NGh/9QhUAd1lhdVeqU/MaZ/S8nXp4DI9cZ7HSMqds3dt Yb/j8ofw88GowRQmQGbdTUwK+Swn/gxsdhM2v/WhHHAkb1TrqQjjx8e7lQJxCJYjcHEI DmcKIqWL9SgOuylaGMNENFqg3ZWTfU9YF5bhArXB8Ko3oaoi3tmq2hs2W6z6hioyEuwM SNU5bsS4OF/bhM/9IQHAzl4L+/GwC6A4qkYxEBkFYblGfMsOvR6fawrv3HdbaDkKwYwq NaSg== X-Gm-Message-State: AOAM5337hXSFvLZKqyCmb6GWj65vr9KE9YSKvnV3sWUh/2a7M3ZjiZMy gYM4RhI4j21h38ZnBWTrfpe2EAxK374l5KzVR7I= X-Received: by 2002:a05:6808:575:: with SMTP id j21mr1096847oig.54.1598624300147; Fri, 28 Aug 2020 07:18:20 -0700 (PDT) MIME-Version: 1.0 References: <20200812202018.49046-1-alcooperx@gmail.com> <20200812202018.49046-2-alcooperx@gmail.com> In-Reply-To: From: Geert Uytterhoeven Date: Fri, 28 Aug 2020 16:18:09 +0200 Message-ID: Subject: Re: [PATCH 1/3] dt-bindings: Add support for Broadcom USB pin map driver To: Linus Walleij Cc: Al Cooper , "linux-kernel@vger.kernel.org" , bcm-kernel-feedback-list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Florian Fainelli , Greg Kroah-Hartman , Linux ARM , linux-usb , Rob Herring 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 Linus et al, On Fri, Aug 28, 2020 at 4:00 PM Linus Walleij wrote: > On Wed, Aug 12, 2020 at 10:20 PM 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. > > > > Signed-off-by: Al Cooper > (...) > > +title: Broadcom USB pin map Controller Device Tree Bindings > > + > > +maintainers: > > + - Al Cooper > > + > > +properties: > > + compatible: > > + items: > > + - const: brcm,usb-pinmap > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + description: Must be defined if any out-gpios are specified. > > + > > + in-gpios: > > + description: Array of one or more GPIO pins used for input signals. > > + > > + in-names: > > + description: Array of input signal names, one per gpio in in-gpios. > > + > > + in-masks: > > + description: Array of enable and mask pairs, one per gpio in-gpios. > > + > > + 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>; > > + }; > > Wow look at that. > > This looks very much like Geert's just invented GPIO aggregator. > But in hardware! > > See: > drivers/gpio/gpio-aggregator.c > > I think Geert is intending to add bindings to the aggregator, and > while I do think this should be its own driver (in drivers/usb) these > bindings and whatever Geert want to use for the aggregator > should certainly be the same. I don't intend to add any DT bindings to the GPIO Aggregator, as it's meant to be an "abstract base" driver. Actual hardware blocks for which the GPIO Aggregator could be a suitable driver should have their own DT bindings, and their compatible values added to the GPIO Aggregator driver's match table. Anyway, DT bindings would just be a compatible value, and a gpios property. > Geert what do you think? This USB pin map driver seems to map GPIO pins to USB pins, not other GPIO pins, so to me it looks like something different than the GPIO Aggregator: a hardware mux instead of a software mux. BTW, at least on most Renesas SoCs, you can usually mux output functions to multiple pins at the same time, which could be considered mirroring, too. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds