Merge branch 'v6v7' into devel
[linux/fpc-iii.git] / arch / arm / plat-spear / include / plat / padmux.h
blob877f3adcf61070d8ef2ba44b0658029645e89433
1 /*
2 * arch/arm/plat-spear/include/plat/padmux.h
4 * SPEAr platform specific gpio pads muxing file
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
14 #ifndef __PLAT_PADMUX_H
15 #define __PLAT_PADMUX_H
17 #include <linux/types.h>
20 * struct pmx_reg: configuration structure for mode reg and mux reg
22 * offset: offset of mode reg
23 * mask: mask of mode reg
25 struct pmx_reg {
26 u32 offset;
27 u32 mask;
31 * struct pmx_dev_mode: configuration structure every group of modes of a device
33 * ids: all modes for this configuration
34 * mask: mask for supported mode
36 struct pmx_dev_mode {
37 u32 ids;
38 u32 mask;
42 * struct pmx_mode: mode definition structure
44 * name: mode name
45 * mask: mode mask
47 struct pmx_mode {
48 char *name;
49 u32 id;
50 u32 mask;
54 * struct pmx_dev: device definition structure
56 * name: device name
57 * modes: device configuration array for different modes supported
58 * mode_count: size of modes array
59 * is_active: is peripheral active/enabled
60 * enb_on_reset: if 1, mask bits to be cleared in reg otherwise to be set in reg
62 struct pmx_dev {
63 char *name;
64 struct pmx_dev_mode *modes;
65 u8 mode_count;
66 bool is_active;
67 bool enb_on_reset;
71 * struct pmx_driver: driver definition structure
73 * mode: mode to be set
74 * devs: array of pointer to pmx devices
75 * devs_count: ARRAY_SIZE of devs
76 * base: base address of soc config registers
77 * mode_reg: structure of mode config register
78 * mux_reg: structure of device mux config register
80 struct pmx_driver {
81 struct pmx_mode *mode;
82 struct pmx_dev **devs;
83 u8 devs_count;
84 u32 *base;
85 struct pmx_reg mode_reg;
86 struct pmx_reg mux_reg;
89 /* pmx functions */
90 int pmx_register(struct pmx_driver *driver);
92 #endif /* __PLAT_PADMUX_H */