Skip to content

Commit c09ab2f

Browse files
boards: shields: mikroe_mcp251xfd_click: rearrange dts and use macros
Rearrange the devicetree overlays for the MikroElektronika MCP251xFD shields to better align with node and property order used in the rest of the tree. Use "can" as devicetree node name as recommended in the Devicetree specification. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
1 parent 2517803 commit c09ab2f

File tree

3 files changed

+42
-36
lines changed

3 files changed

+42
-36
lines changed

‎boards/shields/mikroe_mcp251xfd_click/mikroe_mcp2517fd_click.overlay‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/dt-bindings/gpio/gpio.h>
8+
#include <freq.h>
9+
10+
/ {
11+
chosen {
12+
zephyr,canbus = &mcp2517fd_mikroe_mcp2517fd_click;
13+
};
14+
};
15+
716
&mikrobus_spi {
817
cs-gpios = <&mikrobus_header 2 GPIO_ACTIVE_LOW>;
918

10-
mcp2517fd_mikroe_mcp2517fd_click: mcp2517fd@0 {
19+
mcp2517fd_mikroe_mcp2517fd_click: can@0 {
1120
compatible = "microchip,mcp251xfd";
12-
status = "okay";
13-
14-
spi-max-frequency = <18000000>;
15-
int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>;
1621
reg = <0x0>;
17-
osc-freq = <40000000>;
18-
};
19-
};
20-
21-
/ {
22-
chosen {
23-
zephyr,canbus = &mcp2517fd_mikroe_mcp2517fd_click;
22+
spi-max-frequency = <DT_FREQ_M(18)>;
23+
osc-freq = <DT_FREQ_M(40)>;
24+
int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>;
25+
status = "okay";
2426
};
2527
};

‎boards/shields/mikroe_mcp251xfd_click/mikroe_mcp251863_click.overlay‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/dt-bindings/gpio/gpio.h>
8+
#include <freq.h>
9+
10+
/ {
11+
chosen {
12+
zephyr,canbus = &mcp251863_mikroe_mcp251863_click;
13+
};
14+
};
15+
716
&mikrobus_spi {
817
cs-gpios = <&mikrobus_header 2 GPIO_ACTIVE_LOW>;
918

10-
mcp251863_mikroe_mcp251863_click: mcp251863@0 {
19+
mcp251863_mikroe_mcp251863_click: can@0 {
1120
compatible = "microchip,mcp251xfd";
12-
status = "okay";
13-
14-
spi-max-frequency = <18000000>;
15-
int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>;
1621
reg = <0x0>;
17-
osc-freq = <40000000>;
18-
};
19-
};
20-
21-
/ {
22-
chosen {
23-
zephyr,canbus = &mcp251863_mikroe_mcp251863_click;
22+
spi-max-frequency = <DT_FREQ_M(18)>;
23+
osc-freq = <DT_FREQ_M(40)>;
24+
int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>;
25+
status = "okay";
2426
};
2527
};

‎boards/shields/mikroe_mcp251xfd_click/mikroe_mcp2518fd_click.overlay‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
#include <zephyr/dt-bindings/gpio/gpio.h>
7+
#include <freq.h>
8+
9+
/ {
10+
chosen {
11+
zephyr,canbus = &mcp2518fd_mikroe_mcp2518fd_click;
12+
};
13+
};
14+
615
&mikrobus_spi {
716
cs-gpios = <&mikrobus_header 2 GPIO_ACTIVE_LOW>;
817

9-
mcp2518fd_mikroe_mcp2518fd_click: mcp2518fd@0 {
18+
mcp2518fd_mikroe_mcp2518fd_click: can@0 {
1019
compatible = "microchip,mcp251xfd";
11-
status = "okay";
12-
13-
spi-max-frequency = <18000000>;
14-
int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>;
1520
reg = <0x0>;
16-
osc-freq = <40000000>;
17-
};
18-
};
19-
20-
/ {
21-
chosen {
22-
zephyr,canbus = &mcp2518fd_mikroe_mcp2518fd_click;
21+
spi-max-frequency = <DT_FREQ_M(18)>;
22+
osc-freq = <DT_FREQ_M(40)>;
23+
int-gpios = <&mikrobus_header 7 GPIO_ACTIVE_LOW>;
24+
status = "okay";
2325
};
2426
};

0 commit comments

Comments
 (0)