Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp465454pxu; Tue, 5 Jan 2021 16:46:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxfR4oUnAg59SK+aQD20B+P6QNgtb6dzJsYGh+xZKMGG1hoPhkz4eVJ0PkEFhWxR9qziEc X-Received: by 2002:a17:906:168f:: with SMTP id s15mr1284552ejd.180.1609893974832; Tue, 05 Jan 2021 16:46:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609893974; cv=none; d=google.com; s=arc-20160816; b=bDppTEJgqTS4e4ackEPRmw04XXZm1mjiMEDslLCyb8xrN/+o8ITR9XlA/OwU+eDbDv aphjmr0KSzMM48kII9BEJr1+PtpXL14z8sN2mm2/B290FD3+9OtM+/SZUcpY1JfmH8Vk n8A7k7p1K+OYyS8Cj/VE+PK329WmS0Up/uLzWu/0gDwaZwwROKZfwWkw55ATNyGwgtiL obtmYIEtfMaOkb+Y3l6GGqzJZ4Yiifu01TCeDbbtCKMYMqcHw7yLs2oLf8bAL+MEssuk yndhIHGh2Pn3Sg/DOxPmi23PfVQ66Z3boMHg8+Br1W1F/od9H6IQBmDLoMRzT1GmXNFm zcIw== 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=T4sAiyArUy52pWcai1J+mIoA8s+FFE+f9MM1+ahYCSU=; b=0UGC3whOocTAs+rqKEEt1C/v5YdZzCLhe3qrUKN0yDeP/spYlZyXMcoQP3aIC4pz2q PstBFyExKvtG1T4xxWek0Kx9EP/b4vSqvzkpdetDcFwBOJRiXo1HzZWq8zcuMX6UwnKt cvC6T8m6zv26vetobV/VYp0bWWrkAW2JjSw+YufJaIIWOiJe8SyNhq+ka2/8HdTrSJeP Nais7qCZkRS53dqYwlgrnADc8VJTLMzjGf3H0PiNaw8EJ+Y43AbYbPWxx8fuM/nSiflD m1YCHmUGA8uEsNFvT9+qkKutHM5ePrK4qgP3oovJsC8QMc3AEveiEvVHhtQkzmFpEyJV f4Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gSstDj7k; 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 t20si337617edw.31.2021.01.05.16.45.51; Tue, 05 Jan 2021 16:46:14 -0800 (PST) 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=gSstDj7k; 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 S1729946AbhAEWZI (ORCPT + 99 others); Tue, 5 Jan 2021 17:25:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726306AbhAEWZI (ORCPT ); Tue, 5 Jan 2021 17:25:08 -0500 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05DDFC06179A for ; Tue, 5 Jan 2021 14:23:55 -0800 (PST) Received: by mail-lf1-x135.google.com with SMTP id 23so2113490lfg.10 for ; Tue, 05 Jan 2021 14:23:55 -0800 (PST) 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=T4sAiyArUy52pWcai1J+mIoA8s+FFE+f9MM1+ahYCSU=; b=gSstDj7kJ/OpDFDoqs1xPxaHEMvZpCbZScFn/j+wkKEi4397BOHzU/7uJJX7lav6Yp 9ujkJ1wuM6Kyj+DydTSui7f6ypRH4cbI8xcoUhuClYmgbFhcM2ODIzJO/ehvDuzYO8v4 5/eWwAW9lom4PDt7sp9cFxmXO3QlkfVhvgK5wsdxSMS0x1xyDoUbDMvp7UpAKoBv4MXQ p9AUri7MKrrGYZI45OByNHyEzeh0imrWTVYiXc2E/Z2MrvVJJPS1ByEHNFqG1T1wJ6Ur oUQBGk6HWzotNKjBzWK6ItnX0fnM5EL6LLGFhk4+uf2Ehuf+d8Ig/021w5EX2/+cCF7T 95BA== 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=T4sAiyArUy52pWcai1J+mIoA8s+FFE+f9MM1+ahYCSU=; b=VwxJIQlFUaB9bwKQ/ivmdcKCVYNzHZZpW9wgysCuv8KO+ZZZNCpENNJ0wSyQjfGdTQ QiwsWhnwPA3vtKoQMK+4dY5t4x0oRO7NvlyWzjNV/40Oq+l0ACF63kTHRCIVpbT0lWj2 VabaoHkFCPLRFwNHrilSISbYdR2y1hDyVaFxY9h4lxhao072Y4X5qn3oMxDCFBj776D0 t4mG/d2Z3NhIHM8j6ejj7KplpflNm/0AXWtYCw0UefI0iC5VtAQuPka70SafI1OcDzYk bqJ+rf7+UK6gnWZRvNJJqmMu4vmDJZIZLCxWx+beqjmHNQH9X/C8HR+mez2BZTdt9ObW buSA== X-Gm-Message-State: AOAM53252A/k7xXS3hCV/KrzspP4KD/9P4xV7uE475H0CdNhXIDqrw7i uOTN80W/5hRcIWBMLgS6g6A2UDSLht1DyEatFKifwg== X-Received: by 2002:a05:6512:74e:: with SMTP id c14mr627702lfs.529.1609885434234; Tue, 05 Jan 2021 14:23:54 -0800 (PST) MIME-Version: 1.0 References: <20201004162908.3216898-1-martin.blumenstingl@googlemail.com> <20201004162908.3216898-4-martin.blumenstingl@googlemail.com> In-Reply-To: From: Linus Walleij Date: Tue, 5 Jan 2021 23:23:43 +0100 Message-ID: Subject: Re: [RFC PATCH 3/3] gpio: ej1x8: Add GPIO driver for Etron Tech Inc. EJ168/EJ188/EJ198 To: Martin Blumenstingl , Bjorn Helgaas Cc: linux-usb , linux-pci , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:GPIO SUBSYSTEM" , Rob Herring , Bartosz Golaszewski , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 21, 2020 at 4:28 PM Martin Blumenstingl wrote: > On Wed, Oct 7, 2020 at 9:44 PM Martin Blumenstingl > wrote: > [...] > > > As noted on the earlier patches I think this should be folded into the > > > existing XHCI USB driver in drivers/usb/host/xhci-pci.c or, if that > > > gets messy, as a separate bolt-on, something like > > > xhci-pci-gpio.[c|h] in the drivers/usb/host/* directory. > > > You can use a Kconfig symbol for the GPIO portions or not. > > OK, I will do that if there are no objections from other developers > > I am intending to place the relevant code in xhci-pci-etron.c, similar > > to what we already have with xhci-pci-renesas.c > > I tried this and unfortunately there's a catch. > the nice thing about having a separate GPIO driver means that the > xhci-pci driver doesn't need to know about it. Since PCI devices have device-wide power management and things like that I think that is a really dangerous idea. What if the GPIO driver starts poking around in this PCI device when the main driver is also probed and has put the device into sleep state? This type of set-up needs to be discussed with the PCI maintainer to make sure it is safe. > I implemented xhci-pci-etron.c and gave it a Kconfig option. > xhci-pci is then calling into xhci-pci-etron (through some > etron_xhci_pci_probe function). This sounds about right. > unfortunately this means that xhci-pci now depends on xhci-pci-etron. > for xhci-pci-renesas this is fine (I think) because that part of the > code is needed to get the xHCI controller going > but for xhci-pci-etron this is a different story: the GPIO controller > is entirely optional and only used on few devices I might be naive but should it not be the other way around? That xhci-pci-etron is dependent on xhci-pci? I imagine it would be an optional add-on. > my goal is (at some point in the future) to have the GPIO driver in OpenWrt. > I am not sure if they would accept a patch where xhci-pci would then > pull in the dependencies for that Etron controller, even though most > boards don't need it. Make sure the etron part is an additional module that can be loaded after xhci-pci. OpenWrt support optional modules to be compiled per-system. Yours, Linus Walleij