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: 97927 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp496717qgf; Fri, 21 Apr 2017 13:41:12 -0700 (PDT) X-Received: by 10.84.143.195 with SMTP id 61mr18216581plz.158.1492807271955; Fri, 21 Apr 2017 13:41:11 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si11190563pgn.118.2017.04.21.13.41.11; Fri, 21 Apr 2017 13:41:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161132AbdDUUlK (ORCPT + 4 others); Fri, 21 Apr 2017 16:41:10 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:34774 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1036998AbdDUUlJ (ORCPT ); Fri, 21 Apr 2017 16:41:09 -0400 Received: by mail-lf0-f50.google.com with SMTP id t144so50416713lff.1 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=LE9RDTEtlYXCbHisSqcs5rXQmNN0zQfxrKPx+hmISITnhyEDKFZARaMksUt51DVgq/ /kDq8xlogoJER3Tgh7phdXtOeJxi/larBn50QsWcYcY5NMsEWZ0J97nqeUFpCEsZJ2N9 3I5gZaJsohSAV4MC4/vn9PXKCaYarpKnkPgSB/UtUjfA48TdAv6TQKCQlTB760E/mu36 RAnWY7uF3eAiJy4eoGAWT1evSfzRpHOmYffGrsLLaeH3lJBJrrN4WOmhBo0h2mtyzdan J/miSxht4/Wq+I2LPdyDbUUiO1fF6LXHrjYWi3c23rhb1x/zuBW/iSn+LEZRdQFSqSan owJQ== X-Gm-Message-State: AN3rC/5cbH/uDH7cVfXpY2rttS7Y29z8mJTi5eZbSxBM7xGHdQEDcxb0 V+dUxtcv92x/NBzw 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 Cc: Janos Laube , Paulius Zaleckas , openwrt-devel@openwrt.org, linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH 2/5 v3] usb: host: fotg2: add device tree probing 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> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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(+) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,