Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: i3c: npcm4xx: move header files to driver layer #75

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions boards/arm/npcm400f_evb/npcm400f_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
};

&i3c0 {
status = "disabled";
status = "okay";
assigned-address = <0x20>;
i2c-scl-hz = <100000>;
i3c-scl-hz = <12500000>;
Expand All @@ -188,7 +188,7 @@
};

&i3c1 {
status = "disabled";
status = "okay";
assigned-address = <0x21>;
i2c-scl-hz = <100000>;
i3c-scl-hz = <12500000>;
Expand Down
6 changes: 4 additions & 2 deletions boards/arm/npcm400f_evb/npcm400f_evb_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ CONFIG_SPI=y
CONFIG_SPIP_NPCM4XX=y

# I3C driver
#CONFIG_I3C=y
#CONFIG_I3C_NPCM4XX=y
CONFIG_I3C=y
CONFIG_I3C_NPCM4XX=y
CONFIG_I3C_SLAVE=y
CONFIG_I3C_SLAVE_MQUEUE=y

# USB Driver
CONFIG_USB=y
Expand Down
15 changes: 10 additions & 5 deletions drivers/i3c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
zephyr_library()

zephyr_library_sources(i3c_common.c)
add_subdirectory_ifdef(CONFIG_I3C_SLAVE slave)

#zephyr_library_sources_ifdef(CONFIG_I3C_ASPEED i3c_global_aspeed.c)
#zephyr_library_sources_ifdef(CONFIG_I3C_ASPEED i3c_aspeed.c)
zephyr_library_sources_ifdef(CONFIG_I3C_ASPEED i3c_global_aspeed.c)
zephyr_library_sources_ifdef(CONFIG_I3C_ASPEED i3c_aspeed.c)

add_subdirectory_ifdef(CONFIG_I3C_NPCM4XX NPCM4XX)
add_subdirectory_ifdef(CONFIG_I3C_SLAVE slave)
zephyr_library_sources_ifdef(CONFIG_I3C_NPCM4XX i3c_npcm4xx.c)
zephyr_library_sources_ifdef(CONFIG_I3C_SHELL i3c_shell.c)
add_subdirectory_ifdef(CONFIG_I3C_NPCM4XX npcm4xx)
zephyr_include_directories_ifdef(
CONFIG_I3C_NPCM4XX
${ZEPHYR_BASE}/drivers/i3c/npcm4xx
)

zephyr_library_sources_ifdef(CONFIG_I3C_SHELL i3c_shell.c)
14 changes: 7 additions & 7 deletions drivers/i3c/i3c_npcm4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

#include <portability/cmsis_os2.h>

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_core.h>
#include <drivers/i3c/NPCM4XX/i3c_master.h>
#include <drivers/i3c/NPCM4XX/i3c_slave.h>
#include <drivers/i3c/NPCM4XX/hal_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_drv.h>
#include <drivers/i3c/NPCM4XX/api_i3c.h>
#include "pub_I3C.h"
#include "i3c_core.h"
#include "i3c_master.h"
#include "i3c_slave.h"
#include "hal_I3C.h"
#include "i3c_drv.h"
#include "api_i3c.h"

#include <stdlib.h>
#include <string.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX i3c_core.c)
zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX i3c_master.c)
zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX i3c_slave.c)
zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX api_i3c.c)
zephyr_sources_ifdef(CONFIG_I3C_NPCM4XX api_i3c.c)
12 changes: 6 additions & 6 deletions drivers/i3c/NPCM4XX/api_i3c.c → drivers/i3c/npcm4xx/api_i3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_core.h>
#include <drivers/i3c/NPCM4XX/i3c_master.h>
#include <drivers/i3c/NPCM4XX/i3c_slave.h>
#include <drivers/i3c/NPCM4XX/hal_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_drv.h>
#include "pub_I3C.h"
#include "i3c_core.h"
#include "i3c_master.h"
#include "i3c_slave.h"
#include "hal_I3C.h"
#include "i3c_drv.h"

extern I3C_BUS_INFO_t gBus[];
extern I3C_DEVICE_INFO_t gI3c_dev_node_internal[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef API_I3C_H
#define API_I3C_H

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include "pub_I3C.h"

#ifdef __cplusplus
extern "C"{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#ifndef __HAL_I3C_H__
#define __HAL_I3C_H__

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_drv.h>
#include "pub_I3C.h"
#include "i3c_drv.h"

#if (CHIP_ID_NPCM4XX == 5832)
/*#define I3C_PORT1_MODE I3C_DEVICE_MODE_CURRENT_MASTER*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_core.h>
#include <drivers/i3c/NPCM4XX/i3c_master.h>
#include <drivers/i3c/NPCM4XX/i3c_slave.h>
#include <drivers/i3c/NPCM4XX/hal_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_drv.h>
#include "pub_I3C.h"
#include "i3c_core.h"
#include "i3c_master.h"
#include "i3c_slave.h"
#include "hal_I3C.h"
#include "i3c_drv.h"

I3C_BUS_INFO_t gBus[I3C_BUS_COUNT_MAX] = {
{.busno = 0, .DevCount = 0, .pDevList = NULL, .pCurrentMaster = NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef __I3C_CORE_H__
#define __I3C_CORE_H__

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include "pub_I3C.h"

/*
* variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <portability/cmsis_os2.h>
#include <logging/log.h>

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include "pub_I3C.h"

#define DT_DRV_COMPAT nuvoton_npcm4xx_i3c

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* Copyright (c) 2023 Nuvoton Technology Corporation.
* SPDX-License-Identifier: Apache-2.0
*/
#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_core.h>
#include <drivers/i3c/NPCM4XX/i3c_master.h>
#include <drivers/i3c/NPCM4XX/i3c_slave.h>
#include <drivers/i3c/NPCM4XX/hal_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_drv.h>
#include "pub_I3C.h"
#include "i3c_core.h"
#include "i3c_master.h"
#include "i3c_slave.h"
#include "hal_I3C.h"
#include "i3c_drv.h"

LOG_MODULE_REGISTER(npcm4xx_i3c_master, CONFIG_I3C_LOG_LEVEL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef __I3C_MASTER_H__
#define __I3C_MASTER_H__

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include "pub_I3C.h"

#ifdef __cplusplus
extern "C"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_core.h>
#include <drivers/i3c/NPCM4XX/i3c_master.h>
#include <drivers/i3c/NPCM4XX/i3c_slave.h>
#include <drivers/i3c/NPCM4XX/hal_I3C.h>
#include <drivers/i3c/NPCM4XX/i3c_drv.h>
#include <drivers/i3c/NPCM4XX/api_i3c.h>
#include "pub_I3C.h"
#include "i3c_core.h"
#include "i3c_master.h"
#include "i3c_slave.h"
#include "hal_I3C.h"
#include "i3c_drv.h"
#include "api_i3c.h"

I3C_REG_ITEM_t *pSlaveReg[I3C_PORT_MAX] = {
NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef __I3C_SLAVE_H__
#define __I3C_SLAVE_H__

#include <drivers/i3c/NPCM4XX/pub_I3C.h>
#include "pub_I3C.h"

#ifdef __cplusplus
extern "C"
Expand Down
File renamed without changes.
Loading