提交 6b1506c6 编写于 作者: L Linus Torvalds

Merge branch 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6

* 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6:
  dt: add empty of_machine_is_compatible
  ahci: add DT binding for Calxeda AHCI controller
  dt/platform: minor cleanup
  dt: add empty of_alias_get_id() for non-dt builds
* Calxeda SATA Controller
SATA nodes are defined to describe on-chip Serial ATA controllers.
Each SATA controller should have its own node.
Required properties:
- compatible : compatible list, contains "calxeda,hb-ahci"
- interrupts : <interrupt mapping for SATA IRQ>
- reg : <registers mapping>
Example:
sata@ffe08000 {
compatible = "calxeda,hb-ahci";
reg = <0xffe08000 0x1000>;
interrupts = <115>;
};
...@@ -202,11 +202,18 @@ static int __devexit ahci_remove(struct platform_device *pdev) ...@@ -202,11 +202,18 @@ static int __devexit ahci_remove(struct platform_device *pdev)
return 0; return 0;
} }
static const struct of_device_id ahci_of_match[] = {
{ .compatible = "calxeda,hb-ahci", },
{},
};
MODULE_DEVICE_TABLE(of, ahci_of_match);
static struct platform_driver ahci_driver = { static struct platform_driver ahci_driver = {
.remove = __devexit_p(ahci_remove), .remove = __devexit_p(ahci_remove),
.driver = { .driver = {
.name = "ahci", .name = "ahci",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = ahci_of_match,
}, },
.id_table = ahci_devtype, .id_table = ahci_devtype,
}; };
......
...@@ -310,18 +310,21 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l ...@@ -310,18 +310,21 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
struct device_node *np) struct device_node *np)
{ {
struct resource res; struct resource res;
if (lookup) {
for(; lookup->name != NULL; lookup++) { if (!lookup)
if (!of_device_is_compatible(np, lookup->compatible)) return NULL;
continue;
if (of_address_to_resource(np, 0, &res)) for(; lookup->name != NULL; lookup++) {
continue; if (!of_device_is_compatible(np, lookup->compatible))
if (res.start != lookup->phys_addr) continue;
continue; if (of_address_to_resource(np, 0, &res))
pr_debug("%s: devname=%s\n", np->full_name, lookup->name); continue;
return lookup; if (res.start != lookup->phys_addr)
} continue;
pr_debug("%s: devname=%s\n", np->full_name, lookup->name);
return lookup;
} }
return NULL; return NULL;
} }
...@@ -329,8 +332,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l ...@@ -329,8 +332,9 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
* of_platform_bus_create() - Create a device for a node and its children. * of_platform_bus_create() - Create a device for a node and its children.
* @bus: device node of the bus to instantiate * @bus: device node of the bus to instantiate
* @matches: match table for bus nodes * @matches: match table for bus nodes
* disallow recursive creation of child buses * @lookup: auxdata table for matching id and platform_data with device nodes
* @parent: parent for new device, or NULL for top level. * @parent: parent for new device, or NULL for top level.
* @strict: require compatible property
* *
* Creates a platform_device for the provided device_node, and optionally * Creates a platform_device for the provided device_node, and optionally
* recursively create devices for all the child nodes. * recursively create devices for all the child nodes.
......
...@@ -321,6 +321,16 @@ static inline struct device_node *of_parse_phandle(struct device_node *np, ...@@ -321,6 +321,16 @@ static inline struct device_node *of_parse_phandle(struct device_node *np,
return NULL; return NULL;
} }
static inline int of_alias_get_id(struct device_node *np, const char *stem)
{
return -ENOSYS;
}
static inline int of_machine_is_compatible(const char *compat)
{
return 0;
}
#define of_match_ptr(_ptr) NULL #define of_match_ptr(_ptr) NULL
#define of_match_node(_matches, _node) NULL #define of_match_node(_matches, _node) NULL
#endif /* CONFIG_OF */ #endif /* CONFIG_OF */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册