scan.c (8832f7e43fa7f0f19bd54e13766a825dd1ed4d6f) | scan.c (952c63e9512b63220886105cfc791507046fa39a) |
---|---|
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/slab.h> 8#include <linux/kernel.h> --- 179 unchanged lines hidden (view full) --- 188 mutex_unlock(&device->physical_node_lock); 189 190 return AE_OK; 191} 192 193static int acpi_scan_hot_remove(struct acpi_device *device) 194{ 195 acpi_handle handle = device->handle; | 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/slab.h> 8#include <linux/kernel.h> --- 179 unchanged lines hidden (view full) --- 188 mutex_unlock(&device->physical_node_lock); 189 190 return AE_OK; 191} 192 193static int acpi_scan_hot_remove(struct acpi_device *device) 194{ 195 acpi_handle handle = device->handle; |
196 acpi_handle not_used; | |
197 struct acpi_object_list arg_list; 198 union acpi_object arg; 199 struct device *errdev; 200 acpi_status status; 201 unsigned long long sta; 202 203 /* If there is no handle, the device node has been unregistered. */ 204 if (!handle) { --- 48 unchanged lines hidden (view full) --- 253 acpi_bus_trim(device); 254 255 unlock_device_hotplug(); 256 257 /* Device node has been unregistered. */ 258 put_device(&device->dev); 259 device = NULL; 260 | 196 struct acpi_object_list arg_list; 197 union acpi_object arg; 198 struct device *errdev; 199 acpi_status status; 200 unsigned long long sta; 201 202 /* If there is no handle, the device node has been unregistered. */ 203 if (!handle) { --- 48 unchanged lines hidden (view full) --- 252 acpi_bus_trim(device); 253 254 unlock_device_hotplug(); 255 256 /* Device node has been unregistered. */ 257 put_device(&device->dev); 258 device = NULL; 259 |
261 if (ACPI_SUCCESS(acpi_get_handle(handle, "_LCK", ¬_used))) { | 260 if (acpi_has_method(handle, "_LCK")) { |
262 arg_list.count = 1; 263 arg_list.pointer = &arg; 264 arg.type = ACPI_TYPE_INTEGER; 265 arg.integer.value = 0; 266 acpi_evaluate_object(handle, "_LCK", &arg_list, NULL); 267 } 268 269 arg_list.count = 1; --- 77 unchanged lines hidden (view full) --- 347{ 348 struct acpi_device *device = NULL; 349 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; 350 int error; 351 352 mutex_lock(&acpi_scan_lock); 353 lock_device_hotplug(); 354 | 261 arg_list.count = 1; 262 arg_list.pointer = &arg; 263 arg.type = ACPI_TYPE_INTEGER; 264 arg.integer.value = 0; 265 acpi_evaluate_object(handle, "_LCK", &arg_list, NULL); 266 } 267 268 arg_list.count = 1; --- 77 unchanged lines hidden (view full) --- 346{ 347 struct acpi_device *device = NULL; 348 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; 349 int error; 350 351 mutex_lock(&acpi_scan_lock); 352 lock_device_hotplug(); 353 |
355 if (ost_source != ACPI_NOTIFY_BUS_CHECK) { 356 acpi_bus_get_device(handle, &device); 357 if (device) { 358 dev_warn(&device->dev, "Attempt to re-insert\n"); 359 goto out; 360 } | 354 acpi_bus_get_device(handle, &device); 355 if (device) { 356 dev_warn(&device->dev, "Attempt to re-insert\n"); 357 goto out; |
361 } 362 acpi_evaluate_hotplug_ost(handle, ost_source, 363 ACPI_OST_SC_INSERT_IN_PROGRESS, NULL); 364 error = acpi_bus_scan(handle); 365 if (error) { 366 acpi_handle_warn(handle, "Namespace scan failure\n"); 367 goto out; 368 } --- 280 unchanged lines hidden (view full) --- 649 return sprintf(buf, "%lu\n", acpi_dev->pnp.sun); 650} 651static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL); 652 653static int acpi_device_setup_files(struct acpi_device *dev) 654{ 655 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; 656 acpi_status status; | 358 } 359 acpi_evaluate_hotplug_ost(handle, ost_source, 360 ACPI_OST_SC_INSERT_IN_PROGRESS, NULL); 361 error = acpi_bus_scan(handle); 362 if (error) { 363 acpi_handle_warn(handle, "Namespace scan failure\n"); 364 goto out; 365 } --- 280 unchanged lines hidden (view full) --- 646 return sprintf(buf, "%lu\n", acpi_dev->pnp.sun); 647} 648static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL); 649 650static int acpi_device_setup_files(struct acpi_device *dev) 651{ 652 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; 653 acpi_status status; |
657 acpi_handle temp; | |
658 unsigned long long sun; 659 int result = 0; 660 661 /* 662 * Devices gotten from FADT don't have a "path" attribute 663 */ 664 if (dev->handle) { 665 result = device_create_file(&dev->dev, &dev_attr_path); --- 9 unchanged lines hidden (view full) --- 675 result = device_create_file(&dev->dev, &dev_attr_modalias); 676 if (result) 677 goto end; 678 } 679 680 /* 681 * If device has _STR, 'description' file is created 682 */ | 654 unsigned long long sun; 655 int result = 0; 656 657 /* 658 * Devices gotten from FADT don't have a "path" attribute 659 */ 660 if (dev->handle) { 661 result = device_create_file(&dev->dev, &dev_attr_path); --- 9 unchanged lines hidden (view full) --- 671 result = device_create_file(&dev->dev, &dev_attr_modalias); 672 if (result) 673 goto end; 674 } 675 676 /* 677 * If device has _STR, 'description' file is created 678 */ |
683 status = acpi_get_handle(dev->handle, "_STR", &temp); 684 if (ACPI_SUCCESS(status)) { | 679 if (acpi_has_method(dev->handle, "_STR")) { |
685 status = acpi_evaluate_object(dev->handle, "_STR", 686 NULL, &buffer); 687 if (ACPI_FAILURE(status)) 688 buffer.pointer = NULL; 689 dev->pnp.str_obj = buffer.pointer; 690 result = device_create_file(&dev->dev, &dev_attr_description); 691 if (result) 692 goto end; --- 13 unchanged lines hidden (view full) --- 706 } else { 707 dev->pnp.sun = (unsigned long)-1; 708 } 709 710 /* 711 * If device has _EJ0, 'eject' file is created that is used to trigger 712 * hot-removal function from userland. 713 */ | 680 status = acpi_evaluate_object(dev->handle, "_STR", 681 NULL, &buffer); 682 if (ACPI_FAILURE(status)) 683 buffer.pointer = NULL; 684 dev->pnp.str_obj = buffer.pointer; 685 result = device_create_file(&dev->dev, &dev_attr_description); 686 if (result) 687 goto end; --- 13 unchanged lines hidden (view full) --- 701 } else { 702 dev->pnp.sun = (unsigned long)-1; 703 } 704 705 /* 706 * If device has _EJ0, 'eject' file is created that is used to trigger 707 * hot-removal function from userland. 708 */ |
714 status = acpi_get_handle(dev->handle, "_EJ0", &temp); 715 if (ACPI_SUCCESS(status)) { | 709 if (acpi_has_method(dev->handle, "_EJ0")) { |
716 result = device_create_file(&dev->dev, &dev_attr_eject); 717 if (result) 718 return result; 719 } 720 721 if (dev->flags.power_manageable) { 722 result = device_create_file(&dev->dev, &dev_attr_power_state); 723 if (result) --- 5 unchanged lines hidden (view full) --- 729 } 730 731end: 732 return result; 733} 734 735static void acpi_device_remove_files(struct acpi_device *dev) 736{ | 710 result = device_create_file(&dev->dev, &dev_attr_eject); 711 if (result) 712 return result; 713 } 714 715 if (dev->flags.power_manageable) { 716 result = device_create_file(&dev->dev, &dev_attr_power_state); 717 if (result) --- 5 unchanged lines hidden (view full) --- 723 } 724 725end: 726 return result; 727} 728 729static void acpi_device_remove_files(struct acpi_device *dev) 730{ |
737 acpi_status status; 738 acpi_handle temp; 739 | |
740 if (dev->flags.power_manageable) { 741 device_remove_file(&dev->dev, &dev_attr_power_state); 742 if (dev->power.flags.power_resources) 743 device_remove_file(&dev->dev, 744 &dev_attr_real_power_state); 745 } 746 747 /* 748 * If device has _STR, remove 'description' file 749 */ | 731 if (dev->flags.power_manageable) { 732 device_remove_file(&dev->dev, &dev_attr_power_state); 733 if (dev->power.flags.power_resources) 734 device_remove_file(&dev->dev, 735 &dev_attr_real_power_state); 736 } 737 738 /* 739 * If device has _STR, remove 'description' file 740 */ |
750 status = acpi_get_handle(dev->handle, "_STR", &temp); 751 if (ACPI_SUCCESS(status)) { | 741 if (acpi_has_method(dev->handle, "_STR")) { |
752 kfree(dev->pnp.str_obj); 753 device_remove_file(&dev->dev, &dev_attr_description); 754 } 755 /* 756 * If device has _EJ0, remove 'eject' file. 757 */ | 742 kfree(dev->pnp.str_obj); 743 device_remove_file(&dev->dev, &dev_attr_description); 744 } 745 /* 746 * If device has _EJ0, remove 'eject' file. 747 */ |
758 status = acpi_get_handle(dev->handle, "_EJ0", &temp); 759 if (ACPI_SUCCESS(status)) | 748 if (acpi_has_method(dev->handle, "_EJ0")) |
760 device_remove_file(&dev->dev, &dev_attr_eject); 761 | 749 device_remove_file(&dev->dev, &dev_attr_eject); 750 |
762 status = acpi_get_handle(dev->handle, "_SUN", &temp); 763 if (ACPI_SUCCESS(status)) | 751 if (acpi_has_method(dev->handle, "_SUN")) |
764 device_remove_file(&dev->dev, &dev_attr_sun); 765 766 if (dev->pnp.unique_id) 767 device_remove_file(&dev->dev, &dev_attr_uid); 768 if (dev->pnp.type.bus_address) 769 device_remove_file(&dev->dev, &dev_attr_adr); 770 device_remove_file(&dev->dev, &dev_attr_modalias); 771 device_remove_file(&dev->dev, &dev_attr_hid); --- 559 unchanged lines hidden (view full) --- 1331 &event_status); 1332 if (status == AE_OK) 1333 device->wakeup.flags.run_wake = 1334 !!(event_status & ACPI_EVENT_FLAG_HANDLE); 1335} 1336 1337static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device) 1338{ | 752 device_remove_file(&dev->dev, &dev_attr_sun); 753 754 if (dev->pnp.unique_id) 755 device_remove_file(&dev->dev, &dev_attr_uid); 756 if (dev->pnp.type.bus_address) 757 device_remove_file(&dev->dev, &dev_attr_adr); 758 device_remove_file(&dev->dev, &dev_attr_modalias); 759 device_remove_file(&dev->dev, &dev_attr_hid); --- 559 unchanged lines hidden (view full) --- 1319 &event_status); 1320 if (status == AE_OK) 1321 device->wakeup.flags.run_wake = 1322 !!(event_status & ACPI_EVENT_FLAG_HANDLE); 1323} 1324 1325static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device) 1326{ |
1339 acpi_handle temp; 1340 acpi_status status = 0; | |
1341 int err; 1342 1343 /* Presence of _PRW indicates wake capable */ | 1327 int err; 1328 1329 /* Presence of _PRW indicates wake capable */ |
1344 status = acpi_get_handle(device->handle, "_PRW", &temp); 1345 if (ACPI_FAILURE(status)) | 1330 if (!acpi_has_method(device->handle, "_PRW")) |
1346 return; 1347 1348 err = acpi_bus_extract_wakeup_device_power_package(device->handle, 1349 &device->wakeup); 1350 if (err) { 1351 dev_err(&device->dev, "_PRW evaluation error: %d\n", err); 1352 return; 1353 } --- 13 unchanged lines hidden (view full) --- 1367 "error in _DSW or _PSW evaluation\n")); 1368} 1369 1370static void acpi_bus_init_power_state(struct acpi_device *device, int state) 1371{ 1372 struct acpi_device_power_state *ps = &device->power.states[state]; 1373 char pathname[5] = { '_', 'P', 'R', '0' + state, '\0' }; 1374 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 1331 return; 1332 1333 err = acpi_bus_extract_wakeup_device_power_package(device->handle, 1334 &device->wakeup); 1335 if (err) { 1336 dev_err(&device->dev, "_PRW evaluation error: %d\n", err); 1337 return; 1338 } --- 13 unchanged lines hidden (view full) --- 1352 "error in _DSW or _PSW evaluation\n")); 1353} 1354 1355static void acpi_bus_init_power_state(struct acpi_device *device, int state) 1356{ 1357 struct acpi_device_power_state *ps = &device->power.states[state]; 1358 char pathname[5] = { '_', 'P', 'R', '0' + state, '\0' }; 1359 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
1375 acpi_handle handle; | |
1376 acpi_status status; 1377 1378 INIT_LIST_HEAD(&ps->resources); 1379 1380 /* Evaluate "_PRx" to get referenced power resources */ 1381 status = acpi_evaluate_object(device->handle, pathname, NULL, &buffer); 1382 if (ACPI_SUCCESS(status)) { 1383 union acpi_object *package = buffer.pointer; --- 6 unchanged lines hidden (view full) --- 1390 if (!err) 1391 device->power.flags.power_resources = 1; 1392 } 1393 ACPI_FREE(buffer.pointer); 1394 } 1395 1396 /* Evaluate "_PSx" to see if we can do explicit sets */ 1397 pathname[2] = 'S'; | 1360 acpi_status status; 1361 1362 INIT_LIST_HEAD(&ps->resources); 1363 1364 /* Evaluate "_PRx" to get referenced power resources */ 1365 status = acpi_evaluate_object(device->handle, pathname, NULL, &buffer); 1366 if (ACPI_SUCCESS(status)) { 1367 union acpi_object *package = buffer.pointer; --- 6 unchanged lines hidden (view full) --- 1374 if (!err) 1375 device->power.flags.power_resources = 1; 1376 } 1377 ACPI_FREE(buffer.pointer); 1378 } 1379 1380 /* Evaluate "_PSx" to see if we can do explicit sets */ 1381 pathname[2] = 'S'; |
1398 status = acpi_get_handle(device->handle, pathname, &handle); 1399 if (ACPI_SUCCESS(status)) | 1382 if (acpi_has_method(device->handle, pathname)) |
1400 ps->flags.explicit_set = 1; 1401 1402 /* 1403 * State is valid if there are means to put the device into it. 1404 * D3hot is only valid if _PR3 present. 1405 */ 1406 if (!list_empty(&ps->resources) 1407 || (ps->flags.explicit_set && state < ACPI_STATE_D3_HOT)) { 1408 ps->flags.valid = 1; 1409 ps->flags.os_accessible = 1; 1410 } 1411 1412 ps->power = -1; /* Unknown - driver assigned */ 1413 ps->latency = -1; /* Unknown - driver assigned */ 1414} 1415 1416static void acpi_bus_get_power_flags(struct acpi_device *device) 1417{ | 1383 ps->flags.explicit_set = 1; 1384 1385 /* 1386 * State is valid if there are means to put the device into it. 1387 * D3hot is only valid if _PR3 present. 1388 */ 1389 if (!list_empty(&ps->resources) 1390 || (ps->flags.explicit_set && state < ACPI_STATE_D3_HOT)) { 1391 ps->flags.valid = 1; 1392 ps->flags.os_accessible = 1; 1393 } 1394 1395 ps->power = -1; /* Unknown - driver assigned */ 1396 ps->latency = -1; /* Unknown - driver assigned */ 1397} 1398 1399static void acpi_bus_get_power_flags(struct acpi_device *device) 1400{ |
1418 acpi_status status; 1419 acpi_handle handle; | |
1420 u32 i; 1421 1422 /* Presence of _PS0|_PR0 indicates 'power manageable' */ | 1401 u32 i; 1402 1403 /* Presence of _PS0|_PR0 indicates 'power manageable' */ |
1423 status = acpi_get_handle(device->handle, "_PS0", &handle); 1424 if (ACPI_FAILURE(status)) { 1425 status = acpi_get_handle(device->handle, "_PR0", &handle); 1426 if (ACPI_FAILURE(status)) 1427 return; 1428 } | 1404 if (!acpi_has_method(device->handle, "_PS0") && 1405 !acpi_has_method(device->handle, "_PR0")) 1406 return; |
1429 1430 device->flags.power_manageable = 1; 1431 1432 /* 1433 * Power Management Flags 1434 */ | 1407 1408 device->flags.power_manageable = 1; 1409 1410 /* 1411 * Power Management Flags 1412 */ |
1435 status = acpi_get_handle(device->handle, "_PSC", &handle); 1436 if (ACPI_SUCCESS(status)) | 1413 if (acpi_has_method(device->handle, "_PSC")) |
1437 device->power.flags.explicit_get = 1; | 1414 device->power.flags.explicit_get = 1; |
1438 status = acpi_get_handle(device->handle, "_IRC", &handle); 1439 if (ACPI_SUCCESS(status)) | 1415 if (acpi_has_method(device->handle, "_IRC")) |
1440 device->power.flags.inrush_current = 1; 1441 1442 /* 1443 * Enumerate supported power management states 1444 */ 1445 for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) 1446 acpi_bus_init_power_state(device, i); 1447 --- 17 unchanged lines hidden (view full) --- 1465 if (acpi_bus_init_power(device)) { 1466 acpi_free_power_resources_lists(device); 1467 device->flags.power_manageable = 0; 1468 } 1469} 1470 1471static void acpi_bus_get_flags(struct acpi_device *device) 1472{ | 1416 device->power.flags.inrush_current = 1; 1417 1418 /* 1419 * Enumerate supported power management states 1420 */ 1421 for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) 1422 acpi_bus_init_power_state(device, i); 1423 --- 17 unchanged lines hidden (view full) --- 1441 if (acpi_bus_init_power(device)) { 1442 acpi_free_power_resources_lists(device); 1443 device->flags.power_manageable = 0; 1444 } 1445} 1446 1447static void acpi_bus_get_flags(struct acpi_device *device) 1448{ |
1473 acpi_status status = AE_OK; 1474 acpi_handle temp = NULL; 1475 | |
1476 /* Presence of _STA indicates 'dynamic_status' */ | 1449 /* Presence of _STA indicates 'dynamic_status' */ |
1477 status = acpi_get_handle(device->handle, "_STA", &temp); 1478 if (ACPI_SUCCESS(status)) | 1450 if (acpi_has_method(device->handle, "_STA")) |
1479 device->flags.dynamic_status = 1; 1480 1481 /* Presence of _RMV indicates 'removable' */ | 1451 device->flags.dynamic_status = 1; 1452 1453 /* Presence of _RMV indicates 'removable' */ |
1482 status = acpi_get_handle(device->handle, "_RMV", &temp); 1483 if (ACPI_SUCCESS(status)) | 1454 if (acpi_has_method(device->handle, "_RMV")) |
1484 device->flags.removable = 1; 1485 1486 /* Presence of _EJD|_EJ0 indicates 'ejectable' */ | 1455 device->flags.removable = 1; 1456 1457 /* Presence of _EJD|_EJ0 indicates 'ejectable' */ |
1487 status = acpi_get_handle(device->handle, "_EJD", &temp); 1488 if (ACPI_SUCCESS(status)) | 1458 if (acpi_has_method(device->handle, "_EJD") || 1459 acpi_has_method(device->handle, "_EJ0")) |
1489 device->flags.ejectable = 1; | 1460 device->flags.ejectable = 1; |
1490 else { 1491 status = acpi_get_handle(device->handle, "_EJ0", &temp); 1492 if (ACPI_SUCCESS(status)) 1493 device->flags.ejectable = 1; 1494 } | |
1495} 1496 1497static void acpi_device_get_busid(struct acpi_device *device) 1498{ 1499 char bus_id[5] = { '?', 0 }; 1500 struct acpi_buffer buffer = { sizeof(bus_id), bus_id }; 1501 int i = 0; 1502 --- 32 unchanged lines hidden (view full) --- 1535/* 1536 * acpi_bay_match - see if an acpi object is an ejectable driver bay 1537 * 1538 * If an acpi object is ejectable and has one of the ACPI ATA methods defined, 1539 * then we can safely call it an ejectable drive bay 1540 */ 1541static int acpi_bay_match(acpi_handle handle) 1542{ | 1461} 1462 1463static void acpi_device_get_busid(struct acpi_device *device) 1464{ 1465 char bus_id[5] = { '?', 0 }; 1466 struct acpi_buffer buffer = { sizeof(bus_id), bus_id }; 1467 int i = 0; 1468 --- 32 unchanged lines hidden (view full) --- 1501/* 1502 * acpi_bay_match - see if an acpi object is an ejectable driver bay 1503 * 1504 * If an acpi object is ejectable and has one of the ACPI ATA methods defined, 1505 * then we can safely call it an ejectable drive bay 1506 */ 1507static int acpi_bay_match(acpi_handle handle) 1508{ |
1543 acpi_status status; 1544 acpi_handle tmp; | |
1545 acpi_handle phandle; 1546 | 1509 acpi_handle phandle; 1510 |
1547 status = acpi_get_handle(handle, "_EJ0", &tmp); 1548 if (ACPI_FAILURE(status)) | 1511 if (!acpi_has_method(handle, "_EJ0")) |
1549 return -ENODEV; 1550 | 1512 return -ENODEV; 1513 |
1551 if ((ACPI_SUCCESS(acpi_get_handle(handle, "_GTF", &tmp))) || 1552 (ACPI_SUCCESS(acpi_get_handle(handle, "_GTM", &tmp))) || 1553 (ACPI_SUCCESS(acpi_get_handle(handle, "_STM", &tmp))) || 1554 (ACPI_SUCCESS(acpi_get_handle(handle, "_SDD", &tmp)))) | 1514 if (acpi_has_method(handle, "_GTF") || 1515 acpi_has_method(handle, "_GTM") || 1516 acpi_has_method(handle, "_STM") || 1517 acpi_has_method(handle, "_SDD")) |
1555 return 0; 1556 1557 if (acpi_get_parent(handle, &phandle)) 1558 return -ENODEV; 1559 | 1518 return 0; 1519 1520 if (acpi_get_parent(handle, &phandle)) 1521 return -ENODEV; 1522 |
1560 if ((ACPI_SUCCESS(acpi_get_handle(phandle, "_GTF", &tmp))) || 1561 (ACPI_SUCCESS(acpi_get_handle(phandle, "_GTM", &tmp))) || 1562 (ACPI_SUCCESS(acpi_get_handle(phandle, "_STM", &tmp))) || 1563 (ACPI_SUCCESS(acpi_get_handle(phandle, "_SDD", &tmp)))) | 1523 if (acpi_has_method(phandle, "_GTF") || 1524 acpi_has_method(phandle, "_GTM") || 1525 acpi_has_method(phandle, "_STM") || 1526 acpi_has_method(phandle, "_SDD")) |
1564 return 0; 1565 1566 return -ENODEV; 1567} 1568 1569/* 1570 * acpi_dock_match - see if an acpi object has a _DCK method 1571 */ --- 35 unchanged lines hidden (view full) --- 1607 1608/* 1609 * Old IBM workstations have a DSDT bug wherein the SMBus object 1610 * lacks the SMBUS01 HID and the methods do not have the necessary "_" 1611 * prefix. Work around this. 1612 */ 1613static int acpi_ibm_smbus_match(acpi_handle handle) 1614{ | 1527 return 0; 1528 1529 return -ENODEV; 1530} 1531 1532/* 1533 * acpi_dock_match - see if an acpi object has a _DCK method 1534 */ --- 35 unchanged lines hidden (view full) --- 1570 1571/* 1572 * Old IBM workstations have a DSDT bug wherein the SMBus object 1573 * lacks the SMBUS01 HID and the methods do not have the necessary "_" 1574 * prefix. Work around this. 1575 */ 1576static int acpi_ibm_smbus_match(acpi_handle handle) 1577{ |
1615 acpi_handle h_dummy; | |
1616 struct acpi_buffer path = {ACPI_ALLOCATE_BUFFER, NULL}; 1617 int result; 1618 1619 if (!dmi_name_in_vendors("IBM")) 1620 return -ENODEV; 1621 1622 /* Look for SMBS object */ 1623 result = acpi_get_name(handle, ACPI_SINGLE_NAME, &path); 1624 if (result) 1625 return result; 1626 1627 if (strcmp("SMBS", path.pointer)) { 1628 result = -ENODEV; 1629 goto out; 1630 } 1631 1632 /* Does it have the necessary (but misnamed) methods? */ 1633 result = -ENODEV; | 1578 struct acpi_buffer path = {ACPI_ALLOCATE_BUFFER, NULL}; 1579 int result; 1580 1581 if (!dmi_name_in_vendors("IBM")) 1582 return -ENODEV; 1583 1584 /* Look for SMBS object */ 1585 result = acpi_get_name(handle, ACPI_SINGLE_NAME, &path); 1586 if (result) 1587 return result; 1588 1589 if (strcmp("SMBS", path.pointer)) { 1590 result = -ENODEV; 1591 goto out; 1592 } 1593 1594 /* Does it have the necessary (but misnamed) methods? */ 1595 result = -ENODEV; |
1634 if (ACPI_SUCCESS(acpi_get_handle(handle, "SBI", &h_dummy)) && 1635 ACPI_SUCCESS(acpi_get_handle(handle, "SBR", &h_dummy)) && 1636 ACPI_SUCCESS(acpi_get_handle(handle, "SBW", &h_dummy))) | 1596 if (acpi_has_method(handle, "SBI") && 1597 acpi_has_method(handle, "SBR") && 1598 acpi_has_method(handle, "SBW")) |
1637 result = 0; 1638out: 1639 kfree(path.pointer); 1640 return result; 1641} 1642 1643static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, 1644 int device_type) --- 250 unchanged lines hidden (view full) --- 1895} 1896 1897static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used, 1898 void *not_used, void **return_value) 1899{ 1900 struct acpi_device *device = NULL; 1901 int type; 1902 unsigned long long sta; | 1599 result = 0; 1600out: 1601 kfree(path.pointer); 1602 return result; 1603} 1604 1605static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, 1606 int device_type) --- 250 unchanged lines hidden (view full) --- 1857} 1858 1859static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used, 1860 void *not_used, void **return_value) 1861{ 1862 struct acpi_device *device = NULL; 1863 int type; 1864 unsigned long long sta; |
1903 acpi_status status; | |
1904 int result; 1905 1906 acpi_bus_get_device(handle, &device); 1907 if (device) 1908 goto out; 1909 1910 result = acpi_bus_type_and_status(handle, &type, &sta); 1911 if (result) --- 4 unchanged lines hidden (view full) --- 1916 return AE_OK; 1917 } 1918 1919 acpi_scan_init_hotplug(handle, type); 1920 1921 if (!(sta & ACPI_STA_DEVICE_PRESENT) && 1922 !(sta & ACPI_STA_DEVICE_FUNCTIONING)) { 1923 struct acpi_device_wakeup wakeup; | 1865 int result; 1866 1867 acpi_bus_get_device(handle, &device); 1868 if (device) 1869 goto out; 1870 1871 result = acpi_bus_type_and_status(handle, &type, &sta); 1872 if (result) --- 4 unchanged lines hidden (view full) --- 1877 return AE_OK; 1878 } 1879 1880 acpi_scan_init_hotplug(handle, type); 1881 1882 if (!(sta & ACPI_STA_DEVICE_PRESENT) && 1883 !(sta & ACPI_STA_DEVICE_FUNCTIONING)) { 1884 struct acpi_device_wakeup wakeup; |
1924 acpi_handle temp; | |
1925 | 1885 |
1926 status = acpi_get_handle(handle, "_PRW", &temp); 1927 if (ACPI_SUCCESS(status)) { | 1886 if (acpi_has_method(handle, "_PRW")) { |
1928 acpi_bus_extract_wakeup_device_power_package(handle, 1929 &wakeup); 1930 acpi_power_resources_list_free(&wakeup.resources); 1931 } 1932 return AE_CTRL_DEPTH; 1933 } 1934 1935 acpi_add_single_object(&device, handle, type, sta); --- 42 unchanged lines hidden (view full) --- 1978 * namespace walks prematurely. 1979 */ 1980 if (acpi_bus_type_and_status(handle, &ret, &sta_not_used)) 1981 return AE_OK; 1982 1983 if (acpi_bus_get_device(handle, &device)) 1984 return AE_CTRL_DEPTH; 1985 | 1887 acpi_bus_extract_wakeup_device_power_package(handle, 1888 &wakeup); 1889 acpi_power_resources_list_free(&wakeup.resources); 1890 } 1891 return AE_CTRL_DEPTH; 1892 } 1893 1894 acpi_add_single_object(&device, handle, type, sta); --- 42 unchanged lines hidden (view full) --- 1937 * namespace walks prematurely. 1938 */ 1939 if (acpi_bus_type_and_status(handle, &ret, &sta_not_used)) 1940 return AE_OK; 1941 1942 if (acpi_bus_get_device(handle, &device)) 1943 return AE_CTRL_DEPTH; 1944 |
1986 if (device->handler) 1987 return AE_OK; 1988 | |
1989 ret = acpi_scan_attach_handler(device); 1990 if (ret) 1991 return ret > 0 ? AE_OK : AE_CTRL_DEPTH; 1992 1993 ret = device_attach(&device->dev); 1994 return ret >= 0 ? AE_OK : AE_CTRL_DEPTH; 1995} 1996 --- 173 unchanged lines hidden --- | 1945 ret = acpi_scan_attach_handler(device); 1946 if (ret) 1947 return ret > 0 ? AE_OK : AE_CTRL_DEPTH; 1948 1949 ret = device_attach(&device->dev); 1950 return ret >= 0 ? AE_OK : AE_CTRL_DEPTH; 1951} 1952 --- 173 unchanged lines hidden --- |