Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp18226rdh; Tue, 6 Feb 2024 17:25:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWAq02M8yH8zhH+qYa/Cjoyp3ScJtL4l+3/VjDxGjpPiC9qabTtu0luYRpqXmlxuvr19UI62tec6jMNpexjLmOWQU5mpd89NSD8OFMoqg== X-Google-Smtp-Source: AGHT+IF+1zXDcm9AyIkhfL1CVm7DvSghBffvl5B+hMzfXffPxmkE/528CZIM7S4E0bBTiknqByOd X-Received: by 2002:a05:6870:9106:b0:219:2298:57a8 with SMTP id o6-20020a056870910600b00219229857a8mr4560594oae.45.1707269128736; Tue, 06 Feb 2024 17:25:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707269128; cv=pass; d=google.com; s=arc-20160816; b=kW5N7acsKY+93koXuFz8dkKwC6KcZNSTo3Mhqm6SwXpsZxn9TrfuHcluFaq57cH1Jz 8SnhIAzmM3aEFSaIzrLC/mzubNItn/wSK0T/lCuIIcfADzrB86c928JoKl9ylaezXCyb n6oN1mcqSoWMSuXy/Cji9Syyph7oqqgP+CWZ9P3NUk6s0TqclP5zdLCD7liJ35NiKvP9 LBVcVTUe8Cg8upfnbE80de+uwWvCMLgod3w44+O0vWv8uSYK8B/EYUhO+dEd0L45l/kH 6wrwq0VFD6kptWu5M3Or8KDLd4vlhxBL8H7Qz61zBllF9aYVY6R1BBj7/fhLZ86gBBxz 3w6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=IgPl62Ica5DUxeR7iWfeniS7QkgQTS2Ho8V6ORfH3XA=; fh=LpS0XK6MGM3qxPqtQyKxNHJNOtVy0zgOaElgQPNhzlI=; b=o5Q6qOVSGfyE52TqYQgkl89CHItI0tZb+G4MxV1WrTNuJPvwkL1q99Jf061oaiODm2 6FGMQiAl84uNCEUyI+q9TrW3IkQh5FW+2nTxCkB25BFFG6NVJYVxixKBoLpC8nGGP7io RBXHc2Bj5pm9xUYcdkPSCnzvJXb0zL31CueqxLnPX7szV1P7oVNEFb0vX92cavM58nVO zKldGqiSxA0HXbDp+xnurAVkjDaMBViOeuTKShl+vRz2sXlM7KX4VjtVgWHeMiZ20i6E zT1BDGODIJgqD7bh7XxNLZq+eZD8On4YCYZLTXjpdh0fr+kzcIcHbEVRqoY/oxYXp+ee EqDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Bwt5UhpS; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-55797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCWqnOu0EOPAk+TboHRBrm6FA/uN6pm8+2pmOladbXdZWUDE6wXJIN1g5fJTKGl9rHV0bgeHA/I2MnNP4WLhkEsaDSb18jnByTDUFfE+iw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d28-20020a63735c000000b005dbd253d1ddsi230281pgn.871.2024.02.06.17.25.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 17:25:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Bwt5UhpS; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-55797-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4999628854C for ; Wed, 7 Feb 2024 01:25:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE865D512; Wed, 7 Feb 2024 01:25:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Bwt5UhpS" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 2BD9ADF44; Wed, 7 Feb 2024 01:25:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707269113; cv=none; b=eP3Hv84hNWH8h9XS7p6LZ/FyTBEw1OpDctx7ksBKD7sVZolNQMYF8lv7e5pb0Yfv4kQ4Aw8n29wsQeFrxzRiXO0rBCE2wbwpx5mUbxIkxePkc8pewWYCWmUXIB7HM0chJsAuAGPBQajhTVyLSFwiO9Sl4yr5cR7MXHb6xOAo6Jo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707269113; c=relaxed/simple; bh=YNWm7VCwUiMbQ4q8yVKywcJhspzvtPPmE2IpmVn/494=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=SWhJHLViH1NqaELIPvgpNKusgfJq/xnsVjwWu7+RUQLKUI9XzmL6eXl3GF7UFo/d8qnOwrTIMcFgscTZOiapIDy0JMdo6+4iFGLSRL86OGtNOtvPtTGp/Ey+MHl1NQoGGs6PhaggZgepndAblqtx/ae1p2zQXJbTd3yFCSmU1Eo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Bwt5UhpS; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 416N9VN0028901; Wed, 7 Feb 2024 01:24:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=IgPl62Ica5DUxeR7iWfeniS7QkgQTS2Ho8V6ORfH3XA=; b=Bw t5UhpSEDOH4ZP8oIiK5+UqhoT8yL35uL3wgR2YDVILcXOFHxpkgzm2HDIBItbNec FCow4tRU+0pYxlA4ZZnC/Sj1eIWKb5afDzpODwBQ8W0Fu5HcAKm+0RWGORHiM6AA 0PB/2k+TKStetZoxOEmYvNSTxoWfXHXQFWX1OQ50NsGEMPAE18bswMIZyeDoGR2+ s7ClufMfQ9Fh1OhGJsNHkIgmJqwMUy0Kbp1H5TCx4QMgahhqPP6CMh+maGKybssQ aYosRASaNeW0XR0s/+w5vPhqaPkX97mu8G5KxKRgVx7mLoybtvhwxAXgW+peGxAL Ej5F7DeHuGoYO3eVGgJA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w3ub6gh8j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Feb 2024 01:24:49 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4171Ol18029927 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 7 Feb 2024 01:24:47 GMT Received: from [10.110.7.251] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 6 Feb 2024 17:24:47 -0800 Message-ID: Date: Tue, 6 Feb 2024 17:24:46 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v13 48/53] ALSA: usb-audio: mixer: Add USB offloading mixer control Content-Language: en-US To: Takashi Iwai CC: , , , , , , , , , , , , , , , , , , , , , References: <20240203023645.31105-1-quic_wcheng@quicinc.com> <20240203023645.31105-49-quic_wcheng@quicinc.com> <871q9pwy0l.wl-tiwai@suse.de> From: Wesley Cheng In-Reply-To: <871q9pwy0l.wl-tiwai@suse.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: bVpCbC7ibiiisGB-GI8oyNyTNgqoj7sy X-Proofpoint-ORIG-GUID: bVpCbC7ibiiisGB-GI8oyNyTNgqoj7sy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-06_16,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 adultscore=0 spamscore=0 bulkscore=0 priorityscore=1501 phishscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402070009 Hi Takashi, On 2/6/2024 4:57 AM, Takashi Iwai wrote: > On Sat, 03 Feb 2024 03:36:40 +0100, > Wesley Cheng wrote: >> >> In order to allow userspace/applications know about USB offloading status, >> expose a sound kcontrol that fetches information about which sound card >> index is associated with the ASoC platform card supporting offloading. In >> the USB audio offloading framework, the ASoC BE DAI link is the entity >> responsible for registering to the SOC USB layer. SOC USB will expose more >> details about the current offloading status, which includes the USB sound >> card and USB PCM device indexes currently being used. >> >> Signed-off-by: Wesley Cheng > > The concept is understandable, but the control element name ("SNDUSB > OFFLD playback available") looks non-intrusive and non-conformant. > Use a bit more understandable name instead. > > This provides a card number where the offload driver is bound, and the > name should indicate something about that. > Hmmm, does USB sound have a naming convention that it usually follows for mixer/control interfaces? For something that is more closely related, how about: "USB offload capable card" > Also, about the implementation: > >> +static int >> +snd_usb_offload_create_mixer(struct usb_mixer_interface *mixer, >> + const struct snd_kcontrol_new *new_kctl) >> +{ >> + struct snd_kcontrol *kctl; >> + struct usb_mixer_elem_info *elem; >> + >> + elem = kzalloc(sizeof(struct usb_mixer_elem_info), GFP_KERNEL); >> + if (!elem) >> + return -ENOMEM; >> + >> + elem->head.mixer = mixer; >> + elem->val_type = USB_MIXER_S32; >> + elem->control = 0; >> + elem->head.id = 0; >> + elem->channels = 1; >> + >> + kctl = snd_ctl_new1(new_kctl, elem); >> + if (!kctl) { >> + kfree(elem); >> + return -ENOMEM; >> + } >> + kctl->private_free = snd_usb_mixer_elem_free; >> + >> + return snd_usb_mixer_add_control(&elem->head, kctl); > > This control has almost little to do with the standard USB interface, > and it'll be much simpler if you create a raw control element. > Pass the bus or the sysdev to private_data, and that's all you need in > the get callback. > Sure, I'll remove the need to register over the SND USB mixer API, and just use the core SND control APIs. > Also, don't forget to set the proper access bits (it's read-only). > Thanks for pointing this out, will fix. Thanks Wesley Cheng > > thanks, > > Takashi