property.c (5c53b262c861dc99aefb215eec579ae438d64fdd) property.c (ee89209402e0b9a733169901063afdf0ae7909db)
1/*
2 * ACPI device specific properties support.
3 *
4 * Copyright (C) 2014, Intel Corporation
5 * All rights reserved.
6 *
7 * Authors: Mika Westerberg <mika.westerberg@linux.intel.com>
8 * Darren Hart <dvhart@linux.intel.com>

--- 96 unchanged lines hidden (view full) ---

105 struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER };
106 bool acpi_of = false;
107 struct acpi_hardware_id *hwid;
108 const union acpi_object *desc;
109 acpi_status status;
110 int i;
111
112 /*
1/*
2 * ACPI device specific properties support.
3 *
4 * Copyright (C) 2014, Intel Corporation
5 * All rights reserved.
6 *
7 * Authors: Mika Westerberg <mika.westerberg@linux.intel.com>
8 * Darren Hart <dvhart@linux.intel.com>

--- 96 unchanged lines hidden (view full) ---

105 struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER };
106 bool acpi_of = false;
107 struct acpi_hardware_id *hwid;
108 const union acpi_object *desc;
109 acpi_status status;
110 int i;
111
112 /*
113 * Check if the special PRP0001 ACPI ID is present and in that case we
114 * fill in Device Tree compatible properties for this device.
113 * Check if ACPI_DT_NAMESPACE_HID is present and inthat case we fill in
114 * Device Tree compatible properties for this device.
115 */
116 list_for_each_entry(hwid, &adev->pnp.ids, list) {
115 */
116 list_for_each_entry(hwid, &adev->pnp.ids, list) {
117 if (!strcmp(hwid->id, "PRP0001")) {
117 if (!strcmp(hwid->id, ACPI_DT_NAMESPACE_HID)) {
118 acpi_of = true;
119 break;
120 }
121 }
122
123 status = acpi_evaluate_object_typed(adev->handle, "_DSD", NULL, &buf,
124 ACPI_TYPE_PACKAGE);
125 if (ACPI_FAILURE(status))

--- 39 unchanged lines hidden (view full) ---

165
166 fail:
167 dev_dbg(&adev->dev, "Returned _DSD data is not valid, skipping\n");
168 ACPI_FREE(buf.pointer);
169
170 out:
171 if (acpi_of && !adev->flags.of_compatible_ok)
172 acpi_handle_info(adev->handle,
118 acpi_of = true;
119 break;
120 }
121 }
122
123 status = acpi_evaluate_object_typed(adev->handle, "_DSD", NULL, &buf,
124 ACPI_TYPE_PACKAGE);
125 if (ACPI_FAILURE(status))

--- 39 unchanged lines hidden (view full) ---

165
166 fail:
167 dev_dbg(&adev->dev, "Returned _DSD data is not valid, skipping\n");
168 ACPI_FREE(buf.pointer);
169
170 out:
171 if (acpi_of && !adev->flags.of_compatible_ok)
172 acpi_handle_info(adev->handle,
173 "PRP0001 requires 'compatible' property\n");
173 ACPI_DT_NAMESPACE_HID " requires 'compatible' property\n");
174}
175
176void acpi_free_properties(struct acpi_device *adev)
177{
178 ACPI_FREE((void *)adev->data.pointer);
179 adev->data.of_compatible = NULL;
180 adev->data.pointer = NULL;
181 adev->data.properties = NULL;

--- 378 unchanged lines hidden ---
174}
175
176void acpi_free_properties(struct acpi_device *adev)
177{
178 ACPI_FREE((void *)adev->data.pointer);
179 adev->data.of_compatible = NULL;
180 adev->data.pointer = NULL;
181 adev->data.properties = NULL;

--- 378 unchanged lines hidden ---