From patchwork Thu Jan 24 09:43:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 14255 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 6AF0023EAD for ; Thu, 24 Jan 2013 09:36:00 +0000 (UTC) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by fiordland.canonical.com (Postfix) with ESMTP id 13AAAA18C91 for ; Thu, 24 Jan 2013 09:35:59 +0000 (UTC) Received: by mail-vb0-f53.google.com with SMTP id b23so3637194vbz.12 for ; Thu, 24 Jan 2013 01:35:59 -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=HQ8T0+RwsYA4dtl2H7pfYtBLZ8m+VUM2DuzunG0idTU=; b=RcfMm4cjj9n0Span8hP4xvw0mywBD/SGJuQxoPrkFzBrNlKgAqPrpg5bf/aAIDVkxX r5EM58NA8VCJzOHOC2PQf31+OrQcqSZKd1Hy+TseKv2IlWWXsriSSsTkA0ksSa/Sxcoj 6L5w0DOTDdVuNL6yOaRHzRpfLVj1kxlOdBFV1MzC+Xo+x8Rr+8YTDsDIXT/vHmHCsO3C 9RqEEOm5uAMOwXS/qoBHNQOYXXhHMrRpFE9DQRriF8nXu3h5K991HWfGBwi5ut4Ows5l oe5KIGMlTFYFPg+stHdoZtVIPJ03qbGh17PnoKIvWrfWif9kbVVnSPwN0QeGHRMR9xLc iC3A== X-Received: by 10.52.18.147 with SMTP id w19mr1021950vdd.94.1359020159573; Thu, 24 Jan 2013 01:35:59 -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 st5csp54797veb; Thu, 24 Jan 2013 01:35:56 -0800 (PST) X-Received: by 10.68.202.65 with SMTP id kg1mr3240785pbc.28.1359020155535; Thu, 24 Jan 2013 01:35:55 -0800 (PST) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id bf6si23732040pab.83.2013.01.24.01.35.55; Thu, 24 Jan 2013 01:35:55 -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 epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MH4002VMINOK8W0@mailout4.samsung.com>; Thu, 24 Jan 2013 18:35:54 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 65.12.03918.A7001015; Thu, 24 Jan 2013 18:35:54 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-c6-5101007a6b9b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E4.12.03918.A7001015; Thu, 24 Jan 2013 18:35:54 +0900 (KST) Received: from rajeshwari-linux.sisodomain.com ([107.108.215.115]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MH400JQFINGXJ10@mmp2.samsung.com>; Thu, 24 Jan 2013 18:35:54 +0900 (KST) From: Rajeshwari Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, alim.akhtar@samsung.com, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org Subject: [PATCH 3/7 V2] Sound: Support for MAX98095 codec in driver Date: Thu, 24 Jan 2013 15:13:36 +0530 Message-id: <1359020620-11873-4-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1359020620-11873-1-git-send-email-rajeshwari.s@samsung.com> References: <1359020620-11873-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsWyRsSkWreKgTHQ4OB/EYuH62+yWEw5/IXF gcnjzrU9bAGMUVw2Kak5mWWpRfp2CVwZy2Y9Yyx4I1zxZsZhxgbGt/xdjJwcEgImEnfXrGeE sMUkLtxbz9bFyMUhJLCUUeLmk3vsMEXT7n5kgUhMZ5Q4encZlDORSeLKn68sIFVsAkYSW09O AxslIiAh8av/KpDNwcEsUCoxZWIeSFhYwFmiv6+NDcRmEVCVuHr0NjOIzSvgIXH52jI2iGUK EsemfmUFaeUU8JSY2igLEhYCKnl5Yy/YcRICt9kkLl46wAQxR0Di2+RDLCD1EgKyEpsOMEOM kZQ4uOIGywRG4QWMDKsYRVMLkguKk9JzDfWKE3OLS/PS9ZLzczcxAoPx9L9nUjsYVzZYHGIU 4GBU4uFVUGUIFGJNLCuuzD3EKMHBrCTCG/sSKMSbklhZlVqUH19UmpNafIgxGWj5RGYp0eR8 YKTklcQbGpuYmxqbWhoZmZmakiasJM7LeOpJgJBAemJJanZqakFqEcwWJg5OqQbGtVoRefv8 ef9H/bdZefAJ3/qlx1hULuznCNoXem723rtlZ8tmbGOturS70fZa/SWJUN3j963TorfrXTtu 6TNjYeGen85K0j5XohvPCT5dkX7+sMTVR7NO3Zi03H6KfUSryYMdvRFr019uXCmQIJd0sHeB 1zI5w3fnb5et9dHMKi19wdMfMqfkpxJLcUaioRZzUXEiAOfz2iyKAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsVy+t9jQd0qBsZAg9s3OSwerr/JYjHl8BcW ByaPO9f2sAUwRjUw2mSkJqakFimk5iXnp2TmpdsqeQfHO8ebmhkY6hpaWpgrKeQl5qbaKrn4 BOi6ZeYAzVZSKEvMKQUKBSQWFyvp22GaEBripmsB0xih6xsSBNdjZIAGEtYwZiyb9Yyx4I1w xZsZhxkbGN/ydzFyckgImEhMu/uRBcIWk7hwbz1bFyMXh5DAdEaJo3eXsUA4E5kkrvz5ClbF JmAksfXkNEYQW0RAQuJX/1Ugm4ODWaBUYsrEPJCwsICzRH9fGxuIzSKgKnH16G1mEJtXwEPi 8rVlbBDLFCSOTf3KCtLKKeApMbVRFiQsBFTy8sZetgmMvAsYGVYxiqYWJBcUJ6XnGuoVJ+YW l+al6yXn525iBIf6M6kdjCsbLA4xCnAwKvHwKqgyBAqxJpYVV+YeYpTgYFYS4Y19CRTiTUms rEotyo8vKs1JLT7EmAx01ERmKdHkfGAc5pXEGxqbmJsam1qaWJiYWZImrCTOy3jqSYCQQHpi SWp2ampBahHMFiYOTqkGxmkCBTJ6exIvnXvbd7iuOzZR4OdSq7Rk3TkigWlnVsUt97JVcbRP U3C1cmafy1/8XlB3xrcTzx8u9Fc7LNgsc2jrfZnZ+Ufqxdu2ulr/3epskMqUv+FPXM6fextu pIbGeFVoLzo4c7p0vXPhqck1gZ8m962fJntqudfCT7rb/zJeCpr8LfJynBJLcUaioRZzUXEi AMp1COW5AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQmsK+UaFbwldFgiMpVHZDjRDS8yCLf72EBUP1K4CzBVUs3pOiQj55F8m8WeUXVb/8cO4tg6 This patchs adds support for MAX98095 codec in sound driver. Signed-off-by: Rajeshwari Shinde --- Changes in V2: - None 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 };