Received: by 10.213.65.68 with SMTP id h4csp3673438imn; Tue, 3 Apr 2018 08:55:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx49vuLv8UvpvFbQZEa9hnl2nTqgQ/UHRgqnndEwevJ3ff6oCv2tc5o3zchK3Id7WnqxudXp1 X-Received: by 10.98.103.69 with SMTP id b66mr10885719pfc.151.1522770901510; Tue, 03 Apr 2018 08:55:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522770901; cv=none; d=google.com; s=arc-20160816; b=zqsk932oEmHt6tbMymzC4bPm9gYGx8Rw2+MYJ0ud8UKNvFZb3M3uXMXhbKOuuxJfL1 hnfsQeY45DguiCin/JZo8NpM3mjGM/IhVFYZMoTZCZrwdzhpuhS6jNL9QsMsv9NwcOzl jRAu5kre61GQzOtBftxW7iEhhVAJg3Jy2m5zCuWeWHNbqIB09xsyAO51yJDWPyAdxVcE ARd+Xh12/0NuLNeo2XTy7jnMcuwdCm5pE0fkP/0W1oXBXUdENEO3H3jbdMeuhZDQ9BkC IahRsxqWiULt67zWSDNAqcnntyf9Ci+U4ihpZasuq8CWfLjc4+591laP79LNlPlf15Ow aJAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=4A28V0B7NYS/tLcUuTo4rR/YK+I0ddr0rzVi09wltEU=; b=QUygPFMYdUkIMVI0MN3GHERU5+6Tg1kMJtnLAs+mb99UIjty5m5y51nN3HyPB0AHCI t99TzmJel2uIEX0FbZ2xj2et6EUARs+wd7WfEFFiLBKgTUIOZ+SsmTrCReA6SJqLzM2C nCR+FHFgEWrkZDbU72qJvQr0ZDBmqhpdjf+ungNPBzqkqxFB6TnBaCJUqj68mKh/KmEc SDXCGIH2QF2M49RPXEfjAgEIEjJMelEErCXBo1ro4Tg6KZEYSE3M9wgbd9CyVgke4sSS b4ELaJG4dfNmoi/kjkzsZUtKNMG4wJb6HySjE9cdhxofw3Uk5K5CAMftWwsVdZ2974X6 ZOjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=GJsBpASN; 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 w19-v6si755552plq.156.2018.04.03.08.54.47; Tue, 03 Apr 2018 08:55:01 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=GJsBpASN; 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 S1752093AbeDCPx1 (ORCPT + 99 others); Tue, 3 Apr 2018 11:53:27 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:35829 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751323AbeDCPx0 (ORCPT ); Tue, 3 Apr 2018 11:53:26 -0400 Received: by mail-qt0-f194.google.com with SMTP id s2so19725913qti.2 for ; Tue, 03 Apr 2018 08:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4A28V0B7NYS/tLcUuTo4rR/YK+I0ddr0rzVi09wltEU=; b=GJsBpASN45ZqIRBzLA0vyNjbFaLAgB23zdI9YPeIuJUyI2DJSNXnSNKk82sgZ4eHi+ m596YBv6OBwWkqEdy+RDoskb16UyziNtgW8ofGqDTsnOJWqemtx3YlqiqJsgfqEzQnDq UUz4GUY93tVVgV3nFeqPXVBCKhiep18pzdBh5BfNrsTc3lzctXNY7rkj21TGoNK2F7nn BUka+GPnnHX2+2aF2mDanij9AJB0hzSbMJF+w//5Twv5PR/8aCulPxtVJRQjRPvR8qYy PqxWHySBkDa6bc/Zs1ghmNzsjJLwPYZ1kcA3iN/KrpeViWc9AEwxl79yQcQTAXupbLgf iHoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4A28V0B7NYS/tLcUuTo4rR/YK+I0ddr0rzVi09wltEU=; b=eD9Ts20aIn++Gr67qf55cXXqf5Q+MfTzp/8QDYc+LmVwQ89iGDIbGRhh4DfnIAwPRP AJAKn171VpiQ+/NMi00B4mxgKGarEcQ86yZqiKf5UL45dbfjwehhdWVlO6w7VWWbgJKG 6h6ssWtIbfP+HeHF3axakf8ps2F0hrlysSSbVEoE/XDojfzAxJmycGNnW1Bj9v4PjvfA btaVuhIzOL+e/qfY7vZAF0/SSDXxpwOJB+0HrhFiHLPstQAwnjBuz19W9h+X8fF+VZs2 AsKqqp+IcwhkdOECDc3bXrWckEztzARN1gtWrlAm1WkZrali2uz0mUOeRbDuYk0idsRH I6pg== X-Gm-Message-State: ALQs6tD9dj1cd+GPS6eFA07TTAjq5PHncl/bVCfuWPCW2oHn+gZ9IlIN m4RX/0iZS0yszHnczLF/O4TdqP1c2nl/PvKCAhM= X-Received: by 10.237.55.135 with SMTP id j7mr5025160qtb.213.1522770805643; Tue, 03 Apr 2018 08:53:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.25 with HTTP; Tue, 3 Apr 2018 08:53:25 -0700 (PDT) In-Reply-To: <87lge4485x.fsf@belgarion.home> References: <20180402142656.26815-1-robert.jarzmik@free.fr> <20180402142656.26815-15-robert.jarzmik@free.fr> <87lge4485x.fsf@belgarion.home> From: Arnd Bergmann Date: Tue, 3 Apr 2018 17:53:25 +0200 X-Google-Sender-Auth: b9PiRJfgvb85xWPetN67qKCVRXw Message-ID: Subject: Re: [PATCH 14/15] ARM: pxa: change SSP devices allocation To: Robert Jarzmik Cc: Daniel Mack , Haojian Zhuang , Vinod Koul , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Linux ARM , Linux Kernel Mailing List , alsa-devel@alsa-project.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 3, 2018 at 5:32 PM, Robert Jarzmik wrote: > Arnd Bergmann writes: > > chop chop ... removed several mail recipients to leave only the ASoC / PXA > subset ... > >> On Mon, Apr 2, 2018 at 4:26 PM, Robert Jarzmik wrote: >> >>> >>> +static struct pxa_ssp_info pxa_ssp_infos[] = { >>> + { .dma_chan_rx_name = "ssp1_rx", .dma_chan_tx_name = "ssp1_tx", }, >>> + { .dma_chan_rx_name = "ssp1_rx", .dma_chan_tx_name = "ssp1_tx", }, >>> + { .dma_chan_rx_name = "ssp2_rx", .dma_chan_tx_name = "ssp2_tx", }, >>> + { .dma_chan_rx_name = "ssp2_rx", .dma_chan_tx_name = "ssp2_tx", }, >>> + { .dma_chan_rx_name = "ssp3_rx", .dma_chan_tx_name = "ssp3_tx", }, >>> + { .dma_chan_rx_name = "ssp3_rx", .dma_chan_tx_name = "ssp3_tx", }, >>> + { .dma_chan_rx_name = "ssp4_rx", .dma_chan_tx_name = "ssp4_tx", }, >>> + { .dma_chan_rx_name = "ssp4_rx", .dma_chan_tx_name = "ssp4_tx", }, >>> +}; >> >> This part looks odd to me, you're adding an extra level of indirection to >> do two stages of lookups in some form of platform data. > That's unfortunately right. > >> Why can't you just always use "rx" and "tx" as the names here? > Well I couldn't. I'll explain you why, and maybe you'll find a better solution. > > That all is related to how ASoC and SSP interact. > If I remember correctly, here is how it works : > - the DMA channel is requested in sound/arm/pxa2xx-pcm-lib.c:128 > return snd_dmaengine_pcm_open( > substream, dma_request_slave_channel(rtd->platform->dev, > The trick is that the device here is _not_ the SSP one, it's if memory serves > me well the pxa-pcm-audio one. > > As a consequence, the device cannot be used to differenciate which SSP > exactly is providing the sound samples stream. This information is > nevertheless required to choose the correct requestor line, which is a 1-to-1 > match to the SSP port. > > The indirection in the channel name is used to choose the correct requestor > line for a given SSP port providing the samples. > > It also must be underlined that this dma request serves both AC97 and SSP as > sample providers. I'm still unable to follow through that code, but I understand now that the device you pass to dma_request_slave_channel() is not the one we'd like it to be here. Where exactly does that call to dma_request_chan() happen? Is this the one in dmaengine_pcm_new()? Could we perhaps put a pointer to the SSP device into snd_dmaengine_dai_dma_data? Arnd