Skip to contentSkip to conversation

libata: Bind the Linux device tree to the ACPI device tree

PATCH New Matthew Garrett 1 participant 1 message Jan 20, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 2/8 libata: Bind the Linux device tree to the ACPI device tree

We want to be able to express the dependencies between ACPI dock devices and their children. This requires us to be able to associate the ACPI device tree and libata devices. This patch uses the generic ACPI glue framework to do so.

---
 drivers/acpi/glue.c       |    2 +
 drivers/ata/libata-acpi.c |  117 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/ata/libata-core.c |    3 +
 drivers/ata/libata.h      |    4 ++
 4 files changed, 126 insertions(+), 0 deletions(-)
drivers/acpi/glue.c +2 -0
index 29a4a5c..18d6812 100644
@@ -39,6 +39,7 @@ int register_acpi_bus_type(struct acpi_bus_type *type)
 	}
 	return -ENODEV;
 }
+EXPORT_SYMBOL(register_acpi_bus_type);
 
 int unregister_acpi_bus_type(struct acpi_bus_type *type)
 {
@@ -54,6 +55,7 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type)
 	}
 	return -ENODEV;
 }
+EXPORT_SYMBOL(unregister_acpi_bus_type);
 
 static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type)
 {
drivers/ata/libata-acpi.c +117 -0

126 lines not on this page · raw message

drivers/ata/libata-core.c +3 -0
index c06e0ec..2339faf 100644
@@ -6504,6 +6504,8 @@ static int __init ata_init(void)
 
 	ata_parse_force_param();
 
+	ata_acpi_register();
+
 	rc = ata_sff_init();
 	if (rc) {
 		kfree(ata_force_tbl);
@@ -6530,6 +6532,7 @@ static void __exit ata_exit(void)
 	ata_release_transport(ata_scsi_transport_template);
 	libata_transport_exit();
 	ata_sff_exit();
+	ata_acpi_unregister();
 	kfree(ata_force_tbl);
 }
 
drivers/ata/libata.h +4 -0
index 814486d..3c5de9e 100644
@@ -118,6 +118,8 @@ extern void ata_acpi_on_resume(struct ata_port *ap);
 extern int ata_acpi_on_devcfg(struct ata_device *dev);
 extern void ata_acpi_on_disable(struct ata_device *dev);
 extern void ata_acpi_set_state(struct ata_port *ap, pm_message_t state);
+extern int ata_acpi_register(void);
+extern void ata_acpi_unregister(void);
 #else
 static inline void ata_acpi_associate_sata_port(struct ata_port *ap) { }
 static inline void ata_acpi_associate(struct ata_host *host) { }
@@ -128,6 +130,8 @@ static inline int ata_acpi_on_devcfg(struct ata_device *dev) { return 0; }
 static inline void ata_acpi_on_disable(struct ata_device *dev) { }
 static inline void ata_acpi_set_state(struct ata_port *ap,
 				      pm_message_t state) { }
+static inline int ata_acpi_register(void) { return 0; }
+static void ata_acpi_unregister(void) { }
 #endif
 
 /* libata-scsi.c */
Signature · 1 line
1.7.8