-
Notifications
You must be signed in to change notification settings - Fork 6.8k
/
pinmux.c
55 lines (43 loc) · 1.43 KB
/
pinmux.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel.h>
#include <init.h>
#include <drivers/pinmux.h>
#include "iomux.h"
/*
* :::::::::::: NOTE ::::::::::::
* For a list of possible I/O MUX settings,
* See soc/xtensa/intel_s1000/iomux.h
*/
/*
* Initializes the I/O MUX with the setting needed per Intel S1000 CRB
* For customizations, please refer to the table above for available settings
* Please note that a call to pinmux_pin_set is only needed when a setting
* that is not default is required
*/
static int intel_s1000_pinmux_init(const struct device *dev)
{
const struct device *pinmux;
pinmux = DEVICE_DT_GET(DT_INST(0, intel_s1000_pinmux));
__ASSERT_NO_MSG(device_is_ready(pinmux));
if (pinmux == NULL) {
return -ENXIO;
}
/* Select PDM instead of I2S0 since board has 8 microphones */
pinmux_pin_set(pinmux, PIN_GROUP(I2S0), PINMUX_FUNC_B);
/*
* I2S3 is wired to the host interface connector.
* Select GPIO to avoid any conflict with hosts that may be driving
* the signals.
*/
pinmux_pin_set(pinmux, PIN_GROUP(I2S3), PINMUX_FUNC_B);
/* TI DAC is on I2C1. Usually, there is no device on I2C0 */
pinmux_pin_set(pinmux, PIN_GROUP(I2C), PINMUX_FUNC_B);
/* Intel S1000 CRB has an octal SPI flash. Select MST_DQ */
pinmux_pin_set(pinmux, PIN_GROUP(EM_DQ), PINMUX_FUNC_B);
return 0;
}
SYS_INIT(intel_s1000_pinmux_init, PRE_KERNEL_2, CONFIG_PINMUX_INIT_PRIORITY);