Re: [PATCH v2 2/8] ASoC: codecs: wcd: add common helper for wcd codecs

From: Dmitry Baryshkov
Date: Fri Sep 05 2025 - 09:50:55 EST


On Fri, Sep 05, 2025 at 08:03:49AM +0100, Srinivas Kandagatla wrote:
> Sorry for some reason I did not notice this email!.
>
> On 8/22/25 12:18 PM, Dmitry Baryshkov wrote:
> >> + */
> >> +
> >> +#ifndef __WCD_COMMON_H__
> >> +#define __WCD_COMMON_H___
> >> +
> >> +#define WCD_MIN_MICBIAS_MV 1000
> >> +#define WCD_DEF_MICBIAS_MV 1800
> >> +#define WCD_MAX_MICBIAS_MV 2850
> > These do not belong to a public header.
>
>
> All the wcd codecs have same MICBIAS circuitry, this is the internal
> micbias circuit we are talking about here.
>
> Actual micbias value comes from device tree, but these are min/max
> ranges that are supported by all WCD codecs.
>
> Why do you think it should not be part of common header?

Because they are not used by any of the users of the header.

>
> --srini
> >
> >> +#define WCD_MAX_MICBIAS 4
> >> +
> >> +struct wcd_common {
> >> + struct device *dev;
> >> + int max_bias;
> >> + u32 micb_mv[WCD_MAX_MICBIAS];
> >> + u32 micb_vout[WCD_MAX_MICBIAS];
> >> +};
> >> +
> >> +int wcd_get_micb_vout_ctl_val(struct device *dev, u32 micb_mv);
> >> +int wcd_dt_parse_micbias_info(struct wcd_common *common);
> >> +
> >> +#endif /* __WCD_COMMON_H___ */
>

--
With best wishes
Dmitry