core.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #include <linux/compiler.h>
  13. #include <linux/types.h>
  14. #include "sh_pfc.h"
  15. struct sh_pfc_window {
  16. phys_addr_t phys;
  17. void __iomem *virt;
  18. unsigned long size;
  19. };
  20. struct sh_pfc_chip;
  21. struct sh_pfc_pinctrl;
  22. struct sh_pfc {
  23. struct device *dev;
  24. struct sh_pfc_soc_info *info;
  25. spinlock_t lock;
  26. unsigned int num_windows;
  27. struct sh_pfc_window *window;
  28. struct sh_pfc_chip *gpio;
  29. struct sh_pfc_pinctrl *pinctrl;
  30. };
  31. int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
  32. int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc);
  33. int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
  34. int sh_pfc_unregister_pinctrl(struct sh_pfc *pfc);
  35. int sh_pfc_read_bit(struct pinmux_data_reg *dr, unsigned long in_pos);
  36. void sh_pfc_write_bit(struct pinmux_data_reg *dr, unsigned long in_pos,
  37. unsigned long value);
  38. int sh_pfc_get_data_reg(struct sh_pfc *pfc, unsigned gpio,
  39. struct pinmux_data_reg **drp, int *bitp);
  40. int sh_pfc_gpio_to_enum(struct sh_pfc *pfc, unsigned gpio, int pos,
  41. pinmux_enum_t *enum_idp);
  42. int sh_pfc_config_gpio(struct sh_pfc *pfc, unsigned gpio, int pinmux_type,
  43. int cfg_mode);
  44. extern struct sh_pfc_soc_info r8a7740_pinmux_info;
  45. extern struct sh_pfc_soc_info r8a7779_pinmux_info;
  46. extern struct sh_pfc_soc_info sh7203_pinmux_info;
  47. extern struct sh_pfc_soc_info sh7264_pinmux_info;
  48. extern struct sh_pfc_soc_info sh7269_pinmux_info;
  49. extern struct sh_pfc_soc_info sh7372_pinmux_info;
  50. extern struct sh_pfc_soc_info sh73a0_pinmux_info;
  51. extern struct sh_pfc_soc_info sh7720_pinmux_info;
  52. extern struct sh_pfc_soc_info sh7722_pinmux_info;
  53. extern struct sh_pfc_soc_info sh7723_pinmux_info;
  54. extern struct sh_pfc_soc_info sh7724_pinmux_info;
  55. extern struct sh_pfc_soc_info sh7734_pinmux_info;
  56. extern struct sh_pfc_soc_info sh7757_pinmux_info;
  57. extern struct sh_pfc_soc_info sh7785_pinmux_info;
  58. extern struct sh_pfc_soc_info sh7786_pinmux_info;
  59. extern struct sh_pfc_soc_info shx3_pinmux_info;
  60. #endif /* __SH_PFC_CORE_H__ */