<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/sound/soc/codecs/rt5677.c, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/sound/soc/codecs/rt5677.c?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/sound/soc/codecs/rt5677.c?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2019-11-18T12:55:59Z</updated>
<entry>
<title>ASoC: rt5677: rt5677_check_hotword() can be static</title>
<updated>2019-11-18T12:55:59Z</updated>
<author>
<name>kbuild test robot</name>
<email>lkp@intel.com</email>
</author>
<published>2019-11-14T15:33:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=a3b9ed55775eb18ca9f1641f13328f479a3653cb'/>
<id>urn:sha1:a3b9ed55775eb18ca9f1641f13328f479a3653cb</id>
<content type='text'>
Fixes: 21c00e5df439 ("ASoC: rt5677: Enable jack detect while DSP is running")
Signed-off-by: kbuild test robot &lt;lkp@intel.com&gt;
Link: https://lore.kernel.org/r/20191114153304.n4pyix7qadu76tx4@4978f4969bb8
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Wait for DSP to boot before loading firmware</title>
<updated>2019-11-11T13:02:07Z</updated>
<author>
<name>Curtis Malainey</name>
<email>cujomalainey@chromium.org</email>
</author>
<published>2019-11-06T01:13:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=9da776ba7852f9b5cbfdfaa80a1dc07cda592b55'/>
<id>urn:sha1:9da776ba7852f9b5cbfdfaa80a1dc07cda592b55</id>
<content type='text'>
Wait for hardware to startup. If we load before hardware is ready we
could end up corrupting the firmware.

Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-12-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Set ADC clock to use PLL and enable ASRC</title>
<updated>2019-11-11T13:02:06Z</updated>
<author>
<name>Curtis Malainey</name>
<email>cujomalainey@chromium.org</email>
</author>
<published>2019-11-06T01:13:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=ba0b3a977ecf525231d36f2d9f3a6ea05c35090a'/>
<id>urn:sha1:ba0b3a977ecf525231d36f2d9f3a6ea05c35090a</id>
<content type='text'>
Use the PLL to kept the correct 24M clock rate so frequency shift does
not occur when using the DSP VAD.

Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-11-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Allow VAD to be shut on/off at all times</title>
<updated>2019-11-11T13:02:05Z</updated>
<author>
<name>Curtis Malainey</name>
<email>cujomalainey@chromium.org</email>
</author>
<published>2019-11-06T01:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=395f02ef210e6f7dad2ca0efc16ffaea4a9ed030'/>
<id>urn:sha1:395f02ef210e6f7dad2ca0efc16ffaea4a9ed030</id>
<content type='text'>
Due to limitations of the clocking configuration, we have no way of
scheduling our hibernation before the bdw dsp hibernates. This causes
issues when the system suspends with an open stream. We need userspace
to toggle the kcontrol before we are suspended so that any writes on
suspend are not lost and we don't corrupt the regmap.

Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-9-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Disable irq at suspend</title>
<updated>2019-11-11T13:02:04Z</updated>
<author>
<name>Ben Zhang</name>
<email>benzh@chromium.org</email>
</author>
<published>2019-11-06T01:13:32Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=ee0be4a99d4923a9b9c681b008df561648731793'/>
<id>urn:sha1:ee0be4a99d4923a9b9c681b008df561648731793</id>
<content type='text'>
The irq is disabled at suspend to avoid running the threaded irq
handler after the codec has been powered off. At resume, codec irq is
re-enabled and the interrupt status register is checked to see if
headphone has been pluggnd/unplugged while the device is suspended.

There is still a chance that the headphone gets enabled or disabled
after the codec is suspended. disable_irq syncs the threaded irq
handler, but soc-jack's threaded irq handler schedules a delayed
work to poll gpios (for debounce). This is still OK. The codec won't
be powered back on again because all audio paths have been suspended,
and there are no force enabled supply widgets (MICBIAS1 is disabled).
The gpio status read after codec power off could be wrong, so the
gpio values are checked again after resume.

Signed-off-by: Ben Zhang &lt;benzh@chromium.org&gt;
Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-8-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Stop and restart DSP over suspend/resume</title>
<updated>2019-11-11T13:02:03Z</updated>
<author>
<name>Ben Zhang</name>
<email>benzh@chromium.org</email>
</author>
<published>2019-11-06T01:13:31Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=3f81068dc8e5fc0d3b0d67a5ae99c5140a4e96cb'/>
<id>urn:sha1:3f81068dc8e5fc0d3b0d67a5ae99c5140a4e96cb</id>
<content type='text'>
MCLK1 gets disabled at suspend and re-enabled at resume. Before
MCLK1 is re-enabled, if the DSP is already on (either the DSP was
left on during suspend, or the DSP is turned on early at resume),
i2c register read returns garbage and corrupts the regmap cache.

This patch stops the DSP before suspend and restarts it after
resume with a dalay to ensure MCLK is on while loading firmware.

Signed-off-by: Ben Zhang &lt;benzh@chromium.org&gt;
Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-7-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Mark reg RT5677_PWR_ANLG2 as volatile</title>
<updated>2019-11-11T13:02:02Z</updated>
<author>
<name>Ben Zhang</name>
<email>benzh@chromium.org</email>
</author>
<published>2019-11-06T01:13:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=eabf424f7b60246c76dcb0ea6f1e83ef9abbeaa6'/>
<id>urn:sha1:eabf424f7b60246c76dcb0ea6f1e83ef9abbeaa6</id>
<content type='text'>
The codec dies when RT5677_PWR_ANLG2(MX-64h) is set to 0xACE1
while it's streaming audio over SPI. The DSP firmware turns
on PLL2 (MX-64 bit 8) when SPI streaming starts.  However regmap
does not believe that register can change by itself. When
BST1 (bit 15) is turned on with regmap_update_bits(), it doesn't
read the register first before write, so PLL2 power bit is
cleared by accident.

Marking MX-64h as volatile in regmap solved the issue.

Signed-off-by: Ben Zhang &lt;benzh@chromium.org&gt;
Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-6-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Add DAPM audio path for hotword stream</title>
<updated>2019-11-11T13:02:01Z</updated>
<author>
<name>Ben Zhang</name>
<email>benzh@chromium.org</email>
</author>
<published>2019-11-06T01:13:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=29073ae40c472f17d42aa38850da861b5e3f912e'/>
<id>urn:sha1:29073ae40c472f17d42aa38850da861b5e3f912e</id>
<content type='text'>
Add a DAPM audio path from "DMIC L1" to "DSP Buffer" so that
when hotwording is enabled, DAPM does not power off the codec
with SND_SOC_BIAS_OFF.

Signed-off-by: Ben Zhang &lt;benzh@chromium.org&gt;
Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-5-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Enable jack detect while DSP is running</title>
<updated>2019-11-11T13:02:00Z</updated>
<author>
<name>Ben Zhang</name>
<email>benzh@chromium.org</email>
</author>
<published>2019-11-06T01:13:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=21c00e5df4397870ee835c974bf50570f9d24253'/>
<id>urn:sha1:21c00e5df4397870ee835c974bf50570f9d24253</id>
<content type='text'>
Before a hotword is detected, GPIO1 pin is configured as IRQ
output so that jack detect works. When a hotword is detected,
the DSP firmware configures the GPIO1 pin as GPIO1 and
drives a 1. rt5677_irq() is called after a rising edge on
the GPIO1 pin, due to either jack detect event or hotword
event, or both. All possible events are checked and handled
in rt5677_irq() where GPIO1 pin is configured back to IRQ
output if a hotword is detected.

Signed-off-by: Ben Zhang &lt;benzh@chromium.org&gt;
Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-4-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5677: Load firmware via SPI using delayed work</title>
<updated>2019-11-11T13:01:59Z</updated>
<author>
<name>Ben Zhang</name>
<email>benzh@chromium.org</email>
</author>
<published>2019-11-06T01:13:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=461c623270e4fa9cbab44e3ac2f0ddab2842c034'/>
<id>urn:sha1:461c623270e4fa9cbab44e3ac2f0ddab2842c034</id>
<content type='text'>
The firmware rt5677_elf_vad is an ELF binary obtained from
request_firmware(). Sections of the ELF are loaded to
the DSP via SPI. A model (e.g. en_us.mmap) can optionally be
loaded to the DSP at RT5677_MODEL_ADDR to overwrite the
baked-in model in rt5677_elf_vad.

Then we switch to DSP mode, load firmware, and let DSP run.
When a hotword is detected, an interrupt is fired and
rt5677_irq() is called. When 'DSP VAD Switch' is turned off,
the codec is set back to normal mode.

The kcontrol 'DSP VAD Switch' is automatically enabled/disabled
when the hotwording PCM stream is opened/closed.

Signed-off-by: Ben Zhang &lt;benzh@chromium.org&gt;
Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Link: https://lore.kernel.org/r/20191106011335.223061-2-cujomalainey@chromium.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
