2017-04-05 18:56:59 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Christian Taedcke
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <init.h>
|
2018-11-01 02:19:38 +01:00
|
|
|
#include "board.h"
|
2019-06-25 21:53:52 +02:00
|
|
|
#include <drivers/gpio.h>
|
2019-06-26 16:33:49 +02:00
|
|
|
#include <sys/printk.h>
|
2017-04-05 18:56:59 +02:00
|
|
|
|
|
|
|
static int efm32wg_stk3800_init(struct device *dev)
|
|
|
|
{
|
|
|
|
struct device *bce_dev; /* Board Controller Enable Gpio Device */
|
|
|
|
|
|
|
|
ARG_UNUSED(dev);
|
|
|
|
|
|
|
|
/* Enable the board controller to be able to use the serial port */
|
|
|
|
bce_dev = device_get_binding(BC_ENABLE_GPIO_NAME);
|
|
|
|
|
|
|
|
if (!bce_dev) {
|
|
|
|
printk("Board controller gpio port was not found!\n");
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
2019-01-29 00:30:28 +01:00
|
|
|
gpio_pin_configure(bce_dev, BC_ENABLE_GPIO_PIN, GPIO_OUTPUT_HIGH);
|
2017-04-05 18:56:59 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* needs to be done after GPIO driver init */
|
|
|
|
SYS_INIT(efm32wg_stk3800_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY);
|