From patchwork Wed Aug 26 17:28:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michele Curti X-Patchwork-Id: 7078741 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03EFBBEEC1 for ; Wed, 26 Aug 2015 17:28:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B5032092E for ; Wed, 26 Aug 2015 17:28:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7B5862092C for ; Wed, 26 Aug 2015 17:28:44 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 82994265804; Wed, 26 Aug 2015 19:28:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 5AE51260532; Wed, 26 Aug 2015 19:28:35 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7953A2605B1; Wed, 26 Aug 2015 19:28:33 +0200 (CEST) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by alsa0.perex.cz (Postfix) with ESMTP id 707B5260525 for ; Wed, 26 Aug 2015 19:28:26 +0200 (CEST) Received: by wicne3 with SMTP id ne3so51617225wic.0 for ; Wed, 26 Aug 2015 10:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=xJR/xVugNEAq9PxXMMfyWf6T0Ydf1imlJ7VsT1Z6dEc=; b=mJZZRkO+Ggc+H/buNLL29u0NTZqtH9VnP40DjQIwRj3VPr3B0sB+JnLk1M7eKo3gAL YpkUxMe3O8hz8ML8Ofcyd49Jdim1DvFCKr4FRUKwjT2eqO1e9sY4RvkCBhOFbV32RtdD DMJFcPFj4BSxVIeKNlcWRZ99XsQlqaQ2zchw9gjSQ9pYPdNFB+DnD43MLqrEA6VZln51 iqZ3bT+0bEcrt24qcy02Oe85IwHiXJRapUdZAR/AG9wJxIBQ3532ESSnMcVw4bt1QTUr Wb6co1rGgm2TWm0SadjQlmy/vnWXJDk+ELAHz1P9V+yP4F+oXkiVVxEvKdG7mJQeNUaa LHlA== X-Received: by 10.180.230.199 with SMTP id ta7mr4501929wic.1.1440610106040; Wed, 26 Aug 2015 10:28:26 -0700 (PDT) Received: from asus (host89-60-dynamic.0-87-r.retail.telecomitalia.it. [87.0.60.89]) by smtp.gmail.com with ESMTPSA id ir5sm4838205wjb.23.2015.08.26.10.28.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Aug 2015 10:28:25 -0700 (PDT) Date: Wed, 26 Aug 2015 19:28:23 +0200 From: Michele Curti To: alsa-devel@alsa-project.org Message-ID: <20150826172823.GA2038@asus> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) Subject: [alsa-devel] different acpi_ipc_irq_index among baytrail boards issue X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, some baytrail machines, although belonging to the same platform, have the ADSP IRQ number at different ACPI index (.acpi_ipc_irq_index = 0 instead of 5). Not an issue for now, since there is no support for these machines (like the Asus X205TA) at the moment, but if the driver will work, a patch like the following would be acceptable (I ask so I can try to keep a sort of patchset)? * declare a new struct type sst_acpi_info where to place acpi infos lpe_res_index, ddr_index, ipc_irq_index * create a new 'const struct sst_acpi_info *acpi_info' field into the struct sst_platform_info (to be managed like the others ipc_info, res_info, ...) * move the acpi infos from the byt_rvp_res_info variable to a new byt_acpi_res_info one In this way one could duplicate byt_rvp_acpi_info instead of the whole byt_rvp_res_info (which seems "not good" to me, or it's ok?) to manage different acpi indexes. Hope I was clear enough.. Thanks, Michele --- arch/x86/include/asm/platform_sst_audio.h | 11 ++++++++--- sound/soc/intel/atom/sst/sst_acpi.c | 17 +++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/platform_sst_audio.h b/arch/x86/include/asm/platform_sst_audio.h index 7249e6d..b10f6a7 100644 --- a/arch/x86/include/asm/platform_sst_audio.h +++ b/arch/x86/include/asm/platform_sst_audio.h @@ -118,9 +118,6 @@ struct sst_res_info { unsigned int dram_size; unsigned int mbox_offset; unsigned int mbox_size; - unsigned int acpi_lpe_res_index; - unsigned int acpi_ddr_index; - unsigned int acpi_ipc_irq_index; }; struct sst_ipc_info { @@ -128,13 +125,21 @@ struct sst_ipc_info { unsigned int mbox_recv_off; }; +struct sst_acpi_info { + unsigned int lpe_res_index; + unsigned int ddr_index; + unsigned int ipc_irq_index; +}; + struct sst_platform_info { const struct sst_info *probe_data; const struct sst_ipc_info *ipc_info; + const struct sst_acpi_info *acpi_info; const struct sst_res_info *res_info; const struct sst_lib_dnld_info *lib_info; const char *platform; }; + int add_sst_platform_device(void); #endif diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c index bb19b58..427e404 100644 --- a/sound/soc/intel/atom/sst/sst_acpi.c +++ b/sound/soc/intel/atom/sst/sst_acpi.c @@ -116,14 +116,18 @@ static const struct sst_res_info byt_rvp_res_info = { .dram_size = 0x28000, .mbox_offset = 0x144000, .mbox_size = 0x1000, - .acpi_lpe_res_index = 0, - .acpi_ddr_index = 2, - .acpi_ipc_irq_index = 5, +}; + +static const struct sst_acpi_info byt_rvp_acpi_info = { + .lpe_res_index = 0, + .ddr_index = 2, + .ipc_irq_index = 5, }; static struct sst_platform_info byt_rvp_platform_data = { .probe_data = &byt_fwparse_info, .ipc_info = &byt_ipc_info, + .acpi_info = &byt_rvp_acpi_info, .lib_info = &byt_lib_dnld_info, .res_info = &byt_rvp_res_info, .platform = "sst-mfld-platform", @@ -135,6 +139,7 @@ static struct sst_platform_info byt_rvp_platform_data = { static struct sst_platform_info chv_platform_data = { .probe_data = &byt_fwparse_info, .ipc_info = &byt_ipc_info, + .acpi_info = &byt_rvp_acpi_info, .lib_info = &byt_lib_dnld_info, .res_info = &byt_rvp_res_info, .platform = "sst-mfld-platform", @@ -148,7 +153,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx) /* All ACPI resource request here */ /* Get Shim addr */ rsrc = platform_get_resource(pdev, IORESOURCE_MEM, - ctx->pdata->res_info->acpi_lpe_res_index); + ctx->pdata->acpi_info->lpe_res_index); if (!rsrc) { dev_err(ctx->dev, "Invalid SHIM base from IFWI"); return -EIO; @@ -202,7 +207,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx) ctx->mailbox_add = ctx->info.mailbox_start; rsrc = platform_get_resource(pdev, IORESOURCE_MEM, - ctx->pdata->res_info->acpi_ddr_index); + ctx->pdata->acpi_info->ddr_index); if (!rsrc) { dev_err(ctx->dev, "Invalid DDR base from IFWI"); return -EIO; @@ -219,7 +224,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx) /* Find the IRQ */ ctx->irq_num = platform_get_irq(pdev, - ctx->pdata->res_info->acpi_ipc_irq_index); + ctx->pdata->acpi_info->ipc_irq_index); return 0; }