forked from beagleboard/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
of: Output devicetree alias names in uevent
In some situations, userspace may want to resolve a device by function and logical number (ie, "serial0") rather than by the base address or full device path. Being able to resolve a device by alias frees userspace from the burden of otherwise having to maintain a mapping between device addresses and their logical assignments on each platform when multiple instances of the same hardware block are present in the system. Although the uevent device attribute contains devicetree compatible information and the full device path, the uevent does not list the alises that may have been defined for the device. Signed-off-by: Stepan Moskovchenko <[email protected]> [grant.likely: Removed OF_ALIAS_N field; I don't think it's needed] [grant.likely: Added #ifndef _LINUX_OF_PRIVATE_H wrapper] Signed-off-by: Grant Likely <[email protected]>
- Loading branch information
Showing
3 changed files
with
52 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef _LINUX_OF_PRIVATE_H | ||
#define _LINUX_OF_PRIVATE_H | ||
/* | ||
* Private symbols used by OF support code | ||
* | ||
* Paul Mackerras August 1996. | ||
* Copyright (C) 1996-2005 Paul Mackerras. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
|
||
/** | ||
* struct alias_prop - Alias property in 'aliases' node | ||
* @link: List node to link the structure in aliases_lookup list | ||
* @alias: Alias property name | ||
* @np: Pointer to device_node that the alias stands for | ||
* @id: Index value from end of alias name | ||
* @stem: Alias string without the index | ||
* | ||
* The structure represents one alias property of 'aliases' node as | ||
* an entry in aliases_lookup list. | ||
*/ | ||
struct alias_prop { | ||
struct list_head link; | ||
const char *alias; | ||
struct device_node *np; | ||
int id; | ||
char stem[0]; | ||
}; | ||
|
||
extern struct mutex of_aliases_mutex; | ||
extern struct list_head aliases_lookup; | ||
#endif /* _LINUX_OF_PRIVATE_H */ |