Vinod Koul | 95f0980 | 2015-11-05 21:34:11 +0530 | [diff] [blame] | 1 | /* |
| 2 | * sst_match_apci.c - SST (LPE) match for ACPI enumeration. |
| 3 | * |
| 4 | * Copyright (c) 2013-15, Intel Corporation. |
| 5 | * |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it |
| 8 | * under the terms and conditions of the GNU General Public License, |
| 9 | * version 2, as published by the Free Software Foundation. |
| 10 | * |
| 11 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 14 | * more details. |
| 15 | */ |
| 16 | #include <linux/acpi.h> |
| 17 | #include <linux/device.h> |
| 18 | #include <linux/module.h> |
| 19 | #include <linux/platform_device.h> |
| 20 | |
| 21 | #include "sst-acpi.h" |
| 22 | |
| 23 | static acpi_status sst_acpi_mach_match(acpi_handle handle, u32 level, |
| 24 | void *context, void **ret) |
| 25 | { |
| 26 | *(bool *)context = true; |
| 27 | return AE_OK; |
| 28 | } |
| 29 | |
| 30 | struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines) |
| 31 | { |
| 32 | struct sst_acpi_mach *mach; |
| 33 | bool found = false; |
| 34 | |
| 35 | for (mach = machines; mach->id[0]; mach++) |
| 36 | if (ACPI_SUCCESS(acpi_get_devices(mach->id, |
| 37 | sst_acpi_mach_match, |
| 38 | &found, NULL)) && found) |
| 39 | return mach; |
| 40 | |
| 41 | return NULL; |
| 42 | } |
| 43 | EXPORT_SYMBOL_GPL(sst_acpi_find_machine); |
Vinod Koul | 8ceffd2 | 2016-02-08 10:45:39 +0530 | [diff] [blame^] | 44 | |
| 45 | MODULE_LICENSE("GPL v2"); |
| 46 | MODULE_DESCRIPTION("Intel Common ACPI Match module"); |