Laurent Pinchart | f916513 | 2012-12-15 23:50:44 +0100 | [diff] [blame] | 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 | |
Laurent Pinchart | f916513 | 2012-12-15 23:50:44 +0100 | [diff] [blame] | 13 | #include <linux/types.h> |
| 14 | |
Laurent Pinchart | c332380 | 2012-12-15 23:51:55 +0100 | [diff] [blame] | 15 | #include "sh_pfc.h" |
| 16 | |
Laurent Pinchart | acac8ed | 2013-07-15 18:38:30 +0200 | [diff] [blame] | 17 | struct sh_pfc_pin_range { |
| 18 | u16 start; |
| 19 | u16 end; |
| 20 | }; |
| 21 | |
Laurent Pinchart | f916513 | 2012-12-15 23:50:44 +0100 | [diff] [blame] | 22 | int sh_pfc_register_gpiochip(struct sh_pfc *pfc); |
Laurent Pinchart | f916513 | 2012-12-15 23:50:44 +0100 | [diff] [blame] | 23 | |
| 24 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc); |
Laurent Pinchart | f916513 | 2012-12-15 23:50:44 +0100 | [diff] [blame] | 25 | |
Geert Uytterhoeven | cef28a2 | 2015-03-12 11:09:14 +0100 | [diff] [blame] | 26 | u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width); |
| 27 | void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width, |
Geert Uytterhoeven | fc88936 | 2015-02-27 18:38:04 +0100 | [diff] [blame] | 28 | u32 data); |
Laurent Pinchart | 3caa7d8 | 2016-03-23 16:06:00 +0200 | [diff] [blame] | 29 | u32 sh_pfc_read_reg(struct sh_pfc *pfc, u32 reg, unsigned int width); |
| 30 | void sh_pfc_write_reg(struct sh_pfc *pfc, u32 reg, unsigned int width, |
| 31 | u32 data); |
Laurent Pinchart | 41f1219 | 2013-02-15 02:04:55 +0100 | [diff] [blame] | 32 | |
Laurent Pinchart | 1a0039d | 2013-03-08 17:43:54 +0100 | [diff] [blame] | 33 | int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin); |
Laurent Pinchart | 861601d | 2013-03-10 15:29:14 +0100 | [diff] [blame] | 34 | int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type); |
Laurent Pinchart | f916513 | 2012-12-15 23:50:44 +0100 | [diff] [blame] | 35 | |
Niklas Söderlund | 9229336 | 2016-11-12 17:04:25 +0100 | [diff] [blame] | 36 | const struct sh_pfc_bias_info * |
| 37 | sh_pfc_pin_to_bias_info(const struct sh_pfc_bias_info *info, |
| 38 | unsigned int num, unsigned int pin); |
| 39 | |
Laurent Pinchart | f916513 | 2012-12-15 23:50:44 +0100 | [diff] [blame] | 40 | #endif /* __SH_PFC_CORE_H__ */ |