From patchwork Tue Mar 21 03:15:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fuweix.tang@intel.com X-Patchwork-Id: 9635891 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 DEACA601E9 for ; Tue, 21 Mar 2017 03:16:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2A9A26E97 for ; Tue, 21 Mar 2017 03:16:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C77AF2780C; Tue, 21 Mar 2017 03:16:24 +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 BFA27277D9 for ; Tue, 21 Mar 2017 03:16:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 263B8266FD1; Tue, 21 Mar 2017 04:15:51 +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 42383266FD2; Tue, 21 Mar 2017 04:15:49 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by alsa0.perex.cz (Postfix) with ESMTP id 883B5266FAD for ; Tue, 21 Mar 2017 04:15:44 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP; 20 Mar 2017 20:15:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,197,1486454400"; d="scan'208";a="836868750" Received: from tangfw-thinkpad-x230.sh.intel.com ([10.239.47.167]) by FMSMGA003.fm.intel.com with ESMTP; 20 Mar 2017 20:15:41 -0700 From: fuweix.tang@intel.com To: alsa-devel@alsa-project.org Date: Tue, 21 Mar 2017 11:15:32 +0800 Message-Id: <68144cb2411095ea9c3938975fe8044f4b5cd035.1490064444.git.fuweix.tang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Cc: Nishit Sharma , G Kranthi , tiwai@suse.de, mengdong.lin@intel.com, liam.r.girdwood@linux.intel.com, Vinod Koul , Fuwei Tang Subject: [alsa-devel] [PATCH v2 2/3] ucm-conf: broxton: add broxton-rt298 conf files 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: Vinod Koul This adds the UCM conf files for broxton enabling with rt298 codec on I2S audio, HDMI and DMIC ports. This patch is based on commit 360c976aaa05 ("conf/ucm: broxton: add broxton-rt298 conf files") from alsa-lib by Vinod Koul . Original authorship is retained. Signed-off-by: Nishit Sharma Signed-off-by: G Kranthi Signed-off-by: Vinod Koul Signed-off-by: Fuwei Tang --- Makefile.am | 2 +- broxton-rt298/Hdmi1 | 22 +++++++ broxton-rt298/Hdmi2 | 14 +++++ broxton-rt298/HiFi | 129 +++++++++++++++++++++++++++++++++++++++ broxton-rt298/Makefile.am | 4 ++ broxton-rt298/broxton-rt298.conf | 58 ++++++++++++++++++ configure.ac | 3 +- 7 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 broxton-rt298/Hdmi1 create mode 100644 broxton-rt298/Hdmi2 create mode 100644 broxton-rt298/HiFi create mode 100644 broxton-rt298/Makefile.am create mode 100644 broxton-rt298/broxton-rt298.conf diff --git a/Makefile.am b/Makefile.am index e2baa04..5f86692 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -SUBDIRS= +SUBDIRS=broxton-rt298 diff --git a/broxton-rt298/Hdmi1 b/broxton-rt298/Hdmi1 new file mode 100644 index 0000000..48514f4 --- /dev/null +++ b/broxton-rt298/Hdmi1 @@ -0,0 +1,22 @@ +# Usecase for device HDMI1/Display Port stereo playback on Intel SKYLAKE/KABYLAKE platforms +# For Audio in I2S mode + +SectionDevice."Hdmi1" { + Comment "HDMI/Display Port 1 Stereo" + + EnableSequence [ + exec "echo Hdmi1 EnableSequnece" + ] + + DisableSequence [ + exec "echo Hdmi1 DisableSequnece" + ] + + Value { + PlaybackPCM "hw:broxtonrt298,4" + PlaybackChannels "2" + PlaybackPriority "3" + JackControl "HDMI/DP, pcm=4 Jack" + } +} + diff --git a/broxton-rt298/Hdmi2 b/broxton-rt298/Hdmi2 new file mode 100644 index 0000000..764f8b9 --- /dev/null +++ b/broxton-rt298/Hdmi2 @@ -0,0 +1,14 @@ +# Usecase for device HDMI2/Display Port stereo playback on Intel Broxton platforms +# For Audio in I2S mode + +SectionDevice."Hdmi2" { + Comment "HDMI/Display Port 2 Stereo" + + Value { + PlaybackPCM "hw:broxtonrt298,5" + PlaybackChannels "2" + PlaybackPriority "4" + JackControl "HDMI/DP, pcm=5 Jack" + } +} + diff --git a/broxton-rt298/HiFi b/broxton-rt298/HiFi new file mode 100644 index 0000000..2e2d6fe --- /dev/null +++ b/broxton-rt298/HiFi @@ -0,0 +1,129 @@ +# Usecase for stereo playback Speaker and Headset, Recording on DMIC and Headset MIC. +# For Audio in I2S mode on Intel Broxton platforms + +SectionVerb { + + EnableSequence [ + cdev "hw:broxtonrt298" + cset "name='media0_out mo dmic01_hifi_in mi Switch' 1" + ] + + DisableSequence [ + cdev "hw:broxtonrt298" + ] + + Value { + TQ "HiFi" + CapturePCM "hw:broxtonrt298,1" + PlaybackPCM "hw:broxtonrt298,0" + } +} + +SectionDevice."dmiccap" { + Comment "DMIC Stereo" + + ConflictingDevice [ + "Headset" + ] + + EnableSequence [ + + cdev "hw:broxtonrt298" + exec "echo broxtonrt298 dmiccap called" + cset "name='media0_out mo dmic01_hifi_in mi Switch' 1" + cset "name='media0_out mo codec0_in mi Switch' 0" + cset "name='Mic Jack Switch' 0" + + ] + + DisableSequence [ + cdev "hw:broxtonrt298" + cset "name='media0_out mo codec0_in mi Switch' 1" + cset "name='media0_out mo dmic01_hifi_in mi Switch' 0" + cset "name='Mic Jack Switch' 1" + cset "name='ADC 0 Mux' 0" + ] + Value { + CaptureChannels "2" + CapturePriority "2" + } +} + +SectionDevice."Headphones" { + Comment "Headphones" + + ConflictingDevice [ + "Speaker" + ] + EnableSequence [ + cdev "hw:broxtonrt298" + exec "echo broxtonrt298 Headphone called" + cset "name='HPO L Switch' 1" + cset "name='HPO R Switch' 1" + cset "name='Headphone Jack Switch' 1" + cset "name='Speaker Playback Switch' 0,0" + ] + + DisableSequence [ + cdev "hw:broxtonrt298" + ] + Value { + PlaybackChannels "2" + PlaybackPriority "1" + JackControl "Headphone Jack" + JackHWMute "Speaker" + } +} + +SectionDevice."Speaker" { + Comment "Speaker" + + ConflictingDevice [ + "Headphones" + ] + EnableSequence [ + cdev "hw:broxtonrt298" + exec "echo broxtonrt298 speaker called" + cset "name='SPO Switch' 1" + cset "name='Speaker Playback Switch' 1,1" + cset "name='Speaker Switch' 1" + cset "name='HPO L Switch' 0" + cset "name='HPO R Switch' 0" + ] + + DisableSequence [ + ] + Value { + PlaybackChannels "2" + PlaybackPriority "1" + JackHWMute "Headphones" + } +} + +SectionDevice."Headset" { + Comment "Headset Mic" + + ConflictingDevice [ + "dmiccap" + ] + EnableSequence [ + cdev "hw:broxtonrt298" + exec "echo broxtonrt298 Headset called" + cset "name='media0_out mo codec0_in mi Switch' 1" + cset "name='ADC0 Capture Volume' 105,105" + cset "name='ADC 0 Mux' 0" + cset "name='Mic Jack Switch' 1" + cset "name='media0_out mo dmic01_hifi_in mi Switch' 0" + ] + + DisableSequence [ + cdev "hw:broxtonrt298" + cset "name='media0_out mo dmic01_hifi_in mi Switch' 1" + cset "name='media0_out mo codec0_in mi Switch' 0" + ] + Value { + CaptureChannels "2" + CapturePriority "2" + JackControl "Mic Jack" + } +} diff --git a/broxton-rt298/Makefile.am b/broxton-rt298/Makefile.am new file mode 100644 index 0000000..80f480e --- /dev/null +++ b/broxton-rt298/Makefile.am @@ -0,0 +1,4 @@ +alsaconfigdir = @ALSA_CONFIG_DIR@ +ucmdir = $(alsaconfigdir)/ucm/broxton-rt298 +ucm_DATA = broxton-rt298.conf HiFi Hdmi1 Hdmi2 +EXTRA_DIST = $(ucm_DATA) diff --git a/broxton-rt298/broxton-rt298.conf b/broxton-rt298/broxton-rt298.conf new file mode 100644 index 0000000..3f3d0be --- /dev/null +++ b/broxton-rt298/broxton-rt298.conf @@ -0,0 +1,58 @@ +# UCM for Intel Broxton platforms +# For Audio in I2S mode + +SectionUseCase."HiFi" { + File "HiFi" + Comment "Play and record HiFi quality Music" +} + +SectionUseCase."Hdmi1" { + File "Hdmi1" + Comment "Play on Hdmi/DP 1" +} + +SectionUseCase."Hdmi2" { + File "Hdmi2" + Comment "Play on Hdmi/DP 2" +} + +ValueDefaults { + PlaybackCTL "hw:broxtonrt298" + CaptureCTL "hw:broxtonrt298" + CaptureChannels "2" + CapturePriority "2" +} + +SectionDefaults [ + cdev "hw:broxtonrt298" + exec "echo broxtonrt298 CONF Defaults" + cset "name='Headphone Jack Switch' 1" + cset "name='Speaker Switch' 1" + cset "name='Speaker Playback Switch' 0,0" + cset "name='Front DAC Switch' 1" + cset "name='Front RECMIX Switch' 0" + cset "name='Mic Jack Switch' 1" + cset "name='ADC 0 Mux' 2" + cset "name='ADC 1 Mux' 0" + cset "name='DAC0 Playback Volume' 100,100" + cset "name='HPO L Switch' 0" + cset "name='HPO Mux' 0" + cset "name='HPO R Switch' 0" + cset "name='Pin 5 Mux' 1" + cset "name='Pin 6 Mux' 2" + cset "name='Pin 7 Mux' 3" + cset "name='RECMIX Beep Switch' 0" + cset "name='RECMIX Line1 Switch' 0" + cset "name='RECMIX Mic1 Switch' 0" + cset "name='SPK Mux' 0" + cset "name='SPO Switch' 1" + cset "name='codec0_out mo codec0_in mi Switch' 0" + cset "name='codec0_out mo dmic01_hifi_in mi Switch' 0" + cset "name='codec0_out mo media0_in mi Switch' 1" + cset "name='codec1_out mo codec0_in mi Switch' 0" + cset "name='codec1_out mo dmic01_hifi_in mi Switch' 0" + cset "name='codec1_out mo media0_in mi Switch' 0" + cset "name='media0_out mo codec0_in mi Switch' 1" + cset "name='media0_out mo dmic01_hifi_in mi Switch' 1" + cset "name='media0_out mo media0_in mi Switch' 0" +] diff --git a/configure.ac b/configure.ac index 0723060..c797f58 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,8 @@ AM_INIT_AUTOMAKE # Checks for typedefs, structures, and compiler characteristics. # Checks for library functions. -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile + broxton-rt298/Makefile]) ALSA_CONFIG_DIR="/usr/share/alsa" test "x$prefix" != xNONE && ALSA_CONFIG_DIR=$prefix