blob: b07ae259c0eb29b73111674ecd2f2d7b463a1135 [file] [log] [blame]
Laurent Pinchartf9165132012-12-15 23:50:44 +01001/*
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/sh_pfc.h>
15#include <linux/types.h>
16
17struct pfc_window {
18 phys_addr_t phys;
19 void __iomem *virt;
20 unsigned long size;
21};
22
23struct sh_pfc {
24 struct sh_pfc_platform_data *pdata;
25 spinlock_t lock;
26
27 struct pfc_window *window;
28};
29
30int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
31
32int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
33
34int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos);
35void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos,
36 unsigned long value);
37int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio,
38 struct pinmux_data_reg **drp, int *bitp);
39int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos,
40 pinmux_enum_t *enum_idp);
41int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type,
42 int cfg_mode);
43
44#endif /* __SH_PFC_CORE_H__ */