zephyr/boards/arm/twr_kv58f220m/pinmux.c
Kumar Gala 6b8fa2a85e arm: nxp: kinetis: Remove explicity setting of pincfg to GPIO
Remove board code and a few associated samples/tests that explicitly
call pinmux_pin_set() to set a given pin as GPIO.  This is handled as
part of gpio_mcux_configure() so we don't need to do it again.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-15 12:25:05 +02:00

58 lines
1.6 KiB
C

/*
* Copyright (c) 2019 SEAL AG
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <init.h>
#include <drivers/pinmux.h>
#include <fsl_port.h>
static int twr_kv58f220m_pinmux_init(const struct device *dev)
{
ARG_UNUSED(dev);
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porta), okay)
__unused const struct device *porta =
DEVICE_DT_GET(DT_NODELABEL(porta));
__ASSERT_NO_MSG(device_is_ready(porta));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portb), okay)
__unused const struct device *portb =
DEVICE_DT_GET(DT_NODELABEL(portb));
__ASSERT_NO_MSG(device_is_ready(portb));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portc), okay)
__unused const struct device *portc =
DEVICE_DT_GET(DT_NODELABEL(portc));
__ASSERT_NO_MSG(device_is_ready(portc));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(portd), okay)
__unused const struct device *portd =
DEVICE_DT_GET(DT_NODELABEL(portd));
__ASSERT_NO_MSG(device_is_ready(portd));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(porte), okay)
__unused const struct device *porte =
DEVICE_DT_GET(DT_NODELABEL(porte));
__ASSERT_NO_MSG(device_is_ready(porte));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c1), okay) && CONFIG_I2C
/* I2C1 SCL, SDA */
pinmux_pin_set(portd, 8, PORT_PCR_MUX(kPORT_MuxAlt2)
| PORT_PCR_ODE_MASK);
pinmux_pin_set(portd, 9, PORT_PCR_MUX(kPORT_MuxAlt2)
| PORT_PCR_ODE_MASK);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(uart0), okay) && CONFIG_SERIAL
/* UART0 RX, TX */
pinmux_pin_set(portb, 0, PORT_PCR_MUX(kPORT_MuxAlt7));
pinmux_pin_set(portb, 1, PORT_PCR_MUX(kPORT_MuxAlt7));
#endif
return 0;
}
SYS_INIT(twr_kv58f220m_pinmux_init, PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY);