From patchwork Tue Jul 1 05:55:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 4456631 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C1249F26C for ; Tue, 1 Jul 2014 05:56:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21E412040F for ; Tue, 1 Jul 2014 05:56:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id AD997203E3 for ; Tue, 1 Jul 2014 05:56:03 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E60D4265006; Tue, 1 Jul 2014 07:55:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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 8017E264F1E; Tue, 1 Jul 2014 07:55:46 +0200 (CEST) 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 1E938264F22; Tue, 1 Jul 2014 07:55:45 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id E7518264F1E for ; Tue, 1 Jul 2014 07:55:35 +0200 (CEST) Received: from hd9483857.selulk5.dyn.perspektivbredband.net ([217.72.56.87] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1X1r2V-0000sB-4R; Tue, 01 Jul 2014 05:55:35 +0000 From: David Henningsson To: tiwai@suse.de, alsa-devel@alsa-project.org Date: Tue, 1 Jul 2014 07:55:38 +0200 Message-Id: <1404194138-6899-1-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 Cc: David Henningsson Subject: [alsa-devel] [PATCH (hda-emu)] Adapt to new snd_hda_calc_stream_format 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 Signed-off-by: David Henningsson --- configure.ac | 23 +++++++++++++++++++++++ hda-emu.c | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 31b31cd..fe5c0e2 100644 --- a/configure.ac +++ b/configure.ac @@ -488,6 +488,29 @@ if test "$STREAM_FORMAT_WITH_SPDIF" = "1"; then fi fi +AC_MSG_CHECKING(for snd_hda_calc_stream_format with codec) +ac_save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Iinclude" +STREAM_FORMAT_WITH_CODEC= +AC_TRY_COMPILE([ +#include "hda-types.h" +#include "hda-log.h" +#include +#include +#include +#include "hda/hda_codec.h" +],[ + snd_hda_calc_stream_format(0, 0, 0, 0, 0, 0); +], + [AC_MSG_RESULT(yes); STREAM_FORMAT_WITH_CODEC="1"], + [AC_MSG_RESULT(no)], + [AC_MSG_RESULT(unknown)] +) +CFLAGS=$ac_save_CFLAGS +if test "$STREAM_FORMAT_WITH_CODEC" = "1"; then + AC_DEFINE(STREAM_FORMAT_WITH_CODEC) +fi + HAVE_COMMON_PREPARE= AC_MSG_CHECKING(for common snd_hda_codec_prepare/cleanup) if grep -q snd_hda_codec_prepare hda/hda_codec.h; then diff --git a/hda-emu.c b/hda-emu.c index b564e34..e8309d5 100644 --- a/hda-emu.c +++ b/hda-emu.c @@ -798,7 +798,11 @@ void hda_test_pcm(int id, int op, int subid, hda_log(HDA_LOG_INFO, "Prepare PCM, rate=%d, channels=%d, " "format=%d bits\n", rate, channels, format); - format_val = snd_hda_calc_stream_format(rate, channels, + format_val = snd_hda_calc_stream_format( +#if defined(STREAM_FORMAT_WITH_CODEC) + _codec, +#endif + rate, channels, get_alsa_format(format), format #if defined(INDIVIDUAL_SPDIF_CTLS) || defined(STREAM_FORMAT_WITH_SPDIF)