File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
- # Copyright 2024 NXP
1
+ # Copyright 2024-2025 NXP
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
4
config DAI_NXP_ESAI
5
5
bool "NXP Enhanced Serial Audio Interface (ESAI) driver"
6
6
default y
7
7
depends on DT_HAS_NXP_DAI_ESAI_ENABLED
8
+ select PINCTRL
8
9
help
9
10
Select this to enable NXP ESAI driver.
Original file line number Diff line number Diff line change @@ -740,6 +740,12 @@ static int esai_init(const struct device *dev)
740
740
}
741
741
#endif /* CONFIG_PM_DEVICE_RUNTIME */
742
742
743
+ /* note: optional operation so -ENOENT is allowed */
744
+ ret = pinctrl_apply_state (cfg -> pincfg , PINCTRL_STATE_DEFAULT );
745
+ if (ret < 0 && ret != - ENOENT ) {
746
+ return ret ;
747
+ }
748
+
743
749
ret = esai_parse_pinmodes (cfg , data );
744
750
if (ret < 0 ) {
745
751
return ret ;
@@ -750,6 +756,8 @@ static int esai_init(const struct device *dev)
750
756
751
757
#define ESAI_INIT (inst ) \
752
758
\
759
+ PINCTRL_DT_INST_DEFINE(inst); \
760
+ \
753
761
BUILD_ASSERT(ESAI_TX_FIFO_WATERMARK(inst) >= 1 && \
754
762
ESAI_TX_FIFO_WATERMARK(inst) <= _ESAI_FIFO_DEPTH(inst), \
755
763
"invalid TX watermark value"); \
@@ -806,6 +814,7 @@ static struct esai_config esai_config_##inst = { \
806
814
.clock_cfg = clock_cfg_##inst, \
807
815
.clock_cfg_size = ARRAY_SIZE(clock_cfg_##inst), \
808
816
.clk_data = ESAI_CLOCK_DATA_DECLARE(inst), \
817
+ .pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \
809
818
}; \
810
819
\
811
820
static struct esai_data esai_data_##inst = { \
Original file line number Diff line number Diff line change 12
12
#include <zephyr/device.h>
13
13
#include <zephyr/dt-bindings/dai/esai.h>
14
14
#include <zephyr/drivers/clock_control.h>
15
+ #include <zephyr/drivers/pinctrl.h>
15
16
16
17
#include <fsl_esai.h>
17
18
@@ -218,6 +219,7 @@ struct esai_config {
218
219
uint32_t * clock_cfg ;
219
220
uint32_t clock_cfg_size ;
220
221
struct esai_clock_data clk_data ;
222
+ const struct pinctrl_dev_config * pincfg ;
221
223
};
222
224
223
225
/* this needs to perfectly match SOF's struct sof_ipc_dai_esai_params */
You can’t perform that action at this time.
0 commit comments