summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-08 08:20:32 -0500
committerTakashi Iwai <tiwai@suse.de>2019-02-08 08:20:32 -0500
commitd02cac152c97dffcb0cdd91e09b54fd6e2cca63d (patch)
tree68e4c6bd842703009f3edbf8f0e0e9326e4b2fad /drivers/acpi/power.c
parent36e4617c01153757cde9e5fcd375a75a8f8425c3 (diff)
parenta50e32694fbcdbf55875095258b9398e2eabd71f (diff)
Merge tag 'asoc-v5.1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v5.1 Lots and lots of new drivers so far, a highlight being the MediaTek BTCVSD which is a driver for a Bluetooth radio chip - the first such driver we've had upstream. Hopefully we will soon also see a baseband with an upstream driver! - Support for only powering up channels that are actively being used. - Quite a few improvements to simplify the generic card drivers, especially the merge of the SCU cards into the main generic drivers. - Lots of fixes for probing on Intel systems, trying to rationalize things to look more standard from a framework point of view. - New drivers for Asahi Kasei Microdevices AK4497, Cirrus Logic CS4341, Google ChromeOS embedded controllers, Ingenic JZ4725B, MediaTek BTCVSD, MT8183 and MT6358, NXP MICFIL, Rockchip RK3328, Spreadtrum DMA controllers, Qualcomm WCD9335, Xilinx S/PDIF and PCM formatters.
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r--drivers/acpi/power.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 1b475bc1ae16..665e93ca0b40 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -131,6 +131,23 @@ void acpi_power_resources_list_free(struct list_head *list)
131 } 131 }
132} 132}
133 133
134static bool acpi_power_resource_is_dup(union acpi_object *package,
135 unsigned int start, unsigned int i)
136{
137 acpi_handle rhandle, dup;
138 unsigned int j;
139
140 /* The caller is expected to check the package element types */
141 rhandle = package->package.elements[i].reference.handle;
142 for (j = start; j < i; j++) {
143 dup = package->package.elements[j].reference.handle;
144 if (dup == rhandle)
145 return true;
146 }
147
148 return false;
149}
150
134int acpi_extract_power_resources(union acpi_object *package, unsigned int start, 151int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
135 struct list_head *list) 152 struct list_head *list)
136{ 153{
@@ -150,6 +167,11 @@ int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
150 err = -ENODEV; 167 err = -ENODEV;
151 break; 168 break;
152 } 169 }
170
171 /* Some ACPI tables contain duplicate power resource references */
172 if (acpi_power_resource_is_dup(package, start, i))
173 continue;
174
153 err = acpi_add_power_resource(rhandle); 175 err = acpi_add_power_resource(rhandle);
154 if (err) 176 if (err)
155 break; 177 break;