Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
drivers
pinctrl
core.h
Go to the documentation of this file.
1
/*
2
* Core private header for the pin control subsystem
3
*
4
* Copyright (C) 2011 ST-Ericsson SA
5
* Written on behalf of Linaro for ST-Ericsson
6
*
7
* Author: Linus Walleij <
[email protected]
>
8
*
9
* License terms: GNU General Public License (GPL) version 2
10
*/
11
12
#include <
linux/mutex.h
>
13
#include <
linux/radix-tree.h
>
14
#include <
linux/pinctrl/pinconf.h
>
15
#include <
linux/pinctrl/machine.h
>
16
17
struct
pinctrl_gpio_range;
18
35
struct
pinctrl_dev
{
36
struct
list_head
node
;
37
struct
pinctrl_desc *
desc
;
38
struct
radix_tree_root
pin_desc_tree
;
39
struct
list_head
gpio_ranges
;
40
struct
device
*
dev
;
41
struct
module
*
owner
;
42
void
*
driver_data
;
43
struct
pinctrl
*
p
;
44
#ifdef CONFIG_DEBUG_FS
45
struct
dentry
*device_root;
46
#endif
47
};
48
58
struct
pinctrl
{
59
struct
list_head
node
;
60
struct
device
*
dev
;
61
struct
list_head
states
;
62
struct
pinctrl_state
*
state
;
63
struct
list_head
dt_maps
;
64
};
65
72
struct
pinctrl_state
{
73
struct
list_head
node
;
74
const
char
*
name
;
75
struct
list_head
settings
;
76
};
77
83
struct
pinctrl_setting_mux
{
84
unsigned
group
;
85
unsigned
func
;
86
};
87
96
struct
pinctrl_setting_configs
{
97
unsigned
group_or_pin
;
98
unsigned
long
*
configs
;
99
unsigned
num_configs
;
100
};
101
110
struct
pinctrl_setting
{
111
struct
list_head
node
;
112
enum
pinctrl_map_type
type
;
113
struct
pinctrl_dev
*
pctldev
;
114
union
{
115
struct
pinctrl_setting_mux
mux
;
116
struct
pinctrl_setting_configs
configs
;
117
}
data
;
118
};
119
136
struct
pin_desc
{
137
struct
pinctrl_dev
*
pctldev
;
138
const
char
*
name
;
139
bool
dynamic_name
;
140
/* These fields only added when supporting pinmux drivers */
141
#ifdef CONFIG_PINMUX
142
unsigned
mux_usecount;
143
const
char
*mux_owner;
144
const
struct
pinctrl_setting_mux
*mux_setting;
145
const
char
*gpio_owner;
146
#endif
147
};
148
149
struct
pinctrl_dev
*
get_pinctrl_dev_from_devname
(
const
char
*dev_name);
150
int
pin_get_from_name
(
struct
pinctrl_dev
*pctldev,
const
char
*
name
);
151
const
char
*
pin_get_name
(
struct
pinctrl_dev
*pctldev,
const
unsigned
pin
);
152
int
pinctrl_get_group_selector
(
struct
pinctrl_dev
*pctldev,
153
const
char
*pin_group);
154
155
static
inline
struct
pin_desc
*pin_desc_get(
struct
pinctrl_dev
*
pctldev
,
156
unsigned
int
pin
)
157
{
158
return
radix_tree_lookup
(&pctldev->
pin_desc_tree
, pin);
159
}
160
161
int
pinctrl_register_map
(
struct
pinctrl_map
const
*maps,
unsigned
num_maps,
162
bool
dup,
bool
locked
);
163
void
pinctrl_unregister_map
(
struct
pinctrl_map
const
*
map
);
164
165
extern
struct
mutex
pinctrl_mutex
;
166
extern
struct
list_head
pinctrldev_list
;
Generated on Thu Jan 10 2013 12:58:10 for Linux Kernel by
1.8.2