Merge branches 'pm-sleep' and 'pm-tools'
[deliverable/linux.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>
bf9f0674 14#include <linux/spinlock.h>
f9165132
LP
15#include <linux/types.h>
16
c3323806
LP
17#include "sh_pfc.h"
18
4aeacd5b 19struct sh_pfc_window {
f9165132
LP
20 phys_addr_t phys;
21 void __iomem *virt;
22 unsigned long size;
23};
24
6f6a4a68 25struct sh_pfc_chip;
c6193eac 26struct sh_pfc_pinctrl;
6f6a4a68 27
acac8ed5
LP
28struct sh_pfc_pin_range {
29 u16 start;
30 u16 end;
31};
32
f9165132 33struct sh_pfc {
c6193eac 34 struct device *dev;
cd3c1bee 35 const struct sh_pfc_soc_info *info;
f9165132
LP
36 spinlock_t lock;
37
973931ae 38 unsigned int num_windows;
5b46ac3a 39 struct sh_pfc_window *windows;
70c8f01a
LP
40 unsigned int num_irqs;
41 unsigned int *irqs;
973931ae 42
acac8ed5
LP
43 struct sh_pfc_pin_range *ranges;
44 unsigned int nr_ranges;
45
28818fa5 46 unsigned int nr_gpio_pins;
63d57383 47
6f6a4a68 48 struct sh_pfc_chip *gpio;
56f891b4 49#ifdef CONFIG_SUPERH
16883814 50 struct sh_pfc_chip *func;
56f891b4 51#endif
16883814 52
f9165132
LP
53};
54
55int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
6f6a4a68 56int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc);
f9165132
LP
57
58int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
59
cef28a28
GU
60u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width);
61void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
fc88936a 62 u32 data);
3caa7d8c
LP
63u32 sh_pfc_read_reg(struct sh_pfc *pfc, u32 reg, unsigned int width);
64void sh_pfc_write_reg(struct sh_pfc *pfc, u32 reg, unsigned int width,
65 u32 data);
41f1219f 66
1a0039dc 67int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin);
861601de 68int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type);
f9165132 69
1e7d5d84 70extern const struct sh_pfc_soc_info emev2_pinmux_info;
c98f6c21 71extern const struct sh_pfc_soc_info r8a73a4_pinmux_info;
cd3c1bee 72extern const struct sh_pfc_soc_info r8a7740_pinmux_info;
87f8c988 73extern const struct sh_pfc_soc_info r8a7778_pinmux_info;
cd3c1bee 74extern const struct sh_pfc_soc_info r8a7779_pinmux_info;
58c229e1 75extern const struct sh_pfc_soc_info r8a7790_pinmux_info;
50884519 76extern const struct sh_pfc_soc_info r8a7791_pinmux_info;
19e1e98f 77extern const struct sh_pfc_soc_info r8a7793_pinmux_info;
43c4436e 78extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
0b0ffc96 79extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
cd3c1bee
LP
80extern const struct sh_pfc_soc_info sh7203_pinmux_info;
81extern const struct sh_pfc_soc_info sh7264_pinmux_info;
82extern const struct sh_pfc_soc_info sh7269_pinmux_info;
cd3c1bee
LP
83extern const struct sh_pfc_soc_info sh73a0_pinmux_info;
84extern const struct sh_pfc_soc_info sh7720_pinmux_info;
85extern const struct sh_pfc_soc_info sh7722_pinmux_info;
86extern const struct sh_pfc_soc_info sh7723_pinmux_info;
87extern const struct sh_pfc_soc_info sh7724_pinmux_info;
88extern const struct sh_pfc_soc_info sh7734_pinmux_info;
89extern const struct sh_pfc_soc_info sh7757_pinmux_info;
90extern const struct sh_pfc_soc_info sh7785_pinmux_info;
91extern const struct sh_pfc_soc_info sh7786_pinmux_info;
92extern const struct sh_pfc_soc_info shx3_pinmux_info;
d5b1521a 93
f9165132 94#endif /* __SH_PFC_CORE_H__ */
This page took 0.224271 seconds and 5 git commands to generate.