2 * SuperH Pin Function Controller support.
4 * Copyright (C) 2012 Renesas Solutions Corp.
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
10 #ifndef __SH_PFC_CORE_H__
11 #define __SH_PFC_CORE_H__
13 #include <linux/compiler.h>
14 #include <linux/spinlock.h>
15 #include <linux/types.h>
19 struct sh_pfc_window {
26 struct sh_pfc_pinctrl;
28 struct sh_pfc_pin_range {
35 const struct sh_pfc_soc_info *info;
38 unsigned int num_windows;
39 struct sh_pfc_window *windows;
40 unsigned int num_irqs;
43 struct sh_pfc_pin_range *ranges;
44 unsigned int nr_ranges;
46 unsigned int nr_gpio_pins;
48 struct sh_pfc_chip *gpio;
50 struct sh_pfc_chip *func;
55 int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
56 int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc);
58 int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
60 u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width);
61 void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
63 u32 sh_pfc_read_reg(struct sh_pfc *pfc, u32 reg, unsigned int width);
64 void sh_pfc_write_reg(struct sh_pfc *pfc, u32 reg, unsigned int width,
67 int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin);
68 int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type);
70 #endif /* __SH_PFC_CORE_H__ */