From patchwork Wed Aug 19 11:25:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 42575 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7JBPmg8010634 for ; Wed, 19 Aug 2009 11:25:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751581AbZHSLZp (ORCPT ); Wed, 19 Aug 2009 07:25:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751526AbZHSLZp (ORCPT ); Wed, 19 Aug 2009 07:25:45 -0400 Received: from mail.renesas.com ([202.234.163.13]:62029 "EHLO mail04.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751386AbZHSLZo (ORCPT ); Wed, 19 Aug 2009 07:25:44 -0400 X-AuditID: ac140387-00000006000005fd-5c-4a8be1286775 Received: from guardian03.idc.renesas.com ([172.20.8.202]) by mail04.idc.renesas.com (sendmail) with ESMTP id n7JBPSS8006012; Wed, 19 Aug 2009 20:25:28 +0900 (JST) Received: (from root@localhost) by guardian03.idc.renesas.com with id n7JBPTpo020041; Wed, 19 Aug 2009 20:25:29 +0900 (JST) Received: from mta01.idc.renesas.com (localhost [127.0.0.1]) by mta01.idc.renesas.com with ESMTP id n7JBPSWB005953; Wed, 19 Aug 2009 20:25:28 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KOM00CIRFQGMX@ims05.idc.renesas.com>; Wed, 19 Aug 2009 20:25:28 +0900 (JST) Date: Wed, 19 Aug 2009 20:25:28 +0900 From: Kuninori Morimoto Subject: [PATCH 3/3] Add FSI-AK464x sound support for ms7724se To: linux-sh@vger.kernel.org, alsa-devel@alsa-project.org Cc: Magnus Damm , lethal@linux-sh.org, Takashi Iwai , broonie@opensource.wolfsonmicro.com Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU) X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Signed-off-by: Kuninori Morimoto --- arch/sh/boards/Kconfig | 9 +++ arch/sh/boards/mach-se/7724/Makefile | 3 +- arch/sh/boards/mach-se/7724/fsi-ak464x.c | 90 ++++++++++++++++++++++++++++++ arch/sh/boards/mach-se/7724/setup.c | 90 ++++++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 1 deletions(-) create mode 100644 arch/sh/boards/mach-se/7724/fsi-ak464x.c diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig index db04c85..44f4c8b 100644 --- a/arch/sh/boards/Kconfig +++ b/arch/sh/boards/Kconfig @@ -55,6 +55,15 @@ config SH_7724_SOLUTION_ENGINE Select 7724 SolutionEngine if configuring for a Hitachi SH7724 evaluation board. +config SND_SH4_FSI_AK464X + bool "FSI-AK464X sound support" + depends on SND_SOC_SH4_FSI + depends on SH_7724_SOLUTION_ENGINE + select SND_SOC_AK464X + help + This option enables generic sound support for the + FSI - AK464x unit of the SH4. + config SH_7751_SOLUTION_ENGINE bool "SolutionEngine7751" select SOLUTION_ENGINE diff --git a/arch/sh/boards/mach-se/7724/Makefile b/arch/sh/boards/mach-se/7724/Makefile index 349cbd6..e0f5366 100644 --- a/arch/sh/boards/mach-se/7724/Makefile +++ b/arch/sh/boards/mach-se/7724/Makefile @@ -7,4 +7,5 @@ # # -obj-y := setup.o irq.o \ No newline at end of file +obj-y := setup.o irq.o +obj-$(CONFIG_SND_SH4_FSI_AK464X) += fsi-ak464x.o diff --git a/arch/sh/boards/mach-se/7724/fsi-ak464x.c b/arch/sh/boards/mach-se/7724/fsi-ak464x.c new file mode 100644 index 0000000..bab118e --- /dev/null +++ b/arch/sh/boards/mach-se/7724/fsi-ak464x.c @@ -0,0 +1,90 @@ +/* + * FSI-AK464x sound support for ms7724se + * + * Copyright (C) 2009 Renesas Solutions Corp. + * Kuninori Morimoto + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include <../sound/soc/codecs/ak464x.h> + +static int machine_init(struct snd_soc_codec *codec) +{ + snd_soc_dapm_sync(codec); + return 0; +} + +static struct snd_soc_dai_link fsi_dai_link = { + .name = "AK464x", + .stream_name = "AK464x", + .cpu_dai = &fsi_soc_dai[0], /* fsi */ + .codec_dai = &ak464x_dai, + .init = machine_init, + .ops = NULL, +}; + +static struct snd_soc_card fsi_soc_card = { + .name = "SH4 I2S (FSI)", + .platform = &fsi_soc_platform, + .dai_link = &fsi_dai_link, + .num_links = 1, +}; + +struct ak464x_setup_data ak464x_setup = { + .i2c_bus = 0, + .i2c_address = 0x12, /* 0x13 */ +}; + +static struct snd_soc_device fsi_snd_devdata = { + .card = &fsi_soc_card, + .codec_dev = &soc_codec_dev_ak464x, + .codec_data = &ak464x_setup, +}; + +static struct platform_device *fsi_snd_device; + +static int __init fsi_ak464x_init(void) +{ + int ret; + + ret = -ENOMEM; + fsi_snd_device = platform_device_alloc("soc-audio", -1); + if (!fsi_snd_device) + goto out; + + platform_set_drvdata(fsi_snd_device, + &fsi_snd_devdata); + fsi_snd_devdata.dev = &fsi_snd_device->dev; + ret = platform_device_add(fsi_snd_device); + + if (ret) + platform_device_put(fsi_snd_device); + +out: + return ret; +} + +static void __exit fsi_ak464x_exit(void) +{ + platform_device_unregister(fsi_snd_device); +} + +module_init(fsi_ak464x_init); +module_exit(fsi_ak464x_exit); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Generic SH4 FSI-AK464x sound card"); +MODULE_AUTHOR("Kuninori Morimoto "); diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 9162081..0099a79 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c @@ -22,11 +22,13 @@ #include #include