diff options
author | Jon Eklund <jon.eklund@cirrus.com> | 2023-12-14 14:43:58 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-14 14:43:58 -0600 |
commit | acb8d88fb4a2af762020bcb70d30a21b0f891ef2 (patch) | |
tree | e1067f5a1e9580ccafb75c83b03fe3a8a2b77b61 /library/src/mipi_syst_api.c | |
parent | 370b5944c046bab043dd8b133727b2135af7747a (diff) | |
parent | 6bd53eeb32b1aea9b56d20b6ccc77e33f182f9b6 (diff) | |
download | mipisyst-main.zip mipisyst-main.tar.gz mipisyst-main.tar.bz2 |
Fixed catalog functions to correctly support 64bit arguments.
Diffstat (limited to 'library/src/mipi_syst_api.c')
-rw-r--r-- | library/src/mipi_syst_api.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/library/src/mipi_syst_api.c b/library/src/mipi_syst_api.c index ad1908d..13e3192 100644 --- a/library/src/mipi_syst_api.c +++ b/library/src/mipi_syst_api.c @@ -267,7 +267,7 @@ insert_optional_msg_components(struct mipi_syst_handle* svh, #endif #if defined(MIPI_SYST_PCFG_LENGTH_FIELD) - /* pay load length */ + /* payload length */ if(0 != desc->ed_tag.et_length) { desc->ed_len = len; *prog++ = scatter_ops[SCATTER_OP_LENGTH]; @@ -380,7 +380,7 @@ mipi_syst_write_catalog64_message(struct mipi_syst_handle* svh, #endif paramlen = (mipi_syst_u16) - (svh->systh_param_count * sizeof(mipi_syst_u32)); + (svh->systh_param_count * sizeof(mipi_syst_param)); insert_optional_msg_components( svh, loc, @@ -394,7 +394,7 @@ mipi_syst_write_catalog64_message(struct mipi_syst_handle* svh, /* parameters (if any) */ if (0 != paramlen) { - mipi_syst_u32 *param; + mipi_syst_param *param; param = svh->systh_param; desc.ed_pld.data_catid.param = param; *prog_ptr = scatter_ops[SCATTER_OP_CATID_ARGS]; @@ -402,9 +402,13 @@ mipi_syst_write_catalog64_message(struct mipi_syst_handle* svh, ++prog_ptr; #if defined(MIPI_SYST_BIG_ENDIAN) while(paramlen) { +#if defined(MIPI_SYST_PCFG_ENABLE_64BIT_ADDR) + *param = MIPI_SYST_HTOLE64(*param); +#else *param = MIPI_SYST_HTOLE32(*param); +#endif param++; - paramlen-=sizeof(mipi_syst_u32); + paramlen-=sizeof(mipi_syst_param); } #endif } @@ -453,7 +457,7 @@ mipi_syst_write_catalog32_message(struct mipi_syst_handle* svh, #endif paramlen = (mipi_syst_u16) - (svh->systh_param_count * sizeof(mipi_syst_u32)); + (svh->systh_param_count * sizeof(mipi_syst_param)); insert_optional_msg_components( svh, loc, @@ -467,7 +471,7 @@ mipi_syst_write_catalog32_message(struct mipi_syst_handle* svh, /* parameters (if any) */ if (0 != paramlen) { - mipi_syst_u32 * param; + mipi_syst_param * param; param = svh->systh_param; desc.ed_pld.data_catid.param = param; *prog_ptr = scatter_ops[SCATTER_OP_CATID_ARGS]; @@ -475,9 +479,13 @@ mipi_syst_write_catalog32_message(struct mipi_syst_handle* svh, ++prog_ptr; #if defined(MIPI_SYST_BIG_ENDIAN) while(paramlen) { +#if defined(MIPI_SYST_PCFG_ENABLE_64BIT_ADDR) + *param = MIPI_SYST_HTOLE64(*param); +#else *param = MIPI_SYST_HTOLE32(*param); +#endif param++; - paramlen-=sizeof(mipi_syst_u32); + paramlen-=sizeof(mipi_syst_param); } #endif } |