From patchwork Mon Jan 21 10:52:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 14127 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 A8FDB23E39 for ; Mon, 21 Jan 2013 10:47:38 +0000 (UTC) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by fiordland.canonical.com (Postfix) with ESMTP id 4F46CA18736 for ; Mon, 21 Jan 2013 10:47:38 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so5599445vba.27 for ; Mon, 21 Jan 2013 02:47:37 -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 :in-reply-to:references:x-brightmail-tracker:x-brightmail-tracker :dlp-filter:x-mtr:x-cfilter-loop:x-gm-message-state; bh=+0F0VT7APuZi59nO/uw4aAm1KV8+0zEsQvWie1fmPww=; b=eLZBe8RCo9WqUeemQlsNklvPWZP789EWFvvXBoFju6PuzsESHp+E6t826Cnf8Iczxa p72bwhgn86ZOFpKDfcC+XPWTaL70HzNKDjRtvjUfix1+WWfvKBrrL2g531ZImqXB0Kyr 9oJYj6JgbX1bdwNL1p2kv9bTqbSsKuC3PE66hr2E4N3+bKiB/PhM80I/TKpgpVWvA0D0 v0ldAgHIjBtkzmE6Z+f3/S31XNkI4Q7h4I5FLvJtcqd7/V7NJ/QJa2/QhO3A/z3/I2rK DoY6rFJwSv5dy8qeNWTppjaL4KXCYivRdoOdHqm4KCP9YRE3Q40/hpKoM6vTKfVDxn+e VAFw== X-Received: by 10.220.39.69 with SMTP id f5mr14076768vce.45.1358765257809; Mon, 21 Jan 2013 02:47:37 -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.145.101 with SMTP id st5csp195000veb; Mon, 21 Jan 2013 02:47:37 -0800 (PST) X-Received: by 10.68.225.70 with SMTP id ri6mr28770090pbc.41.1358765256757; Mon, 21 Jan 2013 02:47:36 -0800 (PST) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id e5si13704239pax.116.2013.01.21.02.47.36; Mon, 21 Jan 2013 02:47:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.34 as permitted sender) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.34 as permitted sender) smtp.mail=rajeshwari.s@samsung.com 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 <0MGZ00DG81Z7GM20@mailout4.samsung.com>; Mon, 21 Jan 2013 19:47:35 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 60.D2.03880.7CC1DF05; Mon, 21 Jan 2013 19:47:35 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-7a-50fd1cc732d2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4D.C2.03880.7CC1DF05; Mon, 21 Jan 2013 19:47:35 +0900 (KST) Received: from rajeshwari-linux.sisodomain.com ([107.108.215.115]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MGZ009CX1UTT630@mmp1.samsung.com>; Mon, 21 Jan 2013 19:47:35 +0900 (KST) From: Rajeshwari Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org Subject: [PATCH 3/7] Sound: Support for MAX98095 codec in driver Date: Mon, 21 Jan 2013 16:22:35 +0530 Message-id: <1358765559-32709-4-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1358765559-32709-1-git-send-email-rajeshwari.s@samsung.com> References: <1358765559-32709-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRmVeSWpSXmKPExsWyRsSkWve4zN8Ag5k/lC0err/JYjHl8BcW ByaPO9f2sAUwRnHZpKTmZJalFunbJXBlzHzwlbHgsnDF748LWRsY7/B3MXJySAiYSCx68Y8Z whaTuHBvPVsXIxeHkMBSRonXq5+wwRQt/r2OESKxiFHi+KdTUM5EJon1l3+xg1SxCRhJbD05 jRHEFhGQkPjVfxXMZhaIkXi9/wfYJGEBB4n753aB2SwCqhKbdj4Fq+EV8JB4/H07K8Q2BYlj U7+C2ZwCnhI3DmxiAbGFgGr+bFzJDLJYQuA6m8StI4sYIQYJSHybfAioiAMoISux6QDUO5IS B1fcYJnAKLyAkWEVo2hqQXJBcVJ6rpFecWJucWleul5yfu4mRmBAnv73THoH46oGi0OMAhyM Sjy8CX1/AoRYE8uKK3MPMUpwMCuJ8P6cARTiTUmsrEotyo8vKs1JLT7EmAy0fCKzlGhyPjBa 8kriDY1NzE2NTS2NjMxMTUkTVhLnZTz1JEBIID2xJDU7NbUgtQhmCxMHp1QDY0tH7vW/nz8f inx+ULr32sKWuYU+9/0FdrD1/NNkWxKrFLXx/X33V/Pq3Ey0HZ20UqcXTnXb+Cjr4hfDlXzd 9VF8b3YfNTpXknvddPLRxc4VdiV2AuufH+tinSbnLz6zPjGIq+iQz49HvIfWxR0Ja/d/pL+2 0ZAr8Wtn/tcugyCPSX0111TNlViKMxINtZiLihMBp5ZxAowCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRmVeSWpSXmKPExsVy+t9jAd3jMn8DDF71iVk8XH+TxWLK4S8s Dkwed67tYQtgjGpgtMlITUxJLVJIzUvOT8nMS7dV8g6Od443NTMw1DW0tDBXUshLzE21VXLx CdB1y8wBmq2kUJaYUwoUCkgsLlbSt8M0ITTETdcCpjFC1zckCK7HyAANJKxhzJj54CtjwWXh it8fF7I2MN7h72Lk5JAQMJFY/HsdI4QtJnHh3nq2LkYuDiGBRYwSxz+dYoRwJjJJrL/8ix2k ik3ASGLryWlgHSICEhK/+q+C2cwCMRKv9/9gA7GFBRwk7p/bBWazCKhKbNr5FKyGV8BD4vH3 7awQ2xQkjk39CmZzCnhK3DiwiQXEFgKq+bNxJfMERt4FjAyrGEVTC5ILipPSc430ihNzi0vz 0vWS83M3MYLD/Zn0DsZVDRaHGAU4GJV4eBP6/gQIsSaWFVfmHmKU4GBWEuH9OQMoxJuSWFmV WpQfX1Sak1p8iDEZ6KqJzFKiyfnAWMwriTc0NjE3NTa1NLEwMbMkTVhJnJfx1JMAIYH0xJLU 7NTUgtQimC1MHJxSDYyTj9vIWEmrZmlERE9Z75B3SvTQbWEX/uqnpwOWeU09d/Rn0DSzjxPz Yj6fKFpwx8vuXnuwucpGFXPGskserGEHSi2rlmZzmJ017E9aWXw0gF/Z1eqUUovYnBvWnNFv F37g/bpWmFVE/Ym8Uf4R9jl/u3zbX+8qLu0urE6vdAtapBQWmm/0RImlOCPRUIu5qDgRAJHJ dBe7AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQl91r/QPmlmx3WdWJ5lV2Zb9jvwrDJbRJYc2ateIbrsRSXbISE/Q61XrvWpc16zMeIfufw+ This patchs adds support for MAX98095 codec in sound driver. Signed-off-by: Rajeshwari Shinde --- arch/arm/include/asm/arch-exynos/sound.h | 10 +++++++++- drivers/sound/sound.c | 13 +++++++++++-- include/sound.h | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-exynos/sound.h b/arch/arm/include/asm/arch-exynos/sound.h index d1bd2f6..a216b00 100644 --- a/arch/arm/include/asm/arch-exynos/sound.h +++ b/arch/arm/include/asm/arch-exynos/sound.h @@ -33,6 +33,7 @@ #define I2S_RFS 256 #define I2S_BFS 32 +#ifdef CONFIG_SOUND_WM8994 /* I2C values */ #define AUDIO_I2C_BUS 1 #define AUDIO_I2C_REG 0x1a @@ -40,5 +41,12 @@ /* Audio Codec */ #define AUDIO_CODEC "wm8994" -#define AUDIO_COMPAT 1 +#else /* CONFIG_SOUND_MAX98095 */ +/* I2C values */ +#define AUDIO_I2C_BUS 7 +#define AUDIO_I2C_REG 0x22 + +/* Audio Codec */ +#define AUDIO_CODEC "max98095" +#endif #endif diff --git a/drivers/sound/sound.c b/drivers/sound/sound.c index fa8432d..a74590b 100644 --- a/drivers/sound/sound.c +++ b/drivers/sound/sound.c @@ -31,6 +31,7 @@ #include #include #include "wm8994.h" +#include "max98095.h" /* defines */ #define SOUND_400_HZ 400 @@ -143,17 +144,25 @@ static int codec_init(const void *blob, struct i2stx_info *pi2s_tx) #else codectype = AUDIO_CODEC; #endif +#ifdef CONFIG_SOUND_WM8994 if (!strcmp(codectype, "wm8994")) { /* Check the codec type and initialise the same */ ret = wm8994_init(blob, WM8994_AIF2, pi2s_tx->samplingrate, (pi2s_tx->samplingrate * (pi2s_tx->rfs)), pi2s_tx->bitspersample, pi2s_tx->channels); +#endif +#ifdef CONFIG_SOUND_MAX98095 + if (!strcmp(codectype, "max98095")) { + ret = max98095_init(blob, pi2s_tx->samplingrate, + (pi2s_tx->samplingrate * (pi2s_tx->rfs)), + pi2s_tx->bitspersample); +#endif } else { - debug("%s: Unknown code type %s\n", __func__, - codectype); + debug("%s: Unknown codec type %s\n", __func__, codectype); return -1; } + if (ret) { debug("%s: Codec init failed\n", __func__); return -1; diff --git a/include/sound.h b/include/sound.h index d73839d..94922f6 100644 --- a/include/sound.h +++ b/include/sound.h @@ -28,6 +28,7 @@ enum en_sound_codec { CODEC_WM_8994, CODEC_WM_8995, + CODEC_MAX_98095, CODEC_MAX };