All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
To: alsa-devel@alsa-project.org, broonie@kernel.org, tiwai@suse.de,
	liam.r.girdwood@linux.intel.com
Cc: vinod.koul@intel.com, patches.audio@intel.com,
	Rakesh Ughreja <rakesh.a.ughreja@intel.com>,
	pierre-louis.bossart@linux.intel.com
Subject: [RFC v2 10/11] ASoC: patch_realtek: add ASoC based Realtek HDA codec driver patch
Date: Mon, 11 Dec 2017 16:23:02 +0530	[thread overview]
Message-ID: <1512989583-10877-11-git-send-email-rakesh.a.ughreja@intel.com> (raw)
In-Reply-To: <1512989583-10877-1-git-send-email-rakesh.a.ughreja@intel.com>

This patch adds support for ASoC HDA codec driver for realtek
codecs.

Signed-off-by: Rakesh Ughreja <rakesh.a.ughreja@intel.com>
---
 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 <kailang@realtek.com.tw>
+ *                    PeiSen Hou <pshou@realtek.com.tw>
+ *                    Takashi Iwai <tiwai@suse.de>
+ *                    Jonathan Woithe <jwoithe@just42.net>
+ *
+ *  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 <linux/init.h>
+#include <linux/module.h>
+#include <sound/soc.h>
+#include <sound/hdaudio_ext.h>
+#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");
-- 
2.7.4

  parent reply	other threads:[~2017-12-11 10:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 10:52 [RFC v2 00/11] Enable HDA Codec support on Intel Platforms (Series2) Rakesh Ughreja
2017-12-11 10:52 ` [RFC v2 01/11] ASoC: Intel: Boards: Machine driver for Intel platforms Rakesh Ughreja
2017-12-11 10:52 ` [RFC v2 02/11] ASoC: Intel: Skylake: Add entry in sst_acpi_mach for HDA codecs Rakesh Ughreja
2017-12-11 10:52 ` [RFC v2 03/11] ASoC: Intel: Skylake: add HDA BE DAIs Rakesh Ughreja
2017-12-11 10:52 ` [RFC v2 04/11] ASoC: Intel: Skylake: use hda_bus instead of hdac_bus Rakesh Ughreja
2017-12-11 10:52 ` [RFC v2 05/11] ALSA: hda - make some of the functions externally visible Rakesh Ughreja
2017-12-11 10:52 ` [RFC v2 06/11] ASoC: hdac_hda: add ASoC based HDA codec driver Rakesh Ughreja
2017-12-11 10:52 ` [RFC v2 07/11] ALSA: hda: add new API snd_hda_asoc_codec_new for ASoC codec drivers Rakesh Ughreja
2017-12-11 10:53 ` [RFC v2 08/11] ASoC: hdac_hda: add DAI, widgets and related ops Rakesh Ughreja
2017-12-11 10:53 ` [RFC v2 09/11] ASoC: hdac_hda: add runtime PM support Rakesh Ughreja
2017-12-11 10:53 ` Rakesh Ughreja [this message]
2017-12-11 10:53 ` [RFC v2 11/11] ASoC: Intel: Boards: add support for HDA codecs Rakesh Ughreja
2017-12-11 11:23 ` [RFC v2 00/11] Enable HDA Codec support on Intel Platforms (Series2) Takashi Iwai
2017-12-11 15:10   ` Ughreja, Rakesh A
2017-12-11 15:21     ` Takashi Iwai
2017-12-11 18:20       ` Ughreja, Rakesh A
2017-12-11 18:49         ` Takashi Iwai
2017-12-12 16:37           ` Ughreja, Rakesh A
2017-12-12 16:50             ` Takashi Iwai
2017-12-12 18:25               ` Ughreja, Rakesh A
2017-12-12 18:21             ` Joël Krähemann
2017-12-12 18:40               ` Ughreja, Rakesh A
2017-12-12 18:51                 ` Joël Krähemann
2017-12-13  5:22                   ` Ughreja, Rakesh A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512989583-10877-11-git-send-email-rakesh.a.ughreja@intel.com \
    --to=rakesh.a.ughreja@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.