From patchwork Sun Mar 8 14:37:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 5962151 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D3E22BF440 for ; Sun, 8 Mar 2015 14:43:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7BD58202E6 for ; Sun, 8 Mar 2015 14:43:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BD56A2015A for ; Sun, 8 Mar 2015 14:43:08 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E786426054F; Sun, 8 Mar 2015 15:43:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 276CD2604CE; Sun, 8 Mar 2015 15:41:38 +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 2E61E2604C3; Sun, 8 Mar 2015 15:41:36 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id 6B106260481 for ; Sun, 8 Mar 2015 15:41:28 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 08 Mar 2015 07:39:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,362,1422950400"; d="scan'208";a="464251115" Received: from vkoul-udesk3.iind.intel.com ([10.223.84.65]) by FMSMGA003.fm.intel.com with ESMTP; 08 Mar 2015 07:34:51 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Sun, 8 Mar 2015 20:07:56 +0530 Message-Id: <1425825479-28780-3-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1425825479-28780-1-git-send-email-vinod.koul@intel.com> References: <1425825479-28780-1-git-send-email-vinod.koul@intel.com> Cc: tiwai@suse.de, Jeeja KP , Vinod Koul , lgirdwood@gmail.com Subject: [alsa-devel] [RFC 2/5] ALSA: HDA: create HDA common lib 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 From: Jeeja KP Move the common hda controller and hda codec code from sound/pci/hda/ to sound/hda. This new location will serve as common HDA lib uses by current code as well as upcoming ASoC HDA implementations Signed-off-by: Jeeja KP Signed-off-by: Vinod Koul --- sound/Kconfig | 2 + sound/Makefile | 2 +- sound/hda/Kconfig | 85 +++++++++++++++++++++++++++++++++ sound/hda/Makefile | 20 ++++++++ sound/{pci => }/hda/hda_auto_parser.c | 0 sound/{pci => }/hda/hda_beep.c | 0 sound/{pci => }/hda/hda_codec.c | 0 sound/{pci => }/hda/hda_controller.c | 0 sound/{pci => }/hda/hda_eld.c | 0 sound/{pci => }/hda/hda_generic.c | 0 sound/{pci => }/hda/hda_hwdep.c | 0 sound/{pci => }/hda/hda_intel_trace.h | 0 sound/{pci => }/hda/hda_jack.c | 0 sound/{pci => }/hda/hda_proc.c | 0 sound/{pci => }/hda/hda_sysfs.c | 0 sound/{pci => }/hda/hda_trace.h | 0 sound/pci/hda/Kconfig | 44 ----------------- sound/pci/hda/Makefile | 14 +----- 18 files changed, 110 insertions(+), 57 deletions(-) create mode 100644 sound/hda/Kconfig create mode 100644 sound/hda/Makefile rename sound/{pci => }/hda/hda_auto_parser.c (100%) rename sound/{pci => }/hda/hda_beep.c (100%) rename sound/{pci => }/hda/hda_codec.c (100%) rename sound/{pci => }/hda/hda_controller.c (100%) rename sound/{pci => }/hda/hda_eld.c (100%) rename sound/{pci => }/hda/hda_generic.c (100%) rename sound/{pci => }/hda/hda_hwdep.c (100%) rename sound/{pci => }/hda/hda_intel_trace.h (100%) rename sound/{pci => }/hda/hda_jack.c (100%) rename sound/{pci => }/hda/hda_proc.c (100%) rename sound/{pci => }/hda/hda_sysfs.c (100%) rename sound/{pci => }/hda/hda_trace.h (100%) diff --git a/sound/Kconfig b/sound/Kconfig index c710ce2c5c37..63233752ee01 100644 --- a/sound/Kconfig +++ b/sound/Kconfig @@ -90,6 +90,8 @@ source "sound/mips/Kconfig" source "sound/sh/Kconfig" +source "sound/hda/Kconfig" + # the following will depend on the order of config. # here assuming USB is defined before ALSA source "sound/usb/Kconfig" diff --git a/sound/Makefile b/sound/Makefile index ce9132b1c395..0e5c4283f4a4 100644 --- a/sound/Makefile +++ b/sound/Makefile @@ -5,7 +5,7 @@ obj-$(CONFIG_SOUND) += soundcore.o obj-$(CONFIG_SOUND_PRIME) += sound_firmware.o obj-$(CONFIG_SOUND_PRIME) += oss/ obj-$(CONFIG_DMASOUND) += oss/ -obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ sh/ synth/ usb/ \ +obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ sh/ hda/ synth/ usb/ \ firewire/ sparc/ spi/ parisc/ pcmcia/ mips/ soc/ atmel/ obj-$(CONFIG_SND_AOA) += aoa/ diff --git a/sound/hda/Kconfig b/sound/hda/Kconfig new file mode 100644 index 000000000000..7e1f1a07cb6e --- /dev/null +++ b/sound/hda/Kconfig @@ -0,0 +1,85 @@ +menu "HD-Audio Common Library" + +config SND_CORE_HDA + tristate "Enable HD Audio Common Library" + default n + select SND_VMASTER + select SND_KCTL_JACK + help + Say Y here to enable the HD-audio codec common library. + +if SND_CORE_HDA + +config SND_HDA_PREALLOC_SIZE + int "Pre-allocated buffer size for HD-audio driver" + range 0 32768 + default 64 + help + Specifies the default pre-allocated buffer-size in kB for the + HD-audio driver. A larger buffer (e.g. 2048) is preferred for systems + using PulseAudio. The default 64 is chosen just + for compatibility reasons. + + Note that the pre-allocation size can be changed dynamically + via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too. + +config SND_HDA_HWDEP + bool "Build hwdep interface for HD-audio driver" + select SND_HWDEP + help + Say Y here to build a hwdep interface for HD-audio driver. + This interface can be used for out-of-band communication + with codecs for debugging purposes. + +config SND_HDA_PATCH_LOADER + bool "Support initialization patch loading for HD-audio" + select FW_LOADER + select SND_HDA_RECONFIG + help + Say Y here to allow the HD-audio driver to load a pseudo + firmware file ("patch") for overriding the BIOS setup at + start up. The "patch" file can be specified via patch module + option, such as patch=hda-init. + +config SND_HDA_RECONFIG + bool "Allow dynamic codec reconfiguration" + help + Say Y here to enable the HD-audio codec re-configuration feature. + This adds the sysfs interfaces to allow user to clear the whole + codec configuration, change the codec setup, add extra verbs, + and re-configure the codec dynamically. + +config SND_HDA_INPUT_BEEP + bool "Support digital beep via input layer" + depends on INPUT=y || INPUT=SND_HDA + help + Say Y here to build a digital beep interface for HD-audio + driver. This interface is used to generate digital beeps. + +config SND_HDA_INPUT_BEEP_MODE + int "Digital beep registration mode (0=off, 1=on)" + depends on SND_HDA_INPUT_BEEP=y + default "1" + range 0 1 + help + Set 0 to disable the digital beep interface for HD-audio by default. + Set 1 to always enable the digital beep interface for HD-audio by + default. + +config SND_HDA_INPUT_JACK + bool "Support jack plugging notification via input layer" + depends on INPUT=y || INPUT=SND + select SND_JACK + help + Say Y here to enable the jack plugging notification via + input layer. + +config SND_CORE_HDA_GENERIC + tristate "Enable generic HD-audio codec parser" + help + Say Y or M here to enable the generic HD-audio codec parser + in HDA library. + +endif + +endmenu diff --git a/sound/hda/Makefile b/sound/hda/Makefile new file mode 100644 index 000000000000..6862de9bcbb6 --- /dev/null +++ b/sound/hda/Makefile @@ -0,0 +1,20 @@ +snd-hda-controller-objs := hda_controller.o +snd-hda-codec-y := hda_codec.o hda_jack.o hda_auto_parser.o \ + hda_eld.o hda_sysfs.o + +snd-hda-codec-$(CONFIG_PROC_FS) += hda_proc.o +snd-hda-codec-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o +snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o + +# for trace-points +CFLAGS_hda_controller.o := -I$(src) +CFLAGS_hda_codec.o := -I$(src) + +snd-hda-codec-generic-objs := hda_generic.o + +# common driver +obj-$(CONFIG_SND_CORE_HDA) += snd-hda-codec.o +obj-$(CONFIG_SND_CORE_HDA) += snd-hda-controller.o + +# codec drivers +obj-$(CONFIG_SND_CORE_HDA_GENERIC) += snd-hda-codec-generic.o diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/hda/hda_auto_parser.c similarity index 100% rename from sound/pci/hda/hda_auto_parser.c rename to sound/hda/hda_auto_parser.c diff --git a/sound/pci/hda/hda_beep.c b/sound/hda/hda_beep.c similarity index 100% rename from sound/pci/hda/hda_beep.c rename to sound/hda/hda_beep.c diff --git a/sound/pci/hda/hda_codec.c b/sound/hda/hda_codec.c similarity index 100% rename from sound/pci/hda/hda_codec.c rename to sound/hda/hda_codec.c diff --git a/sound/pci/hda/hda_controller.c b/sound/hda/hda_controller.c similarity index 100% rename from sound/pci/hda/hda_controller.c rename to sound/hda/hda_controller.c diff --git a/sound/pci/hda/hda_eld.c b/sound/hda/hda_eld.c similarity index 100% rename from sound/pci/hda/hda_eld.c rename to sound/hda/hda_eld.c diff --git a/sound/pci/hda/hda_generic.c b/sound/hda/hda_generic.c similarity index 100% rename from sound/pci/hda/hda_generic.c rename to sound/hda/hda_generic.c diff --git a/sound/pci/hda/hda_hwdep.c b/sound/hda/hda_hwdep.c similarity index 100% rename from sound/pci/hda/hda_hwdep.c rename to sound/hda/hda_hwdep.c diff --git a/sound/pci/hda/hda_intel_trace.h b/sound/hda/hda_intel_trace.h similarity index 100% rename from sound/pci/hda/hda_intel_trace.h rename to sound/hda/hda_intel_trace.h diff --git a/sound/pci/hda/hda_jack.c b/sound/hda/hda_jack.c similarity index 100% rename from sound/pci/hda/hda_jack.c rename to sound/hda/hda_jack.c diff --git a/sound/pci/hda/hda_proc.c b/sound/hda/hda_proc.c similarity index 100% rename from sound/pci/hda/hda_proc.c rename to sound/hda/hda_proc.c diff --git a/sound/pci/hda/hda_sysfs.c b/sound/hda/hda_sysfs.c similarity index 100% rename from sound/pci/hda/hda_sysfs.c rename to sound/hda/hda_sysfs.c diff --git a/sound/pci/hda/hda_trace.h b/sound/hda/hda_trace.h similarity index 100% rename from sound/pci/hda/hda_trace.h rename to sound/hda/hda_trace.h diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig index ebf4c2fb99df..7a821ebb3bc2 100644 --- a/sound/pci/hda/Kconfig +++ b/sound/pci/hda/Kconfig @@ -3,8 +3,6 @@ menu "HD-Audio" config SND_HDA tristate select SND_PCM - select SND_VMASTER - select SND_KCTL_JACK config SND_HDA_INTEL tristate "HD Audio PCI" @@ -61,39 +59,6 @@ config SND_HDA_HWDEP This interface can be used for out-of-band communication with codecs for debugging purposes. -config SND_HDA_RECONFIG - bool "Allow dynamic codec reconfiguration" - help - Say Y here to enable the HD-audio codec re-configuration feature. - This adds the sysfs interfaces to allow user to clear the whole - codec configuration, change the codec setup, add extra verbs, - and re-configure the codec dynamically. - -config SND_HDA_INPUT_BEEP - bool "Support digital beep via input layer" - depends on INPUT=y || INPUT=SND_HDA - help - Say Y here to build a digital beep interface for HD-audio - driver. This interface is used to generate digital beeps. - -config SND_HDA_INPUT_BEEP_MODE - int "Digital beep registration mode (0=off, 1=on)" - depends on SND_HDA_INPUT_BEEP=y - default "1" - range 0 1 - help - Set 0 to disable the digital beep interface for HD-audio by default. - Set 1 to always enable the digital beep interface for HD-audio by - default. - -config SND_HDA_INPUT_JACK - bool "Support jack plugging notification via input layer" - depends on INPUT=y || INPUT=SND - select SND_JACK - help - Say Y here to enable the jack plugging notification via - input layer. - config SND_HDA_PATCH_LOADER bool "Support initialization patch loading for HD-audio" select FW_LOADER @@ -229,15 +194,6 @@ config SND_HDA_CODEC_SI3054 comment "Set to Y if you want auto-loading the codec driver" depends on SND_HDA=y && SND_HDA_CODEC_SI3054=m -config SND_HDA_GENERIC - tristate "Enable generic HD-audio codec parser" - help - Say Y or M here to enable the generic HD-audio codec parser - in snd-hda-intel driver. - -comment "Set to Y if you want auto-loading the codec driver" - depends on SND_HDA=y && SND_HDA_GENERIC=m - config SND_HDA_POWER_SAVE_DEFAULT int "Default time-out for HD-audio power-save mode" depends on PM diff --git a/sound/pci/hda/Makefile b/sound/pci/hda/Makefile index 194f30935e77..62c0f3f3424f 100644 --- a/sound/pci/hda/Makefile +++ b/sound/pci/hda/Makefile @@ -1,19 +1,11 @@ snd-hda-intel-objs := hda_intel.o -snd-hda-controller-objs := hda_controller.o snd-hda-tegra-objs := hda_tegra.o # for haswell power well snd-hda-intel-$(CONFIG_SND_HDA_I915) += hda_i915.o -snd-hda-codec-y := hda_codec.o hda_jack.o hda_auto_parser.o hda_sysfs.o -snd-hda-codec-$(CONFIG_PROC_FS) += hda_proc.o -snd-hda-codec-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o -snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o - # for trace-points -CFLAGS_hda_codec.o := -I$(src) -CFLAGS_hda_controller.o := -I$(src) +#CFLAGS_hda_controller.o := -I$(src) -snd-hda-codec-generic-objs := hda_generic.o snd-hda-codec-realtek-objs := patch_realtek.o snd-hda-codec-cmedia-objs := patch_cmedia.o snd-hda-codec-analog-objs := patch_analog.o @@ -27,11 +19,9 @@ snd-hda-codec-via-objs := patch_via.o snd-hda-codec-hdmi-objs := patch_hdmi.o hda_eld.o # common driver -obj-$(CONFIG_SND_HDA) := snd-hda-codec.o -obj-$(CONFIG_SND_HDA) += snd-hda-controller.o +#obj-$(CONFIG_SND_HDA) += snd-hda-controller.o # codec drivers -obj-$(CONFIG_SND_HDA_GENERIC) += snd-hda-codec-generic.o obj-$(CONFIG_SND_HDA_CODEC_REALTEK) += snd-hda-codec-realtek.o obj-$(CONFIG_SND_HDA_CODEC_CMEDIA) += snd-hda-codec-cmedia.o obj-$(CONFIG_SND_HDA_CODEC_ANALOG) += snd-hda-codec-analog.o