From patchwork Wed Mar 6 11:55:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 15260 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 ED3E723E1F for ; Wed, 6 Mar 2013 11:35:31 +0000 (UTC) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by fiordland.canonical.com (Postfix) with ESMTP id 84FEAA1908D for ; Wed, 6 Mar 2013 11:35:31 +0000 (UTC) Received: by mail-ve0-f177.google.com with SMTP id m1so6621574ves.36 for ; Wed, 06 Mar 2013 03:35:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-auditid:from:to:cc:subject:date:message-id:x-mailer :x-brightmail-tracker:x-gm-message-state; bh=WR22M7E8Xkol9zuxV2CF5uoT/ZPw2f8VPKgqzrSLNS4=; b=jZniyycBIo2tTQb2vvKOv6Iu+eDxK1aUws+AxfmHn8lFi0j0Nz3yE+tKTv47+xDBP9 Y9ibRm4YkD4ja+1gsTTPvUzMcik9DDTPO7XnOFPPPZP0a2YKIInOYjwEbUd74SLWeQn2 GFM+9rAE+tmNEZbhoOnduQn9Pte3c2npjyLl7u+jbTQOQO83stHVK6EPafqlXCEK5Iph IjPvCcKvNsP81/R+VY2aQmmdhQzQYSJtppaKnQ6Pv8BXGJFJwZWmJ+SCbbjEigPZFv98 AGM3PG1QYFhwjt+iABR1NvvdPN28RWPoUspyo02bovoLZEc0uo0bTI4cNMlCrmaSBkjf 8cYg== X-Received: by 10.52.29.18 with SMTP id f18mr9676400vdh.57.1362569730762; Wed, 06 Mar 2013 03:35:30 -0800 (PST) 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.58.127.98 with SMTP id nf2csp10206veb; Wed, 6 Mar 2013 03:35:29 -0800 (PST) X-Received: by 10.68.22.73 with SMTP id b9mr44849992pbf.214.1362569729509; Wed, 06 Mar 2013 03:35:29 -0800 (PST) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id tp7si3004466pbc.111.2013.03.06.03.35.28; Wed, 06 Mar 2013 03:35:29 -0800 (PST) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJ80037NLIP6XU0@mailout4.samsung.com>; Wed, 06 Mar 2013 20:35:22 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-27-513729fa1882 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 11.ED.03880.AF927315; Wed, 06 Mar 2013 20:35:22 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJ8009P6LGE2U40@mmp1.samsung.com>; Wed, 06 Mar 2013 20:35:22 +0900 (KST) From: Thomas Abraham To: alsa-devel@alsa-project.org Cc: lrg@ti.com, broonie@opensource.wolfsonmicro.com, jassisinghbrar@gmail.com, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, t.figa@samsung.com, heiko@sntech.de, patches@linaro.org Subject: [PATCH] ASoC: samsung: let device core setup the default pin configuration Date: Wed, 06 Mar 2013 17:25:51 +0530 Message-id: <1362570951-14403-1-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLJMWRmVeSWpSXmKPExsVy+t9jAd1fmuaBBv9+mVpM+bOcyWLK4S8s Dkwed67tYQtgjOKySUnNySxLLdK3S+DK+P/jNmvBJbWKPVf+szYw9sh3MXJwSAiYSGw5INvF yAlkiklcuLeeDcQWEljEKLFzT30XIxeQ3cYksXr6YWaQBJuAgcSjhe/YQXpFBOQlDr3PA6lh BqmZ8WwnC0iNsECoxNPdi1hBbBYBVYm+xvVMIPW8Ap4SO7v1IHYpSWzoPco0gZF7ASPDKkbR 1ILkguKk9FwjveLE3OLSvHS95PzcTYxgTz6T3sG4qsHiEKMAB6MSD+8EFbNAIdbEsuLK3EOM EhzMSiK8W6XNA4V4UxIrq1KL8uOLSnNSiw8xSnOwKInzMp56EiAkkJ5YkpqdmlqQWgSTZeLg lGpgXF9aYtbD1KEt7n3x/QWn3Zct751/nM+yZB7Dj21SDyyVzi6JmGa+VM75yt6bC/dr6l9W vjrFekPKPTn9JYUeNhEqHobpD1S/K6osq0qVs12VYj73vM/uxzxuWyYezkia8Td712S5sEKX h//93+oKcnH+3K7S3CHGtulp57Jr8RJvXfgC3t5XVGIpzkg01GIuKk4EANwA5nvgAQAA X-Gm-Message-State: ALoCoQncosv0eTbqLEtt3ZL54hCNH8b81DhMABJR6ogSlWODhux0YUE26juR8m4scco+hNzR3tHm With device core now able to setup the default pin configuration, the pin configuration code based on the deprecated Samsung specific gpio bindings in i2s driver is removed. Signed-off-by: Thomas Abraham Acked-by: Linus Walleij --- .../devicetree/bindings/sound/samsung-i2s.txt | 30 +-------- sound/soc/samsung/i2s.c | 67 +------------------ 2 files changed, 8 insertions(+), 89 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/samsung-i2s.txt b/Documentation/devicetree/bindings/sound/samsung-i2s.txt index 3070046..1db65e5 100644 --- a/Documentation/devicetree/bindings/sound/samsung-i2s.txt +++ b/Documentation/devicetree/bindings/sound/samsung-i2s.txt @@ -20,23 +20,11 @@ Optional SoC Specific Properties: then this flag is enabled. - samsung,idma-addr: Internal DMA register base address of the audio sub system(used in secondary sound source). - -Required Board Specific Properties: - -- gpios: The gpio specifier for data out,data in, LRCLK, CDCLK and SCLK - interface lines. The format of the gpio specifier depends on the gpio - controller. - The syntax of samsung gpio specifier is - <[phandle of the gpio controller node] - [pin number within the gpio controller] - [mux function] - [flags and pull up/down] - [drive strength]> +- pinctrl-0: Should specify pin control groups used for this controller. +- pinctrl-names: Should contain only one value - "default". Example: -- SoC Specific Portion: - i2s@03830000 { compatible = "samsung,i2s-v5"; reg = <0x03830000 0x100>; @@ -48,16 +36,6 @@ i2s@03830000 { samsung,supports-rstclr; samsung,supports-secdai; samsung,idma-addr = <0x03000000>; -}; - -- Board Specific Portion: - -i2s@03830000 { - gpios = <&gpz 0 2 0 0>, /* I2S_0_SCLK */ - <&gpz 1 2 0 0>, /* I2S_0_CDCLK */ - <&gpz 2 2 0 0>, /* I2S_0_LRCK */ - <&gpz 3 2 0 0>, /* I2S_0_SDI */ - <&gpz 4 2 0 0>, /* I2S_0_SDO[1] */ - <&gpz 5 2 0 0>, /* I2S_0_SDO[2] */ - <&gpz 6 2 0 0>; /* I2S_0_SDO[3] */ + pinctrl-names = "default"; + pinctrl-0 = <&i2s0_bus>; }; diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index d7231e3..f982a83 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -79,7 +78,6 @@ struct i2s_dai { u32 suspend_i2smod; u32 suspend_i2scon; u32 suspend_i2spsr; - unsigned long gpios[7]; /* i2s gpio line numbers */ }; /* Lock for cross i/f checks */ @@ -1009,52 +1007,6 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) return i2s; } -#ifdef CONFIG_OF -static int samsung_i2s_parse_dt_gpio(struct i2s_dai *i2s) -{ - struct device *dev = &i2s->pdev->dev; - int index, gpio, ret; - - for (index = 0; index < 7; index++) { - gpio = of_get_gpio(dev->of_node, index); - if (!gpio_is_valid(gpio)) { - dev_err(dev, "invalid gpio[%d]: %d\n", index, gpio); - goto free_gpio; - } - - ret = gpio_request(gpio, dev_name(dev)); - if (ret) { - dev_err(dev, "gpio [%d] request failed\n", gpio); - goto free_gpio; - } - i2s->gpios[index] = gpio; - } - return 0; - -free_gpio: - while (--index >= 0) - gpio_free(i2s->gpios[index]); - return -EINVAL; -} - -static void samsung_i2s_dt_gpio_free(struct i2s_dai *i2s) -{ - unsigned int index; - for (index = 0; index < 7; index++) - gpio_free(i2s->gpios[index]); -} -#else -static int samsung_i2s_parse_dt_gpio(struct i2s_dai *dai) -{ - return -EINVAL; -} - -static void samsung_i2s_dt_gpio_free(struct i2s_dai *dai) -{ -} - -#endif - static const struct of_device_id exynos_i2s_match[]; static inline int samsung_i2s_get_driver_data(struct platform_device *pdev) @@ -1223,18 +1175,10 @@ static int samsung_i2s_probe(struct platform_device *pdev) pri_dai->sec_dai = sec_dai; } - if (np) { - if (samsung_i2s_parse_dt_gpio(pri_dai)) { - dev_err(&pdev->dev, "Unable to configure gpio\n"); - ret = -EINVAL; - goto err; - } - } else { - if (i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) { - dev_err(&pdev->dev, "Unable to configure gpio\n"); - ret = -EINVAL; - goto err; - } + if (i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) { + dev_err(&pdev->dev, "Unable to configure gpio\n"); + ret = -EINVAL; + goto err; } snd_soc_register_dai(&pri_dai->pdev->dev, &pri_dai->i2s_dai_drv); @@ -1259,9 +1203,6 @@ static int samsung_i2s_remove(struct platform_device *pdev) i2s = dev_get_drvdata(&pdev->dev); other = i2s->pri_dai ? : i2s->sec_dai; - if (!i2s_pdata->cfg_gpio && pdev->dev.of_node) - samsung_i2s_dt_gpio_free(i2s->pri_dai); - if (other) { other->pri_dai = NULL; other->sec_dai = NULL;