From patchwork Tue Mar 8 19:26:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 549736 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A914C433F5 for ; Tue, 8 Mar 2022 19:30:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A815B18BD; Tue, 8 Mar 2022 20:29:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A815B18BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646767826; bh=gIPidTCkt+hMG05SigVPkwXfKWSt3ku7znRlY3Y8WbE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=G+qxTZwTAmvwm54O7QJl1MK77uRx5DJnmt0HuMoCz8+E+hGEoQi8P/MBVefG6Oa2j uOjhkHm6HGCoWYBR85JdJqHX33h0ezut994GZOPhTWe8Cq7tJDo4AqYuC59GBQes5u tP9sr9p7V1SFif6vbWviIpsKqFMSftL1/Z0UM3uI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DB36FF80520; Tue, 8 Mar 2022 20:27:06 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6EB90F8053C; Tue, 8 Mar 2022 20:26:58 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A5D92F8051A for ; Tue, 8 Mar 2022 20:26:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A5D92F8051A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cpGaZN5O" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646767610; x=1678303610; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gIPidTCkt+hMG05SigVPkwXfKWSt3ku7znRlY3Y8WbE=; b=cpGaZN5O6XTSkdjIqFJP02/eYCQuI/bS4WaNUsCv3Mw+6NHFGod7+iAd 8j51OG66tL5oio/Bn6/MWEsFCetP+85j/yjlD5NJYxDE4dmSucM1jM2D0 a2R07kC9RVfi3apkPkz53Atb5WCjGfOPsP1xXsgw/4d4KhXIvxzwFC/Mc Hsxt6kKh/ulnfI+GD9eF9hQPvsO820BkjvJDjDTZBM/3MjG5VwQoxbDAf 4PZH98vcNRh/ouxk1yTP9KeCyvKFHn3kELC3Eb5fglidehSFCcP39uZ6F KZ1B8+565xfrjKXZAUQe/XTyi16CvUcMazcidhAEV9Mf8aMuDh8fpT/lt Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10280"; a="252363719" X-IronPort-AV: E=Sophos;i="5.90,165,1643702400"; d="scan'208";a="252363719" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2022 11:26:46 -0800 X-IronPort-AV: E=Sophos;i="5.90,165,1643702400"; d="scan'208";a="495573969" Received: from jhaskins-mobl.amr.corp.intel.com (HELO pbossart-mobl3.amr.corp.intel.com) ([10.209.53.149]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2022 11:26:46 -0800 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 11/20] ASoC: Intel: sof_es8336: make gpio optional Date: Tue, 8 Mar 2022 13:26:01 -0600 Message-Id: <20220308192610.392950-12-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220308192610.392950-1-pierre-louis.bossart@linux.intel.com> References: <20220308192610.392950-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , tiwai@suse.de, =?utf-8?q?P?= =?utf-8?q?=C3=A9ter_Ujfalusi?= , Huajun Li , Pierre-Louis Bossart , Nikolai Kostrigin , broonie@kernel.org, Mauro Carvalho Chehab , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Do not fail if the GPIO used for speakers is not present, at least the headphone, headset and internal mics should work. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi --- sound/soc/intel/boards/sof_es8336.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c index e6d599f0cd26..eb792bd911fa 100644 --- a/sound/soc/intel/boards/sof_es8336.c +++ b/sound/soc/intel/boards/sof_es8336.c @@ -523,11 +523,10 @@ static int sof_es8336_probe(struct platform_device *pdev) if (ret) dev_warn(codec_dev, "unable to add GPIO mapping table\n"); - priv->gpio_pa = gpiod_get(codec_dev, "pa-enable", GPIOD_OUT_LOW); + priv->gpio_pa = gpiod_get_optional(codec_dev, "pa-enable", GPIOD_OUT_LOW); if (IS_ERR(priv->gpio_pa)) { - ret = PTR_ERR(priv->gpio_pa); - dev_err(codec_dev, "%s, could not get pa-enable: %d\n", - __func__, ret); + ret = dev_err_probe(dev, PTR_ERR(priv->gpio_pa), + "could not get pa-enable GPIO\n"); goto err; }