power: supply: core: Fix parsing of battery chemistry/technology
[linux-2.6-microblaze.git] / sound / soc / sof / intel / pci-tgl.c
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
2 //
3 // This file is provided under a dual BSD/GPLv2 license.  When using or
4 // redistributing this file, you may do so under either license.
5 //
6 // Copyright(c) 2018-2021 Intel Corporation. All rights reserved.
7 //
8 // Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
9 //
10
11 #include <linux/module.h>
12 #include <linux/pci.h>
13 #include <sound/soc-acpi.h>
14 #include <sound/soc-acpi-intel-match.h>
15 #include <sound/sof.h>
16 #include "../ops.h"
17 #include "../sof-pci-dev.h"
18
19 /* platform specific devices */
20 #include "hda.h"
21
22 static const struct sof_dev_desc tgl_desc = {
23         .machines               = snd_soc_acpi_intel_tgl_machines,
24         .alt_machines           = snd_soc_acpi_intel_tgl_sdw_machines,
25         .use_acpi_target_states = true,
26         .resindex_lpe_base      = 0,
27         .resindex_pcicfg_base   = -1,
28         .resindex_imr_base      = -1,
29         .irqindex_host_ipc      = -1,
30         .resindex_dma_base      = -1,
31         .chip_info = &tgl_chip_info,
32         .default_fw_path = "intel/sof",
33         .default_tplg_path = "intel/sof-tplg",
34         .default_fw_filename = "sof-tgl.ri",
35         .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
36         .ops = &sof_tgl_ops,
37 };
38
39 static const struct sof_dev_desc tglh_desc = {
40         .machines               = snd_soc_acpi_intel_tgl_machines,
41         .alt_machines           = snd_soc_acpi_intel_tgl_sdw_machines,
42         .use_acpi_target_states = true,
43         .resindex_lpe_base      = 0,
44         .resindex_pcicfg_base   = -1,
45         .resindex_imr_base      = -1,
46         .irqindex_host_ipc      = -1,
47         .resindex_dma_base      = -1,
48         .chip_info = &tglh_chip_info,
49         .default_fw_path = "intel/sof",
50         .default_tplg_path = "intel/sof-tplg",
51         .default_fw_filename = "sof-tgl-h.ri",
52         .nocodec_tplg_filename = "sof-tgl-nocodec.tplg",
53         .ops = &sof_tgl_ops,
54 };
55
56 static const struct sof_dev_desc ehl_desc = {
57         .machines               = snd_soc_acpi_intel_ehl_machines,
58         .use_acpi_target_states = true,
59         .resindex_lpe_base      = 0,
60         .resindex_pcicfg_base   = -1,
61         .resindex_imr_base      = -1,
62         .irqindex_host_ipc      = -1,
63         .resindex_dma_base      = -1,
64         .chip_info = &ehl_chip_info,
65         .default_fw_path = "intel/sof",
66         .default_tplg_path = "intel/sof-tplg",
67         .default_fw_filename = "sof-ehl.ri",
68         .nocodec_tplg_filename = "sof-ehl-nocodec.tplg",
69         .ops = &sof_tgl_ops,
70 };
71
72 static const struct sof_dev_desc adls_desc = {
73         .machines               = snd_soc_acpi_intel_adl_machines,
74         .alt_machines           = snd_soc_acpi_intel_adl_sdw_machines,
75         .use_acpi_target_states = true,
76         .resindex_lpe_base      = 0,
77         .resindex_pcicfg_base   = -1,
78         .resindex_imr_base      = -1,
79         .irqindex_host_ipc      = -1,
80         .resindex_dma_base      = -1,
81         .chip_info = &adls_chip_info,
82         .default_fw_path = "intel/sof",
83         .default_tplg_path = "intel/sof-tplg",
84         .default_fw_filename = "sof-adl-s.ri",
85         .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
86         .ops = &sof_tgl_ops,
87 };
88
89 static const struct sof_dev_desc adl_desc = {
90         .machines               = snd_soc_acpi_intel_adl_machines,
91         .alt_machines           = snd_soc_acpi_intel_adl_sdw_machines,
92         .resindex_lpe_base      = 0,
93         .resindex_pcicfg_base   = -1,
94         .resindex_imr_base      = -1,
95         .irqindex_host_ipc      = -1,
96         .resindex_dma_base      = -1,
97         .chip_info = &tgl_chip_info,
98         .default_fw_path = "intel/sof",
99         .default_tplg_path = "intel/sof-tplg",
100         .default_fw_filename = "sof-adl.ri",
101         .nocodec_tplg_filename = "sof-adl-nocodec.tplg",
102         .ops = &sof_tgl_ops,
103 };
104
105 /* PCI IDs */
106 static const struct pci_device_id sof_pci_ids[] = {
107         { PCI_DEVICE(0x8086, 0xa0c8), /* TGL-LP */
108                 .driver_data = (unsigned long)&tgl_desc},
109         { PCI_DEVICE(0x8086, 0x43c8), /* TGL-H */
110                 .driver_data = (unsigned long)&tglh_desc},
111         { PCI_DEVICE(0x8086, 0x4b55), /* EHL */
112                 .driver_data = (unsigned long)&ehl_desc},
113         { PCI_DEVICE(0x8086, 0x4b58), /* EHL */
114                 .driver_data = (unsigned long)&ehl_desc},
115         { PCI_DEVICE(0x8086, 0x7ad0), /* ADL-S */
116                 .driver_data = (unsigned long)&adls_desc},
117         { PCI_DEVICE(0x8086, 0x51c8), /* ADL-P */
118                 .driver_data = (unsigned long)&adl_desc},
119         { PCI_DEVICE(0x8086, 0x51cc), /* ADL-M */
120                 .driver_data = (unsigned long)&adl_desc},
121         { 0, }
122 };
123 MODULE_DEVICE_TABLE(pci, sof_pci_ids);
124
125 /* pci_driver definition */
126 static struct pci_driver snd_sof_pci_intel_tgl_driver = {
127         .name = "sof-audio-pci-intel-tgl",
128         .id_table = sof_pci_ids,
129         .probe = hda_pci_intel_probe,
130         .remove = sof_pci_remove,
131         .shutdown = sof_pci_shutdown,
132         .driver = {
133                 .pm = &sof_pci_pm,
134         },
135 };
136 module_pci_driver(snd_sof_pci_intel_tgl_driver);
137
138 MODULE_LICENSE("Dual BSD/GPL");
139 MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
140 MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);
141