From patchwork Sat Sep 22 15:27:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1494391 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 436D9DF2D2 for ; Sat, 22 Sep 2012 15:29:26 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TFRcX-00006m-NL; Sat, 22 Sep 2012 15:27:53 +0000 Received: from mail-yx0-f177.google.com ([209.85.213.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TFRcT-00006M-SY for linux-arm-kernel@lists.infradead.org; Sat, 22 Sep 2012 15:27:50 +0000 Received: by yenr1 with SMTP id r1so23159yen.36 for ; Sat, 22 Sep 2012 08:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=Btpbe6/FAUe/7bRh85PwXLLGX0yVWgeFZB0YqF+Jn9g=; b=cmXE0ja58oAilT5FPvizxE0Nz3rPUQF7Wa0UGypacA5WYYJhgDoaqcmwKZT755Cu0m C2KYXyh2y9bp+Nlz7VMQ/s/y3ZQYV2UhKhoJNkBsIE9LRGhCGBXn28g2kXQYny8E+/kT akBRjBMdtL01cZJCzPbkw7FkYJO9pJvi4ZANDpUMY8LZsfPLOx9uTroRQ4L+XpbtEKnU n/8XVFQaXPrZuG0H7Efm82UaPXU/fC493IQ/3KilpwHVvp+UmYBeeboDUAfjvrBApiSG zS5BN+jok/6vNUjE9PHdz9bMBSqmsT2ctRXEyd8DaFroL+WfhFFOAkBzMC3W0E9mGzAK DKQg== Received: by 10.236.116.226 with SMTP id g62mr8176245yhh.100.1348327668620; Sat, 22 Sep 2012 08:27:48 -0700 (PDT) Received: from localhost.localdomain ([189.101.140.114]) by mx.google.com with ESMTPS id t57sm17425380yhg.0.2012.09.22.08.27.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Sep 2012 08:27:48 -0700 (PDT) From: Fabio Estevam To: broonie@opensource.wolfsonmicro.com Subject: =?UTF-8?q?=5BPATCH=20v2=5D=20ASoC=3A=20eukrea-tlv320=3A=20Convert=20it=20to=20platform=20driver?= Date: Sat, 22 Sep 2012 12:27:31 -0300 Message-Id: <1348327652-21567-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.177 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: linux-arm-kernel@lists.infradead.org, Fabio Estevam , alsa-devel@alsa-project.org, eric@eukrea.com, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Fabio Estevam Convert eukrea-tlv320 to platform driver. Signed-off-by: Fabio Estevam --- Changes since v1: - No changes, only CC'ed ARM kernel list as requested by Mark Brown arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 1 + arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c | 1 + arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 1 + arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c | 1 + sound/soc/fsl/eukrea-tlv320.c | 37 ++++++++++++------------ 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index fd3177f..98aef57 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c @@ -348,4 +348,5 @@ void __init eukrea_mbimx27_baseboard_init(void) imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data); gpio_led_register_device(-1, &eukrea_mbimx27_gpio_led_info); + imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0); } diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c index dfd2da8..0b84666 100644 --- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c @@ -306,4 +306,5 @@ void __init eukrea_mbimxsd25_baseboard_init(void) platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); imx_add_gpio_keys(&eukrea_mbimxsd_button_data); + imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0); } diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c index 6e9dd12..c6532a0 100644 --- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c @@ -315,4 +315,5 @@ void __init eukrea_mbimxsd35_baseboard_init(void) platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); imx_add_gpio_keys(&eukrea_mbimxsd_button_data); + imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0); } diff --git a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c index 96a24b7..8b0de30 100644 --- a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c @@ -228,4 +228,5 @@ void __init eukrea_mbimxsd51_baseboard_init(void) gpio_led_register_device(-1, &eukrea_mbimxsd51_led_info); imx_add_gpio_keys(&eukrea_mbimxsd51_button_data); + imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0); } diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c index efb9ede..267d5b4 100644 --- a/sound/soc/fsl/eukrea-tlv320.c +++ b/sound/soc/fsl/eukrea-tlv320.c @@ -93,9 +93,7 @@ static struct snd_soc_card eukrea_tlv320 = { .num_links = 1, }; -static struct platform_device *eukrea_tlv320_snd_device; - -static int __init eukrea_tlv320_init(void) +static int __devinit eukrea_tlv320_probe(struct platform_device *pdev) { int ret; int int_port = 0, ext_port; @@ -136,29 +134,32 @@ static int __init eukrea_tlv320_init(void) return 0; } - eukrea_tlv320_snd_device = platform_device_alloc("soc-audio", -1); - if (!eukrea_tlv320_snd_device) - return -ENOMEM; - - platform_set_drvdata(eukrea_tlv320_snd_device, &eukrea_tlv320); - ret = platform_device_add(eukrea_tlv320_snd_device); - - if (ret) { - printk(KERN_ERR "ASoC: Platform device allocation failed\n"); - platform_device_put(eukrea_tlv320_snd_device); - } + eukrea_tlv320.dev = &pdev->dev; + ret = snd_soc_register_card(&eukrea_tlv320); + if (ret) + dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); return ret; } -static void __exit eukrea_tlv320_exit(void) +static int __devexit eukrea_tlv320_remove(struct platform_device *pdev) { - platform_device_unregister(eukrea_tlv320_snd_device); + snd_soc_unregister_card(&eukrea_tlv320); + + return 0; } -module_init(eukrea_tlv320_init); -module_exit(eukrea_tlv320_exit); +static struct platform_driver eukrea_tlv320_driver = { + .driver = { + .name = "eukrea_tlv320", + .owner = THIS_MODULE, + }, + .probe = eukrea_tlv320_probe, + .remove = __devexit_p(eukrea_tlv320_remove),}; + +module_platform_driver(eukrea_tlv320_driver); MODULE_AUTHOR("Eric BĂ©nard "); MODULE_DESCRIPTION("CPUIMX ALSA SoC driver"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:eukrea_tlv320");