From patchwork Fri Oct 17 17:16:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38986 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F058D202DB for ; Fri, 17 Oct 2014 17:20:04 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf719076lab.10 for ; Fri, 17 Oct 2014 10:20:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=pHjxr2fDIFG9gzreGwT/J7j1nRDP4boAG375a4Eh5og=; b=Cxn51Wsel0SEueIC4qRX9v9pfWosGmpHVviskR02rkKX/T6H+lee1tmPNX7j7exD28 CypHjv0ZRS+Giu3eF3eQyM1qwItL2SShdZ4ru0ZxRro1QHdZWoCfyV8rAKDKV7iHGo0j VdlZmu/dc35w8/qcArqwYAsI2rS23BHUdaKzKWbgpER8zanEQ4oHg9itlVeekpz9SJrA GqgN6uAnyjqg2kqKAYo8cg76iC66i7xw910uudSV1cnIPyncI4GDDjaZFUaYJWc4Ynlm W0a7rA+hs93GHGg+Cj7COLdodPWTW9eE9ZEnrEyxmsygUkA7DgTFoBu4ONp/9p5a7vrw Coew== X-Gm-Message-State: ALoCoQke02knsEcwP1HYppCR4OquyLMQ0tkZohUTL01umPlwFLLgfxaGlz8PoIgAPaqL4PAzI5lI X-Received: by 10.180.93.35 with SMTP id cr3mr60145wib.2.1413566403865; Fri, 17 Oct 2014 10:20:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.202 with SMTP id y10ls289008lad.51.gmail; Fri, 17 Oct 2014 10:20:03 -0700 (PDT) X-Received: by 10.112.28.103 with SMTP id a7mr10349379lbh.8.1413566403609; Fri, 17 Oct 2014 10:20:03 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id ll8si3053571lac.9.2014.10.17.10.20.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:20:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id q1so1050253lam.22 for ; Fri, 17 Oct 2014 10:20:03 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr10140741lbc.23.1413566403497; Fri, 17 Oct 2014 10:20:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp268415lbz; Fri, 17 Oct 2014 10:20:02 -0700 (PDT) X-Received: by 10.68.234.103 with SMTP id ud7mr10035339pbc.46.1413566401436; Fri, 17 Oct 2014 10:20:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si1752052pdo.4.2014.10.17.10.20.00 for ; Fri, 17 Oct 2014 10:20:01 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753857AbaJQRUA (ORCPT + 5 others); Fri, 17 Oct 2014 13:20:00 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:36348 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753425AbaJQRRw (ORCPT ); Fri, 17 Oct 2014 13:17:52 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHHgs8028718; Fri, 17 Oct 2014 12:17:42 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHgZV000737; Fri, 17 Oct 2014 12:17:42 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:17:42 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHdYc030050; Fri, 17 Oct 2014 12:17:42 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Greg KH , , Paul Zimmerman , , , , , , , Robert Jarzmik , , Felipe Balbi Subject: [PATCH 15/67] usb: gadget: pxa27x_udc: add devicetree support Date: Fri, 17 Oct 2014 12:16:22 -0500 Message-ID: <1413566234-13537-16-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413566234-13537-1-git-send-email-balbi@ti.com> References: <1413566234-13537-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Robert Jarzmik Add support for device-tree device discovery. If devicetree is not provided, fallback to legacy platform data "discovery". Signed-off-by: Robert Jarzmik Cc: devicetree@vger.kernel.org Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/pxa27x_udc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index 5280f64..55598c0 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include @@ -2400,6 +2402,12 @@ static struct pxa_udc memory = { } }; +static struct of_device_id udc_pxa_dt_ids[] = { + { .compatible = "marvell,pxa270-udc" }, + {} +}; +MODULE_DEVICE_TABLE(of, udc_pxa_dt_ids); + /** * pxa_udc_probe - probes the udc device * @_dev: platform device @@ -2427,6 +2435,8 @@ static int pxa_udc_probe(struct platform_device *pdev) udc->gpiod = gpio_to_desc(mach->gpio_pullup); } udc->udc_command = mach->udc_command; + } else { + udc->gpiod = devm_gpiod_get(&pdev->dev, NULL); } regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -2618,6 +2628,7 @@ static struct platform_driver udc_driver = { .driver = { .name = "pxa27x-udc", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(udc_pxa_dt_ids), }, .probe = pxa_udc_probe, .remove = pxa_udc_remove,