xiaoxiang781216 commented on code in PR #13107:
URL: https://github.com/apache/nuttx/pull/13107#discussion_r1729909125


##########
drivers/audio/es8311.c:
##########
@@ -865,11 +863,11 @@ static int es8311_getcaps(FAR struct audio_lowerhalf_s 
*dev, int type,
           {
               /* Report supported input sample rates */
 
-              ptr  = (uint16_t *)caps->ac_controls.b;
-              *ptr =
+              caps->ac_controls.hw[0] =
                 AUDIO_SAMP_RATE_11K | AUDIO_SAMP_RATE_16K |
                 AUDIO_SAMP_RATE_22K | AUDIO_SAMP_RATE_32K |
                 AUDIO_SAMP_RATE_44K | AUDIO_SAMP_RATE_48K;
+              caps->ac_controls.hw[1] = 0;

Review Comment:
   why add



##########
arch/arm/src/cxd56xx/cxd56_nxaudio.c:
##########
@@ -2654,8 +2652,8 @@ static int cxd56_getcaps(struct audio_lowerhalf_s *lower, 
int type,
 
               /* Report supported input sample rates */
 
-              ptr  = (uint16_t *)caps->ac_controls.b;
-              *ptr = CXD56_SUPP_RATES_L;
+              caps->ac_controls.hw[0] = CXD56_SUPP_RATES_L;
+              caps->ac_controls.hw[1] = CXD56_SUPP_RATES_H;

Review Comment:
   ditto



##########
drivers/audio/es8311.c:
##########
@@ -847,11 +845,11 @@ static int es8311_getcaps(FAR struct audio_lowerhalf_s 
*dev, int type,
 
               /* 8kHz is hardware dependent */
 
-              ptr  = (uint16_t *)caps->ac_controls.b;
-              *ptr =
+              caps->ac_controls.hw[0] =
                 AUDIO_SAMP_RATE_11K | AUDIO_SAMP_RATE_16K |
                 AUDIO_SAMP_RATE_22K | AUDIO_SAMP_RATE_32K |
                 AUDIO_SAMP_RATE_44K | AUDIO_SAMP_RATE_48K;
+              caps->ac_controls.hw[1] = 0;

Review Comment:
   ditto



##########
drivers/audio/vs1053.c:
##########
@@ -649,14 +647,13 @@ static int vs1053_getcaps(FAR struct audio_lowerhalf_s 
*lower, int type,
 
               /* Report the Sample rates we support */
 
-              ptr  = (uint16_t *)caps->ac_controls.b;
-              *ptr = AUDIO_SAMP_RATE_8K  |
-                     AUDIO_SAMP_RATE_11K |
-                     AUDIO_SAMP_RATE_16K |
-                     AUDIO_SAMP_RATE_22K |
-                     AUDIO_SAMP_RATE_32K |
-                     AUDIO_SAMP_RATE_44K |
-                     AUDIO_SAMP_RATE_48K;
+              caps->ac_controls.hw[0] = AUDIO_SAMP_RATE_8K  |
+                                       AUDIO_SAMP_RATE_11K |

Review Comment:
   align



##########
arch/arm/src/cxd56xx/cxd56_nxaudio.c:
##########
@@ -2633,8 +2631,8 @@ static int cxd56_getcaps(struct audio_lowerhalf_s *lower, 
int type,
 
               /* Report supported output sample rates */
 
-              ptr  = (uint16_t *)caps->ac_controls.b;
-              *ptr = CXD56_SUPP_RATES_L;
+              caps->ac_controls.hw[0] = CXD56_SUPP_RATES_L;
+              caps->ac_controls.hw[1] = CXD56_SUPP_RATES_H;

Review Comment:
   CXD56_SUPP_RATES_L and CXD56_SUPP_RATES_H into CXD56_SUPP_RATES



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to