From patchwork Mon Dec 11 10:53:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ughreja, Rakesh A" X-Patchwork-Id: 10104759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 80C60602D8 for ; Mon, 11 Dec 2017 10:51:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91D352953D for ; Mon, 11 Dec 2017 10:51:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 866372953F; Mon, 11 Dec 2017 10:51:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB7B72953D for ; Mon, 11 Dec 2017 10:51:40 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9E01426766F; Mon, 11 Dec 2017 11:50:42 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1074E26766F; Mon, 11 Dec 2017 11:50:41 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 16E22267557 for ; Mon, 11 Dec 2017 11:48:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2017 02:48:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,391,1508828400"; d="scan'208";a="11344638" Received: from raughrej-desk.iind.intel.com ([10.223.84.131]) by orsmga003.jf.intel.com with ESMTP; 11 Dec 2017 02:48:55 -0800 From: Rakesh Ughreja To: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.de, liam.r.girdwood@linux.intel.com Date: Mon, 11 Dec 2017 16:23:02 +0530 Message-Id: <1512989583-10877-11-git-send-email-rakesh.a.ughreja@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512989583-10877-1-git-send-email-rakesh.a.ughreja@intel.com> References: <1512989583-10877-1-git-send-email-rakesh.a.ughreja@intel.com> Cc: vinod.koul@intel.com, patches.audio@intel.com, Rakesh Ughreja , pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [RFC v2 10/11] ASoC: patch_realtek: add ASoC based Realtek HDA codec driver patch X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for ASoC HDA codec driver for realtek codecs. Signed-off-by: Rakesh Ughreja --- sound/pci/hda/patch_realtek.c | 3 ++- sound/soc/codecs/Kconfig | 6 +++++ sound/soc/codecs/Makefile | 2 ++ sound/soc/codecs/patch_realtek.c | 48 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 sound/soc/codecs/patch_realtek.c diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 921a10e..88a965c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -7903,7 +7903,7 @@ static int patch_alc680(struct hda_codec *codec) /* * patch entries */ -static const struct hda_device_id snd_hda_id_realtek[] = { +const struct hda_device_id snd_hda_id_realtek[] = { HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269), HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269), HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269), @@ -7974,6 +7974,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), {} /* terminator */ }; +EXPORT_SYMBOL_GPL(snd_hda_id_realtek); MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); MODULE_LICENSE("GPL"); diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 1d41d11..97fd997 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -80,6 +80,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_GTM601 select SND_SOC_HDAC_HDMI select SND_SOC_HDAC_HDA + select SND_SOC_HDA_REALTEK select SND_SOC_ICS43432 select SND_SOC_INNO_RK3036 select SND_SOC_ISABELLE if I2C @@ -587,6 +588,11 @@ config SND_SOC_HDAC_HDA select SND_HDA_EXT_CORE select SND_PCM_ELD +config SND_SOC_HDA_REALTEK + select SND_HDA_CODEC_REALTEK + select SND_SOC_HDAC_HDA + tristate "Realtek ASoC HDA Codec Driver patch" + config SND_SOC_ICS43432 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile index dd5f90f..158ee89 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile @@ -102,6 +102,7 @@ snd-soc-nau8810-objs := nau8810.o snd-soc-nau8824-objs := nau8824.o snd-soc-nau8825-objs := nau8825.o snd-soc-hdmi-codec-objs := hdmi-codec.o +snd-soc-patch_realtek-objs := patch_realtek.o snd-soc-pcm1681-objs := pcm1681.o snd-soc-pcm179x-codec-objs := pcm179x.o snd-soc-pcm179x-i2c-objs := pcm179x-i2c.o @@ -319,6 +320,7 @@ obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o obj-$(CONFIG_SND_SOC_GTM601) += snd-soc-gtm601.o obj-$(CONFIG_SND_SOC_HDAC_HDMI) += snd-soc-hdac-hdmi.o obj-$(CONFIG_SND_SOC_HDAC_HDA) += snd-soc-hdac-hda.o +obj-$(CONFIG_SND_SOC_HDA_REALTEK) += snd-soc-patch_realtek.o obj-$(CONFIG_SND_SOC_ICS43432) += snd-soc-ics43432.o obj-$(CONFIG_SND_SOC_INNO_RK3036) += snd-soc-inno-rk3036.o obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o diff --git a/sound/soc/codecs/patch_realtek.c b/sound/soc/codecs/patch_realtek.c new file mode 100644 index 0000000..80772c3 --- /dev/null +++ b/sound/soc/codecs/patch_realtek.c @@ -0,0 +1,48 @@ +/* + * Universal Interface for Intel High Definition Audio Codec + * + * ASoC HD audio interface patch for Realtek ALC codecs + * + * Copyright (c) 2004 Kailang Yang + * PeiSen Hou + * Takashi Iwai + * Jonathan Woithe + * + * This driver is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This driver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +/* + * license header and copyright is copy/pasted from the legacy realtek HDA + * driver, is that fine or I need to create a new one? + */ + +#include +#include +#include +#include +#include "../../pci/hda/hda_codec.h" +#include "hdac_hda.h" + +/* + * Is snd_hda_id_realtek okay to keep it here or better to move into + * hda_codec.h file? + * Is it okay to define this as extern ? + */ +extern struct hda_device_id snd_hda_id_realtek[]; + +static struct hdac_driver realtek_driver = { + .id_table = snd_hda_id_realtek, +}; + +module_hdac_hda_codec_driver(realtek_driver); + +MODULE_DESCRIPTION("Realtek ASoC HDA Codec driver"); +MODULE_LICENSE("GPL");