drivers: pinmux: mcux: drop driver
Drop the MCUX driver in favor of Kinetis pinctrl driver. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
099012a59f
commit
9ca624eb13
|
@ -46,7 +46,6 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
|
||||||
* and handles clock init. Only bind to these nodes if pinmux driver
|
* and handles clock init. Only bind to these nodes if pinmux driver
|
||||||
* is disabled.
|
* is disabled.
|
||||||
*/
|
*/
|
||||||
#ifndef CONFIG_PINMUX
|
|
||||||
static int pinctrl_mcux_init(const struct device *dev)
|
static int pinctrl_mcux_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
const struct pinctrl_mcux_config *config = dev->config;
|
const struct pinctrl_mcux_config *config = dev->config;
|
||||||
|
@ -79,4 +78,3 @@ static int pinctrl_mcux_init(const struct device *dev)
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
DT_INST_FOREACH_STATUS_OKAY(PINCTRL_MCUX_INIT)
|
DT_INST_FOREACH_STATUS_OKAY(PINCTRL_MCUX_INIT)
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
# Board initialization
|
# Board initialization
|
||||||
zephyr_sources_ifdef(CONFIG_PINMUX_MCUX pinmux_mcux.c)
|
|
||||||
zephyr_sources_ifdef(CONFIG_PINMUX_XEC pinmux_mchp_xec.c)
|
zephyr_sources_ifdef(CONFIG_PINMUX_XEC pinmux_mchp_xec.c)
|
||||||
|
|
|
@ -24,8 +24,6 @@ config PINMUX_INIT_PRIORITY
|
||||||
rule for particular boards. Don't change this value unless you
|
rule for particular boards. Don't change this value unless you
|
||||||
know what you are doing.
|
know what you are doing.
|
||||||
|
|
||||||
source "drivers/pinmux/Kconfig.mcux"
|
|
||||||
|
|
||||||
source "drivers/pinmux/Kconfig.xec"
|
source "drivers/pinmux/Kconfig.xec"
|
||||||
|
|
||||||
endif # PINMUX
|
endif # PINMUX
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
# MCUXpresso SDK pinmux
|
|
||||||
|
|
||||||
# Copyright (c) 2016, Freescale Semiconductor, Inc.
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
config PINMUX_MCUX
|
|
||||||
bool "MCUX pinmux driver"
|
|
||||||
depends on HAS_MCUX
|
|
||||||
help
|
|
||||||
Enable the MCUX pinmux driver.
|
|
|
@ -1,93 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Freescale Semiconductor, Inc.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define DT_DRV_COMPAT nxp_kinetis_pinmux
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <zephyr/device.h>
|
|
||||||
#include <zephyr/drivers/pinmux.h>
|
|
||||||
#include <fsl_common.h>
|
|
||||||
#include <fsl_clock.h>
|
|
||||||
|
|
||||||
struct pinmux_mcux_config {
|
|
||||||
clock_ip_name_t clock_ip_name;
|
|
||||||
PORT_Type *base;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int pinmux_mcux_set(const struct device *dev, uint32_t pin,
|
|
||||||
uint32_t func)
|
|
||||||
{
|
|
||||||
const struct pinmux_mcux_config *config = dev->config;
|
|
||||||
PORT_Type *base = config->base;
|
|
||||||
|
|
||||||
base->PCR[pin] = func;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int pinmux_mcux_get(const struct device *dev, uint32_t pin,
|
|
||||||
uint32_t *func)
|
|
||||||
{
|
|
||||||
const struct pinmux_mcux_config *config = dev->config;
|
|
||||||
PORT_Type *base = config->base;
|
|
||||||
|
|
||||||
*func = base->PCR[pin];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int pinmux_mcux_pullup(const struct device *dev, uint32_t pin,
|
|
||||||
uint8_t func)
|
|
||||||
{
|
|
||||||
return -ENOTSUP;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int pinmux_mcux_input(const struct device *dev, uint32_t pin,
|
|
||||||
uint8_t func)
|
|
||||||
{
|
|
||||||
return -ENOTSUP;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int pinmux_mcux_init(const struct device *dev)
|
|
||||||
{
|
|
||||||
const struct pinmux_mcux_config *config = dev->config;
|
|
||||||
|
|
||||||
CLOCK_EnableClock(config->clock_ip_name);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct pinmux_driver_api pinmux_mcux_driver_api = {
|
|
||||||
.set = pinmux_mcux_set,
|
|
||||||
.get = pinmux_mcux_get,
|
|
||||||
.pullup = pinmux_mcux_pullup,
|
|
||||||
.input = pinmux_mcux_input,
|
|
||||||
};
|
|
||||||
|
|
||||||
#if DT_NODE_HAS_STATUS(DT_INST(0, nxp_kinetis_ke1xf_sim), okay)
|
|
||||||
#define INST_DT_CLOCK_IP_NAME(n) \
|
|
||||||
DT_REG_ADDR(DT_INST_PHANDLE(n, clocks)) + DT_INST_CLOCKS_CELL(n, name)
|
|
||||||
#else
|
|
||||||
#define INST_DT_CLOCK_IP_NAME(n) \
|
|
||||||
CLK_GATE_DEFINE(DT_INST_CLOCKS_CELL(n, offset), \
|
|
||||||
DT_INST_CLOCKS_CELL(n, bits))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PINMUX_MCUX_INIT(n) \
|
|
||||||
static const struct pinmux_mcux_config pinmux_mcux_##n##_config = {\
|
|
||||||
.base = (PORT_Type *)DT_INST_REG_ADDR(n), \
|
|
||||||
.clock_ip_name = INST_DT_CLOCK_IP_NAME(n), \
|
|
||||||
}; \
|
|
||||||
\
|
|
||||||
DEVICE_DT_INST_DEFINE(n, \
|
|
||||||
&pinmux_mcux_init, \
|
|
||||||
NULL, \
|
|
||||||
NULL, &pinmux_mcux_##n##_config, \
|
|
||||||
PRE_KERNEL_1, \
|
|
||||||
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
|
|
||||||
&pinmux_mcux_driver_api);
|
|
||||||
|
|
||||||
DT_INST_FOREACH_STATUS_OKAY(PINMUX_MCUX_INIT)
|
|
|
@ -13,13 +13,6 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||||
int
|
int
|
||||||
default 800000000
|
default 800000000
|
||||||
|
|
||||||
if PINMUX
|
|
||||||
|
|
||||||
config PINMUX_MCUX
|
|
||||||
default y
|
|
||||||
|
|
||||||
endif # PINMUX
|
|
||||||
|
|
||||||
config GPIO
|
config GPIO
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,6 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||||
int
|
int
|
||||||
default 400000000
|
default 400000000
|
||||||
|
|
||||||
if PINMUX
|
|
||||||
|
|
||||||
config PINMUX_MCUX
|
|
||||||
default y
|
|
||||||
|
|
||||||
endif # PINMUX
|
|
||||||
|
|
||||||
config IPM_IMX_REV2
|
config IPM_IMX_REV2
|
||||||
default y
|
default y
|
||||||
depends on IPM
|
depends on IPM
|
||||||
|
|
|
@ -13,13 +13,6 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
|
||||||
int
|
int
|
||||||
default 266000000
|
default 266000000
|
||||||
|
|
||||||
if PINMUX
|
|
||||||
|
|
||||||
config PINMUX_MCUX
|
|
||||||
default y
|
|
||||||
|
|
||||||
endif # PINMUX
|
|
||||||
|
|
||||||
config PINCTRL_IMX
|
config PINCTRL_IMX
|
||||||
default y if HAS_MCUX_IOMUXC
|
default y if HAS_MCUX_IOMUXC
|
||||||
depends on PINCTRL
|
depends on PINCTRL
|
||||||
|
|
Loading…
Reference in a new issue