Skip to content

Commit dd9b2ca

Browse files
drivers: counter: Fix TPM_CONTROLS_COUNT undefined issue.
Maximus channel number can be indicated by the number of controls and status register. For sdk-ng, it's defined by macro TPM_CONTROLS_COUNT. For some devices using legacy sdk, use TPM_CnSC_COUNT instead. Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
1 parent 40f07a0 commit dd9b2ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/counter/counter_mcux_tpm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ struct mcux_tpm_data {
4141
DEVICE_MMIO_NAMED_RAM(tpm_mmio);
4242
counter_top_callback_t top_callback;
4343
uint32_t freq;
44+
#ifdef TPM_CONTROLS_COUNT
4445
struct mcux_tpm_channel_data channels[TPM_CONTROLS_COUNT];
46+
#elif defined(TPM_CnSC_COUNT)
47+
struct mcux_tpm_channel_data channels[TPM_CnSC_COUNT];
48+
#else
49+
#error "Neither TPM_CONTROLS_COUNT nor TPM_CnSC_COUNT is defined."
50+
#endif
4551
void *top_user_data;
4652
};
4753

0 commit comments

Comments
 (0)