@@ -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+
128150static 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 (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
346391static 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