18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci *
38c2ecf20Sopenharmony_ci * SuperH Pin Function Controller support.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2012  Renesas Solutions Corp.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci#ifndef __SH_PFC_CORE_H__
88c2ecf20Sopenharmony_ci#define __SH_PFC_CORE_H__
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/types.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include "sh_pfc.h"
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_cistruct sh_pfc_pin_range {
158c2ecf20Sopenharmony_ci	u16 start;
168c2ecf20Sopenharmony_ci	u16 end;
178c2ecf20Sopenharmony_ci};
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciint sh_pfc_register_gpiochip(struct sh_pfc *pfc);
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciint sh_pfc_register_pinctrl(struct sh_pfc *pfc);
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ciu32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width);
248c2ecf20Sopenharmony_civoid sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
258c2ecf20Sopenharmony_ci			  u32 data);
268c2ecf20Sopenharmony_ciu32 sh_pfc_read(struct sh_pfc *pfc, u32 reg);
278c2ecf20Sopenharmony_civoid sh_pfc_write(struct sh_pfc *pfc, u32 reg, u32 data);
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciint sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin);
308c2ecf20Sopenharmony_ciint sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciconst struct pinmux_bias_reg *
338c2ecf20Sopenharmony_cish_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
348c2ecf20Sopenharmony_ci		       unsigned int *bit);
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#endif /* __SH_PFC_CORE_H__ */
37