Skip to content
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
2 changes: 1 addition & 1 deletion drivers/smbus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ config SMBUS_STATS

config SMBUS_INIT_PRIORITY
int "Init priority"
default KERNEL_INIT_PRIORITY_DEFAULT
default KERNEL_INIT_PRIORITY_DEVICE
help
SMBus device driver initialization priority.

Expand Down
4 changes: 2 additions & 2 deletions drivers/smbus/smbus_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ static int smbus_stm32_pcall(const struct device *dev, uint16_t periph_addr, uin
.flags = I2C_MSG_WRITE,
},
{
.buf = &send_word,
.buf = (uint8_t *)&send_word,
.len = sizeof(send_word),
.flags = I2C_MSG_WRITE,
},
{
.buf = recv_word,
.buf = (uint8_t *)recv_word,
.len = sizeof(*recv_word),
.flags = I2C_MSG_READ | I2C_MSG_RESTART,
},
Expand Down
8 changes: 8 additions & 0 deletions tests/drivers/build_all/smbus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(build_all)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
1 change: 1 addition & 0 deletions tests/drivers/build_all/smbus/boards/nucleo_g071rb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_I2C=y
13 changes: 13 additions & 0 deletions tests/drivers/build_all/smbus/boards/nucleo_g071rb.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
* SPDX-License-Identifier: Apache-2.0
*/

&i2c1 {
status = "okay";
};

&smbus1 {
i2c = <&i2c1>;
status = "okay";
};
3 changes: 3 additions & 0 deletions tests/drivers/build_all/smbus/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_TEST=y
CONFIG_TEST_USERSPACE=y
CONFIG_SMBUS=y
9 changes: 9 additions & 0 deletions tests/drivers/build_all/smbus/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
* SPDX-License-Identifier: Apache-2.0
*/

int main(void)
{
return 0;
}
10 changes: 10 additions & 0 deletions tests/drivers/build_all/smbus/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
common:
build_only: true
tags:
- drivers
- i2c
- smbus
tests:
drivers.smbus.build.stm32:
platform_allow:
- nucleo_g071rb
Loading