Commit e83f54ea authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-resources' and 'acpi-dptf'

* acpi-resources:
  Revert "ACPI: resources: Add checks for ACPI IRQ override"

* acpi-dptf:
  ACPI: DPTF: Fix reading of attributes
...@@ -9,6 +9,42 @@ ...@@ -9,6 +9,42 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
struct pch_fivr_resp {
u64 status;
u64 result;
};
static int pch_fivr_read(acpi_handle handle, char *method, struct pch_fivr_resp *fivr_resp)
{
struct acpi_buffer resp = { sizeof(struct pch_fivr_resp), fivr_resp};
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_buffer format = { sizeof("NN"), "NN" };
union acpi_object *obj;
acpi_status status;
int ret = -EFAULT;
status = acpi_evaluate_object(handle, method, NULL, &buffer);
if (ACPI_FAILURE(status))
return ret;
obj = buffer.pointer;
if (!obj || obj->type != ACPI_TYPE_PACKAGE)
goto release_buffer;
status = acpi_extract_package(obj, &format, &resp);
if (ACPI_FAILURE(status))
goto release_buffer;
if (fivr_resp->status)
goto release_buffer;
ret = 0;
release_buffer:
kfree(buffer.pointer);
return ret;
}
/* /*
* Presentation of attributes which are defined for INT1045 * Presentation of attributes which are defined for INT1045
* They are: * They are:
...@@ -23,15 +59,14 @@ static ssize_t name##_show(struct device *dev,\ ...@@ -23,15 +59,14 @@ static ssize_t name##_show(struct device *dev,\
char *buf)\ char *buf)\
{\ {\
struct acpi_device *acpi_dev = dev_get_drvdata(dev);\ struct acpi_device *acpi_dev = dev_get_drvdata(dev);\
unsigned long long val;\ struct pch_fivr_resp fivr_resp;\
acpi_status status;\ int status;\
\ \
status = acpi_evaluate_integer(acpi_dev->handle, #method,\ status = pch_fivr_read(acpi_dev->handle, #method, &fivr_resp);\
NULL, &val);\ if (status)\
if (ACPI_SUCCESS(status))\ return status;\
return sprintf(buf, "%d\n", (int)val);\ \
else\ return sprintf(buf, "%llu\n", fivr_resp.result);\
return -EINVAL;\
} }
#define PCH_FIVR_STORE(name, method) \ #define PCH_FIVR_STORE(name, method) \
......
...@@ -423,13 +423,6 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, ...@@ -423,13 +423,6 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
} }
} }
static bool irq_is_legacy(struct acpi_resource_irq *irq)
{
return irq->triggering == ACPI_EDGE_SENSITIVE &&
irq->polarity == ACPI_ACTIVE_HIGH &&
irq->shareable == ACPI_EXCLUSIVE;
}
/** /**
* acpi_dev_resource_interrupt - Extract ACPI interrupt resource information. * acpi_dev_resource_interrupt - Extract ACPI interrupt resource information.
* @ares: Input ACPI resource object. * @ares: Input ACPI resource object.
...@@ -468,7 +461,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, ...@@ -468,7 +461,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
} }
acpi_dev_get_irqresource(res, irq->interrupts[index], acpi_dev_get_irqresource(res, irq->interrupts[index],
irq->triggering, irq->polarity, irq->triggering, irq->polarity,
irq->shareable, irq_is_legacy(irq)); irq->shareable, true);
break; break;
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
ext_irq = &ares->data.extended_irq; ext_irq = &ares->data.extended_irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment