Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: Intel: sst: Support LPE0F28 ACPI HID

Some old Bay Trail tablets which shipped with Android as factory OS
have the SST/LPE audio engine described by an ACPI device with a
HID (Hardware-ID) of LPE0F28 instead of 80860F28.

Add support for this. Note this uses a new sst_res_info for just
the LPE0F28 case because it has a different layout for the IO-mem ACPI
resources then the 80860F28.

An example of a tablet which needs this is the Vexia EDU ATLA 10 tablet,
which has been distributed to schools in the Spanish Andalucía region.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patch.msgid.link/20241025090221.52198-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Hans de Goede and committed by
Mark Brown
6668610b 0107f28f

+59 -9
+4
sound/hda/intel-dsp-config.c
··· 723 723 /* BayTrail */ 724 724 { 725 725 .flags = FLAG_SST_OR_SOF_BYT, 726 + .acpi_hid = "LPE0F28", 727 + }, 728 + { 729 + .flags = FLAG_SST_OR_SOF_BYT, 726 730 .acpi_hid = "80860F28", 727 731 }, 728 732 /* CherryTrail */
+55 -9
sound/soc/intel/atom/sst/sst_acpi.c
··· 125 125 .acpi_ipc_irq_index = 0 126 126 }; 127 127 128 + /* For "LPE0F28" ACPI device found on some Android factory OS models */ 129 + static const struct sst_res_info lpe8086_res_info = { 130 + .shim_offset = 0x140000, 131 + .shim_size = 0x000100, 132 + .shim_phy_addr = SST_BYT_SHIM_PHY_ADDR, 133 + .ssp0_offset = 0xa0000, 134 + .ssp0_size = 0x1000, 135 + .dma0_offset = 0x98000, 136 + .dma0_size = 0x4000, 137 + .dma1_offset = 0x9c000, 138 + .dma1_size = 0x4000, 139 + .iram_offset = 0x0c0000, 140 + .iram_size = 0x14000, 141 + .dram_offset = 0x100000, 142 + .dram_size = 0x28000, 143 + .mbox_offset = 0x144000, 144 + .mbox_size = 0x1000, 145 + .acpi_lpe_res_index = 1, 146 + .acpi_ddr_index = 0, 147 + .acpi_ipc_irq_index = 0 148 + }; 149 + 128 150 static struct sst_platform_info byt_rvp_platform_data = { 129 151 .probe_data = &byt_fwparse_info, 130 152 .ipc_info = &byt_ipc_info, ··· 290 268 mach->pdata = &chv_platform_data; 291 269 pdata = mach->pdata; 292 270 293 - ret = kstrtouint(id->id, 16, &dev_id); 294 - if (ret < 0) { 295 - dev_err(dev, "Unique device id conversion error: %d\n", ret); 296 - return ret; 271 + if (!strcmp(id->id, "LPE0F28")) { 272 + struct resource *rsrc; 273 + 274 + /* Use regular BYT SST PCI VID:PID */ 275 + dev_id = 0x80860F28; 276 + byt_rvp_platform_data.res_info = &lpe8086_res_info; 277 + 278 + /* 279 + * The "LPE0F28" ACPI device has separate IO-mem resources for: 280 + * DDR, SHIM, MBOX, IRAM, DRAM, CFG 281 + * None of which covers the entire LPE base address range. 282 + * lpe8086_res_info.acpi_lpe_res_index points to the SHIM. 283 + * Patch this to cover the entire base address range as expected 284 + * by sst_platform_get_resources(). 285 + */ 286 + rsrc = platform_get_resource(pdev, IORESOURCE_MEM, 287 + pdata->res_info->acpi_lpe_res_index); 288 + if (!rsrc) { 289 + dev_err(ctx->dev, "Invalid SHIM base\n"); 290 + return -EIO; 291 + } 292 + rsrc->start -= pdata->res_info->shim_offset; 293 + rsrc->end = rsrc->start + 0x200000 - 1; 294 + } else { 295 + ret = kstrtouint(id->id, 16, &dev_id); 296 + if (ret < 0) { 297 + dev_err(dev, "Unique device id conversion error: %d\n", ret); 298 + return ret; 299 + } 300 + 301 + if (soc_intel_is_byt_cr(pdev)) 302 + byt_rvp_platform_data.res_info = &bytcr_res_info; 297 303 } 298 304 299 305 dev_dbg(dev, "ACPI device id: %x\n", dev_id); ··· 329 279 ret = sst_alloc_drv_context(&ctx, dev, dev_id); 330 280 if (ret < 0) 331 281 return ret; 332 - 333 - if (soc_intel_is_byt_cr(pdev)) { 334 - /* override resource info */ 335 - byt_rvp_platform_data.res_info = &bytcr_res_info; 336 - } 337 282 338 283 /* update machine parameters */ 339 284 mach->mach_params.acpi_ipc_irq_index = ··· 389 344 } 390 345 391 346 static const struct acpi_device_id sst_acpi_ids[] = { 347 + { "LPE0F28", (unsigned long)&snd_soc_acpi_intel_baytrail_machines}, 392 348 { "80860F28", (unsigned long)&snd_soc_acpi_intel_baytrail_machines}, 393 349 { "808622A8", (unsigned long)&snd_soc_acpi_intel_cherrytrail_machines}, 394 350 { },