From patchwork Sat Apr 20 10:45:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 10910207 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 8AE301515 for ; Sat, 20 Apr 2019 10:48:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78E1D28905 for ; Sat, 20 Apr 2019 10:48:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A9B928C92; Sat, 20 Apr 2019 10:48:57 +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,DKIM_SIGNED, DKIM_VALID,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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B5BFA28905 for ; Sat, 20 Apr 2019 10:48:56 +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 03176853; Sat, 20 Apr 2019 12:48:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 03176853 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1555757335; bh=7xOwnUHOypes2KXiuojM3djWyiGurGzjbawsjysBxLs=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Wi4sElmLmRLllg/B4Dmagz/9PlrNxqDwY/04RqmbuZkHkxujGQhPWEitI1B0tC9Go Sk8L+wyZhWzF1HRin8xDHQlZBXGW4QhVGsasD6yc4O7eXQ+VHX7iiABY5XWKOk6oxP OCLg/4iyfcB8UQUp2NnESY/xKSCOVpKtwtLyDOiE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 94D9EF8971F; Sat, 20 Apr 2019 12:46:27 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BCDC3F896E8; Sat, 20 Apr 2019 12:46:22 +0200 (CEST) Received: from crapouillou.net (outils.crapouillou.net [89.234.176.41]) (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 04D7EF896E5 for ; Sat, 20 Apr 2019 12:46:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 04D7EF896E5 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="qRYWagdb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1555757177; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZFNdaIfJj47xCdubjYphhaOdGLseFCSEhtDMHA2MkFo=; b=qRYWagdbYStd7BnfbFN6tceTIudnCdyRo9MizWqVC0GBAWPjL9vnPlYbz6ymY2UleSHwre oJ8rNvj0QXVwd0I23GVUDBIY4btBAzbVfgwIF2BGEdIliQuUZUGCy2S8VyH+KKlzqDnZs6 R+ETEyWJl9ozc6Pj8Vk26r6JGoyo7FU= From: Paul Cercueil To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland Date: Sat, 20 Apr 2019 12:45:53 +0200 Message-Id: <20190420104553.5071-3-paul@crapouillou.net> In-Reply-To: <20190420104553.5071-1-paul@crapouillou.net> References: <20190420104553.5071-1-paul@crapouillou.net> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Kuninori Morimoto , linux-kernel@vger.kernel.org, Paul Cercueil , od@zcrc.me Subject: [alsa-devel] [PATCH 3/3] ASoC: simple-card: Read pin switches conf from devicetree 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" X-Virus-Scanned: ClamAV using ClamSMTP When the routing path between a widget (e.g. "Speaker") and the codec goes through an external amplifier, having a pin switch for this widget allows the amplifier to be disabled when the widget is not to be used (e.g. when using headphones). Signed-off-by: Paul Cercueil --- sound/soc/generic/simple-card.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 34de32efc4c4..d34adb1518e7 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -556,6 +556,10 @@ static int simple_parse_of(struct simple_priv *priv) if (ret < 0) return ret; + ret = asoc_simple_card_of_parse_pin_switches(card, PREFIX); + if (ret < 0) + return ret; + /* Single/Muti DAI link(s) & New style of DT node */ memset(&li, 0, sizeof(li)); for (li.cpu = 1; li.cpu >= 0; li.cpu--) {