blob: 6d598dd63720856774c0f7b2267f631fc67204a0 [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
Laurent Pinchartf9165132012-12-15 23:50:44 +010013#include <linux/types.h>
14
Laurent Pinchartc3323802012-12-15 23:51:55 +010015#include "sh_pfc.h"
16
Laurent Pinchartacac8ed2013-07-15 18:38:30 +020017struct sh_pfc_pin_range {
18 u16 start;
19 u16 end;
20};
21
Laurent Pinchartf9165132012-12-15 23:50:44 +010022int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
Laurent Pinchartf9165132012-12-15 23:50:44 +010023
24int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
Laurent Pinchartf9165132012-12-15 23:50:44 +010025
Geert Uytterhoevencef28a22015-03-12 11:09:14 +010026u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width);
27void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
Geert Uytterhoevenfc889362015-02-27 18:38:04 +010028 u32 data);
Laurent Pinchart3caa7d82016-03-23 16:06:00 +020029u32 sh_pfc_read_reg(struct sh_pfc *pfc, u32 reg, unsigned int width);
30void sh_pfc_write_reg(struct sh_pfc *pfc, u32 reg, unsigned int width,
31 u32 data);
Laurent Pinchart41f12192013-02-15 02:04:55 +010032
Laurent Pinchart1a0039d2013-03-08 17:43:54 +010033int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin);
Laurent Pinchart861601d2013-03-10 15:29:14 +010034int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type);
Laurent Pinchartf9165132012-12-15 23:50:44 +010035
Niklas Söderlund92293362016-11-12 17:04:25 +010036const struct sh_pfc_bias_info *
37sh_pfc_pin_to_bias_info(const struct sh_pfc_bias_info *info,
38 unsigned int num, unsigned int pin);
39
Laurent Pinchartf9165132012-12-15 23:50:44 +010040#endif /* __SH_PFC_CORE_H__ */