-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: sensor: Fix TMAG5273/TMAG3001 by adding a TMAG3001 compatible
Fixes issue introduced in #76460 The previous code attempted to detect whether TMAG5273 or TMAG3001 was connected based on DEVICE ID register. This doesn't work as the bits that denote the version on one part are undefined on the other part, and cannot be relied on to be zero. This commit adds a TMAG3001 compatible which (for now) is just derived from the TMAG5273 compatible. This allows TMAG3001 to be specified directly in the DT. The driver code is updated to support both compatibles. Signed-off-by: Yiding Jia <[email protected]>
- Loading branch information
Showing
6 changed files
with
99 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
description: | | ||
TMAG3001 Low-Power 3D Linear and Angle Hall-Effect Sensor With I2C Interface | ||
and Wake Up Detection in WCSP. | ||
See the specification for the default I2C address. | ||
The specification of the sensor can be found at: | ||
https://www.ti.com/lit/ds/symlink/tmag3001.pdf | ||
Currently, this driver shares implementation with tmag5273. When setting the | ||
enum properties in a .dts or .dtsi file you may include | ||
`zephyr/dt-bindings/sensor/tmag5273.h` and use the macros defined there. | ||
compatible: "ti,tmag3001" | ||
|
||
include: ["ti,tmag5273.yaml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters