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