~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/pinctrl/pinmux.h

Version: ~ [ linux-5.10-rc5 ] ~ [ linux-5.9.10 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.79 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.159 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.208 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.245 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.245 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Interface the pinmux subsystem
  3  *
  4  * Copyright (C) 2011 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 #ifndef __LINUX_PINCTRL_PINMUX_H
 13 #define __LINUX_PINCTRL_PINMUX_H
 14 
 15 #include <linux/list.h>
 16 #include <linux/seq_file.h>
 17 #include <linux/pinctrl/pinctrl.h>
 18 
 19 #ifdef CONFIG_PINMUX
 20 
 21 struct pinctrl_dev;
 22 
 23 /**
 24  * struct pinmux_ops - pinmux operations, to be implemented by pin controller
 25  * drivers that support pinmuxing
 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
 28  *      before selecting any actual mux setting across a function. The driver
 29  *      is allowed to answer "no" by returning a negative error code
 30  * @free: the reverse function of the request() callback, frees a pin after
 31  *      being requested
 32  * @get_functions_count: returns number of selectable named functions available
 33  *      in this pinmux driver
 34  * @get_function_name: return the function name of the muxing selector,
 35  *      called by the core to figure out which mux setting it shall map a
 36  *      certain device to
 37  * @get_function_groups: return an array of groups names (in turn
 38  *      referencing pins) connected to a certain function selector. The group
 39  *      name can be used with the generic @pinctrl_ops to retrieve the
 40  *      actual pins affected. The applicable groups will be returned in
 41  *      @groups and the number of groups in @num_groups
 42  * @enable: enable a certain muxing function with a certain pin group. The
 43  *      driver does not need to figure out whether enabling this function
 44  *      conflicts some other use of the pins in that group, such collisions
 45  *      are handled by the pinmux subsystem. The @func_selector selects a
 46  *      certain function whereas @group_selector selects a certain set of pins
 47  *      to be used. On simple controllers the latter argument may be ignored
 48  * @disable: disable a certain muxing selector with a certain pin group
 49  * @gpio_request_enable: requests and enables GPIO on a certain pin.
 50  *      Implement this only if you can mux every pin individually as GPIO. The
 51  *      affected GPIO range is passed along with an offset(pin number) into that
 52  *      specific GPIO range - function selectors and pin groups are orthogonal
 53  *      to this, the core will however make sure the pins do not collide.
 54  * @gpio_disable_free: free up GPIO muxing on a certain pin, the reverse of
 55  *      @gpio_request_enable
 56  * @gpio_set_direction: Since controllers may need different configurations
 57  *      depending on whether the GPIO is configured as input or output,
 58  *      a direction selector function may be implemented as a backing
 59  *      to the GPIO controllers that need pin muxing.
 60  */
 61 struct pinmux_ops {
 62         int (*request) (struct pinctrl_dev *pctldev, unsigned offset);
 63         int (*free) (struct pinctrl_dev *pctldev, unsigned offset);
 64         int (*get_functions_count) (struct pinctrl_dev *pctldev);
 65         const char *(*get_function_name) (struct pinctrl_dev *pctldev,
 66                                           unsigned selector);
 67         int (*get_function_groups) (struct pinctrl_dev *pctldev,
 68                                   unsigned selector,
 69                                   const char * const **groups,
 70                                   unsigned * const num_groups);
 71         int (*enable) (struct pinctrl_dev *pctldev, unsigned func_selector,
 72                        unsigned group_selector);
 73         void (*disable) (struct pinctrl_dev *pctldev, unsigned func_selector,
 74                          unsigned group_selector);
 75         int (*gpio_request_enable) (struct pinctrl_dev *pctldev,
 76                                     struct pinctrl_gpio_range *range,
 77                                     unsigned offset);
 78         void (*gpio_disable_free) (struct pinctrl_dev *pctldev,
 79                                    struct pinctrl_gpio_range *range,
 80                                    unsigned offset);
 81         int (*gpio_set_direction) (struct pinctrl_dev *pctldev,
 82                                    struct pinctrl_gpio_range *range,
 83                                    unsigned offset,
 84                                    bool input);
 85 };
 86 
 87 #endif /* CONFIG_PINMUX */
 88 
 89 #endif /* __LINUX_PINCTRL_PINMUX_H */
 90 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp