History log of /linux-master/sound/soc/codecs/rt5651.h
Revision Date Author Comments
# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8a68a509 04-Mar-2019 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Add support for active-high jack detect

Some boards use a jack-receptacle with a switch which reports the
jack-inserted status as active-high, rather then the standard active-low
reporting most jacks use.

This commit adds support for it. This is activated by a boolean
"realtek,jack-detect-not-inverted" device-property. The not-inverted
in the device-property name, rather then active-high, was chosen to keep
the device-property naming consistent with the rt5640 codec driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c2ec9d95 29-Dec-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Add support for jack detect using an external GPIO

Some board designs hook the jack-detect up to an external GPIO,
rather then to one of the codec pins, add support for this.

Figuring out which GPIO to use is pretty much board specific so I've
chosen to let the machine driver pass the gpio_desc as data argument to
snd_soc_component_set_jack() rather then add support for getting the
GPIO to the codec driver. This keeps the codec code nice and clean.

Note that using an external GPIO for this conflicts with button-press
support, so this commit disables button-press support when an
external GPIO is used.

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# df1569f2 04-Jul-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Add button press support

Enable button press detection for headsets by using the ovcd IRQ to get
notified of button presses.

This is modelled after (almost exactly copied from) the button press code
for the rt5640 which has identical ovcd hardware.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0f2d4f16 12-Mar-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: move definitions of dt-binding constants to include/dt-bindings

Move the definitions of constants used in the dt-bindings from
include/sound/rt5651.h to include/dt-bindings/sound/rt5651.h.

As dt-bindings headers may also be parsed by the dt-compiler, they cannot
use enums, only defines, so this commit also changes the code declaring
the constants to use defines.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ee680968 04-Mar-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Rewrite jack-type detection

We get the insertion event before the jack is fully inserted at which point
the second ring on a TRRS connector may short the 2nd ring and sleeve
contacts. Testing has shown that this short-circuit may happen as late
as 500ms after the insertion event, but it never lasts longer then 300ms.

This commit changes the detection algorithm to require 5 identical OVCD
values in a row at 100 ms intervals to fix the jack-type sometimes getting
mis-detected.

Tested-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# e6eb0207 04-Mar-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Allow specifying the OVCD scale-factor through a device-property

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).

The threshold for at which current the OVCD triggers on the rt5651 is not
only controlled by setting the absolute current limit, but also by setting
a scale factor which applies to the limit. Testing has shown that we need
to set both (depending on the board).

This commit adds support for the sofar unused OVCD scale-factor register
and adds support for specifying non-default values for it through the
"realtek,over-current-scale-factor" device-property.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 583a9deb 04-Mar-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Allow specifying over-current threshold through a device-property

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 current threshold
because of a resistor on the board in serial with or parallel to the
jack mic contact.

This commit adds support for configuring the OCVD current threshold
through the "realtek,over-current-threshold-microamp" device-property.

Note this commit changes the default value from 600uA to 2000uA,
because testing has shown 600uA to be a poor default.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1cf5b504 04-Mar-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Make rt5651_apply_properties() private

The idea behind exporting rt5651_apply_properties(), was for it to be used
on platforms where the platform code may need to add device-properties,
rather then relying only on properties set by the firmware. The platform
code could then call rt5651_apply_properties() after adding properties to
make sure that the codec driver was aware of the new properties.

But this is not necessary, as long as we do all property parsing from
the codec component-driver's probe function (or later) then the machine
driver can attach properties before calling snd_soc_register_card and
calling rt5651_apply_properties() for ordering reasons is not necessary.

This commit makes rt5651_apply_properties() private and adds 2 comments
documenting that all property parsing must be done from the codec
component-driver's probe function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5f293d43 25-Feb-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Add rt5651_apply_properties() helper function

Move the applying of the differential input and dmic properties to a new
rt5651_apply_properties() helper function. This new function can be called
by platform code which attaches properties after probe() has run to apply
these new properties.

Note this also moves the time when we apply these properties for DT
platforms from i2c-probe to snd-component-probe time, this should not
result in any functional difference.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 6f0b819a 25-Feb-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Use standard component set_jack callback

Use the standard component set_jack callback instead of defining a codec
private API for this.

Tested-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# f06da4fd 25-Feb-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Move all jack-detect initialization to rt5651_set_jack_detect

Move all jack-detect initialization to rt5651_set_jack_detect. The main
reason to do this is so that platform code can setup jack-detect properties
after the device has been probed, which unfortunately is necessary on some
platforms.

This has 2 additional advantages:
1) Grouping all jack-detect init together makes it easier to follow what
is happening and results in a small reduction in the number of loc.
2) Before we would register the irq handler before rt5651->hp_jack was
assigned, leading to a potential NULL deref if the jack_detect work runs
before the machine driver has called set_jack.

Tested-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 54e3a3a1 25-Feb-2018 Hans de Goede <hdegoede@redhat.com>

ASoC: rt5651: Remove unused rt5651_platform_data

There are no in tree users of platform-data for the rt5651 codec driver,
so lets remove support for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 17b52010 28-Jan-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ASoC: rt5651: replace codec to component

Now we can replace Codec to Component. Let's do it.

Note:
xxx_codec_xxx() -> xxx_component_xxx()
.idle_bias_off = 1 -> .idle_bias_on = 0
.ignore_pmdown_time = 0 -> .use_pmdown_time = 1
- -> .endianness = 1
- -> .non_legacy_dai_naming = 1

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 82ab86e8 30-Oct-2017 Mark Brown <broonie@kernel.org>

Revert "ASoC: rt5651: Enable jack detection on JD* pins"

This reverts commit 60d5a1a47b9a8381c08d2263b11ac9c757c87746.

Signed-off-by: Mark Brown <broonie@kernel.org>


# 80bbe4a3 19-Oct-2017 Carlo Caione <carlo@endlessm.com>

ASoC: rt5651: Enable jack detection on JD* pins

Enable jack detection for the RT5651 codec on the JD* pins.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 60d5a1a4 19-Oct-2017 Carlo Caione <carlo@endlessm.com>

ASoC: rt5651: Enable jack detection on JD* pins

Enable jack detection for the RT5651 codec on the JD* pins.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 71c7a2d6 20-May-2014 Oder Chiou <oder_chiou@realtek.com>

ASoC: rt5640: Add the function of the PLL clock calculation to RL6231 shared support

The patch adds the function of the PLL clock calculation to RL6231 shared
support.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 40bc18a2 16-Apr-2014 Bard Liao <bardliao@realtek.com>

ASoC: add RT5651 CODEC driver

This patch adds the Realtek ALC5651 codec driver.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>