Skip to content

Commit d17a965

Browse files
ZhaoxiangJinnashif
authored andcommitted
boards: lpcxpresso55s36: enable hscmp for lpc55s36
enable hscmp for lpc55s36 Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
1 parent a62bf4b commit d17a965

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-0
lines changed

boards/nxp/lpcxpresso55s36/lpcxpresso55s36-pinctrl.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,12 @@
135135
nxp,analog-mode;
136136
};
137137
};
138+
139+
pinmux_hscmp0: pinmux_hscmp0 {
140+
group0 {
141+
pinmux = <HSCMP0_IN3_PIO1_5>;
142+
slew-rate = "standard";
143+
nxp,analog-mode;
144+
};
145+
};
138146
};

boards/nxp/lpcxpresso55s36/lpcxpresso55s36.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,9 @@ zephyr_udc0: &usbfs {
214214
pinctrl-0 = <&pinmux_opamp0>;
215215
pinctrl-names = "default";
216216
};
217+
218+
&hscmp0 {
219+
status = "okay";
220+
pinctrl-0 = <&pinmux_hscmp0>;
221+
pinctrl-names = "default";
222+
};

boards/nxp/lpcxpresso55s36/lpcxpresso55s36.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ supported:
2323
- pwm
2424
- usb_device
2525
- usbd
26+
- comparator
2627
vendor: nxp

dts/arm/nxp/nxp_lpc55S3x_common.dtsi

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,36 @@
312312
clocks = <&syscon MCUX_LPADC1_CLK>;
313313
};
314314

315+
hscmp0: comparator@b3000 {
316+
compatible = "nxp,hscmp";
317+
reg = <0xb3000 0x1000>;
318+
interrupts = <77 0>;
319+
clocks = <&syscon MCUX_HSCMP0_CLK>;
320+
resets = <&reset NXP_SYSCON_RESET(3, 15)>;
321+
status = "disabled";
322+
nxp,references = <&vref0 1800>;
323+
};
324+
325+
hscmp1: comparator@b7000 {
326+
compatible = "nxp,hscmp";
327+
reg = <0xb7000 0x1000>;
328+
interrupts = <78 0>;
329+
clocks = <&syscon MCUX_HSCMP1_CLK>;
330+
resets = <&reset NXP_SYSCON_RESET(3, 16)>;
331+
status = "disabled";
332+
nxp,references = <&vref0 1800>;
333+
};
334+
335+
hscmp2: comparator@ba000 {
336+
compatible = "nxp,hscmp";
337+
reg = <0xba000 0x1000>;
338+
interrupts = <79 0>;
339+
clocks = <&syscon MCUX_HSCMP2_CLK>;
340+
resets = <&reset NXP_SYSCON_RESET(3, 17)>;
341+
status = "disabled";
342+
nxp,references = <&vref0 1800>;
343+
};
344+
315345
opamp0: opamp@b4000 {
316346
compatible = "nxp,opamp";
317347
reg = <0xb4000 0x1000>;

soc/nxp/lpc/lpc55xxx/soc.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,27 @@ DT_FOREACH_STATUS_OKAY(nxp_ctimer_pwm, CTIMER_CLOCK_SETUP)
444444
SYSCON->MCLKDIV = SYSCON_MCLKDIV_DIV(0U);
445445
SYSCON->MCLKIO = 1U;
446446
#endif /* CONFIG_AUDIO_CODEC_WM8904 */
447+
448+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(hscmp0))
449+
POWER_DisablePD(kPDRUNCFG_PD_VREF);
450+
POWER_DisablePD(kPDRUNCFG_PD_CMPBIAS);
451+
POWER_DisablePD(kPDRUNCFG_PD_HSCMP0);
452+
POWER_DisablePD(kPDRUNCFG_PD_HSCMP0_DAC);
453+
#endif
454+
455+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(hscmp1))
456+
POWER_DisablePD(kPDRUNCFG_PD_VREF);
457+
POWER_DisablePD(kPDRUNCFG_PD_CMPBIAS);
458+
POWER_DisablePD(kPDRUNCFG_PD_HSCMP1);
459+
POWER_DisablePD(kPDRUNCFG_PD_HSCMP1_DAC);
460+
#endif
461+
462+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(hscmp2))
463+
POWER_DisablePD(kPDRUNCFG_PD_VREF);
464+
POWER_DisablePD(kPDRUNCFG_PD_CMPBIAS);
465+
POWER_DisablePD(kPDRUNCFG_PD_HSCMP2);
466+
POWER_DisablePD(kPDRUNCFG_PD_HSCMP2_DAC);
467+
#endif
447468
}
448469

449470
/**

0 commit comments

Comments
 (0)