Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6483146rwb; Wed, 18 Jan 2023 05:53:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXtupYYbHMy3RkCF8v+PbJBwFK07/pYdBFb2NlyuEcaAWV7WjxYKbhaplgnht/KW513xuFcS X-Received: by 2002:a05:6402:5305:b0:499:8849:5fb6 with SMTP id eo5-20020a056402530500b0049988495fb6mr7398551edb.30.1674050005614; Wed, 18 Jan 2023 05:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674050005; cv=none; d=google.com; s=arc-20160816; b=ApBCMYHUQOZOk3FX2/YCIDCWBQpAhyaQbANu2AoZjpO5tPR/FZOOzF3dN2Tia4SbMX Wv+zyVf4wKCEKq9uVYgD1CgkNdw+LMNuFqM1IQpMDzTsNEH3ho0h/263XH3LXdSrNvDc xAGpXohU88yJcrlo0WX+PZvlO4xxtZ92u60QaEd2mcSi34rXin4PBvpcj612S7zzmBfX pg3NK+2FZZNWKtWzScaLgOgU6DAux4AEVU0ddSTT+xE6Jutt/YLDBEvkJP8k4G9WWnlC 2QysLXifpT8h8rxWT3sxsNXJHQmfZorSnnvXYxw+TK6IlHr0CMEiZSLj5ezFVyUcVtWh FJrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/x6a0kRqZFzfACVy+tFZa/D9buCWMk7aPEZ6L3MonEA=; b=AExwf/8EQqkmBB9DwERcY74gKMscL4LUE/n3Z/qpxBs3D5Rj6x3p46SfQqdBUlV6RC kqIP7v7fNHMTRXRy2UkvxrSSpQ4vYGTWwFfaE2Qoops/BRUuFJ4G2bUzGn/ItcPt1AUi WWLPBNcSxTsrOimeqhLrgkT1fwUlatdTuaXDKvCWBOS5kHlckmUjMzGM9cIM9G2ZFkph h1XA/e4nIpm5tUtcJ52n3sxQFf86dDpQ/dUmO2hyoEwVN92lNkWOfSgPPDF2XPV2O2rc jYKXZ870HBGNAQ+i6HYXhLX0H+EzHtSLvFOjNxItGAG0soiQphUte01yGh2ibiXYumBM Z+cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=kEwuorQ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a056402084e00b004842aaeea0bsi16167238edz.603.2023.01.18.05.53.14; Wed, 18 Jan 2023 05:53:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=kEwuorQ0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231420AbjARN0P (ORCPT + 45 others); Wed, 18 Jan 2023 08:26:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231672AbjARNZe (ORCPT ); Wed, 18 Jan 2023 08:25:34 -0500 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F80A9B11A for ; Wed, 18 Jan 2023 04:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1674046360; x=1705582360; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/x6a0kRqZFzfACVy+tFZa/D9buCWMk7aPEZ6L3MonEA=; b=kEwuorQ0DMhcfZFTIhFT5F/jom3ZIXO2OGSjrpg+vM+iF/G4FQQrF2IN O2yQ/LHkHn46R2fk+Qv0ofE+lppaox1QR8jv7ksH2WpPvlLzjGoCeITOT rKSN3A1qJiZb2yQMHMBl1TVN4nQtS6W1hgwp8QN5IeWPM8RwN5IPV6z2G U+xdLWxeBUCcAsyOBsClt0O1vKLnbrNbWRkGNTwKAxWrohcv32AUhd7v7 MLdqvmW485U2xdd6Q8zq0y92WsAO4E3GS7l7NOlmyy4xwF8Uy8QscGYrd 1TLHaLthuiApM/xdTUIGdyHA42e6CnwHPItEQ+9owezkyEYpjiWq3Tm1e g==; From: Astrid Rost To: Mark Brown , Liam Girdwood , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai CC: , , , Astrid Rost Subject: [PATCH v1 1/4] ASoC: soc-component: add get_jack_supported_type Date: Wed, 18 Jan 2023 13:52:23 +0100 Message-ID: <20230118125226.333214-2-astrid.rost@axis.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230118125226.333214-1-astrid.rost@axis.com> References: <20230118125226.333214-1-astrid.rost@axis.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add function to return the supported jack type of snd_jack_types. This allows a generic card driver to check whether the jack type is valid or add all supported ones. Signed-off-by: Astrid Rost --- include/sound/soc-component.h | 2 ++ sound/soc/soc-component.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h index c26ffb033777..5aa43c323028 100644 --- a/include/sound/soc-component.h +++ b/include/sound/soc-component.h @@ -98,6 +98,7 @@ struct snd_soc_component_driver { int source, unsigned int freq_in, unsigned int freq_out); int (*set_jack)(struct snd_soc_component *component, struct snd_soc_jack *jack, void *data); + int (*get_jack_supported_type)(struct snd_soc_component *component); /* DT */ int (*of_xlate_dai_name)(struct snd_soc_component *component, @@ -384,6 +385,7 @@ int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id, unsigned int freq_out); int snd_soc_component_set_jack(struct snd_soc_component *component, struct snd_soc_jack *jack, void *data); +int snd_soc_component_get_jack_supported_type(struct snd_soc_component *component); void snd_soc_component_seq_notifier(struct snd_soc_component *component, enum snd_soc_dapm_type type, int subseq); diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index e12f8244242b..112da1647f10 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -256,6 +256,24 @@ int snd_soc_component_set_jack(struct snd_soc_component *component, } EXPORT_SYMBOL_GPL(snd_soc_component_set_jack); +/** + * snd_soc_component_get_jack_supported_type + * @component: COMPONENTs + * + * Returns the supported jack type of the component + */ +int snd_soc_component_get_jack_supported_type( + struct snd_soc_component *component) +{ + int ret = -ENOTSUPP; + + if (component->driver->get_jack_supported_type) + ret = component->driver->get_jack_supported_type(component); + + return soc_component_ret(component, ret); +} +EXPORT_SYMBOL_GPL(snd_soc_component_get_jack_supported_type); + int snd_soc_component_module_get(struct snd_soc_component *component, void *mark, int upon_open) { -- 2.30.2