-
Notifications
You must be signed in to change notification settings - Fork 8k
drivers: smbus: stm32: support packet-error-checking (pec) #96691
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -28,6 +28,14 @@ config SMBUS_INIT_PRIORITY | |||
help | ||||
SMBus device driver initialization priority. | ||||
|
||||
config SMBUS_SOFT_PEC | ||||
bool "SMBus software PEC support" | ||||
select CRC | ||||
help | ||||
Enable software Packet Error Checking (PEC) support. | ||||
|
||||
These generic functions can be used by SMBus drivers for transceivers that do not support | ||||
PEC in hardware. | ||||
|
||||
module = SMBUS | ||||
module-str = smbus | ||||
|
@@ -83,6 +91,7 @@ menuconfig SMBUS_STM32 | |||
depends on DT_HAS_ST_STM32_SMBUS_ENABLED | ||||
depends on I2C_STM32 | ||||
select PINCTRL | ||||
select SMBUS_SOFT_PEC | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose there are two ways to look at this:
With the select here it is more the latter one, although it should actually be the first one? But this then would also mean that everything has to be ifdef-ed in the driver itself, so I'm not sure if it is actually a good idea. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Slowly I start to understand it, you actually need this config-flag so that the utility functions for PEC (which themselves require CRC) are only pulled in when necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
"Should" is potentially debatable. E.g. zephyr/drivers/smbus/intel_pch_smbus.c Line 332 in d3e645e
The stm32 driver is the only other smbus driver in-tree. It's almost completely platform-independent, actually, with the exception of Personally, I would feel better if there was a uniform API, so that PEC can at least be configured by the application, but it isn't disabled by default here (the Zephyr convention), so I can see your point.
I'm ok to go either way. @benediktibk , @erwango , @etienne-lms - do you have preferences? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'd go for |
||||
help | ||||
Enable STM32 SMBus driver. | ||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this option configurable by the project? It seems rather a driver private config.
... hmmm, i see at least the test sample needs to enable it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's configurable by the project. Technically could be used by any driver or other code.