Skip to content

Commit 6668610

Browse files
jwrdegoedebroonie
authored andcommitted
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>
1 parent 0107f28 commit 6668610

File tree

2 files changed

+59
-9
lines changed

2 files changed

+59
-9
lines changed

sound/hda/intel-dsp-config.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,10 @@ static const struct config_entry acpi_config_table[] = {
721721
#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) || \
722722
IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
723723
/* BayTrail */
724+
{
725+
.flags = FLAG_SST_OR_SOF_BYT,
726+
.acpi_hid = "LPE0F28",
727+
},
724728
{
725729
.flags = FLAG_SST_OR_SOF_BYT,
726730
.acpi_hid = "80860F28",

sound/soc/intel/atom/sst/sst_acpi.c

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,28 @@ static const struct sst_res_info bytcr_res_info = {
125125
.acpi_ipc_irq_index = 0
126126
};
127127

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+
128150
static struct sst_platform_info byt_rvp_platform_data = {
129151
.probe_data = &byt_fwparse_info,
130152
.ipc_info = &byt_ipc_info,
@@ -268,10 +290,38 @@ static int sst_acpi_probe(struct platform_device *pdev)
268290
mach->pdata = &chv_platform_data;
269291
pdata = mach->pdata;
270292

271-
ret = kstrtouint(id->id, 16, &dev_id);
272-
if (ret < 0) {
273-
dev_err(dev, "Unique device id conversion error: %d\n", ret);
274-
return ret;
293+
if (!strcmp(id->id, "LPE0F28")) {
294+
struct resource *rsrc;
295+
296+
/* Use regular BYT SST PCI VID:PID */
297+
dev_id = 0x80860F28;
298+
byt_rvp_platform_data.res_info = &lpe8086_res_info;
299+
300+
/*
301+
* The "LPE0F28" ACPI device has separate IO-mem resources for:
302+
* DDR, SHIM, MBOX, IRAM, DRAM, CFG
303+
* None of which covers the entire LPE base address range.
304+
* lpe8086_res_info.acpi_lpe_res_index points to the SHIM.
305+
* Patch this to cover the entire base address range as expected
306+
* by sst_platform_get_resources().
307+
*/
308+
rsrc = platform_get_resource(pdev, IORESOURCE_MEM,
309+
pdata->res_info->acpi_lpe_res_index);
310+
if (!rsrc) {
311+
dev_err(ctx->dev, "Invalid SHIM base\n");
312+
return -EIO;
313+
}
314+
rsrc->start -= pdata->res_info->shim_offset;
315+
rsrc->end = rsrc->start + 0x200000 - 1;
316+
} else {
317+
ret = kstrtouint(id->id, 16, &dev_id);
318+
if (ret < 0) {
319+
dev_err(dev, "Unique device id conversion error: %d\n", ret);
320+
return ret;
321+
}
322+
323+
if (soc_intel_is_byt_cr(pdev))
324+
byt_rvp_platform_data.res_info = &bytcr_res_info;
275325
}
276326

277327
dev_dbg(dev, "ACPI device id: %x\n", dev_id);
@@ -280,11 +330,6 @@ static int sst_acpi_probe(struct platform_device *pdev)
280330
if (ret < 0)
281331
return ret;
282332

283-
if (soc_intel_is_byt_cr(pdev)) {
284-
/* override resource info */
285-
byt_rvp_platform_data.res_info = &bytcr_res_info;
286-
}
287-
288333
/* update machine parameters */
289334
mach->mach_params.acpi_ipc_irq_index =
290335
pdata->res_info->acpi_ipc_irq_index;
@@ -344,6 +389,7 @@ static void sst_acpi_remove(struct platform_device *pdev)
344389
}
345390

346391
static const struct acpi_device_id sst_acpi_ids[] = {
392+
{ "LPE0F28", (unsigned long)&snd_soc_acpi_intel_baytrail_machines},
347393
{ "80860F28", (unsigned long)&snd_soc_acpi_intel_baytrail_machines},
348394
{ "808622A8", (unsigned long)&snd_soc_acpi_intel_cherrytrail_machines},
349395
{ },

0 commit comments

Comments
 (0)