From mboxrd@z Thu Jan 1 00:00:00 1970 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 F3355C4708E for ; Fri, 6 Jan 2023 01:07:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236570AbjAFBHE (ORCPT ); Thu, 5 Jan 2023 20:07:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236627AbjAFBGz (ORCPT ); Thu, 5 Jan 2023 20:06:55 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 142F66E435; Thu, 5 Jan 2023 17:06:53 -0800 (PST) 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 305N8x3o008970; Fri, 6 Jan 2023 01:05:57 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=FcuAOQbllRhmH8qhEZKJY9Hw6HNDVm92HvBhxZczYDQ=; b=porboc8+tR1WTFp5opFaP3VOlLpToAKQamRr/twhlhaGhuMrbHMm++UhtqcEaZVA60Wc 5XoM0BrhgJKagE8vYpIt1RW1FDoRUryrAe51fkidYN/H01grpz9myLqcp0DaU46YUqVQ oVoWvTWF+h4JSHu0wu4mi0d853SZH6i26qOTE6eTGhmjJEQYMv8LDAH304Tfbe1p2sDY z08rVnsNpTSlQLhfNAaQtF+LNfZH0X6iuWzKGz4M9tAmruuisZMVmJqinyXohWx5vAdg u9bduvjY17V1L4gXbeZcuJ/JmA0K1TJcRNobsbDROd6tNFo6ndmlZ/X245S04o7bmTkp nA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mwvaphnau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Jan 2023 01:05:57 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30615uO7019008 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Jan 2023 01:05:56 GMT Received: from [10.110.47.113] (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.986.36; Thu, 5 Jan 2023 17:05:55 -0800 Message-ID: <0f903c49-a989-14a6-bac1-c4cae21839eb@quicinc.com> Date: Thu, 5 Jan 2023 17:05:54 -0800 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: [RFC PATCH 03/14] ASoC: qcom: Add USB backend ASoC driver for Q6 Content-Language: en-US To: Pierre-Louis Bossart , , , , , , , , , , , , , CC: , , , , , , References: <20221223233200.26089-1-quic_wcheng@quicinc.com> <20221223233200.26089-4-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: nasanex01a.na.qualcomm.com (10.52.223.231) 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: 6_IpYtxD6uzAwC3wkpJuW8wRxLMR9ea2 X-Proofpoint-ORIG-GUID: 6_IpYtxD6uzAwC3wkpJuW8wRxLMR9ea2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-05_14,2023-01-05_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 mlxscore=0 impostorscore=0 phishscore=0 spamscore=0 mlxlogscore=789 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301060006 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi Pierre, On 1/4/2023 3:41 PM, Pierre-Louis Bossart wrote: > >> +int q6usb_alsa_connection_cb(struct snd_soc_usb *usb, int card_idx, >> + int connected) >> +{ >> + struct snd_soc_dapm_context *dapm; >> + struct q6usb_port_data *data; >> + >> + if (!usb->component) >> + return 0; >> + >> + dapm = snd_soc_component_get_dapm(usb->component); >> + data = dev_get_drvdata(usb->component->dev); >> + >> + if (connected) { >> + snd_soc_dapm_enable_pin(dapm, "USB_RX_BE"); >> + /* We only track the latest USB headset plugged in */ > > that answers to my earlier question on how to deal with multiple > devices, but is this a desirable policy? This could lead to a lot of > confusion. If there are restrictions to a single device, then it might > be more interesting for userspace or the user to indicate which USB > device gets to use USB offload and all others use legacy. > Yeah, as mentioned its still pretty open ended. I think from the feedback received from Mark/Takashi, this was a viable option for now. Would you happen to have any insight/input on how the userspace can pass down that selection to the ASoC framework? Maybe some kind of PCM IOCTL call? Thanks Wesley Cheng From mboxrd@z Thu Jan 1 00:00:00 1970 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62C32C3DA7A for ; Fri, 6 Jan 2023 01:07:18 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0341AEFA2; Fri, 6 Jan 2023 02:06:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0341AEFA2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1672967236; bh=Jud3qgQsOesFyRuv0KY3Nq97F5wtva6gZwee+dO/geA=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=G291TCjx4f21aJ+BfHzuztaRhMu161gJM+DvLMC//F27E5c4oN/yxAvgROe/iQ1cV yba12T/XyqE4TAUeTLWnDlQfYGVsaNRQ5P5Mkbwp0TawzhiwbF3s/vZq4ZJTkkqMSi 0EeEy/jI5Z8m87Sl2JOJKbMgOWGuQRkCYEDot7c8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 16483F8053C; Fri, 6 Jan 2023 02:06:02 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 013D0F8053A; Fri, 6 Jan 2023 02:06:00 +0100 (CET) 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 alsa1.perex.cz (Postfix) with ESMTPS id 1E0ACF8051C for ; Fri, 6 Jan 2023 02:05:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1E0ACF8051C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=porboc8+ 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 305N8x3o008970; Fri, 6 Jan 2023 01:05:57 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=FcuAOQbllRhmH8qhEZKJY9Hw6HNDVm92HvBhxZczYDQ=; b=porboc8+tR1WTFp5opFaP3VOlLpToAKQamRr/twhlhaGhuMrbHMm++UhtqcEaZVA60Wc 5XoM0BrhgJKagE8vYpIt1RW1FDoRUryrAe51fkidYN/H01grpz9myLqcp0DaU46YUqVQ oVoWvTWF+h4JSHu0wu4mi0d853SZH6i26qOTE6eTGhmjJEQYMv8LDAH304Tfbe1p2sDY z08rVnsNpTSlQLhfNAaQtF+LNfZH0X6iuWzKGz4M9tAmruuisZMVmJqinyXohWx5vAdg u9bduvjY17V1L4gXbeZcuJ/JmA0K1TJcRNobsbDROd6tNFo6ndmlZ/X245S04o7bmTkp nA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mwvaphnau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Jan 2023 01:05:57 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30615uO7019008 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Jan 2023 01:05:56 GMT Received: from [10.110.47.113] (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.986.36; Thu, 5 Jan 2023 17:05:55 -0800 Message-ID: <0f903c49-a989-14a6-bac1-c4cae21839eb@quicinc.com> Date: Thu, 5 Jan 2023 17:05:54 -0800 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: [RFC PATCH 03/14] ASoC: qcom: Add USB backend ASoC driver for Q6 Content-Language: en-US To: Pierre-Louis Bossart , , , , , , , , , , , , , References: <20221223233200.26089-1-quic_wcheng@quicinc.com> <20221223233200.26089-4-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: nasanex01a.na.qualcomm.com (10.52.223.231) 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: 6_IpYtxD6uzAwC3wkpJuW8wRxLMR9ea2 X-Proofpoint-ORIG-GUID: 6_IpYtxD6uzAwC3wkpJuW8wRxLMR9ea2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-05_14,2023-01-05_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 mlxscore=0 impostorscore=0 phishscore=0 spamscore=0 mlxlogscore=789 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301060006 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, quic_jackp@quicinc.com, quic_plai@quicinc.com Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hi Pierre, On 1/4/2023 3:41 PM, Pierre-Louis Bossart wrote: > >> +int q6usb_alsa_connection_cb(struct snd_soc_usb *usb, int card_idx, >> + int connected) >> +{ >> + struct snd_soc_dapm_context *dapm; >> + struct q6usb_port_data *data; >> + >> + if (!usb->component) >> + return 0; >> + >> + dapm = snd_soc_component_get_dapm(usb->component); >> + data = dev_get_drvdata(usb->component->dev); >> + >> + if (connected) { >> + snd_soc_dapm_enable_pin(dapm, "USB_RX_BE"); >> + /* We only track the latest USB headset plugged in */ > > that answers to my earlier question on how to deal with multiple > devices, but is this a desirable policy? This could lead to a lot of > confusion. If there are restrictions to a single device, then it might > be more interesting for userspace or the user to indicate which USB > device gets to use USB offload and all others use legacy. > Yeah, as mentioned its still pretty open ended. I think from the feedback received from Mark/Takashi, this was a viable option for now. Would you happen to have any insight/input on how the userspace can pass down that selection to the ASoC framework? Maybe some kind of PCM IOCTL call? Thanks Wesley Cheng