style/spell: fix spell checker error

To make checker happy:

arch/arm/src/sama5/sam_classd.c:997: nd ==> and, 2nd
arch/arm/src/sama5/sam_classd.c:1362: levl ==> level
drivers/sensors/apds9922.c:286: persistance ==> persistence

Signed-off-by: chao an <anchao.archer@bytedance.com>
This commit is contained in:
chao an
2025-10-16 10:52:00 +08:00
committed by Xiang Xiao
parent 87f134cfaa
commit a8af5f3d0e
3 changed files with 36 additions and 36 deletions

View File

@@ -911,7 +911,7 @@ void classd_dsp_clock_config(struct classd_dev_s *priv)
#ifdef CONFIG_CLASSD_REGDEBUG #ifdef CONFIG_CLASSD_REGDEBUG
/* double check clock settings */ /* double check clock settings */
uint32_t nd; uint32_t divider;
uint32_t fracr; uint32_t fracr;
uint32_t qdpmc; uint32_t qdpmc;
uint64_t clk = BOARD_MAINOSC_FREQUENCY; uint64_t clk = BOARD_MAINOSC_FREQUENCY;
@@ -990,11 +990,11 @@ void classd_dsp_clock_config(struct classd_dev_s *priv)
classd_dump_registers("After dsp clock setup"); classd_dump_registers("After dsp clock setup");
#ifdef CONFIG_CLASSD_REGDEBUG #ifdef CONFIG_CLASSD_REGDEBUG
nd = (pll0 & PMC_AUDIO_PLL0_ND_MASK) >> PMC_AUDIO_PLL0_ND_SHIFT; divider = (pll0 & PMC_AUDIO_PLL0_ND_MASK) >> PMC_AUDIO_PLL0_ND_SHIFT;
fracr = (pll1 & PMC_AUDIO_PLL1_FRACR_MASK) >> PMC_AUDIO_PLL1_FRACR_SHIFT; fracr = (pll1 & PMC_AUDIO_PLL1_FRACR_MASK) >> PMC_AUDIO_PLL1_FRACR_SHIFT;
qdpmc = (pll0 & PMC_AUDIO_PLL0_QDPMC_MASK) >> PMC_AUDIO_PLL0_QDPMC_SHIFT; qdpmc = (pll0 & PMC_AUDIO_PLL0_QDPMC_MASK) >> PMC_AUDIO_PLL0_QDPMC_SHIFT;
clk *= ((nd + 1) << 22) + fracr; clk *= ((divider + 1) << 22) + fracr;
clk /= 1 << 22; clk /= 1 << 22;
clk /= (qdpmc + 1); clk /= (qdpmc + 1);
clk /= 8; clk /= 8;
@@ -1359,8 +1359,8 @@ inline static uint8_t classd_get_atten(uint16_t volume, uint16_t balance)
static int classd_setvolume(struct classd_dev_s *priv, uint16_t vol) static int classd_setvolume(struct classd_dev_s *priv, uint16_t vol)
{ {
struct sam_classd_config_s *config; struct sam_classd_config_s *config;
uint32_t levl; uint32_t left;
uint32_t levr; uint32_t right;
uint32_t bal; uint32_t bal;
uint32_t regval; uint32_t regval;
@@ -1377,11 +1377,11 @@ static int classd_setvolume(struct classd_dev_s *priv, uint16_t vol)
/* Calculate the attenuation value to send to the peripheral */ /* Calculate the attenuation value to send to the peripheral */
#ifndef CONFIG_AUDIO_EXCLUDE_BALANCE #ifndef CONFIG_AUDIO_EXCLUDE_BALANCE
levl = classd_get_atten(vol, AUDIO_BALANCE_RIGHT - bal); left = classd_get_atten(vol, AUDIO_BALANCE_RIGHT - bal);
levr = classd_get_atten(vol, bal); right = classd_get_atten(vol, bal);
#else #else
levl = classd_get_atten(volume, AUDIO_BALANCE_CENTER); left = classd_get_atten(volume, AUDIO_BALANCE_CENTER);
levr = classd_get_atten(volume, AUDIO_BALANCE_CENTER); right = classd_get_atten(volume, AUDIO_BALANCE_CENTER);
#endif #endif
/* Set the volume */ /* Set the volume */
@@ -1389,8 +1389,8 @@ static int classd_setvolume(struct classd_dev_s *priv, uint16_t vol)
regval = classd_getreg(priv, SAM_CLASSD_INTPMR); regval = classd_getreg(priv, SAM_CLASSD_INTPMR);
regval &= ~CLASSD_INTPMR_ATTL_MASK; regval &= ~CLASSD_INTPMR_ATTL_MASK;
regval &= ~CLASSD_INTPMR_ATTR_MASK; regval &= ~CLASSD_INTPMR_ATTR_MASK;
regval |= CLASSD_VOL_LEFT(levl); regval |= CLASSD_VOL_LEFT(left);
regval |= CLASSD_VOL_RIGHT(levr); regval |= CLASSD_VOL_RIGHT(right);
classd_putreg(SAM_CLASSD_INTPMR, regval); classd_putreg(SAM_CLASSD_INTPMR, regval);

View File

@@ -282,8 +282,8 @@ static int apds9922_als_gain(FAR struct apds9922_dev_s *priv, uint8_t gain);
static int apds9922_autogain(FAR struct apds9922_dev_s *priv, bool enable); static int apds9922_autogain(FAR struct apds9922_dev_s *priv, bool enable);
static int apds9922_als_resolution(FAR struct apds9922_dev_s *priv, int res); static int apds9922_als_resolution(FAR struct apds9922_dev_s *priv, int res);
static int apds9922_als_rate(FAR struct apds9922_dev_s *priv, int rate); static int apds9922_als_rate(FAR struct apds9922_dev_s *priv, int rate);
static int apds9922_als_persistance(FAR struct apds9922_dev_s *priv, static int apds9922_als_persistence(FAR struct apds9922_dev_s *priv,
uint8_t persistance); uint8_t persistence);
static int apds9922_als_variance(FAR struct apds9922_dev_s *priv, static int apds9922_als_variance(FAR struct apds9922_dev_s *priv,
uint8_t variance); uint8_t variance);
static int apds9922_als_thresh(FAR struct apds9922_dev_s *priv, static int apds9922_als_thresh(FAR struct apds9922_dev_s *priv,
@@ -312,8 +312,8 @@ static int apds9922_ps_thresh(FAR struct apds9922_dev_s *priv,
static int apds9922_ps_canc_lev(FAR struct apds9922_dev_s *priv, static int apds9922_ps_canc_lev(FAR struct apds9922_dev_s *priv,
uint16_t lev); uint16_t lev);
static int apds9922_ps_int_mode(FAR struct apds9922_dev_s *priv, int mode); static int apds9922_ps_int_mode(FAR struct apds9922_dev_s *priv, int mode);
static int apds9922_ps_persistance(FAR struct apds9922_dev_s *priv, static int apds9922_ps_persistence(FAR struct apds9922_dev_s *priv,
uint8_t persistance); uint8_t persistence);
static int apds9922_ps_notify_mode(FAR struct apds9922_dev_s *priv, static int apds9922_ps_notify_mode(FAR struct apds9922_dev_s *priv,
int notify); int notify);
@@ -539,7 +539,7 @@ static int apds9922_reset(FAR struct apds9922_dev_s *priv)
priv->als_setup.thresh.lower = ALS_DEF_THRESHL; priv->als_setup.thresh.lower = ALS_DEF_THRESHL;
priv->als_setup.thresh_var = ALS_DEF_VAR; priv->als_setup.thresh_var = ALS_DEF_VAR;
priv->als_setup.int_mode = ALS_INT_MODE_THRESHOLD; priv->als_setup.int_mode = ALS_INT_MODE_THRESHOLD;
priv->als_setup.persistance = ALS_DEF_PERSISTANCE; priv->als_setup.persistence = ALS_DEF_PERSISTANCE;
priv->als_setup.als_factor = 1; priv->als_setup.als_factor = 1;
priv->als_setup.range_lim = 1; priv->als_setup.range_lim = 1;
priv->als_setup.autogain = false; priv->als_setup.autogain = false;
@@ -554,7 +554,7 @@ static int apds9922_reset(FAR struct apds9922_dev_s *priv)
priv->ps_setup.thresh.upper = PS_DEF_THRESHU; priv->ps_setup.thresh.upper = PS_DEF_THRESHU;
priv->ps_setup.thresh.lower = PS_DEF_THRESHL; priv->ps_setup.thresh.lower = PS_DEF_THRESHL;
priv->ps_setup.cancel_lev = PS_DEF_CANCEL_LVL; priv->ps_setup.cancel_lev = PS_DEF_CANCEL_LVL;
priv->ps_setup.persistance = PS_DEF_PERSISTANCE; priv->ps_setup.persistence = PS_DEF_PERSISTANCE;
priv->ps_setup.notify = PS_ALL_INFO; priv->ps_setup.notify = PS_ALL_INFO;
priv->ps_setup.int_mode = PS_INT_MODE_NORMAL; priv->ps_setup.int_mode = PS_INT_MODE_NORMAL;
@@ -662,7 +662,7 @@ static int apds9922_als_config(FAR struct apds9922_dev_s *priv,
return ret; return ret;
} }
ret = apds9922_als_persistance(priv, config->persistance); ret = apds9922_als_persistence(priv, config->persistence);
if (ret < 0) if (ret < 0)
{ {
return ret; return ret;
@@ -981,7 +981,7 @@ static int apds9922_als_variance(FAR struct apds9922_dev_s *priv,
} }
/**************************************************************************** /****************************************************************************
* Name: apds9922_als_persistance * Name: apds9922_als_persistence
* *
* Description: * Description:
* Set the number of consecutive int events needed before int is asserted. * Set the number of consecutive int events needed before int is asserted.
@@ -995,13 +995,13 @@ static int apds9922_als_variance(FAR struct apds9922_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
static int apds9922_als_persistance(FAR struct apds9922_dev_s *priv, static int apds9922_als_persistence(FAR struct apds9922_dev_s *priv,
uint8_t persistance) uint8_t persistence)
{ {
uint8_t regval; uint8_t regval;
int ret; int ret;
if (persistance > ALS_PERSISTANCE_MAX) if (persistence > ALS_PERSISTANCE_MAX)
{ {
return -EINVAL; return -EINVAL;
} }
@@ -1013,14 +1013,14 @@ static int apds9922_als_persistance(FAR struct apds9922_dev_s *priv,
} }
regval &= ~ALS_PERSISTANCE_MASK; regval &= ~ALS_PERSISTANCE_MASK;
regval |= ALS_SET_PERSISTANCE(persistance); regval |= ALS_SET_PERSISTANCE(persistence);
ret = apds9922_i2c_write(priv, APDS9922_INT_PERSIST, &regval, 1); ret = apds9922_i2c_write(priv, APDS9922_INT_PERSIST, &regval, 1);
if (ret < 0) if (ret < 0)
{ {
return ret; return ret;
} }
priv->als_setup.persistance = persistance; priv->als_setup.persistence = persistence;
return OK; return OK;
} }
@@ -1281,7 +1281,7 @@ static int apds9922_ps_config(FAR struct apds9922_dev_s *priv,
return ret; return ret;
} }
ret = apds9922_ps_persistance(priv, config->persistance) ; ret = apds9922_ps_persistence(priv, config->persistence) ;
if (ret < 0) if (ret < 0)
{ {
return ret; return ret;
@@ -1710,27 +1710,27 @@ static int apds9922_ps_int_mode(FAR struct apds9922_dev_s *priv, int mode)
} }
/**************************************************************************** /****************************************************************************
* Name: apds9922_ps_persistance * Name: apds9922_ps_persistence
* *
* Description: * Description:
* Set the number of consecutive int events needed before int is asserted. * Set the number of consecutive int events needed before int is asserted.
* *
* Input Parameters: * Input Parameters:
* priv - pointer to device structure * priv - pointer to device structure
* persistance - number of values to be out of range before int asserted * persistence - number of values to be out of range before int asserted
* *
* Returned Value: * Returned Value:
* Success or failure * Success or failure
* *
****************************************************************************/ ****************************************************************************/
static int apds9922_ps_persistance(FAR struct apds9922_dev_s *priv, static int apds9922_ps_persistence(FAR struct apds9922_dev_s *priv,
uint8_t persistance) uint8_t persistence)
{ {
uint8_t regval; uint8_t regval;
int ret; int ret;
if (persistance > PS_PERSISTANCE_MAX) if (persistence > PS_PERSISTANCE_MAX)
{ {
return -EINVAL; return -EINVAL;
} }
@@ -1742,14 +1742,14 @@ static int apds9922_ps_persistance(FAR struct apds9922_dev_s *priv,
} }
regval &= ~PS_PERSISTANCE_MASK; regval &= ~PS_PERSISTANCE_MASK;
regval |= PS_SET_PERSISTANCE(persistance); regval |= PS_SET_PERSISTANCE(persistence);
ret = apds9922_i2c_write(priv, APDS9922_INT_PERSIST, &regval, 1); ret = apds9922_i2c_write(priv, APDS9922_INT_PERSIST, &regval, 1);
if (ret < 0) if (ret < 0)
{ {
return ret; return ret;
} }
priv->ps_setup.persistance = persistance; priv->ps_setup.persistence = persistence;
return OK; return OK;
} }

View File

@@ -198,7 +198,7 @@ struct apds9922_als_setup_s
thresh; /* Upper and lower thresholds */ thresh; /* Upper and lower thresholds */
uint8_t thresh_var; /* threshold variation */ uint8_t thresh_var; /* threshold variation */
int int_mode; /* Interrupt mode */ int int_mode; /* Interrupt mode */
uint8_t persistance; /* Num events before interrupt */ uint8_t persistence; /* Num events before interrupt */
uint32_t als_factor; /* Lux correction factor applied */ uint32_t als_factor; /* Lux correction factor applied */
uint32_t range_lim; /* % limit of ADC full range uint32_t range_lim; /* % limit of ADC full range
* allowed in autogain mode. * allowed in autogain mode.
@@ -221,7 +221,7 @@ struct apds9922_ps_setup_s
thresh; /* Upper and lower thresholds */ thresh; /* Upper and lower thresholds */
uint16_t cancel_lev; /* Intelligent cancellation lev. */ uint16_t cancel_lev; /* Intelligent cancellation lev. */
int int_mode; /* Interrupt mode */ int int_mode; /* Interrupt mode */
uint8_t persistance; /* Num events before interrupt */ uint8_t persistence; /* Num events before interrupt */
int notify; /* States that cause a notify */ int notify; /* States that cause a notify */
}; };