Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp34344rdb; Wed, 18 Oct 2023 17:11:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeVsQLvP1fL1595mOD8nB7y/+f9JXjSpWGrF2gyVFqLz2W+t+Kw+IPm0rNnsHmvRPXR0+8 X-Received: by 2002:a17:90a:558f:b0:27d:eaf:7142 with SMTP id c15-20020a17090a558f00b0027d0eaf7142mr723382pji.20.1697674260455; Wed, 18 Oct 2023 17:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697674260; cv=none; d=google.com; s=arc-20160816; b=MmtSZTrF2y3WHu4lV1jhHCNSyXSEABOrxeXf5Swlz0V8O7psUkom2ZjhdO+snsW0G5 WavtlpeT2Kf6M3+5vSwBgDDvW/IDLu8aKlGcgkZCwRfPxu5pzue3FlaYLmt270Zv0Qm8 QtzOfyTHWp/oZMsQXVjOF9ng+qAWZF2csQYvAWAEpWAO9SZT/miJwJ7Vsxf1uJLrwBrY 2q8OyvpbGdtAZX14TnZA6Qk6KTYgpHOYOCWRomxQg9rl0QIlazD7qL66rcO2BveePFdK 5wglmPKo7VAvJPEQWjoOW+DK1V1BE+ff4jRIBDrS7Wp6NTyCTDXLpownZSgEl8CglSLn VKew== 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=6hQElVCyOOnSkM+Zznfzy7HZx857FhWzEl1qsufSNo4=; fh=9+IEscr4WmNbE41gibPc+AZ0nx0+/tccCXbA5gmgnS8=; b=p70V5aRhxxgH6yOsUJv8Z/U7221xzVaiyR04TeGuZ7/HrY894/T+Zsm4n8730HUOBM G9XSdn/n/nIzunwf3L8+uYzVk/kSOOJw6DucJKqC8eeICCS/jZ4vTg5qm+zfs4yb50xE yiSkfH2lQ/DoK2+DNj7NITkvmdDkLrbqPuSZAqz0Ez8W6oNUL+imm02SxnOwEiN1+iO8 eqpFOCx2S71rcLnxntXwlghDtcKavP9gQ4oaH2A8XZrerJOmHlKN5ffiXwdkIq+Ux70U f6lGwF6WcQimJDXpcQ2k2OyWlVai5VGoT1wx+jJKENJnLWN6mOTRCogsiMek6iEnmiEd 4Dpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SFCZ3WxO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id pq8-20020a17090b3d8800b00262f937bf93si957102pjb.77.2023.10.18.17.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 17:11:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SFCZ3WxO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 495FC8101C51; Wed, 18 Oct 2023 17:10:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231349AbjJSAKk (ORCPT + 99 others); Wed, 18 Oct 2023 20:10:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjJSAKj (ORCPT ); Wed, 18 Oct 2023 20:10:39 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97A17FA; Wed, 18 Oct 2023 17:10:37 -0700 (PDT) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39INBi2G013562; Thu, 19 Oct 2023 00:10:17 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=6hQElVCyOOnSkM+Zznfzy7HZx857FhWzEl1qsufSNo4=; b=SFCZ3WxOtDkGT2IZD6/38EC1pZOMIEbyZLOg0siVLOIn7mc1eyRbGB9fyZSSdHjtOFhW fXe0Qn4yePa6t8JF15Meq2bQi3ZgMlPsF7Xb7lmBXjIsZg+76ay4UqGq6fC5secPEb2f FBsGaSG0ZE5iPwYL0O1A6EZvwQ+FNnkZ6WcHoujpQqjfteGCWYWVJQY5MYdyGWbbLb4Z zUV3eWuyPNY/3wJwL1CTNLA9dhqPBSvX5r++T5KO/5lzcrUVw9LgmM5HYgThe8jIvJdX qbGB6SK0BCuAdXbiLvVCLSO0a8sUv0WJapFvYqBKCSy1t3XkB1HHPDqtTTJ2N4aszXV0 GQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ttg82sb9x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 00:10:16 +0000 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 39J0AFLp024950 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 00:10:15 GMT Received: from [10.110.123.255] (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.39; Wed, 18 Oct 2023 17:10:14 -0700 Message-ID: Date: Wed, 18 Oct 2023 17:10:14 -0700 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 v9 26/34] ASoC: qcom: qdsp6: q6afe: Split USB AFE dev_token param into separate API Content-Language: en-US To: Pierre-Louis Bossart , , , , , , , , , , , , , , , CC: , , , , References: <20231017200109.11407-1-quic_wcheng@quicinc.com> <20231017200109.11407-27-quic_wcheng@quicinc.com> From: Wesley Cheng In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] 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: blhNU9CerJ0mDNSk9ta5Q5PAa7V6Hd1o X-Proofpoint-ORIG-GUID: blhNU9CerJ0mDNSk9ta5Q5PAa7V6Hd1o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-18_18,2023-10-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310180199 X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 17:10:56 -0700 (PDT) Hi Pierre, On 10/17/2023 3:39 PM, Pierre-Louis Bossart wrote: > > > On 10/17/23 15:01, Wesley Cheng wrote: >> The Q6USB backend can carry information about the available USB SND cards >> and PCM devices discovered on the USB bus. The dev_token field is used by >> the audio DSP to notify the USB offload driver of which card and PCM index >> to enable playback on. Separate this into a dedicated API, so the USB >> backend can set the dev_token accordingly. The audio DSP does not utilize >> this information until the AFE port start command is sent, which is done >> during the PCM prepare phase. >> >> Signed-off-by: Wesley Cheng >> --- >> sound/soc/qcom/qdsp6/q6afe.c | 49 +++++++++++++++++++++++++----------- >> sound/soc/qcom/qdsp6/q6afe.h | 1 + >> 2 files changed, 36 insertions(+), 14 deletions(-) >> >> diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c >> index 72c4e6fe20c4..f09a756246f8 100644 >> --- a/sound/soc/qcom/qdsp6/q6afe.c >> +++ b/sound/soc/qcom/qdsp6/q6afe.c >> @@ -1394,10 +1394,42 @@ void q6afe_tdm_port_prepare(struct q6afe_port *port, >> } >> EXPORT_SYMBOL_GPL(q6afe_tdm_port_prepare); >> >> -static int afe_port_send_usb_dev_param(struct q6afe_port *port, struct q6afe_usb_cfg *cfg) >> +/** >> + * afe_port_send_usb_dev_param() - Send USB dev token >> + * >> + * @port: Instance of afe port >> + * @cardidx: USB SND card index to reference >> + * @pcmidx: USB SND PCM device index to reference >> + * >> + * The USB dev token carries information about which USB SND card instance and >> + * PCM device to execute the offload on. This information is carried through >> + * to the stream enable QMI request, which is handled by the offload class >> + * driver. The information is parsed to determine which USB device to query >> + * the required resources for. >> + */ >> +int afe_port_send_usb_dev_param(struct q6afe_port *port, int cardidx, int pcmidx) >> { >> - union afe_port_config *pcfg = &port->port_cfg; >> struct afe_param_id_usb_audio_dev_params usb_dev; >> + int ret; >> + >> + memset(&usb_dev, 0, sizeof(usb_dev)); >> + >> + usb_dev.cfg_minor_version = AFE_API_MINOR_VERSION_USB_AUDIO_CONFIG; >> + usb_dev.dev_token = (cardidx << 16) | (pcmidx << 8); >> + ret = q6afe_port_set_param_v2(port, &usb_dev, >> + AFE_PARAM_ID_USB_AUDIO_DEV_PARAMS, >> + AFE_MODULE_AUDIO_DEV_INTERFACE, sizeof(usb_dev)); >> + if (ret) >> + dev_err(port->afe->dev, "%s: AFE device param cmd failed %d\n", >> + __func__, ret); >> + >> + return ret; >> +} >> +EXPORT_SYMBOL_GPL(afe_port_send_usb_dev_param); >> + >> +static int afe_port_send_usb_params(struct q6afe_port *port, struct q6afe_usb_cfg *cfg) >> +{ >> + union afe_port_config *pcfg = &port->port_cfg; >> struct afe_param_id_usb_audio_dev_lpcm_fmt lpcm_fmt; >> struct afe_param_id_usb_audio_svc_interval svc_int; >> int ret = 0; >> @@ -1408,20 +1440,9 @@ static int afe_port_send_usb_dev_param(struct q6afe_port *port, struct q6afe_usb >> goto exit; >> } >> >> - memset(&usb_dev, 0, sizeof(usb_dev)); >> memset(&lpcm_fmt, 0, sizeof(lpcm_fmt)); >> memset(&svc_int, 0, sizeof(svc_int)); >> >> - usb_dev.cfg_minor_version = AFE_API_MINOR_VERSION_USB_AUDIO_CONFIG; >> - ret = q6afe_port_set_param_v2(port, &usb_dev, >> - AFE_PARAM_ID_USB_AUDIO_DEV_PARAMS, >> - AFE_MODULE_AUDIO_DEV_INTERFACE, sizeof(usb_dev)); >> - if (ret) { >> - dev_err(port->afe->dev, "%s: AFE device param cmd failed %d\n", >> - __func__, ret); >> - goto exit; >> - } >> - > > this feels like a questionable patch split. Why not introduce the new > helper earlier and avoid adding code then modifying the same code? > Let me see if I can squash this with the change that adds the USB AFE port. Thanks Wesley Cheng