18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef BCM63XX_GPIO_H
38c2ecf20Sopenharmony_ci#define BCM63XX_GPIO_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/init.h>
68c2ecf20Sopenharmony_ci#include <bcm63xx_cpu.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciint __init bcm63xx_gpio_init(void);
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_cistatic inline unsigned long bcm63xx_gpio_count(void)
118c2ecf20Sopenharmony_ci{
128c2ecf20Sopenharmony_ci	switch (bcm63xx_get_cpu_id()) {
138c2ecf20Sopenharmony_ci	case BCM6328_CPU_ID:
148c2ecf20Sopenharmony_ci		return 32;
158c2ecf20Sopenharmony_ci	case BCM3368_CPU_ID:
168c2ecf20Sopenharmony_ci		return 40;
178c2ecf20Sopenharmony_ci	case BCM6338_CPU_ID:
188c2ecf20Sopenharmony_ci		return 8;
198c2ecf20Sopenharmony_ci	case BCM6345_CPU_ID:
208c2ecf20Sopenharmony_ci		return 16;
218c2ecf20Sopenharmony_ci	case BCM6358_CPU_ID:
228c2ecf20Sopenharmony_ci	case BCM6368_CPU_ID:
238c2ecf20Sopenharmony_ci		return 38;
248c2ecf20Sopenharmony_ci	case BCM6362_CPU_ID:
258c2ecf20Sopenharmony_ci		return 48;
268c2ecf20Sopenharmony_ci	case BCM6348_CPU_ID:
278c2ecf20Sopenharmony_ci	default:
288c2ecf20Sopenharmony_ci		return 37;
298c2ecf20Sopenharmony_ci	}
308c2ecf20Sopenharmony_ci}
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define BCM63XX_GPIO_DIR_OUT	0x0
338c2ecf20Sopenharmony_ci#define BCM63XX_GPIO_DIR_IN	0x1
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#endif /* !BCM63XX_GPIO_H */
36