Merge remote-tracking branches 'regulator/topic/doc', 'regulator/topic/enable', ...
authorMark Brown <broonie@linaro.org>
Wed, 26 Mar 2014 16:57:57 +0000 (16:57 +0000)
committerMark Brown <broonie@linaro.org>
Wed, 26 Mar 2014 16:57:57 +0000 (16:57 +0000)
1  2  3  4  5  6  7  8  9 
Documentation/devicetree/bindings/regulator/gpio-regulator.txt
drivers/of/base.c
drivers/regulator/max14577.c
include/linux/of.h

@@@@@@@@@@ -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.
@@@@@@@@@@ -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;
         }
         
         /**
Simple merge
@@@@@@@@@@ -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.