From: Mark Brown Date: Wed, 26 Mar 2014 16:57:57 +0000 (+0000) Subject: Merge remote-tracking branches 'regulator/topic/doc', 'regulator/topic/enable', ... X-Git-Tag: v3.15-rc1~148^2~4 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=794016f9dcb5930205becb040860190662c5847c;p=linux.git Merge remote-tracking branches 'regulator/topic/doc', 'regulator/topic/enable', 'regulator/topic/fan53555', 'regulator/topic/fixed', 'regulator/topic/gpio', 'regulator/topic/lp3971', 'regulator/topic/lp872x' and 'regulator/topic/max14577' into regulator-next --- 794016f9dcb5930205becb040860190662c5847c diff --cc Documentation/devicetree/bindings/regulator/gpio-regulator.txt index 63c659800c03,1229541f48a2,63c659800c03,63c659800c03,63c659800c03,356e8bbd9b2a,63c659800c03,63c659800c03,63c659800c03..e5cac1e0ca8a --- a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt @@@@@@@@@@ -8,8 -8,10 -8,8 -8,8 -8,8 -8,10 -8,8 -8,8 -8,8 +8,12 @@@@@@@@@@ Required properties Optional properties: - enable-gpio : GPIO to use to enable/disable the regulator. - gpios : GPIO group used to control voltage. +++++ +++- gpios-states : gpios pin's initial states array. 0: LOW, 1: HIGH. +++++ +++ defualt is LOW if nothing is specified. - startup-delay-us : Startup time in microseconds. - enable-active-high : Polarity of GPIO is active high (default is low). + +++++++- regulator-type : Specifies what is being regulated, must be either + +++++++ "voltage" or "current", defaults to current. Any property defined as part of the core regulator binding defined in regulator.txt can also be used. diff --cc drivers/of/base.c index 89e888a78899,ff85450d5683,ff85450d5683,ff85450d5683,ff85450d5683,8a2a55c65e5d,ff85450d5683,ff85450d5683,ff85450d5683..1b95a405628f --- a/drivers/of/base.c +++ b/drivers/of/base.c @@@@@@@@@@ -782,16 -740,37 -740,37 -740,37 -740,37 -740,37 -740,37 -740,37 -740,37 +782,16 @@@@@@@@@@ const struct of_device_id *__of_match_n if (!matches) return NULL; -------- cp = __of_get_property(node, "compatible", &cplen); -------- do { -------- const struct of_device_id *m = matches; -------- -------- /* Check against matches with current compatible string */ -------- while (m->name[0] || m->type[0] || m->compatible[0]) { -------- int match = 1; -------- if (m->name[0]) -------- match &= node->name -------- && !strcmp(m->name, node->name); -------- if (m->type[0]) -------- match &= node->type -------- && !strcmp(m->type, node->type); -------- if (m->compatible[0]) -------- match &= cp -------- && !of_compat_cmp(m->compatible, cp, -------- strlen(m->compatible)); -------- if (match) -------- return m; -------- m++; ---- --- } ---- --- ---- --- /* Get node's next compatible string */ ---- --- if (cp) { ---- --- l = strlen(cp) + 1; ---- --- cp += l; ---- --- cplen -= l; ++++++++ for (; matches->name[0] || matches->type[0] || matches->compatible[0]; matches++) { ++++++++ score = __of_device_is_compatible(node, matches->compatible, ++++++++ matches->type, matches->name); ++++++++ if (score > best_score) { ++++++++ best_match = matches; ++++++++ best_score = score; } ---- --- } while (cp && (cplen > 0)); ++++++++ } - /* Get node's next compatible string */ - if (cp) { - l = strlen(cp) + 1; - cp += l; - cplen -= l; - } - } while (cp && (cplen > 0)); - -------- return NULL; ++++++++ return best_match; } /** diff --cc include/linux/of.h index 435cb995904d,70c64ba17fa5,70c64ba17fa5,70c64ba17fa5,70c64ba17fa5,b59f2e41c7ce,70c64ba17fa5,70c64ba17fa5,70c64ba17fa5..83d1ac80c91e --- a/include/linux/of.h +++ b/include/linux/of.h @@@@@@@@@@ -528,13 -569,6 -569,6 -569,6 -569,6 -577,74 -569,6 -569,6 -569,6 +536,81 @@@@@@@@@@ extern int of_node_to_nid(struct device static inline int of_node_to_nid(struct device_node *device) { return 0; } #endif ++++++++static inline struct device_node *of_find_matching_node( ++++++++ struct device_node *from, ++++++++ const struct of_device_id *matches) ++++++++{ ++++++++ return of_find_matching_node_and_match(from, matches, NULL); ++++++++} ++++++++ +++++ +++/** +++++ +++ * of_property_count_u8_elems - Count the number of u8 elements in a property +++++ +++ * +++++ +++ * @np: device node from which the property value is to be read. +++++ +++ * @propname: name of the property to be searched. +++++ +++ * +++++ +++ * Search for a property in a device node and count the number of u8 elements +++++ +++ * in it. Returns number of elements on sucess, -EINVAL if the property does +++++ +++ * not exist or its length does not match a multiple of u8 and -ENODATA if the +++++ +++ * property does not have a value. +++++ +++ */ +++++ +++static inline int of_property_count_u8_elems(const struct device_node *np, +++++ +++ const char *propname) +++++ +++{ +++++ +++ return of_property_count_elems_of_size(np, propname, sizeof(u8)); +++++ +++} +++++ +++ +++++ +++/** +++++ +++ * of_property_count_u16_elems - Count the number of u16 elements in a property +++++ +++ * +++++ +++ * @np: device node from which the property value is to be read. +++++ +++ * @propname: name of the property to be searched. +++++ +++ * +++++ +++ * Search for a property in a device node and count the number of u16 elements +++++ +++ * in it. Returns number of elements on sucess, -EINVAL if the property does +++++ +++ * not exist or its length does not match a multiple of u16 and -ENODATA if the +++++ +++ * property does not have a value. +++++ +++ */ +++++ +++static inline int of_property_count_u16_elems(const struct device_node *np, +++++ +++ const char *propname) +++++ +++{ +++++ +++ return of_property_count_elems_of_size(np, propname, sizeof(u16)); +++++ +++} +++++ +++ +++++ +++/** +++++ +++ * of_property_count_u32_elems - Count the number of u32 elements in a property +++++ +++ * +++++ +++ * @np: device node from which the property value is to be read. +++++ +++ * @propname: name of the property to be searched. +++++ +++ * +++++ +++ * Search for a property in a device node and count the number of u32 elements +++++ +++ * in it. Returns number of elements on sucess, -EINVAL if the property does +++++ +++ * not exist or its length does not match a multiple of u32 and -ENODATA if the +++++ +++ * property does not have a value. +++++ +++ */ +++++ +++static inline int of_property_count_u32_elems(const struct device_node *np, +++++ +++ const char *propname) +++++ +++{ +++++ +++ return of_property_count_elems_of_size(np, propname, sizeof(u32)); +++++ +++} +++++ +++ +++++ +++/** +++++ +++ * of_property_count_u64_elems - Count the number of u64 elements in a property +++++ +++ * +++++ +++ * @np: device node from which the property value is to be read. +++++ +++ * @propname: name of the property to be searched. +++++ +++ * +++++ +++ * Search for a property in a device node and count the number of u64 elements +++++ +++ * in it. Returns number of elements on sucess, -EINVAL if the property does +++++ +++ * not exist or its length does not match a multiple of u64 and -ENODATA if the +++++ +++ * property does not have a value. +++++ +++ */ +++++ +++static inline int of_property_count_u64_elems(const struct device_node *np, +++++ +++ const char *propname) +++++ +++{ +++++ +++ return of_property_count_elems_of_size(np, propname, sizeof(u64)); +++++ +++} +++++ +++ /** * of_property_read_bool - Findfrom a property * @np: device node from which the property value is to be read.