Skip to content

Commit a323a41

Browse files
mnkpgalak
authored andcommitted
sensor: qdec_sam: use compatible atmel,sam-tc-qdec
Change the drivers's compatible from atmel,sam-tc to atmel,sam-tc-qdec. The atmel,sam-tc should be reserved for the future counter driver. Signed-off-by: Piotr Mienkowski <[email protected]>
1 parent 80ad300 commit a323a41

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

drivers/sensor/qdec_sam/qdec_sam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#define DT_DRV_COMPAT atmel_sam_tc
7+
#define DT_DRV_COMPAT atmel_sam_tc_qdec
88

99
/** @file
1010
* @brief Atmel SAM MCU family Quadrature Decoder (QDEC/TC) driver.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
description: Atmel SAM Timer Counter (TC) QDEC node
4+
5+
compatible: "atmel,sam-tc-qdec"
6+
7+
include: base.yaml
8+
9+
properties:
10+
reg:
11+
required: true
12+
13+
interrupts:
14+
required: true
15+
16+
label:
17+
required: true
18+
19+
peripheral-id:
20+
type: array
21+
description: peripheral ID
22+
required: true
23+
24+
pinctrl-0:
25+
type: phandles
26+
required: false
27+
description: |
28+
PIO pin configuration for Timer Counter signals. We expect that
29+
the phandles will reference pinctrl nodes. These nodes will
30+
have a nodelabel that matches the Atmel SoC HAL defines and
31+
be of the form p<port><pin><periph>_<inst>_<signal>.
32+
33+
In Quadrature Decoder mode TIOA0 & TIOB0 signals are expected
34+
35+
For example the TC0 on SAME7x would be
36+
pinctrl-0 = <&pa0b_tc0_tioa0 &pa1b_tc0_tiob0>;

samples/sensor/qdec/boards/sam_e70_xplained.overlay

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
&tc0 {
8+
compatible = "atmel,sam-tc-qdec";
89
status = "okay";
910
pinctrl-0 = <&pa0b_tc0_tioa0 &pa1b_tc0_tiob0>;
1011
label = "QDEC_0";

0 commit comments

Comments
 (0)