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> | |
bf9f0674 | 14 | #include <linux/spinlock.h> |
f9165132 LP |
15 | #include <linux/types.h> |
16 | ||
c3323806 LP |
17 | #include "sh_pfc.h" |
18 | ||
4aeacd5b | 19 | struct sh_pfc_window { |
f9165132 LP |
20 | phys_addr_t phys; |
21 | void __iomem *virt; | |
22 | unsigned long size; | |
23 | }; | |
24 | ||
6f6a4a68 | 25 | struct sh_pfc_chip; |
c6193eac | 26 | struct sh_pfc_pinctrl; |
6f6a4a68 | 27 | |
f9165132 | 28 | struct sh_pfc { |
c6193eac | 29 | struct device *dev; |
cd3c1bee | 30 | const struct sh_pfc_soc_info *info; |
0c151062 | 31 | void *soc_data; |
f9165132 LP |
32 | spinlock_t lock; |
33 | ||
973931ae | 34 | unsigned int num_windows; |
4aeacd5b | 35 | struct sh_pfc_window *window; |
973931ae | 36 | |
63d57383 LP |
37 | unsigned int nr_pins; |
38 | ||
6f6a4a68 | 39 | struct sh_pfc_chip *gpio; |
16883814 LP |
40 | struct sh_pfc_chip *func; |
41 | ||
c6193eac | 42 | struct sh_pfc_pinctrl *pinctrl; |
f9165132 LP |
43 | }; |
44 | ||
45 | int sh_pfc_register_gpiochip(struct sh_pfc *pfc); | |
6f6a4a68 | 46 | int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc); |
f9165132 LP |
47 | |
48 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc); | |
c6193eac | 49 | int sh_pfc_unregister_pinctrl(struct sh_pfc *pfc); |
f9165132 | 50 | |
41f1219f LP |
51 | unsigned long sh_pfc_read_raw_reg(void __iomem *mapped_reg, |
52 | unsigned long reg_width); | |
53 | void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned long reg_width, | |
54 | unsigned long data); | |
55 | ||
1a0039dc | 56 | int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin); |
861601de | 57 | int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type); |
f9165132 | 58 | |
c98f6c21 | 59 | extern const struct sh_pfc_soc_info r8a73a4_pinmux_info; |
cd3c1bee | 60 | extern const struct sh_pfc_soc_info r8a7740_pinmux_info; |
87f8c988 | 61 | extern const struct sh_pfc_soc_info r8a7778_pinmux_info; |
cd3c1bee | 62 | extern const struct sh_pfc_soc_info r8a7779_pinmux_info; |
58c229e1 | 63 | extern const struct sh_pfc_soc_info r8a7790_pinmux_info; |
cd3c1bee LP |
64 | extern const struct sh_pfc_soc_info sh7203_pinmux_info; |
65 | extern const struct sh_pfc_soc_info sh7264_pinmux_info; | |
66 | extern const struct sh_pfc_soc_info sh7269_pinmux_info; | |
67 | extern const struct sh_pfc_soc_info sh7372_pinmux_info; | |
68 | extern const struct sh_pfc_soc_info sh73a0_pinmux_info; | |
69 | extern const struct sh_pfc_soc_info sh7720_pinmux_info; | |
70 | extern const struct sh_pfc_soc_info sh7722_pinmux_info; | |
71 | extern const struct sh_pfc_soc_info sh7723_pinmux_info; | |
72 | extern const struct sh_pfc_soc_info sh7724_pinmux_info; | |
73 | extern const struct sh_pfc_soc_info sh7734_pinmux_info; | |
74 | extern const struct sh_pfc_soc_info sh7757_pinmux_info; | |
75 | extern const struct sh_pfc_soc_info sh7785_pinmux_info; | |
76 | extern const struct sh_pfc_soc_info sh7786_pinmux_info; | |
77 | extern const struct sh_pfc_soc_info shx3_pinmux_info; | |
d5b1521a | 78 | |
f9165132 | 79 | #endif /* __SH_PFC_CORE_H__ */ |