Lines Matching +full:bool +full:- +full:property

1 /* SPDX-License-Identifier: GPL-2.0+ */
8 * Copyright (C) 1996-2005 Paul Mackerras.
22 #include <linux/property.h>
31 struct property { struct
35 struct property *next; argument
57 struct property *properties; argument
58 struct property *deadprops; /* removed properties */
99 struct property *prop;
100 struct property *old_prop;
109 kobject_init(&node->kobj, &of_node_ktype); in of_node_init()
111 fwnode_init(&node->fwnode, &of_fwnode_ops); in of_node_init()
115 #define of_node_kobj(n) (&(n)->kobj)
124 /* Dummy ref counting routines - to be implemented later */
150 #define OF_BAD_ADDR ((u64)-1)
155 static inline bool is_of_node(const struct fwnode_handle *fwnode) in is_of_node()
157 return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &of_fwnode_ops; in is_of_node()
175 &__of_fwnode_handle_node->fwnode : NULL; \
178 static inline bool of_have_populated_dt(void) in of_have_populated_dt()
183 static inline bool of_node_is_root(const struct device_node *node) in of_node_is_root()
185 return node && (node->parent == NULL); in of_node_is_root()
190 return test_bit(flag, &n->_flags); in of_node_check_flag()
196 return test_and_set_bit(flag, &n->_flags); in of_node_test_and_set_flag()
201 set_bit(flag, &n->_flags); in of_node_set_flag()
206 clear_bit(flag, &n->_flags); in of_node_clear_flag()
210 static inline int of_property_check_flag(const struct property *p, unsigned long flag) in of_property_check_flag()
212 return test_bit(flag, &p->_flags); in of_property_check_flag()
215 static inline void of_property_set_flag(struct property *p, unsigned long flag) in of_property_set_flag()
217 set_bit(flag, &p->_flags); in of_property_set_flag()
220 static inline void of_property_clear_flag(struct property *p, unsigned long flag) in of_property_clear_flag()
222 clear_bit(flag, &p->_flags); in of_property_clear_flag()
237 for (; size--; cell++) in of_read_number()
253 #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
254 #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
256 extern bool of_node_name_eq(const struct device_node *np, const char *name);
257 extern bool of_node_name_prefix(const struct device_node *np, const char *prefix);
261 return np ? np->full_name : "<no-node>"; in of_node_full_name()
304 extern struct property *of_find_property(const struct device_node *np,
347 extern bool of_device_is_available(const struct device_node *device);
348 extern bool of_device_is_big_endian(const struct device_node *device);
359 for (pp = dn->properties; pp != NULL; pp = pp->next)
394 extern int of_add_property(struct device_node *np, struct property *prop);
395 extern int of_remove_property(struct device_node *np, struct property *prop);
396 extern int of_update_property(struct device_node *np, struct property *newprop);
411 * struct property *prop;
418 const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
421 * struct property *prop;
427 const char *of_prop_next_string(struct property *prop, const char *cur);
429 bool of_console_check(struct device_node *dn, char *name, int index);
450 static inline bool is_of_node(const struct fwnode_handle *fwnode) in is_of_node()
460 static inline bool of_node_name_eq(const struct device_node *np, const char *name) in of_node_name_eq()
465 static inline bool of_node_name_prefix(const struct device_node *np, const char *prefix) in of_node_name_prefix()
472 return "<no-node>"; in of_node_full_name()
541 static inline bool of_have_populated_dt(void) in of_have_populated_dt()
571 static inline bool of_device_is_available(const struct device_node *device) in of_device_is_available()
576 static inline bool of_device_is_big_endian(const struct device_node *device) in of_device_is_big_endian()
581 static inline struct property *of_find_property(const struct device_node *np, in of_find_property()
599 return -ENOSYS; in of_property_count_elems_of_size()
605 return -ENOSYS; in of_property_read_u32_index()
611 return -ENOSYS; in of_property_read_u64_index()
652 return -ENOSYS; in of_property_read_variable_u8_array()
659 return -ENOSYS; in of_property_read_variable_u16_array()
668 return -ENOSYS; in of_property_read_variable_u32_array()
674 return -ENOSYS; in of_property_read_u64()
683 return -ENOSYS; in of_property_read_variable_u64_array()
690 return -ENOSYS; in of_property_read_string()
697 return -ENOSYS; in of_property_match_string()
704 return -ENOSYS; in of_property_read_string_helper()
714 return -ENOSYS; in __of_parse_phandle_with_args()
723 return -ENOSYS; in of_parse_phandle_with_args_map()
730 return -ENOSYS; in of_count_phandle_with_args()
739 return -ENOSYS; in of_phandle_iterator_init()
744 return -ENOSYS; in of_phandle_iterator_next()
756 return -ENOSYS; in of_alias_get_id()
761 return -ENOSYS; in of_alias_get_highest_id()
769 static inline int of_add_property(struct device_node *np, struct property *prop) in of_add_property()
774 static inline int of_remove_property(struct device_node *np, struct property *prop) in of_remove_property()
779 static inline bool of_console_check(const struct device_node *dn, const char *name, int index) in of_console_check()
784 static inline const __be32 *of_prop_next_u32(struct property *prop, in of_prop_next_u32()
790 static inline const char *of_prop_next_string(struct property *prop, in of_prop_next_string()
815 static inline int of_property_check_flag(const struct property *p, in of_property_check_flag()
821 static inline void of_property_set_flag(struct property *p, unsigned long flag) in of_property_set_flag()
825 static inline void of_property_clear_flag(struct property *p, unsigned long flag) in of_property_clear_flag()
831 return -ENODEV; in of_cpu_node_to_id()
838 return -EINVAL; in of_map_id()
857 static inline int of_prop_val_eq(struct property *p1, struct property *p2) in of_prop_val_eq()
859 return p1->length == p2->length && in of_prop_val_eq()
860 !memcmp(p1->value, p2->value, (size_t)p1->length); in of_prop_val_eq()
877 return -ENOSYS; in of_numa_init()
893 static inline bool of_node_is_type(const struct device_node *np, const char *type) in of_node_is_type()
901 * of_parse_phandle - Resolve a phandle property to a device_node pointer
902 * @np: Pointer to device node holding phandle property
903 * @phandle_name: Name of property holding a phandle value
924 * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
926 * @list_name: property name that contains a list
927 * @cells_name: property name that specifies phandles' arguments count
935 * Caller is responsible to call of_node_put() on the returned out_args->np
941 * #list-cells = <2>;
945 * #list-cells = <1>;
953 * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
961 int cell_count = -1; in of_parse_phandle_with_args()
972 * of_parse_phandle_with_fixed_args() - Find a node pointed by phandle in a list
974 * @list_name: property name that contains a list
983 * Caller is responsible to call of_node_put() on the returned out_args->np
1012 * of_property_count_u8_elems - Count the number of u8 elements in a property
1014 * @np: device node from which the property value is to be read.
1015 * @propname: name of the property to be searched.
1017 * Search for a property in a device node and count the number of u8 elements
1020 * Return: The number of elements on sucess, -EINVAL if the property does
1021 * not exist or its length does not match a multiple of u8 and -ENODATA if the
1022 * property does not have a value.
1031 * of_property_count_u16_elems - Count the number of u16 elements in a property
1033 * @np: device node from which the property value is to be read.
1034 * @propname: name of the property to be searched.
1036 * Search for a property in a device node and count the number of u16 elements
1039 * Return: The number of elements on sucess, -EINVAL if the property does
1040 * not exist or its length does not match a multiple of u16 and -ENODATA if the
1041 * property does not have a value.
1050 * of_property_count_u32_elems - Count the number of u32 elements in a property
1052 * @np: device node from which the property value is to be read.
1053 * @propname: name of the property to be searched.
1055 * Search for a property in a device node and count the number of u32 elements
1058 * Return: The number of elements on sucess, -EINVAL if the property does
1059 * not exist or its length does not match a multiple of u32 and -ENODATA if the
1060 * property does not have a value.
1069 * of_property_count_u64_elems - Count the number of u64 elements in a property
1071 * @np: device node from which the property value is to be read.
1072 * @propname: name of the property to be searched.
1074 * Search for a property in a device node and count the number of u64 elements
1077 * Return: The number of elements on sucess, -EINVAL if the property does
1078 * not exist or its length does not match a multiple of u64 and -ENODATA if the
1079 * property does not have a value.
1088 * of_property_read_string_array() - Read an array of strings from a multiple
1089 * strings property.
1090 * @np: device node from which the property value is to be read.
1091 * @propname: name of the property to be searched.
1095 * Search for a property in a device tree node and retrieve a list of
1096 * terminated string values (pointer to data, not a copy) in that property.
1098 * Return: If @out_strs is NULL, the number of strings in the property is returned.
1108 * of_property_count_strings() - Find and return the number of strings from a
1109 * multiple strings property.
1110 * @np: device node from which the property value is to be read.
1111 * @propname: name of the property to be searched.
1113 * Search for a property in a device tree node and retrieve the number of null
1116 * Return: The number of strings on success, -EINVAL if the property does not
1117 * exist, -ENODATA if property does not have a value, and -EILSEQ if the string
1118 * is not null-terminated within the length of the property data.
1127 * of_property_read_string_index() - Find and read a string from a multiple
1128 * strings property.
1129 * @np: device node from which the property value is to be read.
1130 * @propname: name of the property to be searched.
1135 * Search for a property in a device tree node and retrieve a null
1137 * contained in that property.
1139 * Return: 0 on success, -EINVAL if the property does not exist, -ENODATA if
1140 * property does not have a value, and -EILSEQ if the string is not
1141 * null-terminated within the length of the property data.
1154 * of_property_read_bool - Find a property
1155 * @np: device node from which the property value is to be read.
1156 * @propname: name of the property to be searched.
1158 * Search for a property in a device node.
1160 * Return: true if the property exists false otherwise.
1162 static inline bool of_property_read_bool(const struct device_node *np, in of_property_read_bool()
1165 struct property *prop = of_find_property(np, propname, NULL); in of_property_read_bool()
1171 * of_property_read_u8_array - Find and read an array of u8 from a property.
1173 * @np: device node from which the property value is to be read.
1174 * @propname: name of the property to be searched.
1178 * Search for a property in a device node and read 8-bit value(s) from
1182 * ``property = /bits/ 8 <0x50 0x60 0x70>;``
1184 * Return: 0 on success, -EINVAL if the property does not exist,
1185 * -ENODATA if property does not have a value, and -EOVERFLOW if the
1186 * property data isn't large enough.
1203 * of_property_read_u16_array - Find and read an array of u16 from a property.
1205 * @np: device node from which the property value is to be read.
1206 * @propname: name of the property to be searched.
1210 * Search for a property in a device node and read 16-bit value(s) from
1214 * ``property = /bits/ 16 <0x5000 0x6000 0x7000>;``
1216 * Return: 0 on success, -EINVAL if the property does not exist,
1217 * -ENODATA if property does not have a value, and -EOVERFLOW if the
1218 * property data isn't large enough.
1235 * of_property_read_u32_array - Find and read an array of 32 bit integers
1236 * from a property.
1238 * @np: device node from which the property value is to be read.
1239 * @propname: name of the property to be searched.
1243 * Search for a property in a device node and read 32-bit value(s) from
1246 * Return: 0 on success, -EINVAL if the property does not exist,
1247 * -ENODATA if property does not have a value, and -EOVERFLOW if the
1248 * property data isn't large enough.
1265 * of_property_read_u64_array - Find and read an array of 64 bit integers
1266 * from a property.
1268 * @np: device node from which the property value is to be read.
1269 * @propname: name of the property to be searched.
1273 * Search for a property in a device node and read 64-bit value(s) from
1276 * Return: 0 on success, -EINVAL if the property does not exist,
1277 * -ENODATA if property does not have a value, and -EOVERFLOW if the
1278 * property data isn't large enough.
1423 * struct of_changeset_entry - Holds a changeset entry
1428 * @prop: pointer to the property affected
1429 * @old_prop: hold a pointer to the original property
1440 struct property *prop;
1441 struct property *old_prop;
1445 * struct of_changeset - changeset tracker structure
1450 * live tree. In case of an error, changes are rolled-back.
1477 struct property *prop);
1492 struct device_node *np, struct property *prop) in of_changeset_add_property()
1498 struct device_node *np, struct property *prop) in of_changeset_remove_property()
1504 struct device_node *np, struct property *prop) in of_changeset_update_property()
1511 return -EINVAL; in of_reconfig_notifier_register()
1515 return -EINVAL; in of_reconfig_notifier_unregister()
1520 return -EINVAL; in of_reconfig_notify()
1525 return -EINVAL; in of_reconfig_get_state_change()
1530 * of_device_is_system_power_controller - Tells if system-power-controller is found for device_node
1535 static inline bool of_device_is_system_power_controller(const struct device_node *np) in of_device_is_system_power_controller()
1537 return of_property_read_bool(np, "system-power-controller"); in of_device_is_system_power_controller()
1556 "pre-apply", in of_overlay_action_name()
1557 "post-apply", in of_overlay_action_name()
1558 "pre-remove", in of_overlay_action_name()
1559 "post-remove", in of_overlay_action_name()
1585 return -ENOTSUPP; in of_overlay_fdt_apply()
1590 return -ENOTSUPP; in of_overlay_remove()
1595 return -ENOTSUPP; in of_overlay_remove_all()