From patchwork Tue Jul 17 15:36:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10529889 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 5BD49603ED for ; Tue, 17 Jul 2018 15:42:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B638293CE for ; Tue, 17 Jul 2018 15:42:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49E4D29567; Tue, 17 Jul 2018 15:42:39 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID 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 B77DD29751 for ; Tue, 17 Jul 2018 15:42:37 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 27323267864; Tue, 17 Jul 2018 17:37:24 +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 3F98C26781F; Tue, 17 Jul 2018 17:37:07 +0200 (CEST) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by alsa0.perex.cz (Postfix) with ESMTP id 27F122677D7 for ; Tue, 17 Jul 2018 17:37:04 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id v25-v6so1976982wmc.0 for ; Tue, 17 Jul 2018 08:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yoo5n4dhpulCSFNRPHfsRmRUHZHqOi5jkgvB0Euf0Sg=; b=mkPDfy2TrU9TpaAJ+aww5QTfB8F/rkYM23QejFTw1hkEqPzKDy2lg+uMve0YbQLe70 2k50Kd7GEPbHwdcf7Um8zihA/PArsgs7C8ivn6fY3QS5OTYSiaxZW+HuzJVD4lfupreS pajhG0hujS2nM4tQnKDLMljis0W75cLDttcGM0QEtnkqG149/7W2/3PKkYPW0tUlO7ja 39VjtWuylPqVB+Zu8nq9aGSXWU3wDAxG3dXj5Bcv1miGzWOPuGApSu8QiLUPq6H4xmlp 1M3TypZxs3buLDg9pThLuXO+vDfTWO5Mmcj0yQBotrdyLjCR1fb9AwSsdO3Zu6CqRlcc 93+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yoo5n4dhpulCSFNRPHfsRmRUHZHqOi5jkgvB0Euf0Sg=; b=gy8uJzpvoQdpllLWQHd3TGIIgRErBxck8icteIVnPb12OwFcVZLgYF0RGp7BpHlrM/ XJ671K4hZ2/MrCjNIn0NM3ECtzsRHSWFhbCBLrNyj8TD2yuOwnw32NEcn7Jm6Bp+0xfX w8T1HxYpt2x7pH5WLmRt3CTes0SiqSPMrVjJsG+xkroDF55Pt0C5rwlmlUlwAgwXrOsA mmowEfPHAvusotdgjuNOS9W0PGsYTQ/5OQ5cWaWTjKngSUz+Lpvg7vmwkCgffJKQTw5b 7alIOvTUG5dQkE5hCpFJ7dGowI1vT4R5IA8oenPW0iKxhUFbrU80Zm2wxppLQG0xuXcO 3AKA== X-Gm-Message-State: AOUpUlG1My47uD7EFd/YaXGV5rkAhL8eTZ2HIiktcnPIF1WXjkJnpWvr uMdEmhBQ9XQYbC45J9wLcN8r+w== X-Google-Smtp-Source: AAOMgpc995b1jmCC/CEWqHFmDSSNWOsmhhzibjX7wSF3scH69quIlP88N9XLR49qlkNZt7tqo4AWZg== X-Received: by 2002:a1c:3f08:: with SMTP id m8-v6mr1826562wma.88.1531841823914; Tue, 17 Jul 2018 08:37:03 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id h12-v6sm16971464wmb.3.2018.07.17.08.37.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Jul 2018 08:37:03 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood , Kevin Hilman , Carlo Caione Date: Tue, 17 Jul 2018 17:36:40 +0200 Message-Id: <20180717153643.8806-17-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180717153643.8806-1-jbrunet@baylibre.com> References: <20180717153643.8806-1-jbrunet@baylibre.com> Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Jerome Brunet Subject: [alsa-devel] [PATCH 13/15] ASoC: export snd_soc_of_get_slot_mask 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 Amlogic's axg card driver can't use snd_soc_of_parse_tdm_slot() directly because it needs to handle 4 mask for each direction. Yet the parsing of each mask is the same, so export snd_soc_of_get_slot_mask() to reuse the the existing code. Signed-off-by: Jerome Brunet --- include/sound/soc.h | 3 +++ sound/soc/soc-core.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index a4915148f739..41cec42fb456 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1426,6 +1426,9 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card, const char *propname); int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, const char *propname); +int snd_soc_of_get_slot_mask(struct device_node *np, + const char *prop_name, + unsigned int *mask); int snd_soc_of_parse_tdm_slot(struct device_node *np, unsigned int *tx_mask, unsigned int *rx_mask, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3be0310d5c81..1344e8e602fd 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3366,9 +3366,9 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets); -static int snd_soc_of_get_slot_mask(struct device_node *np, - const char *prop_name, - unsigned int *mask) +int snd_soc_of_get_slot_mask(struct device_node *np, + const char *prop_name, + unsigned int *mask) { u32 val; const __be32 *of_slot_mask = of_get_property(np, prop_name, &val); @@ -3383,6 +3383,7 @@ static int snd_soc_of_get_slot_mask(struct device_node *np, return val; } +EXPORT_SYMBOL_GPL(snd_soc_of_get_slot_mask); int snd_soc_of_parse_tdm_slot(struct device_node *np, unsigned int *tx_mask,