-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
overlays: spi-rtc: Add ds3232 and ds3234
Extend the spi-rtc overlay to support the ds3232 and ds3234 RTCs, as well as adding parameters to select difference SPI controllers and chip selects. N.B. The default CS is now active-low - use the "cs_high" parameter to override this. Signed-off-by: Phil Elwell <[email protected]>
- Loading branch information
Showing
2 changed files
with
61 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,75 @@ | ||
// Definitions for several SPI-based Real Time Clocks | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "brcm,bcm2835"; | ||
|
||
fragment@0 { | ||
target = <&spidev0>; | ||
target = <&rtc>; | ||
__dormant__ { | ||
status = "disabled"; | ||
compatible = "maxim,ds3232"; | ||
}; | ||
}; | ||
|
||
fragment@1 { | ||
target = <&spi0>; | ||
target = <&rtc>; | ||
__dormant__ { | ||
compatible = "maxim,ds3234"; | ||
}; | ||
}; | ||
|
||
fragment@2 { | ||
target = <&rtc>; | ||
__dormant__ { | ||
compatible = "nxp,rtc-pcf2123"; | ||
}; | ||
}; | ||
|
||
spidev: fragment@100 { | ||
target = <&spidev0>; | ||
__overlay__ { | ||
status = "disabled"; | ||
}; | ||
}; | ||
|
||
frag101: fragment@101 { | ||
target = <&spi0>; | ||
__overlay__ { | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
status = "okay"; | ||
|
||
rtc-pcf2123@0 { | ||
compatible = "nxp,rtc-pcf2123"; | ||
spi-max-frequency = <5000000>; | ||
spi-cs-high = <1>; | ||
rtc: rtc@0 { | ||
reg = <0>; | ||
spi-max-frequency = <5000000>; | ||
}; | ||
}; | ||
}; | ||
|
||
__overrides__ { | ||
pcf2123 = <0>, "=0=1"; | ||
spi0_0 = <&spidev>, "target:0=",<&spidev0>, | ||
<&frag101>, "target:0=",<&spi0>, | ||
<&rtc>, "reg:0=0"; | ||
spi0_1 = <&spidev>, "target:0=",<&spidev1>, | ||
<&frag101>, "target:0=",<&spi0>, | ||
<&rtc>, "reg:0=1"; | ||
spi1_0 = <0>,"-100", | ||
<&frag101>, "target:0=",<&spi1>, | ||
<&rtc>, "reg:0=0"; | ||
spi1_1 = <0>,"-100", | ||
<&frag101>, "target:0=",<&spi1>, | ||
<&rtc>, "reg:0=1"; | ||
spi2_0 = <0>,"-100", | ||
<&frag101>, "target:0=",<&spi2>, | ||
<&rtc>, "reg:0=0"; | ||
spi2_1 = <0>,"-100", | ||
<&frag101>, "target:0=",<&spi2>, | ||
<&rtc>, "reg:0=1"; | ||
cs_high = <&rtc>, "spi-cs-high?"; | ||
|
||
ds3232 = <0>,"+0"; | ||
ds3234 = <0>,"+1"; | ||
pcf2123 = <0>,"+2"; | ||
}; | ||
}; |