Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pinmux.h
Go to the documentation of this file.
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 <[email protected]>
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 
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 */