Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4143237ybv; Mon, 10 Feb 2020 13:14:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzJCWSnEjfam7JcOCe6bMEqzKm4dSzbAlS9OAeLbp9SQ561GFaFUvwM+qX4/tuenpmTdBfG X-Received: by 2002:a05:6830:1011:: with SMTP id a17mr2442020otp.45.1581369278036; Mon, 10 Feb 2020 13:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581369278; cv=none; d=google.com; s=arc-20160816; b=ejTH6GjWbA1/Tf2At2+2bz/Uh9n4Qn2vby2ksUso8ijjIzV32KNXUtsZaI29dh6xRg PYwe54djzDHvphxG8oEmZtxSdepVOlofYsUg94HoqCPe3OlC389Yd4IV6jSOGaxPs/+4 5FsuhZoG+rtcXgo3BlWo8A9lKeYJwCP3ewpnGr+wsSlGyH6qyzbSsbXRd1ypXZ8cp8Kr 6AUYAoZ5DVG/7gONl/UVaMeg6T65ZMZdpSwtyPXp5V6YsDzXZ+zYBxJ1uSYOyqNkwgeR SU626H7IoOhUgnwap5mvOjX6iXc1bmy5ap4y9hk45tI4risYpa89j4VBvJ+PNZLVwI9l uOnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-filter; bh=I3EkcQkTwwd2J+O4KVzA9fWCbXcpR3MPvY39AeBuXPc=; b=bVNkWYcz4dNNPF5rzPmN+Ts61V0PqOuBM+mdj1DxrX0p6udxK/YGWAOO2sT9PclSP1 w0dZemFr6ISbqlrwRE3rEbgJrorPPwtajWiAA5cMgXB8mD9kbVzef/PrzT2WCv/OjUmb WDHWuN1LBKzZkVCR9hPr61xFmFXFez1T841Q2HojiX6730aL9UaYZfrXzYr8/unjG+l4 dOiKdJ+fdYpDnoWmsaep7hMIIg0xoVL97GD+jD+E7yNZx+U2agfAVdqEOgNUCouxQcvR oMhfsygTSW0AH63Wqej9B6yX7N3D7Thno++i7q0C73R8XdanRwxGJK7NU6xD3121nX0r 2ykQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@serbinski.com header.s=default header.b="WOvn/ALS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22si739701oti.316.2020.02.10.13.14.24; Mon, 10 Feb 2020 13:14:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@serbinski.com header.s=default header.b="WOvn/ALS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727411AbgBJVOA (ORCPT + 99 others); Mon, 10 Feb 2020 16:14:00 -0500 Received: from mail.serbinski.com ([162.218.126.2]:47700 "EHLO mail.serbinski.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgBJVOA (ORCPT ); Mon, 10 Feb 2020 16:14:00 -0500 Received: from localhost (unknown [127.0.0.1]) by mail.serbinski.com (Postfix) with ESMTP id 61398D006F9; Mon, 10 Feb 2020 21:13:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at serbinski.com Received: from mail.serbinski.com ([127.0.0.1]) by localhost (mail.serbinski.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zu_DfRZFKs-n; Mon, 10 Feb 2020 16:13:52 -0500 (EST) Received: from mail.serbinski.com (localhost [127.0.0.1]) by mail.serbinski.com (Postfix) with ESMTP id 9949FD00693; Mon, 10 Feb 2020 16:13:52 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.serbinski.com 9949FD00693 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=serbinski.com; s=default; t=1581369232; bh=I3EkcQkTwwd2J+O4KVzA9fWCbXcpR3MPvY39AeBuXPc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WOvn/ALSo44nlC/+0cDovkez1JTNslVLaIIbhuvoM+/3oa4nBGa1pnceTS0UoWX6c 08w+kT2ztltcs1aFhDmLxRRrQlebR647uWLrm5h5kITpI1/Gl9QgmcVGSIoIFTvokp NeLvnj41zH+LetieRTbae51hBYAK18UL2QF9t+xE= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 10 Feb 2020 16:13:52 -0500 From: Adam Serbinski To: Mark Brown Cc: Srini Kandagatla , Rob Herring , Bjorn Andersson , Andy Gross , Mark Rutland , Liam Girdwood , Patrick Lai , Banajit Goswami , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 8/8] ASoC: qcom: apq8096: add kcontrols to set PCM rate In-Reply-To: <20200210200839.GG14166@sirena.org.uk> References: <20200207205013.12274-1-adam@serbinski.com> <20200209154748.3015-1-adam@serbinski.com> <20200209154748.3015-9-adam@serbinski.com> <20200210133636.GJ7685@sirena.org.uk> <18057b47c76d350f8380f277713e0936@serbinski.com> <20200210182609.GA14166@sirena.org.uk> <20200210200839.GG14166@sirena.org.uk> User-Agent: Roundcube Webmail/1.4-beta Message-ID: <7c57801d8f671c40d4c6094e5ce89681@serbinski.com> X-Sender: adam@serbinski.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-10 15:08, Mark Brown wrote: > On Mon, Feb 10, 2020 at 03:00:55PM -0500, Adam Serbinski wrote: >> On 2020-02-10 13:26, Mark Brown wrote: > >> > To repeat my comment on another patch in the series there should still >> > be some representation of the DAI for this device in the kernel. > >> Respectfully, I'm not sure I understand what it is that you are >> suggesting. > >> Is it your intention to suggest that instead of adding controls to the >> machine driver, I should instead write a codec driver to contain those >> controls? > > I have already separately said that you should write a CODEC driver for > this CODEC. I'm saying that this seems like the sort of thing that > might fit in that CODEC driver. I see. My initial thought with respect to the codec driver would be just to use bt-sco.c, which is a dummy codec. I can certainly implement a new codec driver. >> Or is it your intention to suggest that something within the kernel is >> already aware of the rate to be set, and it is that which should set >> the >> rate rather than a control? > > That would be one example of how such a CODEC driver could be > configured, and is how other baseband/BT devices have ended up going > (see cx20442.c for example). I am not aware of how this could be done for bluetooth, since the value still has to originate from userspace. The driver you referred to supports only a single sample rate, whereas for bluetooth, 2 sample rates are required, and nothing in the kernel is aware of the appropriate rate, at least in the case of the qca6174a I'm working with right now, or for that matter, TI Wilink 8, which I've also worked with. My concern with implementing this in a new codec driver, is that this codec driver will be bound to qdsp6, since its purpose is to work around a characteristic of this DSP. Under simple-card, for instance, it would be redundant, since in that case, the parameters userspace uses to open the pcm will be propagated to the port. But under qdsp6, userspace could open the pcm at 44.1 kHz, yet the backend port is still set to 8 or 16 kHz, and the DSP resamples between them, so the sole purpose of this change is to allow userspace to deliver the required sample rate to the back end of qdsp6.