1 /*
2  * Copyright (c) 2022 Vaishnav Achath
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #define DT_DRV_COMPAT ti_cc13xx_cc26xx_pinctrl
8 
9 #include <zephyr/drivers/pinctrl.h>
10 
pinctrl_c13xx_cc26xx_set(uint32_t pin,uint32_t func,uint32_t mode)11 static int pinctrl_c13xx_cc26xx_set(uint32_t pin, uint32_t func, uint32_t mode)
12 {
13 	if (pin >= NUM_IO_MAX || func >= NUM_IO_PORTS) {
14 		return -EINVAL;
15 	}
16 
17 	IOCPortConfigureSet(pin, func, mode);
18 
19 	return 0;
20 }
21 
pinctrl_configure_pins(const pinctrl_soc_pin_t * pins,uint8_t pin_cnt,uintptr_t reg)22 int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg)
23 {
24 	ARG_UNUSED(reg);
25 
26 	for (uint8_t i = 0U; i < pin_cnt; i++) {
27 		pinctrl_c13xx_cc26xx_set(pins[i].pin, pins[i].iofunc, pins[i].iomode);
28 	}
29 
30 	return 0;
31 }
32