pinmux.c 18 KB

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