Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6542048rwb; Wed, 18 Jan 2023 06:32:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXsArqd32Oz2rkXLBMhD5cGlpVpYlRepL3YNkjSHVkiDRo9IOb6Wcv5Y3q5cK1zQm0zM86fB X-Received: by 2002:a17:902:7597:b0:194:afe4:3011 with SMTP id j23-20020a170902759700b00194afe43011mr4771787pll.52.1674052324831; Wed, 18 Jan 2023 06:32:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674052324; cv=none; d=google.com; s=arc-20160816; b=gqlFXUUFlDZ22wrOOKp/BIOTs2u0uyh+tiyEbMws/QTkCxjNe9FBTQbi22JnB2sRMn msDz3sIizPP0mdr5w77f4yQzsbBs6iKC2qorEXnTOJoiwcJCOo8RzLfeIWxRMbZVrHeQ R2KSKd7jeRg8CyaWJ+oVRjddddURP64YVLXfAOXymarYCyeA6Fn+kr5gacfTVYo7UEm+ bT+0beWbPO4UkJZfwXrmTH8BuedXTCnYiEbW0y1unyn2tFrFWm1I2p/Z2N13hivo2Pq0 HoCTRY6zkPTKEmSa+XB8DVNa399rqn46J6lijGBCQ9w2Z8Nyb7OqhVLn2AFr6vm9wPju M35A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gQiVosP9m1wn9kgNdjxRuR4PEuJid+S83dBBkWWGqXM=; b=Idl71Bf7fek8LPo2NAtRW0kXvoJCAzR1cjaOnVdGwo4uIpnm2hc2LidV99MUWxYT82 xtcjmT+XxqdIYQzOmOYLvkZDtxipDT4Mb6F2MUFjlhisIAu5xhIfDEaY5iPz7UOwyBL0 uMyWqpipqPYUZvZoDm0T4oWGi7HrWtLmabpNM8oxRDfPPDh7HaZXXmpfHbZKFZCSPP7l HmFsWo2hIoTM3UzQ+Q0ydcNvLLsM+CTc+7vrt7g8N8d22omvElcD4aUScL1mTJNWRoWl ketZJ7J/yCNgmwnNPMV9g0PayEaMYUWPOj69HSu0M4/v+cMdoekDkowJFQIz2mNAZN9N PQGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=focWksFd; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020a17090332cf00b00189c10f6b4csi39440408plr.417.2023.01.18.06.31.58; Wed, 18 Jan 2023 06:32:04 -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 header.i=@intel.com header.s=Intel header.b=focWksFd; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbjAROJc (ORCPT + 45 others); Wed, 18 Jan 2023 09:09:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbjAROIq (ORCPT ); Wed, 18 Jan 2023 09:08:46 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABE4C5AB77 for ; Wed, 18 Jan 2023 05:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674049770; x=1705585770; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=FeABRWZG/7wT2V4yotl0KXOF5NebpsvSF1ap6am3g1M=; b=focWksFdNG4QXsYBs6UNWgnGPz8Ia4k/WwX4iC1dztc5ysV9HnL7VzTk O3p6NX2IxW4R9Jwku/CsCYmgNzSq18MEawYOpexnYYshO5Rzafh4CZuJb AqAI5GWsjogB4zIXTkpP1cdwB2qxj/octV5ef1YtTw+2NMxl/M1x1qgTP fRw1xXv5GEpqihBfarb9NvSvLfGGI5zMkjsURCOsCooV89zLsue+2IS0r OQ5gxGA4qsmeGsJyubToLdbkcMK1Nc6My7EM2Kcc5QzB3g2EDbsASma7Y UKOtuHKHstXSQHaCWBFsN9+z9lorWtqkDMYZ16afggefh3ZxEOKzl4EjU w==; X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="411221685" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="411221685" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 05:49:30 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="988549431" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="988549431" Received: from aslawinx-mobl.ger.corp.intel.com (HELO [10.99.16.144]) ([10.99.16.144]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 05:49:27 -0800 Message-ID: <5da005dd-e34e-ff08-7a97-8a37b231ed5e@linux.intel.com> Date: Wed, 18 Jan 2023 14:49:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v1 3/4] ASoC: ts3a227e: add set_jack and get_jack_supported_type Content-Language: en-US To: Astrid Rost , Mark Brown , Liam Girdwood , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, kernel@axis.com, linux-kernel@vger.kernel.org References: <20230118125226.333214-1-astrid.rost@axis.com> <20230118125226.333214-4-astrid.rost@axis.com> From: =?UTF-8?Q?Amadeusz_S=c5=82awi=c5=84ski?= In-Reply-To: <20230118125226.333214-4-astrid.rost@axis.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 On 1/18/2023 1:52 PM, Astrid Rost wrote: > 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); > +} Patch looks ok, but it seems that ts3a227e_enable_jack_detect() doesn't check if jack is NULL, before calling snd_jack_set_key() I guess this should be also fixed, as _set_jack can be called with jack being NULL to disable jack detection. Optionally, while set_jack is being added I would also just get rid of EXPORT_SYMBOL_GPL(ts3a227e_enable_jack_detect); and convert all other users to snd_soc_component_set_jack as it currently serves as bad example. > + > +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,