From patchwork Fri Dec 7 23:50:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 10719011 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5ACFA109C for ; Fri, 7 Dec 2018 23:51:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49B6A2E155 for ; Fri, 7 Dec 2018 23:51:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CE0C2E310; Fri, 7 Dec 2018 23:51:54 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 898C42E155 for ; Fri, 7 Dec 2018 23:51:53 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3DE6C267D52; Sat, 8 Dec 2018 00:51:22 +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 8EB4F267D2F; Sat, 8 Dec 2018 00:51:09 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by alsa0.perex.cz (Postfix) with ESMTP id 4E20E267D20 for ; Sat, 8 Dec 2018 00:51:07 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2018 15:51:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,327,1539673200"; d="scan'208";a="99019164" Received: from shuhuang-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.255.77.13]) by orsmga006.jf.intel.com with ESMTP; 07 Dec 2018 15:51:05 -0800 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Fri, 7 Dec 2018 17:50:07 -0600 Message-Id: <20181207235008.22988-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181207235008.22988-1-pierre-louis.bossart@linux.intel.com> References: <20181207235008.22988-1-pierre-louis.bossart@linux.intel.com> Cc: Cezary Rojewski , Filip Kaczmarski , tiwai@suse.de, Chris Chiu , Pierre-Louis Bossart , Daniel Drake , liam.r.girdwood@linux.intel.com, vkoul@kernel.org, broonie@kernel.org, Michal Wasko , Gustaw Lewandowski Subject: [alsa-devel] [PATCH 5/6] ASoC: Intel: Skylake: add error logs on probe, remove dependency on NHLT 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 Add error logs to make probe debug easier. Also remove hard-coded dependency on NHLT. NHLT literally stands for NonHdaudioLinkTable and is only required for SSP/DMIC interfaces. Signed-off-by: Pierre-Louis Bossart --- sound/soc/intel/skylake/skl-nhlt.c | 3 +++ sound/soc/intel/skylake/skl.c | 41 +++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c index 01a050cf8775..5d125a3df527 100644 --- a/sound/soc/intel/skylake/skl-nhlt.c +++ b/sound/soc/intel/skylake/skl-nhlt.c @@ -180,6 +180,9 @@ int skl_get_dmic_geo(struct skl *skl) unsigned int dmic_geo = 0; u8 j; + if (!nhlt) + return 0; + epnt = (struct nhlt_endpoint *)nhlt->desc; for (j = 0; j < nhlt->endpoint_count; j++) { diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index f04e9ec4432b..f9888b1d5521 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -1010,8 +1010,10 @@ static int skl_probe(struct pci_dev *pci, bus = skl_to_bus(skl); err = skl_first_init(bus); - if (err < 0) + if (err < 0) { + dev_err(bus->dev, "skl_first_init failed with err: %d\n", err); goto out_free; + } skl->pci_id = pci->device; @@ -1020,26 +1022,39 @@ static int skl_probe(struct pci_dev *pci, skl->nhlt = skl_nhlt_init(bus->dev); if (skl->nhlt == NULL) { +#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) + dev_err(bus->dev, "no nhlt info found\n"); err = -ENODEV; goto out_free; - } +#else + dev_warn(bus->dev, "no nhlt info found, continuing to try to enable HDaudio codec\n"); +#endif + } else { - err = skl_nhlt_create_sysfs(skl); - if (err < 0) - goto out_nhlt_free; + err = skl_nhlt_create_sysfs(skl); + if (err < 0) { + dev_err(bus->dev, "skl_nhlt_create_sysfs failed with err: %d\n", err); + goto out_nhlt_free; + } - skl_nhlt_update_topology_bin(skl); + skl_nhlt_update_topology_bin(skl); + + /* create device for dsp clk */ + err = skl_clock_device_register(skl); + if (err < 0) { + dev_err(bus->dev, "skl_clock_device_register failed with err: %d\n", err); + goto out_clk_free; + } + } pci_set_drvdata(skl->pci, bus); - /* create device for dsp clk */ - err = skl_clock_device_register(skl); - if (err < 0) - goto out_clk_free; err = skl_find_machine(skl, (void *)pci_id->driver_data); - if (err < 0) + if (err < 0) { + dev_err(bus->dev, "skl_find_machine failed with err: %d\n", err); goto out_nhlt_free; + } err = skl_init_dsp(skl); if (err < 0) { @@ -1056,8 +1071,10 @@ static int skl_probe(struct pci_dev *pci, /* create device for soc dmic */ err = skl_dmic_device_register(skl); - if (err < 0) + if (err < 0) { + dev_err(bus->dev, "skl_dmic_device_register failed with err: %d\n", err); goto out_dsp_free; + } schedule_work(&skl->probe_work);