pinmux.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. /*
  2. * Core driver for the pin muxing portions of the pin control subsystem
  3. *
  4. * Copyright (C) 2011-2012 ST-Ericsson SA
  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. *
  10. * License terms: GNU General Public License (GPL) version 2
  11. */
  12. #define pr_fmt(fmt) "pinmux core: " fmt
  13. #include <linux/kernel.h>
  14. #include <linux/module.h>
  15. #include <linux/init.h>
  16. #include <linux/device.h>
  17. #include <linux/slab.h>
  18. #include <linux/radix-tree.h>
  19. #include <linux/err.h>
  20. #include <linux/list.h>
  21. #include <linux/mutex.h>
  22. #include <linux/spinlock.h>
  23. #include <linux/string.h>
  24. #include <linux/sysfs.h>
  25. #include <linux/debugfs.h>
  26. #include <linux/seq_file.h>
  27. #include <linux/pinctrl/machine.h>
  28. #include <linux/pinctrl/pinmux.h>
  29. #include "core.h"
  30. #include "pinmux.h"
  31. /**
  32. * struct pinmux_group - group list item for pinmux groups
  33. * @node: pinmux group list node
  34. * @func_selector: the function selector for the pinmux device handling
  35. * this pinmux
  36. * @group_selector: the group selector for this group
  37. */
  38. struct pinmux_group {
  39. struct list_head node;
  40. unsigned func_selector;
  41. unsigned group_selector;
  42. };
  43. int pinmux_check_ops(struct pinctrl_dev *pctldev)
  44. {
  45. const struct pinmux_ops *ops = pctldev->desc->pmxops;
  46. unsigned selector = 0;
  47. /* Check that we implement required operations */
  48. if (!ops->list_functions ||
  49. !ops->get_function_name ||
  50. !ops->get_function_groups ||
  51. !ops->enable ||
  52. !ops->disable)
  53. return -EINVAL;
  54. /* Check that all functions registered have names */
  55. while (ops->list_functions(pctldev, selector) >= 0) {
  56. const char *fname = ops->get_function_name(pctldev,
  57. selector);
  58. if (!fname) {
  59. pr_err("pinmux ops has no name for function%u\n",
  60. selector);
  61. return -EINVAL;
  62. }
  63. selector++;
  64. }
  65. return 0;
  66. }
  67. /**
  68. * pin_request() - request a single pin to be muxed in, typically for GPIO
  69. * @pin: the pin number in the global pin space
  70. * @owner: a representation of the owner of this pin; typically the device
  71. * name that controls its mux function, or the requested GPIO name
  72. * @gpio_range: the range matching the GPIO pin if this is a request for a
  73. * single GPIO pin
  74. */
  75. static int pin_request(struct pinctrl_dev *pctldev,
  76. int pin, const char *owner,
  77. struct pinctrl_gpio_range *gpio_range)
  78. {
  79. struct pin_desc *desc;
  80. const struct pinmux_ops *ops = pctldev->desc->pmxops;
  81. int status = -EINVAL;
  82. dev_dbg(pctldev->dev, "request pin %d for %s\n", pin, owner);
  83. desc = pin_desc_get(pctldev, pin);
  84. if (desc == NULL) {
  85. dev_err(pctldev->dev,
  86. "pin is not registered so it cannot be requested\n");
  87. goto out;
  88. }
  89. spin_lock(&desc->lock);
  90. if (desc->owner && strcmp(desc->owner, owner)) {
  91. spin_unlock(&desc->lock);
  92. dev_err(pctldev->dev,
  93. "pin already requested\n");
  94. goto out;
  95. }
  96. desc->owner = owner;
  97. spin_unlock(&desc->lock);
  98. /* Let each pin increase references to this module */
  99. if (!try_module_get(pctldev->owner)) {
  100. dev_err(pctldev->dev,
  101. "could not increase module refcount for pin %d\n",
  102. pin);
  103. status = -EINVAL;
  104. goto out_free_pin;
  105. }
  106. /*
  107. * If there is no kind of request function for the pin we just assume
  108. * we got it by default and proceed.
  109. */
  110. if (gpio_range && ops->gpio_request_enable)
  111. /* This requests and enables a single GPIO pin */
  112. status = ops->gpio_request_enable(pctldev, gpio_range, pin);
  113. else if (ops->request)
  114. status = ops->request(pctldev, pin);
  115. else
  116. status = 0;
  117. if (status)
  118. dev_err(pctldev->dev, "->request on device %s failed for pin %d\n",
  119. pctldev->desc->name, pin);
  120. out_free_pin:
  121. if (status) {
  122. spin_lock(&desc->lock);
  123. desc->owner = NULL;
  124. spin_unlock(&desc->lock);
  125. }
  126. out:
  127. if (status)
  128. dev_err(pctldev->dev, "pin-%d (%s) status %d\n",
  129. pin, owner, status);
  130. return status;
  131. }
  132. /**
  133. * pin_free() - release a single muxed in pin so something else can be muxed
  134. * @pctldev: pin controller device handling this pin
  135. * @pin: the pin to free
  136. * @gpio_range: the range matching the GPIO pin if this is a request for a
  137. * single GPIO pin
  138. *
  139. * This function returns a pointer to the previous owner. This is used
  140. * for callers that dynamically allocate an owner name so it can be freed
  141. * once the pin is free. This is done for GPIO request functions.
  142. */
  143. static const char *pin_free(struct pinctrl_dev *pctldev, int pin,
  144. struct pinctrl_gpio_range *gpio_range)
  145. {
  146. const struct pinmux_ops *ops = pctldev->desc->pmxops;
  147. struct pin_desc *desc;
  148. const char *owner;
  149. desc = pin_desc_get(pctldev, pin);
  150. if (desc == NULL) {
  151. dev_err(pctldev->dev,
  152. "pin is not registered so it cannot be freed\n");
  153. return NULL;
  154. }
  155. /*
  156. * If there is no kind of request function for the pin we just assume
  157. * we got it by default and proceed.
  158. */
  159. if (gpio_range && ops->gpio_disable_free)
  160. ops->gpio_disable_free(pctldev, gpio_range, pin);
  161. else if (ops->free)
  162. ops->free(pctldev, pin);
  163. spin_lock(&desc->lock);
  164. owner = desc->owner;
  165. desc->owner = NULL;
  166. spin_unlock(&desc->lock);
  167. module_put(pctldev->owner);
  168. return owner;
  169. }
  170. /**
  171. * pinmux_request_gpio() - request pinmuxing for a GPIO pin
  172. * @pctldev: pin controller device affected
  173. * @pin: the pin to mux in for GPIO
  174. * @range: the applicable GPIO range
  175. */
  176. int pinmux_request_gpio(struct pinctrl_dev *pctldev,
  177. struct pinctrl_gpio_range *range,
  178. unsigned pin, unsigned gpio)
  179. {
  180. char gpiostr[16];
  181. const char *owner;
  182. int ret;
  183. /* Conjure some name stating what chip and pin this is taken by */
  184. snprintf(gpiostr, 15, "%s:%d", range->name, gpio);
  185. owner = kstrdup(gpiostr, GFP_KERNEL);
  186. if (!owner)
  187. return -EINVAL;
  188. ret = pin_request(pctldev, pin, owner, range);
  189. if (ret < 0)
  190. kfree(owner);
  191. return ret;
  192. }
  193. /**
  194. * pinmux_free_gpio() - release a pin from GPIO muxing
  195. * @pctldev: the pin controller device for the pin
  196. * @pin: the affected currently GPIO-muxed in pin
  197. * @range: applicable GPIO range
  198. */
  199. void pinmux_free_gpio(struct pinctrl_dev *pctldev, unsigned pin,
  200. struct pinctrl_gpio_range *range)
  201. {
  202. const char *owner;
  203. owner = pin_free(pctldev, pin, range);
  204. kfree(owner);
  205. }
  206. /**
  207. * pinmux_gpio_direction() - set the direction of a single muxed-in GPIO pin
  208. * @pctldev: the pin controller handling this pin
  209. * @range: applicable GPIO range
  210. * @pin: the affected GPIO pin in this controller
  211. * @input: true if we set the pin as input, false for output
  212. */
  213. int pinmux_gpio_direction(struct pinctrl_dev *pctldev,
  214. struct pinctrl_gpio_range *range,
  215. unsigned pin, bool input)
  216. {
  217. const struct pinmux_ops *ops;
  218. int ret;
  219. ops = pctldev->desc->pmxops;
  220. if (ops->gpio_set_direction)
  221. ret = ops->gpio_set_direction(pctldev, range, pin, input);
  222. else
  223. ret = 0;
  224. return ret;
  225. }
  226. /**
  227. * acquire_pins() - acquire all the pins for a certain function on a pinmux
  228. * @pctldev: the device to take the pins on
  229. * @owner: a representation of the owner of this pin; typically the device
  230. * name that controls its mux function
  231. * @group_selector: the group selector containing the pins to acquire
  232. */
  233. static int acquire_pins(struct pinctrl_dev *pctldev,
  234. const char *owner,
  235. unsigned group_selector)
  236. {
  237. const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
  238. const unsigned *pins;
  239. unsigned num_pins;
  240. int ret;
  241. int i;
  242. ret = pctlops->get_group_pins(pctldev, group_selector,
  243. &pins, &num_pins);
  244. if (ret)
  245. return ret;
  246. dev_dbg(pctldev->dev, "requesting the %u pins from group %u\n",
  247. num_pins, group_selector);
  248. /* Try to allocate all pins in this group, one by one */
  249. for (i = 0; i < num_pins; i++) {
  250. ret = pin_request(pctldev, pins[i], owner, NULL);
  251. if (ret) {
  252. dev_err(pctldev->dev,
  253. "could not get request pin %d on device %s - conflicting mux mappings?\n",
  254. pins[i],
  255. pinctrl_dev_get_name(pctldev));
  256. /* On error release all taken pins */
  257. i--; /* this pin just failed */
  258. for (; i >= 0; i--)
  259. pin_free(pctldev, pins[i], NULL);
  260. return -ENODEV;
  261. }
  262. }
  263. return 0;
  264. }
  265. /**
  266. * release_pins() - release pins taken by earlier acquirement
  267. * @pctldev: the device to free the pins on
  268. * @group_selector: the group selector containing the pins to free
  269. */
  270. static void release_pins(struct pinctrl_dev *pctldev,
  271. unsigned group_selector)
  272. {
  273. const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
  274. const unsigned *pins;
  275. unsigned num_pins;
  276. int ret;
  277. int i;
  278. ret = pctlops->get_group_pins(pctldev, group_selector,
  279. &pins, &num_pins);
  280. if (ret) {
  281. dev_err(pctldev->dev, "could not get pins to release for group selector %d\n",
  282. group_selector);
  283. return;
  284. }
  285. for (i = 0; i < num_pins; i++)
  286. pin_free(pctldev, pins[i], NULL);
  287. }
  288. /**
  289. * pinmux_check_pin_group() - check function and pin group combo
  290. * @pctldev: device to check the pin group vs function for
  291. * @func_selector: the function selector to check the pin group for, we have
  292. * already looked this up in the calling function
  293. * @pin_group: the pin group to match to the function
  294. *
  295. * This function will check that the pinmux driver can supply the
  296. * selected pin group for a certain function, returns the group selector if
  297. * the group and function selector will work fine together, else returns
  298. * negative
  299. */
  300. static int pinmux_check_pin_group(struct pinctrl_dev *pctldev,
  301. unsigned func_selector,
  302. const char *pin_group)
  303. {
  304. const struct pinmux_ops *pmxops = pctldev->desc->pmxops;
  305. const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
  306. int ret;
  307. /*
  308. * If the driver does not support different pin groups for the
  309. * functions, we only support group 0, and assume this exists.
  310. */
  311. if (!pctlops || !pctlops->list_groups)
  312. return 0;
  313. /*
  314. * Passing NULL (no specific group) will select the first and
  315. * hopefully only group of pins available for this function.
  316. */
  317. if (!pin_group) {
  318. char const * const *groups;
  319. unsigned num_groups;
  320. ret = pmxops->get_function_groups(pctldev, func_selector,
  321. &groups, &num_groups);
  322. if (ret)
  323. return ret;
  324. if (num_groups < 1)
  325. return -EINVAL;
  326. ret = pinctrl_get_group_selector(pctldev, groups[0]);
  327. if (ret < 0) {
  328. dev_err(pctldev->dev,
  329. "function %s wants group %s but the pin controller does not seem to have that group\n",
  330. pmxops->get_function_name(pctldev, func_selector),
  331. groups[0]);
  332. return ret;
  333. }
  334. if (num_groups > 1)
  335. dev_dbg(pctldev->dev,
  336. "function %s support more than one group, default-selecting first group %s (%d)\n",
  337. pmxops->get_function_name(pctldev, func_selector),
  338. groups[0],
  339. ret);
  340. return ret;
  341. }
  342. dev_dbg(pctldev->dev,
  343. "check if we have pin group %s on controller %s\n",
  344. pin_group, pinctrl_dev_get_name(pctldev));
  345. ret = pinctrl_get_group_selector(pctldev, pin_group);
  346. if (ret < 0) {
  347. dev_dbg(pctldev->dev,
  348. "%s does not support pin group %s with function %s\n",
  349. pinctrl_dev_get_name(pctldev),
  350. pin_group,
  351. pmxops->get_function_name(pctldev, func_selector));
  352. }
  353. return ret;
  354. }
  355. /**
  356. * pinmux_search_function() - check pin control driver for a certain function
  357. * @pctldev: device to check for function and position
  358. * @map: function map containing the function and position to look for
  359. * @func_selector: returns the applicable function selector if found
  360. * @group_selector: returns the applicable group selector if found
  361. *
  362. * This will search the pinmux driver for an applicable
  363. * function with a specific pin group, returns 0 if these can be mapped
  364. * negative otherwise
  365. */
  366. static int pinmux_search_function(struct pinctrl_dev *pctldev,
  367. struct pinctrl_map const *map,
  368. unsigned *func_selector,
  369. unsigned *group_selector)
  370. {
  371. const struct pinmux_ops *ops = pctldev->desc->pmxops;
  372. unsigned selector = 0;
  373. /* See if this pctldev has this function */
  374. while (ops->list_functions(pctldev, selector) >= 0) {
  375. const char *fname = ops->get_function_name(pctldev,
  376. selector);
  377. int ret;
  378. if (!strcmp(map->function, fname)) {
  379. /* Found the function, check pin group */
  380. ret = pinmux_check_pin_group(pctldev, selector,
  381. map->group);
  382. if (ret < 0)
  383. return ret;
  384. /* This function and group selector can be used */
  385. *func_selector = selector;
  386. *group_selector = ret;
  387. return 0;
  388. }
  389. selector++;
  390. }
  391. pr_err("%s does not support function %s\n",
  392. pinctrl_dev_get_name(pctldev), map->function);
  393. return -EINVAL;
  394. }
  395. /**
  396. * pinmux_enable_muxmap() - enable a map entry for a certain pinmux
  397. */
  398. static int pinmux_enable_muxmap(struct pinctrl_dev *pctldev,
  399. struct pinctrl *p,
  400. struct device *dev,
  401. const char *devname,
  402. struct pinctrl_map const *map)
  403. {
  404. unsigned func_selector;
  405. unsigned group_selector;
  406. struct pinmux_group *grp;
  407. int ret;
  408. /*
  409. * Note that we're not locking the pinmux mutex here, because
  410. * this is only called at pinmux initialization time when it
  411. * has not been added to any list and thus is not reachable
  412. * by anyone else.
  413. */
  414. if (p->pctldev && p->pctldev != pctldev) {
  415. dev_err(pctldev->dev,
  416. "different pin control devices given for device %s, function %s\n",
  417. devname, map->function);
  418. return -EINVAL;
  419. }
  420. p->dev = dev;
  421. p->pctldev = pctldev;
  422. /* Now go into the driver and try to match a function and group */
  423. ret = pinmux_search_function(pctldev, map, &func_selector,
  424. &group_selector);
  425. if (ret < 0)
  426. return ret;
  427. /* Now add this group selector, we may have many of them */
  428. grp = kmalloc(sizeof(*grp), GFP_KERNEL);
  429. if (!grp)
  430. return -ENOMEM;
  431. grp->func_selector = func_selector;
  432. grp->group_selector = group_selector;
  433. ret = acquire_pins(pctldev, devname, group_selector);
  434. if (ret) {
  435. kfree(grp);
  436. return ret;
  437. }
  438. list_add_tail(&grp->node, &p->groups);
  439. return 0;
  440. }
  441. /**
  442. * pinmux_apply_muxmap() - apply a certain mux mapping entry
  443. */
  444. int pinmux_apply_muxmap(struct pinctrl_dev *pctldev,
  445. struct pinctrl *p,
  446. struct device *dev,
  447. const char *devname,
  448. struct pinctrl_map const *map)
  449. {
  450. int ret;
  451. ret = pinmux_enable_muxmap(pctldev, p, dev,
  452. devname, map);
  453. if (ret) {
  454. pinmux_put(p);
  455. return ret;
  456. }
  457. return 0;
  458. }
  459. /**
  460. * pinmux_put() - free up the pinmux portions of a pin controller handle
  461. */
  462. void pinmux_put(struct pinctrl *p)
  463. {
  464. struct list_head *node, *tmp;
  465. list_for_each_safe(node, tmp, &p->groups) {
  466. struct pinmux_group *grp =
  467. list_entry(node, struct pinmux_group, node);
  468. /* Release all pins taken by this group */
  469. release_pins(p->pctldev, grp->group_selector);
  470. list_del(node);
  471. kfree(grp);
  472. }
  473. }
  474. /**
  475. * pinmux_enable() - enable the pinmux portion of a pin control handle
  476. */
  477. int pinmux_enable(struct pinctrl *p)
  478. {
  479. struct pinctrl_dev *pctldev = p->pctldev;
  480. const struct pinmux_ops *ops = pctldev->desc->pmxops;
  481. struct pinmux_group *grp;
  482. int ret;
  483. list_for_each_entry(grp, &p->groups, node) {
  484. ret = ops->enable(pctldev, grp->func_selector,
  485. grp->group_selector);
  486. if (ret)
  487. /*
  488. * TODO: call disable() on all groups we called
  489. * enable() on to this point?
  490. */
  491. return ret;
  492. }
  493. return 0;
  494. }
  495. /**
  496. * pinmux_disable() - disable the pinmux portions of a pin control handle
  497. */
  498. void pinmux_disable(struct pinctrl *p)
  499. {
  500. struct pinctrl_dev *pctldev = p->pctldev;
  501. const struct pinmux_ops *ops = pctldev->desc->pmxops;
  502. struct pinmux_group *grp;
  503. list_for_each_entry(grp, &p->groups, node) {
  504. ops->disable(pctldev, grp->func_selector,
  505. grp->group_selector);
  506. }
  507. }
  508. #ifdef CONFIG_DEBUG_FS
  509. /* Called from pincontrol core */
  510. static int pinmux_functions_show(struct seq_file *s, void *what)
  511. {
  512. struct pinctrl_dev *pctldev = s->private;
  513. const struct pinmux_ops *pmxops = pctldev->desc->pmxops;
  514. unsigned func_selector = 0;
  515. while (pmxops->list_functions(pctldev, func_selector) >= 0) {
  516. const char *func = pmxops->get_function_name(pctldev,
  517. func_selector);
  518. const char * const *groups;
  519. unsigned num_groups;
  520. int ret;
  521. int i;
  522. ret = pmxops->get_function_groups(pctldev, func_selector,
  523. &groups, &num_groups);
  524. if (ret)
  525. seq_printf(s, "function %s: COULD NOT GET GROUPS\n",
  526. func);
  527. seq_printf(s, "function: %s, groups = [ ", func);
  528. for (i = 0; i < num_groups; i++)
  529. seq_printf(s, "%s ", groups[i]);
  530. seq_puts(s, "]\n");
  531. func_selector++;
  532. }
  533. return 0;
  534. }
  535. static int pinmux_pins_show(struct seq_file *s, void *what)
  536. {
  537. struct pinctrl_dev *pctldev = s->private;
  538. unsigned i, pin;
  539. seq_puts(s, "Pinmux settings per pin\n");
  540. seq_puts(s, "Format: pin (name): owner\n");
  541. /* The pin number can be retrived from the pin controller descriptor */
  542. for (i = 0; i < pctldev->desc->npins; i++) {
  543. struct pin_desc *desc;
  544. bool is_hog = false;
  545. pin = pctldev->desc->pins[i].number;
  546. desc = pin_desc_get(pctldev, pin);
  547. /* Skip if we cannot search the pin */
  548. if (desc == NULL)
  549. continue;
  550. if (desc->owner &&
  551. !strcmp(desc->owner, pinctrl_dev_get_name(pctldev)))
  552. is_hog = true;
  553. seq_printf(s, "pin %d (%s): %s%s\n", pin,
  554. desc->name ? desc->name : "unnamed",
  555. desc->owner ? desc->owner : "UNCLAIMED",
  556. is_hog ? " (HOG)" : "");
  557. }
  558. return 0;
  559. }
  560. void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p)
  561. {
  562. struct pinctrl_dev *pctldev = p->pctldev;
  563. const struct pinmux_ops *pmxops;
  564. const struct pinctrl_ops *pctlops;
  565. struct pinmux_group *grp;
  566. const char *sep = "";
  567. pmxops = pctldev->desc->pmxops;
  568. pctlops = pctldev->desc->pctlops;
  569. seq_printf(s, " groups: [");
  570. list_for_each_entry(grp, &p->groups, node) {
  571. seq_printf(s, "%s%s (%u)=%s (%u)",
  572. sep,
  573. pctlops->get_group_name(pctldev,
  574. grp->group_selector),
  575. grp->group_selector,
  576. pmxops->get_function_name(pctldev,
  577. grp->func_selector),
  578. grp->func_selector);
  579. sep = ", ";
  580. }
  581. seq_printf(s, " ]");
  582. }
  583. static int pinmux_functions_open(struct inode *inode, struct file *file)
  584. {
  585. return single_open(file, pinmux_functions_show, inode->i_private);
  586. }
  587. static int pinmux_pins_open(struct inode *inode, struct file *file)
  588. {
  589. return single_open(file, pinmux_pins_show, inode->i_private);
  590. }
  591. static const struct file_operations pinmux_functions_ops = {
  592. .open = pinmux_functions_open,
  593. .read = seq_read,
  594. .llseek = seq_lseek,
  595. .release = single_release,
  596. };
  597. static const struct file_operations pinmux_pins_ops = {
  598. .open = pinmux_pins_open,
  599. .read = seq_read,
  600. .llseek = seq_lseek,
  601. .release = single_release,
  602. };
  603. void pinmux_init_device_debugfs(struct dentry *devroot,
  604. struct pinctrl_dev *pctldev)
  605. {
  606. debugfs_create_file("pinmux-functions", S_IFREG | S_IRUGO,
  607. devroot, pctldev, &pinmux_functions_ops);
  608. debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO,
  609. devroot, pctldev, &pinmux_pins_ops);
  610. }
  611. #endif /* CONFIG_DEBUG_FS */