From patchwork Fri Sep 14 11:48:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 11418 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 566B223E42 for ; Fri, 14 Sep 2012 11:52:10 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id B1CBBA33F80 for ; Fri, 14 Sep 2012 11:52:08 +0000 (UTC) Received: by ieak11 with SMTP id k11so6409935iea.11 for ; Fri, 14 Sep 2012 04:52:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=d/3OvS5SwQJOfleDWwGYb2aukbfTE5NQM/2RL24HK9E=; b=R/zctXy+Ovm70+q0DSYb/yFAuqvXML/kWW4qJWedohXomd9zLWyVg7fzEn4qgdwBX2 FufQQNKVc2QwpXjQfcOcNMsnbLUGng8ea8f9IQXQe1IpORkfoKYtDBiYssttoGQvhL/4 8HCOUAj6Sn3sokLXliXDbVwn2RGtGP8qX2vvVmWb4pjlOJ6WTaDXh36S5azwkkmSMJfA AYss3o3j6AaYGFnGDeEE+RWWWua68USbIA2mTJXYAJBOISFliCrzPqizcjcMx/bZjjfj /maX18MyWkfnZx7/R3v+bbfEoq80YMMg8YA6L8BYLSnTYSk4dMOu/l9eHrZO4vhp5Jy5 9NCw== Received: by 10.50.45.162 with SMTP id o2mr2958231igm.0.1347623528073; Fri, 14 Sep 2012 04:52:08 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp185628igc; Fri, 14 Sep 2012 04:52:07 -0700 (PDT) Received: by 10.66.78.9 with SMTP id x9mr3768627paw.84.1347623527398; Fri, 14 Sep 2012 04:52:07 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id kt9si2333028pbc.320.2012.09.14.04.52.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 04:52:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by pbcmd12 with SMTP id md12so6334621pbc.37 for ; Fri, 14 Sep 2012 04:52:07 -0700 (PDT) Received: by 10.68.226.130 with SMTP id rs2mr4776513pbc.151.1347623527066; Fri, 14 Sep 2012 04:52:07 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id pj8sm861252pbb.60.2012.09.14.04.52.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 04:52:05 -0700 (PDT) From: Tushar Behera To: linux-usb@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Cc: balbi@ti.com, patches@linaro.org Subject: [PATCH] usb: gadget: s3c-hsotg: Add device tree support Date: Fri, 14 Sep 2012 17:18:58 +0530 Message-Id: <1347623338-14292-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQmXcXqtOC/OIt8pOs1HvAjKak+7k6YLC7WSy+xUDcci5PMhDdsfRZEjiZv5OERLHpfLbiea This patch adds device tree support for s3c-hsotg driver used for Samsung platforms. Cc: Felipe Balbi Signed-off-by: Tushar Behera --- .../devicetree/bindings/usb/s3c-hsotg.txt | 16 ++++++++++++++++ drivers/usb/gadget/s3c-hsotg.c | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/s3c-hsotg.txt diff --git a/Documentation/devicetree/bindings/usb/s3c-hsotg.txt b/Documentation/devicetree/bindings/usb/s3c-hsotg.txt new file mode 100644 index 0000000..30b26c0 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/s3c-hsotg.txt @@ -0,0 +1,16 @@ +Samsung HSOTG controller s3c-hsotg + +Required properties: + - compatible : should be "samsung,exynos-hsotg". + - reg : should contain at least address and length of the standard HSOTG + register set for the device. + - interrupts : one HSOTG interrupt should be described here. + +Example (Samsung Origen): + + usb@12480000 { + compatible = "samsung,exynos-hsotg"; + reg = <0x12480000 0x20000>; + interrupts = <0 71 0>; + }; + diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index b13e0bb..d7f557f 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -3485,6 +3486,8 @@ static void s3c_hsotg_release(struct device *dev) kfree(hsotg); } +static u64 s3c_hsotg_dma_mask = DMA_BIT_MASK(32); + /** * s3c_hsotg_probe - probe function for hsotg driver * @pdev: The platform information for the driver @@ -3507,6 +3510,14 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev) return -EINVAL; } + /* + * Right now device-tree probed devices don't get dma_mask set. + */ + if (!pdev->dev.dma_mask) + pdev->dev.dma_mask = &s3c_hsotg_dma_mask; + if (!pdev->dev.coherent_dma_mask) + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + hsotg = devm_kzalloc(&pdev->dev, sizeof(struct s3c_hsotg), GFP_KERNEL); if (!hsotg) { dev_err(dev, "cannot get memory\n"); @@ -3701,10 +3712,19 @@ static int __devexit s3c_hsotg_remove(struct platform_device *pdev) #define s3c_hsotg_resume NULL #endif +#ifdef CONFIG_OF +static const struct of_device_id exynos_hsotg_match[] = { + { .compatible = "samsung,exynos-hsotg" }, + {}, +}; +MODULE_DEVICE_TABLE(of, exynos_hsotg_match); +#endif + static struct platform_driver s3c_hsotg_driver = { .driver = { .name = "s3c-hsotg", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(exynos_hsotg_match), }, .probe = s3c_hsotg_probe, .remove = __devexit_p(s3c_hsotg_remove),