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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01EDCC05027 for ; Mon, 23 Jan 2023 13:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232022AbjAWN7z (ORCPT ); Mon, 23 Jan 2023 08:59:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbjAWN7t (ORCPT ); Mon, 23 Jan 2023 08:59:49 -0500 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E4AA23DB7 for ; Mon, 23 Jan 2023 05:59:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1674482383; x=1706018383; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GFfgTb34a//0h/wk1qs7LHk+iVK4qzPfVOmAPGqO2dk=; b=IlW/XCh4wi3QdBU/iv9N0/iOD5OlNlKkIKdd9P6vX1omT7PYm8jtlQYt hp53/cxam38jzCdrTlUl+Cp734dTqaguiN5xYd5OithsfJNp6LZPXKd4z AtN4RGK1Bnr0zPaDv+ArXGtNPRa8Y7oLJp0uZy2wAXMi73a4Awn42WtMb LKMf2q8BLBcjZ6yBPQzFt8JGEKaLb4/v2OjIFunC7DeGZRuTxwErvzF3b x9T8oDqoeaJisWEdm5FwXQIzUH/sYaePu4B+YcdJbGtzkaFUTVsIxNLFz 3ix4DwIoeplLNAkyOcaCkFyKBBxd1c/qta8SN2W+HG+MORZJyuaGkFaz3 A==; From: Astrid Rost To: Mark Brown , Liam Girdwood , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai CC: , , , Astrid Rost Subject: [PATCH v3 3/3] ASoC: ts3a227e: add set_jack and get_jack_type Date: Mon, 23 Jan 2023 14:59:13 +0100 Message-ID: <20230123135913.2720991-4-astrid.rost@axis.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230123135913.2720991-1-astrid.rost@axis.com> References: <20230123135913.2720991-1-astrid.rost@axis.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add set_jack and get_jack_type to allow simple-card-utils to add a jack for it. Signed-off-by: Astrid Rost --- sound/soc/codecs/ts3a227e.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c index 2305a472d132..5282112c7d8d 100644 --- a/sound/soc/codecs/ts3a227e.c +++ b/sound/soc/codecs/ts3a227e.c @@ -258,7 +258,25 @@ 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) +{ + if (jack == NULL) + return -EINVAL; + + return ts3a227e_enable_jack_detect(component, jack); +} + +static int ts3a227e_get_jack_type(struct snd_soc_component *component) +{ + return SND_JACK_HEADSET; +} + +static const struct snd_soc_component_driver ts3a227e_soc_driver = { + .name = "ti,ts3a227e", + .set_jack = ts3a227e_set_jack, + .get_jack_type = ts3a227e_get_jack_type, +}; static const struct regmap_config ts3a227e_regmap_config = { .val_bits = 8, -- 2.30.2