Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6462311rwb; Wed, 18 Jan 2023 05:36:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXsD5N0FcsZE5EOBjbF9rRgx//cSSu4mVsBD6ypb/s7GtBun8l6l00PINS9El3rzoainF4d6 X-Received: by 2002:a17:907:c911:b0:870:5bf4:a3b1 with SMTP id ui17-20020a170907c91100b008705bf4a3b1mr6084235ejc.33.1674049006579; Wed, 18 Jan 2023 05:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674049006; cv=none; d=google.com; s=arc-20160816; b=hgKnBK9dGN599srzPKnAElIT32NXgRkahlfOc8uYbVqN4lMdAOMsSgRWL/i6hVy3GI kzSZnd0+AKPErehloAchK1EjgLbD7kEFKlq2Xdg73X4nazfV7AFO/Dl2+6fejF4mCtJR KAvN4ReTt5H8xrPYibcjeQZRivmmw1kkeM2FVLZyDhLa4gyJx9vrwHNQWQUKFzfn5rqg Nxi7rVMLbgUVBUzyxf/oVQVEfS/VmqH7Rb4RMUInerAbZowNex6xzJIYwjYplEwMSUIg QnWcbWOH9JuJQ748bRNO8WTbysbrnoWOmjFhKKHkyglDmydMabJXl4lNBBNFbQgHwJBB yeBQ== 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=c9tQ6467axGUUkqK8Hn/WxBs1AovQDwhp7i0J3ZaltU=; b=Nx94/u7RbCyT5i8NRaJ6R8RSSPQc9RhMS/TggSF9M/cYTWBaxRdtmre0GxuKes4qZp uNc57dTES7p3aLw9de7tM0Qvu2radmmi2oYPqNd/heYeDVS/PsX+oV8eLs8HhHso95QE ptzp2P2PrlgkYUFWAgirZ3b7Ushn9k8k1M8wLPUvAZ+92/kdZeDF4uvAgjr7PD6c/94I IXC9QTyha2/MDQlxLl8bVw5rmTU9Z83/xuElY9NyeW9ZZwBL95W6OJWIUWgJwgMxibpZ qopjgSJ48k0rsbQAk2os34T8RspxFtlOKixe9ddlrnNIWRV6RJvNXjdI5oNgsfhhpsdf X2vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=oUTJko1H; 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 sd10-20020a1709076e0a00b0086b7f3397c1si18479839ejc.494.2023.01.18.05.36.35; Wed, 18 Jan 2023 05:36:46 -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=oUTJko1H; 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 S231441AbjARN0Z (ORCPT + 45 others); Wed, 18 Jan 2023 08:26:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231678AbjARNZg (ORCPT ); Wed, 18 Jan 2023 08:25:36 -0500 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88F979AAB1 for ; Wed, 18 Jan 2023 04:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1674046362; x=1705582362; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c9tQ6467axGUUkqK8Hn/WxBs1AovQDwhp7i0J3ZaltU=; b=oUTJko1HiCs47ScSwNDFuyBfNE3/2E0xF+mmifvzaRtcShJ/MXnqcHDa 29gKUadym3+U7+WVCNHoP9uvyS4348E3/lpNlI1nwRC6mNj0QDzvgTEg/ DPSu18dUf4VREGNeM9BDgNV3hwz73rG/IcU/BVJN+0qflq01JqhAcC/uf K1eu20Wa9h8CJN7GJiubj2tcQCAJl/bbNExAZOn1qYV1rU6FND0ikxNfu QUg/MHcgYuO2t+PFvzrFFyRHsz/sSrAmGNLWbv+Eoxyk60OelSrx4H6/F NOI/Jn5IkJTAf3jTbC/QzcloJxQdtv137/5qNNgBYNzsNSaCGhvt7ppvX A==; From: Astrid Rost To: Mark Brown , Liam Girdwood , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai CC: , , , Astrid Rost Subject: [PATCH v1 3/4] ASoC: ts3a227e: add set_jack and get_jack_supported_type Date: Wed, 18 Jan 2023 13:52:25 +0100 Message-ID: <20230118125226.333214-4-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 set_jack and get_jack_supported_type to allow simple-card-utils to add a jack for it. Signed-off-by: Astrid Rost --- sound/soc/codecs/ts3a227e.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c index 2305a472d132..212dfd2b60ed 100644 --- a/sound/soc/codecs/ts3a227e.c +++ b/sound/soc/codecs/ts3a227e.c @@ -258,7 +258,22 @@ int ts3a227e_enable_jack_detect(struct snd_soc_component *component, } EXPORT_SYMBOL_GPL(ts3a227e_enable_jack_detect); -static struct snd_soc_component_driver ts3a227e_soc_driver; +static int ts3a227e_set_jack(struct snd_soc_component *component, + struct snd_soc_jack *jack, void *data) +{ + return ts3a227e_enable_jack_detect(component, jack); +} + +static int ts3a227e_get_supported_jack_type(struct snd_soc_component *component) +{ + return TS3A227E_JACK_MASK; +} + +static const struct snd_soc_component_driver ts3a227e_soc_driver = { + .name = "ti,ts3a227e", + .set_jack = ts3a227e_set_jack, + .get_jack_supported_type = ts3a227e_get_supported_jack_type, +}; static const struct regmap_config ts3a227e_regmap_config = { .val_bits = 8, -- 2.30.2