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