Skip to content

Commit 055509c

Browse files
committed
ASoC: codecs: wcd938x/wcd934x: loglevel fix and
Merge series from Johan Hovold <johan+linaro@kernel.org>: When investigating a race in the wcd938x driver I noticed that the MBHC impedance measurements where printed at error loglevel which is clearly wrong. Fix that, and clean up the logging somewhat by using dev_printk() and addressing some style issues. Included are also two patches that drop the bogus inline keywords from the functions involved.
2 parents ac192c1 + c93723a commit 055509c

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

sound/soc/codecs/wcd934x.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,7 +2642,7 @@ static int wcd934x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *compon
26422642
return rc;
26432643
}
26442644

2645-
static inline void wcd934x_mbhc_get_result_params(struct wcd934x_codec *wcd934x,
2645+
static void wcd934x_mbhc_get_result_params(struct wcd934x_codec *wcd934x,
26462646
s16 *d1_a, u16 noff,
26472647
int32_t *zdet)
26482648
{
@@ -2683,7 +2683,7 @@ static inline void wcd934x_mbhc_get_result_params(struct wcd934x_codec *wcd934x,
26832683
else if (x1 < minCode_param[noff])
26842684
*zdet = WCD934X_ZDET_FLOATING_IMPEDANCE;
26852685

2686-
dev_info(wcd934x->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%d(milliOhm)\n",
2686+
dev_dbg(wcd934x->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%di (milliohm)\n",
26872687
__func__, d1, c1, x1, *zdet);
26882688
ramp_down:
26892689
i = 0;
@@ -2740,8 +2740,8 @@ static void wcd934x_mbhc_zdet_ramp(struct snd_soc_component *component,
27402740
*zr = zdet;
27412741
}
27422742

2743-
static inline void wcd934x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component,
2744-
int32_t *z_val, int flag_l_r)
2743+
static void wcd934x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component,
2744+
int32_t *z_val, int flag_l_r)
27452745
{
27462746
s16 q1;
27472747
int q1_cal;

sound/soc/codecs/wcd938x.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,10 +2124,11 @@ static int wcd938x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *compon
21242124
return wcd938x_mbhc_micb_adjust_voltage(component, micb_mv, MIC_BIAS_2);
21252125
}
21262126

2127-
static inline void wcd938x_mbhc_get_result_params(struct wcd938x_priv *wcd938x,
2127+
static void wcd938x_mbhc_get_result_params(struct snd_soc_component *component,
21282128
s16 *d1_a, u16 noff,
21292129
int32_t *zdet)
21302130
{
2131+
struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
21312132
int i;
21322133
int val, val1;
21332134
s16 c1;
@@ -2154,8 +2155,8 @@ static inline void wcd938x_mbhc_get_result_params(struct wcd938x_priv *wcd938x,
21542155
usleep_range(5000, 5050);
21552156

21562157
if (!c1 || !x1) {
2157-
pr_err("%s: Impedance detect ramp error, c1=%d, x1=0x%x\n",
2158-
__func__, c1, x1);
2158+
dev_err(component->dev, "Impedance detect ramp error, c1=%d, x1=0x%x\n",
2159+
c1, x1);
21592160
goto ramp_down;
21602161
}
21612162
d1 = d1_a[c1];
@@ -2165,7 +2166,7 @@ static inline void wcd938x_mbhc_get_result_params(struct wcd938x_priv *wcd938x,
21652166
else if (x1 < minCode_param[noff])
21662167
*zdet = WCD938X_ZDET_FLOATING_IMPEDANCE;
21672168

2168-
pr_err("%s: d1=%d, c1=%d, x1=0x%x, z_val=%d(milliOhm)\n",
2169+
dev_dbg(component->dev, "%s: d1=%d, c1=%d, x1=0x%x, z_val=%d (milliohm)\n",
21692170
__func__, d1, c1, x1, *zdet);
21702171
ramp_down:
21712172
i = 0;
@@ -2210,7 +2211,7 @@ static void wcd938x_mbhc_zdet_ramp(struct snd_soc_component *component,
22102211
WCD938X_ANA_MBHC_ZDET, 0x80, 0x80);
22112212
dev_dbg(component->dev, "%s: ramp for HPH_L, noff = %d\n",
22122213
__func__, zdet_param->noff);
2213-
wcd938x_mbhc_get_result_params(wcd938x, d1_a, zdet_param->noff, &zdet);
2214+
wcd938x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet);
22142215
regmap_update_bits(wcd938x->regmap,
22152216
WCD938X_ANA_MBHC_ZDET, 0x80, 0x00);
22162217

@@ -2224,15 +2225,15 @@ static void wcd938x_mbhc_zdet_ramp(struct snd_soc_component *component,
22242225
WCD938X_ANA_MBHC_ZDET, 0x40, 0x40);
22252226
dev_dbg(component->dev, "%s: ramp for HPH_R, noff = %d\n",
22262227
__func__, zdet_param->noff);
2227-
wcd938x_mbhc_get_result_params(wcd938x, d1_a, zdet_param->noff, &zdet);
2228+
wcd938x_mbhc_get_result_params(component, d1_a, zdet_param->noff, &zdet);
22282229
regmap_update_bits(wcd938x->regmap,
22292230
WCD938X_ANA_MBHC_ZDET, 0x40, 0x00);
22302231

22312232
*zr = zdet;
22322233
}
22332234

2234-
static inline void wcd938x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component,
2235-
int32_t *z_val, int flag_l_r)
2235+
static void wcd938x_wcd_mbhc_qfuse_cal(struct snd_soc_component *component,
2236+
int32_t *z_val, int flag_l_r)
22362237
{
22372238
s16 q1;
22382239
int q1_cal;

0 commit comments

Comments
 (0)