Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5591655ybh; Wed, 7 Aug 2019 08:23:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhcXw691oNNE0gK+Ah+N7Wt0BujJqHNKLPJo+kAR34ZQUWo7UP5JtniQbT+U2IbPVxH7Vn X-Received: by 2002:a17:902:4324:: with SMTP id i33mr8575751pld.108.1565191415704; Wed, 07 Aug 2019 08:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565191415; cv=none; d=google.com; s=arc-20160816; b=PKgcVniQr7493e0Og0/fXryzpRIIS6vk/Rgqvz1DuMBZspgZfL7ug6E8YfYWSMr+3v fNBE7WXL3h4u1+TELwwA0jYG3n99i+AI6pAUmtHFgqqsA0gn3oALNagy+qTa6SmUVs+/ /o/ZtpA9j1qkzfHRPpzM66kMXkkw40zOSMC4ceNWPjg7Mc7xQnjg7/pIDZVMFW/9nAOA X7fPOAtKzMnkv1TWi18IL5eTqifvPSI8LpLf/qlMbo1HQRi+dlJtiYspguRJXq/mU0dR j/yZMSU/ofnx0nxGHmSPCsPQMCCRQ/wqqeGsah9zUhdRQZcD8AD+sCZWUkbSyDNjhPC7 tmJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=P3cE3iRXqgryP/OgCV51qAh9BI8S6dpcnW7bPxWsCaw=; b=evjEy7YihLaIXzuHf81mONrHZIp3/wmDkixbJWVeB1PPld1QRs1RKZVrUs969GGZzn ATsPDRgZhUT25RDgbwSEgVeXe9E8/NEEInFzrLpomxii28WuDihZistVnozaCbgti9zI 4bw3jxPJsUHDisi+cb4EswYpp+8LMdKSfbg2AG/32RmXZ8opw+Kj/ij4UTdFK6tw9YYq sQMYia8J//Ja4+jWQfUYtUYcC+eyZGCr8raviG1W9owEeqsX1vkP1j6b+A1ZaS/jJkAi IcYHcA3OBu9gkaFRnpGJbL2vPP3QEQVvKueNTxP0u+CaNEP7Z2yvyRpD4t6d/6TyM8hL 8m9w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si45649843plb.274.2019.08.07.08.23.20; Wed, 07 Aug 2019 08:23:35 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388463AbfHGPWP (ORCPT + 99 others); Wed, 7 Aug 2019 11:22:15 -0400 Received: from mga18.intel.com ([134.134.136.126]:54844 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388257AbfHGPWO (ORCPT ); Wed, 7 Aug 2019 11:22:14 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2019 08:22:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,357,1559545200"; d="scan'208";a="373804945" Received: from knguye7-mobl.amr.corp.intel.com (HELO [10.255.81.127]) ([10.255.81.127]) by fmsmga005.fm.intel.com with ESMTP; 07 Aug 2019 08:22:12 -0700 Subject: Re: [Sound-open-firmware] [PATCH v2 3/5] ASoC: SOF: Add DT DSP device support To: Daniel Baluta Cc: Daniel Baluta , Marco Felsch , Shawn Guo , Mark Rutland , Aisheng Dong , Peng Fan , Anson Huang , Devicetree List , "S.j. Wang" , Linux Kernel Mailing List , Paul Olaru , Rob Herring , dl-linux-imx , Pengutronix Kernel Team , Leonard Crestez , Fabio Estevam , linux-arm-kernel , sound-open-firmware@alsa-project.org References: <20190723084104.12639-1-daniel.baluta@nxp.com> <20190723084104.12639-4-daniel.baluta@nxp.com> From: Pierre-Louis Bossart Message-ID: <85b4a2c4-761e-bdcf-f05e-2fb16c06f11e@linux.intel.com> Date: Wed, 7 Aug 2019 10:22:12 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>> +static int sof_dt_probe(struct platform_device *pdev) >>>> +{ >>>> + struct device *dev = &pdev->dev; >>>> + const struct sof_dev_desc *desc; >>>> + /*TODO: create a generic snd_soc_xxx_mach */ >>>> + struct snd_soc_acpi_mach *mach; >>> >>> I wonder if you really need to use the same structures. For Intel we get >>> absolutely zero info from the firmware so rely on an ACPI codec ID as a >>> key to find information on which firmware and topology to use, and which >>> machine driver to load. You could have all this information in a DT blob? >> >> Yes. I see your point. I will still need to make a generic structure for >> snd_soc_acpi_mach so that everyone can use sof_nocodec_setup function. >> >> Maybe something like this: >> >> struct snd_soc_mach { >> union { >> struct snd_soc_acpi_mach acpi_mach; >> struct snd_soc_of_mach of_mach; >> } >> }; >> >> and then change the prototype of sof_nocodec_setup. > > Hi Pierre, > > I fixed all the comments except the one above. Replacing snd_soc_acpi_mach > with a generic snd_soc_mach is not trivial task. > > I wonder if it is acceptable to get the initial patches as they are > now and later switch to > generic ACPI/OF abstraction. > > Asking this because for the moment on the i.MX side I have only > implemented no codec > version and we don't probe any of the machine drivers we have. > > So, there is this only one member of snd_soc_acpi_mach that imx > version is making use of: > > mach->drv_name = "sof-nocodec"; > > That's all. > > I think the change as it is now is very clean and non-intrusive. Later > we will get options to > read firmware name and stuff from DT. > > Anyhow, I don't think we can get rid of snd_dev_desc structure on > i.MX. This will be used > to store the information read from DT: > > static struct sof_dev_desc sof_of_imx8qxp_desc = { > » .default_fw_path = "imx/sof", > » .default_tplg_path = "imx/sof-tplg", > » .nocodec_fw_filename = "sof-imx8.ri", > » .nocodec_tplg_filename = "sof-imx8-nocodec.tplg", > » .ops = &sof_imx8_ops, > }; > > For the moment we will only use the default values. Yes, that's fine for now. If you don't have a real machine driver then there's nothing urgent to change. Is the new version on GitHub? Thanks -Pierre