From patchwork Fri Apr 21 20:40:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 753597 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w8nhb1qk3z9s78 for ; Sat, 22 Apr 2017 06:41:35 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DTAvqZqu"; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6758FB800DA; Fri, 21 Apr 2017 22:41:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Fri, 21 Apr 2017 22:41:10 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id CE392B800B6 for ; Fri, 21 Apr 2017 22:41:08 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .linaro. - helo: .mail-lf0-f52.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7 Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 21 Apr 2017 22:41:08 +0200 (CEST) Received: by mail-lf0-f52.google.com with SMTP id 75so50366338lfs.2 for ; Fri, 21 Apr 2017 13:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7ETV9bHdJJuNfXQGQ8l40aQzMZnlGCGJcXLR6WKcvig=; b=DTAvqZqulTQXuE3Ih4oBdz1G/XDhGuxVNpuroOKM+/cVTzLsK17ApyxMh/Yq4ETlD+ PdGizAe7kMSWmVlUTWT0c2VdxDzk71erADHETy+OTxGyPaOgCJWFs0KcSm9UfHNUgDMj zMjAGXzLlH4TzyPz3lx46t77VYkkEOvLm9Km4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7ETV9bHdJJuNfXQGQ8l40aQzMZnlGCGJcXLR6WKcvig=; b=gBpDRQ5bQkH8j42lqCpVzTGyn3HLjjIcuGUQCF6i+W3MhiVuwCstnR24MhtjD2lNfs SrAbUTxZTb8tY7VVHl0+g1CXJLXt3cVbsQZLBT/Bhlf5oDU82OroTr89F+rjKdVoLDn/ kJZyyGhKvQZ+So1wuwt6Uj9a5BRW9hMbXM3+5RYFmZH6qGSeZsyGjzV9OinVUGQoBuU4 t+r+V2rVbTRNnEhDtSdbRhmBex7NF2kb4Utrtn9w1Kj9hb1XiEHzmtCIEARTT7FyFe3p /EB5Icy+0iHk1RdPtVEpxGS0en3WPPT1yiAuVRQpWfYo69Fl8khopVaxVFIIVnic1mUT cjdA== X-Gm-Message-State: AN3rC/5aBgaBPCZvz0DthW9YP0cAK+hLaeFPbJyI8mBcuJvVfRiz+nJX mwRiknSlulg+dh6Z X-Received: by 10.46.82.137 with SMTP id n9mr5593562lje.0.1492807267885; Fri, 21 Apr 2017 13:41:07 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-8a7f71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.127.138]) by smtp.gmail.com with ESMTPSA id m191sm1770244lfe.43.2017.04.21.13.41.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Apr 2017 13:41:06 -0700 (PDT) From: Linus Walleij To: Hans Ulli Kroll , Florian Fainelli , linux-usb@vger.kernel.org, Greg Kroah-Hartman Date: Fri, 21 Apr 2017 22:40:55 +0200 Message-Id: <20170421204058.6206-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170421204058.6206-1-linus.walleij@linaro.org> References: <20170421204058.6206-1-linus.walleij@linaro.org> Subject: [OpenWrt-Devel] [PATCH 2/5 v3] usb: host: fotg2: add device tree probing X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@openwrt.org, Janos Laube , linux-arm-kernel@lists.infradead.org, Paulius Zaleckas MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Hans Ulli Kroll Add device tree probing to the fotg2 driver. Signed-off-by: Hans Ulli Kroll Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Change compatible to "faraday,fotg210" simply. --- drivers/usb/host/fotg210-hcd.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 1c5b34b74860..c226041101d1 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -23,6 +23,7 @@ * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include +#include #include #include #include @@ -5600,6 +5601,15 @@ static int fotg210_hcd_probe(struct platform_device *pdev) if (usb_disabled()) return -ENODEV; + /* Right now device-tree probed devices don't get dma_mask set. + * Since shared usb code relies on it, set it here for now. + * Once we have dma capability bindings this can go away. + */ + + retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (retval) + goto fail_create_hcd; + pdev->dev.power.power_state = PMSG_ON; res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); @@ -5676,9 +5686,18 @@ static int fotg210_hcd_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id fotg210_of_match[] = { + { .compatible = "faraday,fotg210" }, + {}, +}; +MODULE_DEVICE_TABLE(of, fotg210_of_match); +#endif + static struct platform_driver fotg210_hcd_driver = { .driver = { .name = "fotg210-hcd", + .of_match_table = of_match_ptr(fotg210_of_match), }, .probe = fotg210_hcd_probe, .remove = fotg210_hcd_remove,