Commit | Line | Data |
---|---|---|
f9165132 LP |
1 | /* |
2 | * SuperH Pin Function Controller support. | |
3 | * | |
4 | * Copyright (C) 2012 Renesas Solutions Corp. | |
5 | * | |
6 | * This file is subject to the terms and conditions of the GNU General Public | |
7 | * License. See the file "COPYING" in the main directory of this archive | |
8 | * for more details. | |
9 | */ | |
10 | #ifndef __SH_PFC_CORE_H__ | |
11 | #define __SH_PFC_CORE_H__ | |
12 | ||
13 | #include <linux/compiler.h> | |
14 | #include <linux/sh_pfc.h> | |
15 | #include <linux/types.h> | |
16 | ||
4aeacd5b | 17 | struct sh_pfc_window { |
f9165132 LP |
18 | phys_addr_t phys; |
19 | void __iomem *virt; | |
20 | unsigned long size; | |
21 | }; | |
22 | ||
6f6a4a68 | 23 | struct sh_pfc_chip; |
c6193eac | 24 | struct sh_pfc_pinctrl; |
6f6a4a68 | 25 | |
f9165132 | 26 | struct sh_pfc { |
c6193eac | 27 | struct device *dev; |
19bb7fe3 | 28 | struct sh_pfc_soc_info *info; |
f9165132 LP |
29 | spinlock_t lock; |
30 | ||
973931ae | 31 | unsigned int num_windows; |
4aeacd5b | 32 | struct sh_pfc_window *window; |
973931ae | 33 | |
6f6a4a68 | 34 | struct sh_pfc_chip *gpio; |
c6193eac | 35 | struct sh_pfc_pinctrl *pinctrl; |
f9165132 LP |
36 | }; |
37 | ||
38 | int sh_pfc_register_gpiochip(struct sh_pfc *pfc); | |
6f6a4a68 | 39 | int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc); |
f9165132 LP |
40 | |
41 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc); | |
c6193eac | 42 | int sh_pfc_unregister_pinctrl(struct sh_pfc *pfc); |
f9165132 LP |
43 | |
44 | int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos); | |
45 | void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos, | |
46 | unsigned long value); | |
47 | int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio, | |
48 | struct pinmux_data_reg **drp, int *bitp); | |
49 | int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos, | |
50 | pinmux_enum_t *enum_idp); | |
51 | int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type, | |
52 | int cfg_mode); | |
53 | ||
d5b1521a | 54 | extern struct sh_pfc_soc_info r8a7740_pinmux_info; |
881023d2 | 55 | extern struct sh_pfc_soc_info r8a7779_pinmux_info; |
ccda552e | 56 | extern struct sh_pfc_soc_info sh7203_pinmux_info; |
a8d42fc4 | 57 | extern struct sh_pfc_soc_info sh7264_pinmux_info; |
f5e811f2 | 58 | extern struct sh_pfc_soc_info sh7269_pinmux_info; |
6e5469a6 | 59 | extern struct sh_pfc_soc_info sh7372_pinmux_info; |
5d5166dc | 60 | extern struct sh_pfc_soc_info sh73a0_pinmux_info; |
74cad605 | 61 | extern struct sh_pfc_soc_info sh7720_pinmux_info; |
f5e25ae5 | 62 | extern struct sh_pfc_soc_info sh7722_pinmux_info; |
d05afa0a | 63 | extern struct sh_pfc_soc_info sh7723_pinmux_info; |
0ff25bab | 64 | extern struct sh_pfc_soc_info sh7724_pinmux_info; |
ac1ebc21 | 65 | extern struct sh_pfc_soc_info sh7734_pinmux_info; |
d5b1521a | 66 | |
f9165132 | 67 | #endif /* __SH_PFC_CORE_H__ */ |