diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2012-05-12 17:22:36 -0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2012-05-12 17:22:36 -0400 |
| commit | 7afeca1a30360c7b5cee94fc7ff8f350d582282a (patch) | |
| tree | a5f19ff1ffef8000a128ac9b0b343ced451bb203 /include/linux | |
| parent | 4a0dfe69fe489b06ae5bad26ae67ae8aefaca3aa (diff) | |
| parent | 366695ff706669d40459174b1cbb78fca42f4e06 (diff) | |
Merge branch 'spear/pinctrl' into next/pinctrl
* spear/pinctrl:
pinctrl: (cosmetic) fix two entries in DocBook comments
pinctrl: add more info to error msgs in pin_request
CLKDEV: provide helpers for common clock framework
pinctrl: add pinctrl-mxs support
pinctrl: pinctrl-imx: add imx6q pinctrl driver
pinctrl: pinctrl-imx: add imx pinctrl core driver
dt: add of_get_child_count helper function
pinctrl: support gpio request deferred probing
pinctrl: add pinctrl_provide_dummies interface for platforms to use
pinctrl: enhance reporting of errors when loading from DT
pinctrl: add kerneldoc for pinctrl_ops device tree functions
pinctrl: propagate map validation errors
pinctrl: fix dangling comment
pinctrl: fix signed vs unsigned conditionals inside pinmux_map_to_setting
ARM: 7392/1: CLKDEV: Optimize clk_find()
ARM: 7376/1: clkdev: Implement managed clk_get()
This just adds more dependencies that are required in order not to
break the spear pinctrl support.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/clk.h | 32 | ||||
| -rw-r--r-- | include/linux/clkdev.h | 3 | ||||
| -rw-r--r-- | include/linux/of.h | 16 | ||||
| -rw-r--r-- | include/linux/pinctrl/machine.h | 7 | ||||
| -rw-r--r-- | include/linux/pinctrl/pinconf.h | 1 | ||||
| -rw-r--r-- | include/linux/pinctrl/pinctrl.h | 9 | ||||
| -rw-r--r-- | include/linux/pinctrl/pinmux.h | 2 |
7 files changed, 66 insertions, 4 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index b0252726df61..70cf722ac3af 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
| @@ -101,6 +101,26 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); | |||
| 101 | struct clk *clk_get(struct device *dev, const char *id); | 101 | struct clk *clk_get(struct device *dev, const char *id); |
| 102 | 102 | ||
| 103 | /** | 103 | /** |
| 104 | * devm_clk_get - lookup and obtain a managed reference to a clock producer. | ||
| 105 | * @dev: device for clock "consumer" | ||
| 106 | * @id: clock comsumer ID | ||
| 107 | * | ||
| 108 | * Returns a struct clk corresponding to the clock producer, or | ||
| 109 | * valid IS_ERR() condition containing errno. The implementation | ||
| 110 | * uses @dev and @id to determine the clock consumer, and thereby | ||
| 111 | * the clock producer. (IOW, @id may be identical strings, but | ||
| 112 | * clk_get may return different clock producers depending on @dev.) | ||
| 113 | * | ||
| 114 | * Drivers must assume that the clock source is not enabled. | ||
| 115 | * | ||
| 116 | * devm_clk_get should not be called from within interrupt context. | ||
| 117 | * | ||
| 118 | * The clock will automatically be freed when the device is unbound | ||
| 119 | * from the bus. | ||
| 120 | */ | ||
| 121 | struct clk *devm_clk_get(struct device *dev, const char *id); | ||
| 122 | |||
| 123 | /** | ||
| 104 | * clk_prepare - prepare a clock source | 124 | * clk_prepare - prepare a clock source |
| 105 | * @clk: clock source | 125 | * @clk: clock source |
| 106 | * | 126 | * |
| @@ -206,6 +226,18 @@ unsigned long clk_get_rate(struct clk *clk); | |||
| 206 | */ | 226 | */ |
| 207 | void clk_put(struct clk *clk); | 227 | void clk_put(struct clk *clk); |
| 208 | 228 | ||
| 229 | /** | ||
| 230 | * devm_clk_put - "free" a managed clock source | ||
| 231 | * @dev: device used to acuqire the clock | ||
| 232 | * @clk: clock source acquired with devm_clk_get() | ||
| 233 | * | ||
| 234 | * Note: drivers must ensure that all clk_enable calls made on this | ||
| 235 | * clock source are balanced by clk_disable calls prior to calling | ||
| 236 | * this function. | ||
| 237 | * | ||
| 238 | * clk_put should not be called from within interrupt context. | ||
| 239 | */ | ||
| 240 | void devm_clk_put(struct device *dev, struct clk *clk); | ||
| 209 | 241 | ||
| 210 | /* | 242 | /* |
| 211 | * The remaining APIs are optional for machine class support. | 243 | * The remaining APIs are optional for machine class support. |
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h index d9a4fd028c9d..a6a6f603103b 100644 --- a/include/linux/clkdev.h +++ b/include/linux/clkdev.h | |||
| @@ -40,4 +40,7 @@ void clkdev_drop(struct clk_lookup *cl); | |||
| 40 | void clkdev_add_table(struct clk_lookup *, size_t); | 40 | void clkdev_add_table(struct clk_lookup *, size_t); |
| 41 | int clk_add_alias(const char *, const char *, char *, struct device *); | 41 | int clk_add_alias(const char *, const char *, char *, struct device *); |
| 42 | 42 | ||
| 43 | int clk_register_clkdev(struct clk *, const char *, const char *, ...); | ||
| 44 | int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); | ||
| 45 | |||
| 43 | #endif | 46 | #endif |
diff --git a/include/linux/of.h b/include/linux/of.h index e3f942d9da89..2ec1083af7ff 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -193,6 +193,17 @@ extern struct device_node *of_get_next_child(const struct device_node *node, | |||
| 193 | for (child = of_get_next_child(parent, NULL); child != NULL; \ | 193 | for (child = of_get_next_child(parent, NULL); child != NULL; \ |
| 194 | child = of_get_next_child(parent, child)) | 194 | child = of_get_next_child(parent, child)) |
| 195 | 195 | ||
| 196 | static inline int of_get_child_count(const struct device_node *np) | ||
| 197 | { | ||
| 198 | struct device_node *child; | ||
| 199 | int num = 0; | ||
| 200 | |||
| 201 | for_each_child_of_node(np, child) | ||
| 202 | num++; | ||
| 203 | |||
| 204 | return num; | ||
| 205 | } | ||
| 206 | |||
| 196 | extern struct device_node *of_find_node_with_property( | 207 | extern struct device_node *of_find_node_with_property( |
| 197 | struct device_node *from, const char *prop_name); | 208 | struct device_node *from, const char *prop_name); |
| 198 | #define for_each_node_with_property(dn, prop_name) \ | 209 | #define for_each_node_with_property(dn, prop_name) \ |
| @@ -300,6 +311,11 @@ static inline bool of_have_populated_dt(void) | |||
| 300 | #define for_each_child_of_node(parent, child) \ | 311 | #define for_each_child_of_node(parent, child) \ |
| 301 | while (0) | 312 | while (0) |
| 302 | 313 | ||
| 314 | static inline int of_get_child_count(const struct device_node *np) | ||
| 315 | { | ||
| 316 | return 0; | ||
| 317 | } | ||
| 318 | |||
| 303 | static inline int of_device_is_compatible(const struct device_node *device, | 319 | static inline int of_device_is_compatible(const struct device_node *device, |
| 304 | const char *name) | 320 | const char *name) |
| 305 | { | 321 | { |
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h index e4d1de742502..7d22ab00343f 100644 --- a/include/linux/pinctrl/machine.h +++ b/include/linux/pinctrl/machine.h | |||
| @@ -154,7 +154,7 @@ struct pinctrl_map { | |||
| 154 | 154 | ||
| 155 | extern int pinctrl_register_mappings(struct pinctrl_map const *map, | 155 | extern int pinctrl_register_mappings(struct pinctrl_map const *map, |
| 156 | unsigned num_maps); | 156 | unsigned num_maps); |
| 157 | 157 | extern void pinctrl_provide_dummies(void); | |
| 158 | #else | 158 | #else |
| 159 | 159 | ||
| 160 | static inline int pinctrl_register_mappings(struct pinctrl_map const *map, | 160 | static inline int pinctrl_register_mappings(struct pinctrl_map const *map, |
| @@ -163,5 +163,8 @@ static inline int pinctrl_register_mappings(struct pinctrl_map const *map, | |||
| 163 | return 0; | 163 | return 0; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | #endif /* !CONFIG_PINMUX */ | 166 | static inline void pinctrl_provide_dummies(void) |
| 167 | { | ||
| 168 | } | ||
| 169 | #endif /* !CONFIG_PINCTRL */ | ||
| 167 | #endif | 170 | #endif |
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h index 7b9d5f00ed37..e7a720104a47 100644 --- a/include/linux/pinctrl/pinconf.h +++ b/include/linux/pinctrl/pinconf.h | |||
| @@ -25,7 +25,6 @@ struct seq_file; | |||
| 25 | * @pin_config_get: get the config of a certain pin, if the requested config | 25 | * @pin_config_get: get the config of a certain pin, if the requested config |
| 26 | * is not available on this controller this should return -ENOTSUPP | 26 | * is not available on this controller this should return -ENOTSUPP |
| 27 | * and if it is available but disabled it should return -EINVAL | 27 | * and if it is available but disabled it should return -EINVAL |
| 28 | * @pin_config_get: get the config of a certain pin | ||
| 29 | * @pin_config_set: configure an individual pin | 28 | * @pin_config_set: configure an individual pin |
| 30 | * @pin_config_group_get: get configurations for an entire pin group | 29 | * @pin_config_group_get: get configurations for an entire pin group |
| 31 | * @pin_config_group_set: configure all pins in a group | 30 | * @pin_config_group_set: configure all pins in a group |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index c22d0409d2ef..3b894a668d32 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -72,6 +72,15 @@ struct pinctrl_gpio_range { | |||
| 72 | * group selector @pins, and the size of the array in @num_pins | 72 | * group selector @pins, and the size of the array in @num_pins |
| 73 | * @pin_dbg_show: optional debugfs display hook that will provide per-device | 73 | * @pin_dbg_show: optional debugfs display hook that will provide per-device |
| 74 | * info for a certain pin in debugfs | 74 | * info for a certain pin in debugfs |
| 75 | * @dt_node_to_map: parse a device tree "pin configuration node", and create | ||
| 76 | * mapping table entries for it. These are returned through the @map and | ||
| 77 | * @num_maps output parameters. This function is optional, and may be | ||
| 78 | * omitted for pinctrl drivers that do not support device tree. | ||
| 79 | * @dt_free_map: free mapping table entries created via @dt_node_to_map. The | ||
| 80 | * top-level @map pointer must be freed, along with any dynamically | ||
| 81 | * allocated members of the mapping table entries themselves. This | ||
| 82 | * function is optional, and may be omitted for pinctrl drivers that do | ||
| 83 | * not support device tree. | ||
| 75 | */ | 84 | */ |
| 76 | struct pinctrl_ops { | 85 | struct pinctrl_ops { |
| 77 | int (*get_groups_count) (struct pinctrl_dev *pctldev); | 86 | int (*get_groups_count) (struct pinctrl_dev *pctldev); |
diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h index dd7bef61d066..1818dcbdd9ab 100644 --- a/include/linux/pinctrl/pinmux.h +++ b/include/linux/pinctrl/pinmux.h | |||
| @@ -23,7 +23,7 @@ struct pinctrl_dev; | |||
| 23 | /** | 23 | /** |
| 24 | * struct pinmux_ops - pinmux operations, to be implemented by pin controller | 24 | * struct pinmux_ops - pinmux operations, to be implemented by pin controller |
| 25 | * drivers that support pinmuxing | 25 | * drivers that support pinmuxing |
| 26 | * @request: called by the core to see if a certain pin can be made available | 26 | * @request: called by the core to see if a certain pin can be made |
| 27 | * available for muxing. This is called by the core to acquire the pins | 27 | * available for muxing. This is called by the core to acquire the pins |
| 28 | * before selecting any actual mux setting across a function. The driver | 28 | * before selecting any actual mux setting across a function. The driver |
| 29 | * is allowed to answer "no" by returning a negative error code | 29 | * is allowed to answer "no" by returning a negative error code |
