From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65681190470 for ; Thu, 2 Jan 2025 22:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735856123; cv=none; b=myFm8IbFEG7juA2Y66Xj2JSNvJ9BXzlX5hJQAgZA+XAFoHYZaosgPOWbORlxOaTUGiaKGujuRBFlifdL7GxigXHmmJdsp2nttNYGza22P+xVp8fLmj95VsTpsq7eMLqxN30eMnq54PwM6HmWKXSgnbDYzLu2bNgKEnkRAkLxKIs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735856123; c=relaxed/simple; bh=nEerf2puQBdwBcW4SXWfgTFn++kXgAdCIREdgjGbHu4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ds4fIIyt3WJpu1v8YfAKpWoUc86ac0Y5BPSO7RjBIZM4bK8XuirebpX7106UYFlGLnt+IS92/20FeD5qppPQK6JBX1oOCRxkqpWbx9IVYCAJ9830D7wtsOJNfN/mr6I3/BiCgLG/hdDI2/inzcaXA6G6hTsSU3UKJbuPcsyOraI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=UhlN/J9M; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="UhlN/J9M" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1735856118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h4Li18FmBDwsKEGHXDYR1d3v0BjQC1ALcn/iCLqRoys=; b=UhlN/J9MeFkDmNp7t2BP86uoCi7m5wyQ14XqlQTXn8tl9RYNcKpGz5I3ePgDM1JdRiYrXa CaMdbYr3P+ucFRRZTq5L+nLHX0veJVJswPTk7UU1ad7SeESvmxYy/L/W6MUo/GCEtu7nd+ Msf5nnExA0V+WdhUkQn8Y9k0D8MvSoU= Date: Thu, 2 Jan 2025 16:01:19 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 4/5] ASoC: SDCA: Add missing function type names To: Charles Keepax , broonie@kernel.org Cc: lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com References: <20241220173516.907406-1-ckeepax@opensource.cirrus.com> <20241220173516.907406-4-ckeepax@opensource.cirrus.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Pierre-Louis Bossart In-Reply-To: <20241220173516.907406-4-ckeepax@opensource.cirrus.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 12/20/24 11:35, Charles Keepax wrote: > It is not helpful to error out on some SDCA function types, we > might as well report the correct name and let the driver core > simply not bind a driver to those functions for which the code > lacks support. Also given no functions currently have support, > it seems odd to select some as unsupported. > > Signed-off-by: Charles Keepax > --- > include/sound/sdca_function.h | 1 + > sound/soc/sdca/sdca_functions.c | 12 ++++++++++-- > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/include/sound/sdca_function.h b/include/sound/sdca_function.h > index 6943df0851a9..89e42db6d591 100644 > --- a/include/sound/sdca_function.h > +++ b/include/sound/sdca_function.h > @@ -42,6 +42,7 @@ enum sdca_function_type { > #define SDCA_FUNCTION_TYPE_RJ_NAME "RJ" > #define SDCA_FUNCTION_TYPE_SIMPLE_NAME "SimpleJack" > #define SDCA_FUNCTION_TYPE_HID_NAME "HID" > +#define SDCA_FUNCTION_TYPE_IMP_DEF_NAME "ImplementationDefined" > > enum sdca_entity0_controls { > SDCA_CONTROL_ENTITY_0_COMMIT_GROUP_MASK = 0x01, > diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c > index a69fdb9c8b15..400763e056fa 100644 > --- a/sound/soc/sdca/sdca_functions.c > +++ b/sound/soc/sdca/sdca_functions.c > @@ -75,12 +75,20 @@ static int patch_sdca_function_type(struct device *dev, > *function_name = SDCA_FUNCTION_TYPE_HID_NAME; > break; > case SDCA_FUNCTION_TYPE_SIMPLE_AMP: > + *function_name = SDCA_FUNCTION_TYPE_SIMPLE_AMP_NAME; > + break; > case SDCA_FUNCTION_TYPE_SIMPLE_MIC: > + *function_name = SDCA_FUNCTION_TYPE_SIMPLE_MIC_NAME; > + break; > case SDCA_FUNCTION_TYPE_SPEAKER_MIC: > + *function_name = SDCA_FUNCTION_TYPE_SPEAKER_MIC_NAME; > + break; > case SDCA_FUNCTION_TYPE_RJ: > + *function_name = SDCA_FUNCTION_TYPE_RJ_NAME; > + break; the changes above are fine... > case SDCA_FUNCTION_TYPE_IMP_DEF: > - dev_warn(dev, "unsupported SDCA function type %d\n", *function_type); > - return -EINVAL; > + *function_name = SDCA_FUNCTION_TYPE_IMP_DEF_NAME; > + break; but this one is controversial. We really have no idea what to do in this case. There could be completely different 'imp-def' functions that require different drivers. I don't know how the entire binding mechanism would work. Probably best to err on the side of throwing a 'not supported' error? > default: > dev_err(dev, "invalid SDCA function type %d\n", *function_type); > return -EINVAL;