| 1 | #ifndef _LINUX_OF_H
|
|---|
| 2 | #define _LINUX_OF_H
|
|---|
| 3 | /*
|
|---|
| 4 | * Definitions for talking to the Open Firmware PROM on
|
|---|
| 5 | * Power Macintosh and other computers.
|
|---|
| 6 | *
|
|---|
| 7 | * Copyright (C) 1996-2005 Paul Mackerras.
|
|---|
| 8 | *
|
|---|
| 9 | * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
|
|---|
| 10 | * Updates for SPARC64 by David S. Miller
|
|---|
| 11 | * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp.
|
|---|
| 12 | *
|
|---|
| 13 | * This program is free software; you can redistribute it and/or
|
|---|
| 14 | * modify it under the terms of the GNU General Public License
|
|---|
| 15 | * as published by the Free Software Foundation; either version
|
|---|
| 16 | * 2 of the License, or (at your option) any later version.
|
|---|
| 17 | */
|
|---|
| 18 | #include <linux/types.h>
|
|---|
| 19 | #include <linux/bitops.h>
|
|---|
| 20 | #include <linux/errno.h>
|
|---|
| 21 | #include <linux/kobject.h>
|
|---|
| 22 | #include <linux/mod_devicetable.h>
|
|---|
| 23 | #include <linux/spinlock.h>
|
|---|
| 24 | //#include <linux/topology.h>
|
|---|
| 25 | #include <linux/notifier.h>
|
|---|
| 26 | //#include <linux/property.h>
|
|---|
| 27 | #include <linux/list.h>
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | struct property {
|
|---|
| 31 | char *name;
|
|---|
| 32 | int length;
|
|---|
| 33 | void *value;
|
|---|
| 34 | struct property *next;
|
|---|
| 35 | unsigned long _flags;
|
|---|
| 36 | unsigned int unique_id;
|
|---|
| 37 | // struct bin_attribute attr;
|
|---|
| 38 | };
|
|---|
| 39 |
|
|---|
| 40 | static inline struct property *of_find_property(const struct device_node *np,
|
|---|
| 41 | const char *name,
|
|---|
| 42 | int *lenp)
|
|---|
| 43 | {
|
|---|
| 44 | return NULL;
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| 47 | /**
|
|---|
| 48 | * of_property_read_bool - Findfrom a property
|
|---|
| 49 | * @np: device node from which the property value is to be read.
|
|---|
| 50 | * @propname: name of the property to be searched.
|
|---|
| 51 | *
|
|---|
| 52 | * Search for a property in a device node.
|
|---|
| 53 | * Returns true if the property exists false otherwise.
|
|---|
| 54 | */
|
|---|
| 55 | static inline bool of_property_read_bool(const struct device_node *np,
|
|---|
| 56 | const char *propname)
|
|---|
| 57 | {
|
|---|
| 58 | struct property *prop = of_find_property(np, propname, NULL);
|
|---|
| 59 |
|
|---|
| 60 | return prop ? true : false;
|
|---|
| 61 | }
|
|---|
| 62 |
|
|---|
| 63 | #endif /* _LINUX_OF_H */
|
|---|