scan.c (2fb20b61550d3c5335e59819ed22734900d4d6e3) | scan.c (222e82ac9ffbd3b80ab1b0b1d2c8c60ddb47d69d) |
---|---|
1/* 2 * scan.c - support for transforming the ACPI namespace into individual objects 3 */ 4 5#include <linux/module.h> 6#include <linux/init.h> 7#include <linux/kernel.h> 8#include <linux/acpi.h> 9#include <linux/signal.h> 10#include <linux/kthread.h> | 1/* 2 * scan.c - support for transforming the ACPI namespace into individual objects 3 */ 4 5#include <linux/module.h> 6#include <linux/init.h> 7#include <linux/kernel.h> 8#include <linux/acpi.h> 9#include <linux/signal.h> 10#include <linux/kthread.h> |
11#include <linux/dmi.h> |
|
11 12#include <acpi/acpi_drivers.h> 13 14#include "internal.h" 15 16#define _COMPONENT ACPI_BUS_COMPONENT 17ACPI_MODULE_NAME("scan"); 18#define STRUCT_TO_INT(s) (*((int*)&s)) --- 1008 unchanged lines hidden (view full) --- 1027 kfree(id); 1028 return; 1029 } 1030 1031 strcpy(id->id, dev_id); 1032 list_add_tail(&id->list, &device->pnp.ids); 1033} 1034 | 12 13#include <acpi/acpi_drivers.h> 14 15#include "internal.h" 16 17#define _COMPONENT ACPI_BUS_COMPONENT 18ACPI_MODULE_NAME("scan"); 19#define STRUCT_TO_INT(s) (*((int*)&s)) --- 1008 unchanged lines hidden (view full) --- 1028 kfree(id); 1029 return; 1030 } 1031 1032 strcpy(id->id, dev_id); 1033 list_add_tail(&id->list, &device->pnp.ids); 1034} 1035 |
1036/* 1037 * Old IBM workstations have a DSDT bug wherein the SMBus object 1038 * lacks the SMBUS01 HID and the methods do not have the necessary "_" 1039 * prefix. Work around this. 1040 */ 1041static int acpi_ibm_smbus_match(struct acpi_device *device) 1042{ 1043 acpi_handle h_dummy; 1044 struct acpi_buffer path = {ACPI_ALLOCATE_BUFFER, NULL}; 1045 int result; 1046 1047 if (!dmi_name_in_vendors("IBM")) 1048 return -ENODEV; 1049 1050 /* Look for SMBS object */ 1051 result = acpi_get_name(device->handle, ACPI_SINGLE_NAME, &path); 1052 if (result) 1053 return result; 1054 1055 if (strcmp("SMBS", path.pointer)) { 1056 result = -ENODEV; 1057 goto out; 1058 } 1059 1060 /* Does it have the necessary (but misnamed) methods? */ 1061 result = -ENODEV; 1062 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "SBI", &h_dummy)) && 1063 ACPI_SUCCESS(acpi_get_handle(device->handle, "SBR", &h_dummy)) && 1064 ACPI_SUCCESS(acpi_get_handle(device->handle, "SBW", &h_dummy))) 1065 result = 0; 1066out: 1067 kfree(path.pointer); 1068 return result; 1069} 1070 |
|
1035static void acpi_device_set_id(struct acpi_device *device) 1036{ 1037 acpi_status status; 1038 struct acpi_device_info *info; 1039 struct acpica_device_id_list *cid_list; 1040 int i; 1041 1042 switch (device->device_type) { --- 34 unchanged lines hidden (view full) --- 1077 * synthetic HIDs to make sure drivers can find them. 1078 */ 1079 if (acpi_is_video_device(device)) 1080 acpi_add_id(device, ACPI_VIDEO_HID); 1081 else if (ACPI_SUCCESS(acpi_bay_match(device))) 1082 acpi_add_id(device, ACPI_BAY_HID); 1083 else if (ACPI_SUCCESS(acpi_dock_match(device))) 1084 acpi_add_id(device, ACPI_DOCK_HID); | 1071static void acpi_device_set_id(struct acpi_device *device) 1072{ 1073 acpi_status status; 1074 struct acpi_device_info *info; 1075 struct acpica_device_id_list *cid_list; 1076 int i; 1077 1078 switch (device->device_type) { --- 34 unchanged lines hidden (view full) --- 1113 * synthetic HIDs to make sure drivers can find them. 1114 */ 1115 if (acpi_is_video_device(device)) 1116 acpi_add_id(device, ACPI_VIDEO_HID); 1117 else if (ACPI_SUCCESS(acpi_bay_match(device))) 1118 acpi_add_id(device, ACPI_BAY_HID); 1119 else if (ACPI_SUCCESS(acpi_dock_match(device))) 1120 acpi_add_id(device, ACPI_DOCK_HID); |
1121 else if (!acpi_ibm_smbus_match(device)) 1122 acpi_add_id(device, ACPI_SMBUS_IBM_HID); |
|
1085 1086 break; 1087 case ACPI_BUS_TYPE_POWER: 1088 acpi_add_id(device, ACPI_POWER_HID); 1089 break; 1090 case ACPI_BUS_TYPE_PROCESSOR: 1091 acpi_add_id(device, ACPI_PROCESSOR_OBJECT_HID); 1092 break; --- 423 unchanged lines hidden --- | 1123 1124 break; 1125 case ACPI_BUS_TYPE_POWER: 1126 acpi_add_id(device, ACPI_POWER_HID); 1127 break; 1128 case ACPI_BUS_TYPE_PROCESSOR: 1129 acpi_add_id(device, ACPI_PROCESSOR_OBJECT_HID); 1130 break; --- 423 unchanged lines hidden --- |