Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Core driver for the pin muxing portions of the pin control subsystem |
| 3 | * |
Linus Walleij | e93bcee | 2012-02-09 07:23:28 +0100 | [diff] [blame] | 4 | * Copyright (C) 2011-2012 ST-Ericsson SA |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 5 | * Written on behalf of Linaro for ST-Ericsson |
| 6 | * Based on bits of regulator core, gpio core and clk core |
| 7 | * |
| 8 | * Author: Linus Walleij <linus.walleij@linaro.org> |
| 9 | * |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 10 | * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved. |
| 11 | * |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 12 | * License terms: GNU General Public License (GPL) version 2 |
| 13 | */ |
| 14 | #define pr_fmt(fmt) "pinmux core: " fmt |
| 15 | |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/module.h> |
| 18 | #include <linux/init.h> |
| 19 | #include <linux/device.h> |
| 20 | #include <linux/slab.h> |
| 21 | #include <linux/radix-tree.h> |
| 22 | #include <linux/err.h> |
| 23 | #include <linux/list.h> |
Linus Walleij | 97607d1 | 2011-11-29 12:52:39 +0100 | [diff] [blame] | 24 | #include <linux/string.h> |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 25 | #include <linux/sysfs.h> |
| 26 | #include <linux/debugfs.h> |
| 27 | #include <linux/seq_file.h> |
| 28 | #include <linux/pinctrl/machine.h> |
| 29 | #include <linux/pinctrl/pinmux.h> |
| 30 | #include "core.h" |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 31 | #include "pinmux.h" |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 32 | |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 33 | int pinmux_check_ops(struct pinctrl_dev *pctldev) |
| 34 | { |
| 35 | const struct pinmux_ops *ops = pctldev->desc->pmxops; |
Dong Aisheng | a1d31f7 | 2012-04-06 20:18:09 +0800 | [diff] [blame] | 36 | unsigned nfuncs; |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 37 | unsigned selector = 0; |
| 38 | |
| 39 | /* Check that we implement required operations */ |
Dong Aisheng | a1d31f7 | 2012-04-06 20:18:09 +0800 | [diff] [blame] | 40 | if (!ops || |
| 41 | !ops->get_functions_count || |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 42 | !ops->get_function_name || |
| 43 | !ops->get_function_groups || |
| 44 | !ops->enable || |
| 45 | !ops->disable) |
| 46 | return -EINVAL; |
| 47 | |
| 48 | /* Check that all functions registered have names */ |
Dong Aisheng | a1d31f7 | 2012-04-06 20:18:09 +0800 | [diff] [blame] | 49 | nfuncs = ops->get_functions_count(pctldev); |
Viresh Kumar | d1e90e9 | 2012-03-30 11:25:40 +0530 | [diff] [blame] | 50 | while (selector < nfuncs) { |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 51 | const char *fname = ops->get_function_name(pctldev, |
| 52 | selector); |
| 53 | if (!fname) { |
Dong Aisheng | a1d31f7 | 2012-04-06 20:18:09 +0800 | [diff] [blame] | 54 | dev_err(pctldev->dev, "pinmux ops has no name for function%u\n", |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 55 | selector); |
| 56 | return -EINVAL; |
| 57 | } |
| 58 | selector++; |
| 59 | } |
| 60 | |
| 61 | return 0; |
| 62 | } |
| 63 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 64 | int pinmux_validate_map(struct pinctrl_map const *map, int i) |
| 65 | { |
| 66 | if (!map->data.mux.function) { |
| 67 | pr_err("failed to register map %s (%d): no function given\n", |
| 68 | map->name, i); |
| 69 | return -EINVAL; |
| 70 | } |
| 71 | |
| 72 | return 0; |
| 73 | } |
| 74 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 75 | /** |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 76 | * pin_request() - request a single pin to be muxed in, typically for GPIO |
| 77 | * @pin: the pin number in the global pin space |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 78 | * @owner: a representation of the owner of this pin; typically the device |
| 79 | * name that controls its mux function, or the requested GPIO name |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 80 | * @gpio_range: the range matching the GPIO pin if this is a request for a |
| 81 | * single GPIO pin |
| 82 | */ |
| 83 | static int pin_request(struct pinctrl_dev *pctldev, |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 84 | int pin, const char *owner, |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 85 | struct pinctrl_gpio_range *gpio_range) |
| 86 | { |
| 87 | struct pin_desc *desc; |
| 88 | const struct pinmux_ops *ops = pctldev->desc->pmxops; |
| 89 | int status = -EINVAL; |
| 90 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 91 | desc = pin_desc_get(pctldev, pin); |
| 92 | if (desc == NULL) { |
Stephen Warren | 51cd24e | 2011-12-09 16:59:05 -0700 | [diff] [blame] | 93 | dev_err(pctldev->dev, |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 94 | "pin is not registered so it cannot be requested\n"); |
| 95 | goto out; |
| 96 | } |
| 97 | |
Dong Aisheng | d0bd8df | 2012-04-17 15:00:45 +0800 | [diff] [blame] | 98 | dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n", |
| 99 | pin, desc->name, owner); |
| 100 | |
Stephen Warren | 652162d | 2012-03-05 17:22:15 -0700 | [diff] [blame] | 101 | if (gpio_range) { |
| 102 | /* There's no need to support multiple GPIO requests */ |
| 103 | if (desc->gpio_owner) { |
| 104 | dev_err(pctldev->dev, |
| 105 | "pin already requested\n"); |
| 106 | goto out; |
| 107 | } |
| 108 | |
| 109 | desc->gpio_owner = owner; |
| 110 | } else { |
| 111 | if (desc->mux_usecount && strcmp(desc->mux_owner, owner)) { |
| 112 | dev_err(pctldev->dev, |
| 113 | "pin already requested\n"); |
| 114 | goto out; |
| 115 | } |
| 116 | |
| 117 | desc->mux_usecount++; |
| 118 | if (desc->mux_usecount > 1) |
| 119 | return 0; |
| 120 | |
| 121 | desc->mux_owner = owner; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 122 | } |
Stephen Warren | 0e3db173 | 2012-03-02 13:05:46 -0700 | [diff] [blame] | 123 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 124 | /* Let each pin increase references to this module */ |
| 125 | if (!try_module_get(pctldev->owner)) { |
Stephen Warren | 51cd24e | 2011-12-09 16:59:05 -0700 | [diff] [blame] | 126 | dev_err(pctldev->dev, |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 127 | "could not increase module refcount for pin %d\n", |
| 128 | pin); |
| 129 | status = -EINVAL; |
| 130 | goto out_free_pin; |
| 131 | } |
| 132 | |
| 133 | /* |
| 134 | * If there is no kind of request function for the pin we just assume |
| 135 | * we got it by default and proceed. |
| 136 | */ |
Stephen Warren | 3712a3c | 2011-10-21 12:25:53 -0600 | [diff] [blame] | 137 | if (gpio_range && ops->gpio_request_enable) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 138 | /* This requests and enables a single GPIO pin */ |
| 139 | status = ops->gpio_request_enable(pctldev, gpio_range, pin); |
| 140 | else if (ops->request) |
| 141 | status = ops->request(pctldev, pin); |
| 142 | else |
| 143 | status = 0; |
| 144 | |
Stephen Warren | 0e3db173 | 2012-03-02 13:05:46 -0700 | [diff] [blame] | 145 | if (status) { |
Uwe Kleine-König | f9d41d7 | 2012-01-19 22:42:48 +0100 | [diff] [blame] | 146 | dev_err(pctldev->dev, "->request on device %s failed for pin %d\n", |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 147 | pctldev->desc->name, pin); |
Stephen Warren | 0e3db173 | 2012-03-02 13:05:46 -0700 | [diff] [blame] | 148 | module_put(pctldev->owner); |
| 149 | } |
| 150 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 151 | out_free_pin: |
Stephen Warren | 0e3db173 | 2012-03-02 13:05:46 -0700 | [diff] [blame] | 152 | if (status) { |
Stephen Warren | 652162d | 2012-03-05 17:22:15 -0700 | [diff] [blame] | 153 | if (gpio_range) { |
| 154 | desc->gpio_owner = NULL; |
| 155 | } else { |
| 156 | desc->mux_usecount--; |
| 157 | if (!desc->mux_usecount) |
| 158 | desc->mux_owner = NULL; |
| 159 | } |
Stephen Warren | 0e3db173 | 2012-03-02 13:05:46 -0700 | [diff] [blame] | 160 | } |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 161 | out: |
| 162 | if (status) |
Stephen Warren | 51cd24e | 2011-12-09 16:59:05 -0700 | [diff] [blame] | 163 | dev_err(pctldev->dev, "pin-%d (%s) status %d\n", |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 164 | pin, owner, status); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 165 | |
| 166 | return status; |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * pin_free() - release a single muxed in pin so something else can be muxed |
| 171 | * @pctldev: pin controller device handling this pin |
| 172 | * @pin: the pin to free |
Stephen Warren | 3712a3c | 2011-10-21 12:25:53 -0600 | [diff] [blame] | 173 | * @gpio_range: the range matching the GPIO pin if this is a request for a |
| 174 | * single GPIO pin |
Linus Walleij | 336cdba0 | 2011-11-10 09:27:41 +0100 | [diff] [blame] | 175 | * |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 176 | * This function returns a pointer to the previous owner. This is used |
| 177 | * for callers that dynamically allocate an owner name so it can be freed |
Linus Walleij | 336cdba0 | 2011-11-10 09:27:41 +0100 | [diff] [blame] | 178 | * once the pin is free. This is done for GPIO request functions. |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 179 | */ |
Stephen Warren | 3712a3c | 2011-10-21 12:25:53 -0600 | [diff] [blame] | 180 | static const char *pin_free(struct pinctrl_dev *pctldev, int pin, |
| 181 | struct pinctrl_gpio_range *gpio_range) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 182 | { |
| 183 | const struct pinmux_ops *ops = pctldev->desc->pmxops; |
| 184 | struct pin_desc *desc; |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 185 | const char *owner; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 186 | |
| 187 | desc = pin_desc_get(pctldev, pin); |
| 188 | if (desc == NULL) { |
Stephen Warren | 51cd24e | 2011-12-09 16:59:05 -0700 | [diff] [blame] | 189 | dev_err(pctldev->dev, |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 190 | "pin is not registered so it cannot be freed\n"); |
Stephen Warren | 3712a3c | 2011-10-21 12:25:53 -0600 | [diff] [blame] | 191 | return NULL; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 192 | } |
| 193 | |
Stephen Warren | 652162d | 2012-03-05 17:22:15 -0700 | [diff] [blame] | 194 | if (!gpio_range) { |
| 195 | desc->mux_usecount--; |
| 196 | if (desc->mux_usecount) |
| 197 | return NULL; |
| 198 | } |
Stephen Warren | 0e3db173 | 2012-03-02 13:05:46 -0700 | [diff] [blame] | 199 | |
Stephen Warren | 3712a3c | 2011-10-21 12:25:53 -0600 | [diff] [blame] | 200 | /* |
| 201 | * If there is no kind of request function for the pin we just assume |
| 202 | * we got it by default and proceed. |
| 203 | */ |
| 204 | if (gpio_range && ops->gpio_disable_free) |
| 205 | ops->gpio_disable_free(pctldev, gpio_range, pin); |
| 206 | else if (ops->free) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 207 | ops->free(pctldev, pin); |
| 208 | |
Stephen Warren | 652162d | 2012-03-05 17:22:15 -0700 | [diff] [blame] | 209 | if (gpio_range) { |
| 210 | owner = desc->gpio_owner; |
| 211 | desc->gpio_owner = NULL; |
| 212 | } else { |
| 213 | owner = desc->mux_owner; |
| 214 | desc->mux_owner = NULL; |
| 215 | desc->mux_setting = NULL; |
| 216 | } |
| 217 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 218 | module_put(pctldev->owner); |
Stephen Warren | 3712a3c | 2011-10-21 12:25:53 -0600 | [diff] [blame] | 219 | |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 220 | return owner; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | /** |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 224 | * pinmux_request_gpio() - request pinmuxing for a GPIO pin |
| 225 | * @pctldev: pin controller device affected |
| 226 | * @pin: the pin to mux in for GPIO |
| 227 | * @range: the applicable GPIO range |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 228 | */ |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 229 | int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
| 230 | struct pinctrl_gpio_range *range, |
| 231 | unsigned pin, unsigned gpio) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 232 | { |
| 233 | char gpiostr[16]; |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 234 | const char *owner; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 235 | int ret; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 236 | |
| 237 | /* Conjure some name stating what chip and pin this is taken by */ |
| 238 | snprintf(gpiostr, 15, "%s:%d", range->name, gpio); |
| 239 | |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 240 | owner = kstrdup(gpiostr, GFP_KERNEL); |
| 241 | if (!owner) |
Stephen Warren | 5d2eaf8 | 2011-10-19 16:19:28 -0600 | [diff] [blame] | 242 | return -EINVAL; |
| 243 | |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 244 | ret = pin_request(pctldev, pin, owner, range); |
Stephen Warren | 5d2eaf8 | 2011-10-19 16:19:28 -0600 | [diff] [blame] | 245 | if (ret < 0) |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 246 | kfree(owner); |
Stephen Warren | 5d2eaf8 | 2011-10-19 16:19:28 -0600 | [diff] [blame] | 247 | |
| 248 | return ret; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 249 | } |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 250 | |
| 251 | /** |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 252 | * pinmux_free_gpio() - release a pin from GPIO muxing |
| 253 | * @pctldev: the pin controller device for the pin |
| 254 | * @pin: the affected currently GPIO-muxed in pin |
| 255 | * @range: applicable GPIO range |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 256 | */ |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 257 | void pinmux_free_gpio(struct pinctrl_dev *pctldev, unsigned pin, |
| 258 | struct pinctrl_gpio_range *range) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 259 | { |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 260 | const char *owner; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 261 | |
Stephen Warren | 3cc70ed | 2012-02-19 23:45:44 -0700 | [diff] [blame] | 262 | owner = pin_free(pctldev, pin, range); |
| 263 | kfree(owner); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 264 | } |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 265 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 266 | /** |
| 267 | * pinmux_gpio_direction() - set the direction of a single muxed-in GPIO pin |
| 268 | * @pctldev: the pin controller handling this pin |
| 269 | * @range: applicable GPIO range |
| 270 | * @pin: the affected GPIO pin in this controller |
| 271 | * @input: true if we set the pin as input, false for output |
| 272 | */ |
| 273 | int pinmux_gpio_direction(struct pinctrl_dev *pctldev, |
| 274 | struct pinctrl_gpio_range *range, |
| 275 | unsigned pin, bool input) |
Linus Walleij | 542e704 | 2011-11-14 10:06:22 +0100 | [diff] [blame] | 276 | { |
Linus Walleij | 542e704 | 2011-11-14 10:06:22 +0100 | [diff] [blame] | 277 | const struct pinmux_ops *ops; |
| 278 | int ret; |
Linus Walleij | 542e704 | 2011-11-14 10:06:22 +0100 | [diff] [blame] | 279 | |
| 280 | ops = pctldev->desc->pmxops; |
| 281 | |
Linus Walleij | 542e704 | 2011-11-14 10:06:22 +0100 | [diff] [blame] | 282 | if (ops->gpio_set_direction) |
| 283 | ret = ops->gpio_set_direction(pctldev, range, pin, input); |
| 284 | else |
| 285 | ret = 0; |
| 286 | |
| 287 | return ret; |
| 288 | } |
| 289 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 290 | static int pinmux_func_name_to_selector(struct pinctrl_dev *pctldev, |
| 291 | const char *function) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 292 | { |
| 293 | const struct pinmux_ops *ops = pctldev->desc->pmxops; |
Viresh Kumar | d1e90e9 | 2012-03-30 11:25:40 +0530 | [diff] [blame] | 294 | unsigned nfuncs = ops->get_functions_count(pctldev); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 295 | unsigned selector = 0; |
| 296 | |
| 297 | /* See if this pctldev has this function */ |
Viresh Kumar | d1e90e9 | 2012-03-30 11:25:40 +0530 | [diff] [blame] | 298 | while (selector < nfuncs) { |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 299 | const char *fname = ops->get_function_name(pctldev, |
| 300 | selector); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 301 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 302 | if (!strcmp(function, fname)) |
| 303 | return selector; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 304 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 305 | selector++; |
| 306 | } |
| 307 | |
| 308 | pr_err("%s does not support function %s\n", |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 309 | pinctrl_dev_get_name(pctldev), function); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 310 | return -EINVAL; |
| 311 | } |
| 312 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 313 | int pinmux_map_to_setting(struct pinctrl_map const *map, |
| 314 | struct pinctrl_setting *setting) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 315 | { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 316 | struct pinctrl_dev *pctldev = setting->pctldev; |
| 317 | const struct pinmux_ops *pmxops = pctldev->desc->pmxops; |
| 318 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; |
| 319 | char const * const *groups; |
| 320 | unsigned num_groups; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 321 | int ret; |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 322 | const char *group; |
| 323 | int i; |
| 324 | const unsigned *pins; |
| 325 | unsigned num_pins; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 326 | |
Dong Aisheng | ad8bb72 | 2012-04-10 12:41:34 +0800 | [diff] [blame] | 327 | if (!pmxops) { |
| 328 | dev_err(pctldev->dev, "does not support mux function\n"); |
| 329 | return -EINVAL; |
| 330 | } |
| 331 | |
John Crispin | 15f70e1 | 2012-04-23 19:01:58 +0200 | [diff] [blame^] | 332 | ret = pinmux_func_name_to_selector(pctldev, map->data.mux.function); |
| 333 | if (ret < 0) |
| 334 | return ret; |
| 335 | setting->data.mux.func = ret; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 336 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 337 | ret = pmxops->get_function_groups(pctldev, setting->data.mux.func, |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 338 | &groups, &num_groups); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 339 | if (ret < 0) |
| 340 | return ret; |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 341 | if (!num_groups) |
| 342 | return -EINVAL; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 343 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 344 | if (map->data.mux.group) { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 345 | bool found = false; |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 346 | group = map->data.mux.group; |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 347 | for (i = 0; i < num_groups; i++) { |
| 348 | if (!strcmp(group, groups[i])) { |
| 349 | found = true; |
| 350 | break; |
| 351 | } |
| 352 | } |
| 353 | if (!found) |
| 354 | return -EINVAL; |
| 355 | } else { |
| 356 | group = groups[0]; |
| 357 | } |
| 358 | |
John Crispin | 15f70e1 | 2012-04-23 19:01:58 +0200 | [diff] [blame^] | 359 | ret = pinctrl_get_group_selector(pctldev, group); |
| 360 | if (ret < 0) |
| 361 | return ret; |
| 362 | setting->data.mux.group = ret; |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 363 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 364 | ret = pctlops->get_group_pins(pctldev, setting->data.mux.group, &pins, |
| 365 | &num_pins); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 366 | if (ret) { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 367 | dev_err(pctldev->dev, |
| 368 | "could not get pins for device %s group selector %d\n", |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 369 | pinctrl_dev_get_name(pctldev), setting->data.mux.group); |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 370 | return -ENODEV; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 371 | } |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 372 | |
| 373 | /* Try to allocate all pins in this group, one by one */ |
| 374 | for (i = 0; i < num_pins; i++) { |
| 375 | ret = pin_request(pctldev, pins[i], map->dev_name, NULL); |
| 376 | if (ret) { |
| 377 | dev_err(pctldev->dev, |
| 378 | "could not get request pin %d on device %s\n", |
| 379 | pins[i], pinctrl_dev_get_name(pctldev)); |
| 380 | /* On error release all taken pins */ |
| 381 | i--; /* this pin just failed */ |
| 382 | for (; i >= 0; i--) |
| 383 | pin_free(pctldev, pins[i], NULL); |
| 384 | return -ENODEV; |
| 385 | } |
| 386 | } |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 387 | |
| 388 | return 0; |
| 389 | } |
| 390 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 391 | void pinmux_free_setting(struct pinctrl_setting const *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 392 | { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 393 | struct pinctrl_dev *pctldev = setting->pctldev; |
| 394 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; |
| 395 | const unsigned *pins; |
| 396 | unsigned num_pins; |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 397 | int ret; |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 398 | int i; |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 399 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 400 | ret = pctlops->get_group_pins(pctldev, setting->data.mux.group, |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 401 | &pins, &num_pins); |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 402 | if (ret) { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 403 | dev_err(pctldev->dev, |
| 404 | "could not get pins for device %s group selector %d\n", |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 405 | pinctrl_dev_get_name(pctldev), setting->data.mux.group); |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 406 | return; |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 407 | } |
| 408 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 409 | for (i = 0; i < num_pins; i++) |
| 410 | pin_free(pctldev, pins[i], NULL); |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 411 | } |
| 412 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 413 | int pinmux_enable_setting(struct pinctrl_setting const *setting) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 414 | { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 415 | struct pinctrl_dev *pctldev = setting->pctldev; |
Stephen Warren | ba110d9 | 2012-03-02 13:05:49 -0700 | [diff] [blame] | 416 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 417 | const struct pinmux_ops *ops = pctldev->desc->pmxops; |
Stephen Warren | ba110d9 | 2012-03-02 13:05:49 -0700 | [diff] [blame] | 418 | int ret; |
| 419 | const unsigned *pins; |
| 420 | unsigned num_pins; |
| 421 | int i; |
| 422 | struct pin_desc *desc; |
| 423 | |
| 424 | ret = pctlops->get_group_pins(pctldev, setting->data.mux.group, |
| 425 | &pins, &num_pins); |
| 426 | if (ret) { |
| 427 | /* errors only affect debug data, so just warn */ |
| 428 | dev_warn(pctldev->dev, |
| 429 | "could not get pins for group selector %d\n", |
| 430 | setting->data.mux.group); |
| 431 | num_pins = 0; |
| 432 | } |
| 433 | |
| 434 | for (i = 0; i < num_pins; i++) { |
| 435 | desc = pin_desc_get(pctldev, pins[i]); |
| 436 | if (desc == NULL) { |
| 437 | dev_warn(pctldev->dev, |
| 438 | "could not get pin desc for pin %d\n", |
| 439 | pins[i]); |
| 440 | continue; |
| 441 | } |
| 442 | desc->mux_setting = &(setting->data.mux); |
| 443 | } |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 444 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 445 | return ops->enable(pctldev, setting->data.mux.func, |
| 446 | setting->data.mux.group); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 447 | } |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 448 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 449 | void pinmux_disable_setting(struct pinctrl_setting const *setting) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 450 | { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 451 | struct pinctrl_dev *pctldev = setting->pctldev; |
Stephen Warren | ba110d9 | 2012-03-02 13:05:49 -0700 | [diff] [blame] | 452 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 453 | const struct pinmux_ops *ops = pctldev->desc->pmxops; |
Stephen Warren | ba110d9 | 2012-03-02 13:05:49 -0700 | [diff] [blame] | 454 | int ret; |
| 455 | const unsigned *pins; |
| 456 | unsigned num_pins; |
| 457 | int i; |
| 458 | struct pin_desc *desc; |
| 459 | |
| 460 | ret = pctlops->get_group_pins(pctldev, setting->data.mux.group, |
| 461 | &pins, &num_pins); |
| 462 | if (ret) { |
| 463 | /* errors only affect debug data, so just warn */ |
| 464 | dev_warn(pctldev->dev, |
| 465 | "could not get pins for group selector %d\n", |
| 466 | setting->data.mux.group); |
| 467 | num_pins = 0; |
| 468 | } |
| 469 | |
| 470 | for (i = 0; i < num_pins; i++) { |
| 471 | desc = pin_desc_get(pctldev, pins[i]); |
| 472 | if (desc == NULL) { |
| 473 | dev_warn(pctldev->dev, |
| 474 | "could not get pin desc for pin %d\n", |
| 475 | pins[i]); |
| 476 | continue; |
| 477 | } |
| 478 | desc->mux_setting = NULL; |
| 479 | } |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 480 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 481 | ops->disable(pctldev, setting->data.mux.func, setting->data.mux.group); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 482 | } |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 483 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 484 | #ifdef CONFIG_DEBUG_FS |
| 485 | |
| 486 | /* Called from pincontrol core */ |
| 487 | static int pinmux_functions_show(struct seq_file *s, void *what) |
| 488 | { |
| 489 | struct pinctrl_dev *pctldev = s->private; |
| 490 | const struct pinmux_ops *pmxops = pctldev->desc->pmxops; |
Dong Aisheng | ad8bb72 | 2012-04-10 12:41:34 +0800 | [diff] [blame] | 491 | unsigned nfuncs; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 492 | unsigned func_selector = 0; |
| 493 | |
Dong Aisheng | ad8bb72 | 2012-04-10 12:41:34 +0800 | [diff] [blame] | 494 | if (!pmxops) |
| 495 | return 0; |
Stephen Warren | 57b676f | 2012-03-02 13:05:44 -0700 | [diff] [blame] | 496 | |
Dong Aisheng | ad8bb72 | 2012-04-10 12:41:34 +0800 | [diff] [blame] | 497 | mutex_lock(&pinctrl_mutex); |
| 498 | nfuncs = pmxops->get_functions_count(pctldev); |
Viresh Kumar | d1e90e9 | 2012-03-30 11:25:40 +0530 | [diff] [blame] | 499 | while (func_selector < nfuncs) { |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 500 | const char *func = pmxops->get_function_name(pctldev, |
| 501 | func_selector); |
| 502 | const char * const *groups; |
| 503 | unsigned num_groups; |
| 504 | int ret; |
| 505 | int i; |
| 506 | |
| 507 | ret = pmxops->get_function_groups(pctldev, func_selector, |
| 508 | &groups, &num_groups); |
| 509 | if (ret) |
| 510 | seq_printf(s, "function %s: COULD NOT GET GROUPS\n", |
| 511 | func); |
| 512 | |
| 513 | seq_printf(s, "function: %s, groups = [ ", func); |
| 514 | for (i = 0; i < num_groups; i++) |
| 515 | seq_printf(s, "%s ", groups[i]); |
| 516 | seq_puts(s, "]\n"); |
| 517 | |
| 518 | func_selector++; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 519 | } |
| 520 | |
Stephen Warren | 57b676f | 2012-03-02 13:05:44 -0700 | [diff] [blame] | 521 | mutex_unlock(&pinctrl_mutex); |
| 522 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 523 | return 0; |
| 524 | } |
| 525 | |
| 526 | static int pinmux_pins_show(struct seq_file *s, void *what) |
| 527 | { |
| 528 | struct pinctrl_dev *pctldev = s->private; |
Stephen Warren | ba110d9 | 2012-03-02 13:05:49 -0700 | [diff] [blame] | 529 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; |
| 530 | const struct pinmux_ops *pmxops = pctldev->desc->pmxops; |
Chanho Park | 706e852 | 2012-01-03 16:47:50 +0900 | [diff] [blame] | 531 | unsigned i, pin; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 532 | |
Dong Aisheng | ad8bb72 | 2012-04-10 12:41:34 +0800 | [diff] [blame] | 533 | if (!pmxops) |
| 534 | return 0; |
| 535 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 536 | seq_puts(s, "Pinmux settings per pin\n"); |
Stephen Warren | 652162d | 2012-03-05 17:22:15 -0700 | [diff] [blame] | 537 | seq_puts(s, "Format: pin (name): mux_owner gpio_owner hog?\n"); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 538 | |
Stephen Warren | 57b676f | 2012-03-02 13:05:44 -0700 | [diff] [blame] | 539 | mutex_lock(&pinctrl_mutex); |
| 540 | |
Chanho Park | 706e852 | 2012-01-03 16:47:50 +0900 | [diff] [blame] | 541 | /* The pin number can be retrived from the pin controller descriptor */ |
| 542 | for (i = 0; i < pctldev->desc->npins; i++) { |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 543 | struct pin_desc *desc; |
Linus Walleij | 1cf94c4 | 2012-02-24 06:53:04 +0100 | [diff] [blame] | 544 | bool is_hog = false; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 545 | |
Chanho Park | 706e852 | 2012-01-03 16:47:50 +0900 | [diff] [blame] | 546 | pin = pctldev->desc->pins[i].number; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 547 | desc = pin_desc_get(pctldev, pin); |
Chanho Park | 706e852 | 2012-01-03 16:47:50 +0900 | [diff] [blame] | 548 | /* Skip if we cannot search the pin */ |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 549 | if (desc == NULL) |
| 550 | continue; |
| 551 | |
Stephen Warren | 652162d | 2012-03-05 17:22:15 -0700 | [diff] [blame] | 552 | if (desc->mux_owner && |
| 553 | !strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev))) |
Linus Walleij | 1cf94c4 | 2012-02-24 06:53:04 +0100 | [diff] [blame] | 554 | is_hog = true; |
| 555 | |
Stephen Warren | 652162d | 2012-03-05 17:22:15 -0700 | [diff] [blame] | 556 | seq_printf(s, "pin %d (%s): %s %s%s", pin, |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 557 | desc->name ? desc->name : "unnamed", |
Stephen Warren | 652162d | 2012-03-05 17:22:15 -0700 | [diff] [blame] | 558 | desc->mux_owner ? desc->mux_owner |
| 559 | : "(MUX UNCLAIMED)", |
| 560 | desc->gpio_owner ? desc->gpio_owner |
| 561 | : "(GPIO UNCLAIMED)", |
Linus Walleij | 1cf94c4 | 2012-02-24 06:53:04 +0100 | [diff] [blame] | 562 | is_hog ? " (HOG)" : ""); |
Stephen Warren | ba110d9 | 2012-03-02 13:05:49 -0700 | [diff] [blame] | 563 | |
| 564 | if (desc->mux_setting) |
| 565 | seq_printf(s, " function %s group %s\n", |
| 566 | pmxops->get_function_name(pctldev, |
| 567 | desc->mux_setting->func), |
| 568 | pctlops->get_group_name(pctldev, |
| 569 | desc->mux_setting->group)); |
| 570 | else |
| 571 | seq_printf(s, "\n"); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 572 | } |
| 573 | |
Stephen Warren | 57b676f | 2012-03-02 13:05:44 -0700 | [diff] [blame] | 574 | mutex_unlock(&pinctrl_mutex); |
| 575 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 576 | return 0; |
| 577 | } |
| 578 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 579 | void pinmux_show_map(struct seq_file *s, struct pinctrl_map const *map) |
| 580 | { |
| 581 | seq_printf(s, "group %s\nfunction %s\n", |
| 582 | map->data.mux.group ? map->data.mux.group : "(default)", |
| 583 | map->data.mux.function); |
| 584 | } |
| 585 | |
| 586 | void pinmux_show_setting(struct seq_file *s, |
| 587 | struct pinctrl_setting const *setting) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 588 | { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 589 | struct pinctrl_dev *pctldev = setting->pctldev; |
| 590 | const struct pinmux_ops *pmxops = pctldev->desc->pmxops; |
| 591 | const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 592 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 593 | seq_printf(s, "group: %s (%u) function: %s (%u)\n", |
| 594 | pctlops->get_group_name(pctldev, setting->data.mux.group), |
| 595 | setting->data.mux.group, |
| 596 | pmxops->get_function_name(pctldev, setting->data.mux.func), |
| 597 | setting->data.mux.func); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 598 | } |
| 599 | |
| 600 | static int pinmux_functions_open(struct inode *inode, struct file *file) |
| 601 | { |
| 602 | return single_open(file, pinmux_functions_show, inode->i_private); |
| 603 | } |
| 604 | |
| 605 | static int pinmux_pins_open(struct inode *inode, struct file *file) |
| 606 | { |
| 607 | return single_open(file, pinmux_pins_show, inode->i_private); |
| 608 | } |
| 609 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 610 | static const struct file_operations pinmux_functions_ops = { |
| 611 | .open = pinmux_functions_open, |
| 612 | .read = seq_read, |
| 613 | .llseek = seq_lseek, |
| 614 | .release = single_release, |
| 615 | }; |
| 616 | |
| 617 | static const struct file_operations pinmux_pins_ops = { |
| 618 | .open = pinmux_pins_open, |
| 619 | .read = seq_read, |
| 620 | .llseek = seq_lseek, |
| 621 | .release = single_release, |
| 622 | }; |
| 623 | |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 624 | void pinmux_init_device_debugfs(struct dentry *devroot, |
| 625 | struct pinctrl_dev *pctldev) |
| 626 | { |
| 627 | debugfs_create_file("pinmux-functions", S_IFREG | S_IRUGO, |
| 628 | devroot, pctldev, &pinmux_functions_ops); |
| 629 | debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO, |
| 630 | devroot, pctldev, &pinmux_pins_ops); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 631 | } |
| 632 | |
| 633 | #endif /* CONFIG_DEBUG_FS */ |