[alsa-devel] [PATCH v2 17/32] ASoC: rt5651: Allow specifying over-current thresholds through device-properties

Rob Herring robh at kernel.org
Fri Mar 2 23:18:52 CET 2018


On Sun, Feb 25, 2018 at 11:46:58AM +0100, Hans de Goede wrote:
> OVer-Current-Detection (OVCD) for the micbias current is used to detect if
> an inserted jack is a headset or headphones (mic shorted to ground).
> 
> Some boards may need different values for the OVCD threshold because of a
> resistor on the board in serial with or parallel to the jack mic contact.
> 
> This commit adds support for the sofar unset OVCD scale-factor register
> values and adds support for specifying non-default values for both the
> current threshold and the scale-factor through device-properties.
> 
> Cc: devicetree at vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  Documentation/devicetree/bindings/sound/rt5651.txt | 11 ++++++

Please split to a separate patch.

>  include/sound/rt5651.h                             | 11 ++++++
>  sound/soc/codecs/rt5651.c                          | 42 +++++++++++++++++++++-
>  sound/soc/codecs/rt5651.h                          | 10 ++++++
>  4 files changed, 73 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/rt5651.txt b/Documentation/devicetree/bindings/sound/rt5651.txt
> index 1632c0cf6123..8cb7ee8e79cf 100644
> --- a/Documentation/devicetree/bindings/sound/rt5651.txt
> +++ b/Documentation/devicetree/bindings/sound/rt5651.txt
> @@ -22,6 +22,17 @@ Optional properties:
>    2: Use JD1_2 pin for jack-dectect
>    3: Use JD2 pin for jack-dectect
>  
> +- realtek,over-current-threshold
> +  u32, micbias over-current detection threshold in µA, valid values are
> +  600, 1500 and 2000µA.

Needs a unit suffix as defined in property-units.txt

> +
> +- realtek,over-current-scale-factor
> +  u32, micbias over-current detection scale-factor, valid values are:
> +  0: Scale current by 0.5
> +  1: Scale current by 0.75
> +  2: Scale current by 1.0
> +  3: Scale current by 1.5
> +
>  Pins on the device (for linking into audio routes) for RT5651:
>  
>    * DMIC L1


More information about the Alsa-devel mailing list