1
0
Fork 0
Commit Graph

30 Commits (c2f26938d2a456dcf429385617e58cfd510a64a8)

Author SHA1 Message Date
Hans de Goede c2f26938d2
ASoC: Intel: bytcr_rt5651: Actually honor the DMIC_EN quirk if specified
Before this commit it was possible to set the DMIC_EN quirk in the machine
driver, but it would never be passed to the codec driver so it was a nop.

This commit adds code to actually pass the quirk to the codec driver.

Since the DMIC_EN quirk was ignored before, this commit removes it from
the default quirk settings, to avoid this causing an unexpected functional
change. If we really want the DMIC_EN behavior anywhere it should be
specifically enabled by follow up commits.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-07 14:17:52 +00:00
Hans de Goede 46058aeb6b
ASoC: Intel: bytcr_rt5651: Pass jack-src info via device-properties
This commit add support for a new BYT_RT5651_JDSRC quirk, sets this
quirk for the KIANO SlimNote 14.2 laptop and uses the new "realtek,
jack-detect-source" property to pass this info to the codec driver.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-07 14:17:29 +00:00
Mark Brown c9ae06decc
Merge branch 'topic/rt5651' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel 2018-03-07 14:16:00 +00:00
Hans de Goede e39cacc1b7
ASoC: Intel: bytcr_rt5651: Not being able to find the codec ACPI-dev is an error
If we cannot find the codec ACPI-dev, then the snd-soc-core will not be
able to find the codec either and snd_soc_register_card() will just keep
exiting with -EPROBE_DEFER, filling the log with errors each time the
probe gets retried.

Instead simply log an error from the machine driver and exit with -ENODEV.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-03-07 12:55:40 +00:00
Hans de Goede 6f0b819ae2
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>
2018-03-01 17:32:24 +00:00
Kuninori Morimoto 17b52010b5
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>
2018-02-12 09:45:52 +00:00
Andy Shevchenko 3a1479599a
ASoC: Intel - Convert to use acpi_dev_get_first_match_name()
Instead of home grown snd_soc_acpi_find_name_from_hid() use
acpi_dev_get_first_match_name().

Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-12 21:20:29 +00:00
Pierre-Louis Bossart 2be2d57986
ASoC: acpi: remove hard-coded i2c-device name length
Remove hard-codec [16] array size, replace with clearer description and
dependency on ACPI_ID_LEN
No functionality change

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-12 21:05:41 +00:00
Pierre-Louis Bossart ea39bdcf22
ASoC: Intel: bytcr-rt5651: add support for Line In
Add the DAPM widgets and routes.

Tested with MinnowMax Turbot + rt5651 eval board with Speaker
(LineOut) -> LineIn loopback

Thanks to Bard Liao @ Realtek for providing the 0dB settings

"IN Capture Volume" = 23
"ADC Capture Volume" = 47
"OUT Playback Volume" = 31
"DAC1 Playback Volume" = 175

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-08 16:02:56 +00:00
Pierre-Louis Bossart 416f2b5111
ASoC: Intel: bytcr-rt5651: enable MinnowBoard Turbot quirks
Define DMI quirk for rt5651 eval board connected to MinnowBoard
Turbot. The only difference with a MinnowBoard MAX is that the MCLK
pin is enabled on the LSE connector

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Keqiao.Zhang <Keqiao.zhang@intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-08 16:01:50 +00:00
Keyon Jie 60e3b52e93
ASoC: Intel: bytcr-rt5651: add quirk for IN3P which may also be used
On Minnowboard Max with Realtek rt5651 eval board, the IN3P is
connected to Headset Mic.

Here add and select it for Minnowboard Max.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-08 16:01:43 +00:00
Pierre-Louis Bossart 56e49aa41d
ASoC: Intel: bytcr_rt5651: fix Kiano DMI quirk
The current code doesn't enable the MCLK which reduces audio quality
(PLL driven from BLCK), fix the quirk

Tested-by: Carlo Caione <carlo@caione.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-08 16:01:25 +00:00
Carlo Caione 56fa898be8
ASoC: intel: byt: Fix quirk for KIANO laptop
This laptop has actually two different analog mics, no just one. Fix the
quirk to reflect the correct configuration.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-29 15:42:09 +00:00
Carlo Caione ea261bd02a
ASoC: intel: byt: Introduce new map for dual mics
The RT5651 codec has 3 analog inputs. Some laptops have two different
internal analog microphones on the external case.
Add a new custom quirk mapping the two internal mics on IN1P / IN2P,
leaving the headset mic on IN3P.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-29 15:42:05 +00:00
Carlo Caione 2fe30129b0
ASoC: intel: byt: Enable IN2 map quirk for a KIANO laptop
This cherry-trails laptop has the internal mic connected to the IN2
input pins. Enable the quirk to correctly map the routes.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-26 16:15:55 +02:00
Carlo Caione d9f8f9b2f3
ASoC: intel: byt: Add headset jack
Introduce an headset jack in the machine driver and register it to the
codec driver.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-26 16:15:47 +02:00
Pierre-Louis Bossart 7feb2f786a ASoC: move ACPI common code out of Intel/sst tree
ACPI support is not specific to the Intel/SST driver. Move the enumeration
and matching code which is not hardware-dependent to sound/soc and rename
relevant sst_acpi_ structures and functions with snd_soc_acpi_ prefix

soc-acpi.h is protected by a #ifndef __LINUX_SND_SOC_ACPI_H for
consistency with all other SoC .h files:

grep -L __LINUX include/sound/soc* | wc -l
0
grep __LINUX include/sound/soc* | wc -l
14

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-21 11:21:09 +01:00
Carlo Caione 39712db878 SoC: intel: byt: Introduce new custom IN2 map
Introduce a new custom dapm routes map to quirk platforms with the
internal mic connected to IN2P.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-21 11:11:35 +01:00
Pierre-Louis Bossart 2193eb9631 ASoC: Intel: boards: remove hard-coded compressed dailinks
The hard-coded compressed dailinks are not supported using
publicly-available firmwares, which creates unnecessary user
confusion [1]. Even if the firmware was available, the mainline
code does not have the required .dynamic=1 and .dpcm_playback=1
fields so probably never worked as is, and last and they conflict
with topology-defined streams.

Remove them and move on. This can be re-enabled with SOF later
in a more flexible manner.

[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2017-August/124868.html

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-18 12:30:29 +01:00
Pierre-Louis Bossart 149f775759 ASoC: Intel: boards: fix off-by-one dailink id
For some reason the Atom/HiFi2 machine drivers use an id=1 instead
of zero as done on all other platforms. This gets in the way of
topology-based matching, realign for consistency. This should
not have any functional impact on existing solutions with don't rely
on topology.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-18 12:30:25 +01:00
Pierre-Louis Bossart dfb6ec7ae5 ASoC: Intel: boards: use helper to get codec_dai
Remove duplicate code with a common helper in all Intel machine drivers.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-18 12:30:22 +01:00
Pierre-Louis Bossart 02c0a3b304 ASoC: Intel: bytcr_rt5651: add MCLK, quirks and cleanups
Same as for other codecs, enable MCLK by default. When it is not
present, e.g. on MinnowBoard B3 since it's not routed on the LSE
connector, we fall back to blck-based clocking.

The DMIC quirks are also fixed, there is a single DMIC input of the
codec.

reorder variables in reverse x-mas tree as suggested by Andy

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-10-18 12:29:25 +01:00
Pierre-Louis Bossart 6356c78c68 ASoC: Intel: bytcr-rt5651: fix capture routes
There is only one dmic path and the routes were not added.
Probably a copy-paste mistake when initially creating the
file

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-09-19 14:36:23 +01:00
Takashi Iwai 1ebb4d9dbf ASoC: intel: byt: Constify hw_constraints
snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the
const pointers.  Constify the corresponding static objects for better
hardening.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-13 21:29:37 +01:00
Takashi Iwai 6e4cac23c5 ASoC: intel: Fix PM and non-atomic crash in bytcr drivers
The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry
the ignore_suspend flag, and this prevents the suspend/resume working
properly while the stream is running, since SST core code has the
check of the running streams and returns -EBUSY.  Drop these
superfluous flags for fixing the behavior.

Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE
definitions, which leads to the kernel Oops at suspend/resume like:

  BUG: scheduling while atomic: systemd-sleep/3144/0x00000003
  Call Trace:
   dump_stack+0x5c/0x7a
   __schedule_bug+0x55/0x70
   __schedule+0x63c/0x8c0
   schedule+0x3d/0x90
   schedule_timeout+0x16b/0x320
   ? del_timer_sync+0x50/0x50
   ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
   ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
   ? remove_wait_queue+0x60/0x60
   ? sst_prepare_and_post_msg+0x275/0x960 [snd_intel_sst_core]
   ? sst_pause_stream+0x9b/0x110 [snd_intel_sst_core]
   ....

This patch addresses these appropriately, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org> # v4.1+
2017-04-25 15:54:30 +01:00
Pierre-Louis Bossart f12f5c84e3 ASoC: Intel: atom: fix frame polarity
The current frame sync polarity definitions are inconsistent in the
Atom/DPCM driver, fix to align with regular ASoC definitions and
update code in platform and machine drivers for RT5640 and RT5651.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 19:56:20 +00:00
Pierre-Louis Bossart 3639ac1cd5 ASoC: Intel: boards: remove .pm_ops in all Atom/DPCM machine drivers
This patch corrects an omission in bytcr_rt5640 and bytcr_rt5651.
All existing machine drivers shall not use .pm_ops to avoid a double
suspend, as initially implemented by 3f2dcbeaeb
("ASoC: Intel: Remove soc pm handling to allow platform driver handle it").

Reported-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31 19:56:15 +00:00
Julia Lawall 9b6fdef62b ASoC: constify snd_soc_ops structures
Check for snd_soc_ops structures that are only stored in the ops field of a
snd_soc_dai_link structure.  This field is declared const, so snd_soc_ops
structures that have this property can be declared as const also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_soc_ops i@p = { ... };

@ok1@
identifier r.i;
struct snd_soc_dai_link e;
position p;
@@
e.ops = &i@p;

@ok2@
identifier r.i, e;
position p;
@@
struct snd_soc_dai_link e[] = { ..., { .ops = &i@p, }, ..., };

@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_soc_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct snd_soc_ops i = { ... };
// </smpl>

The effect on the layout of the .o files is shown by the following output
of the size command, first before then after the transformation:

   text    data     bss     dec     hex filename
   4500     696       0    5196    144c sound/soc/generic/simple-card.o
   4564     632       0    5196    144c sound/soc/generic/simple-card.o

   text    data     bss     dec     hex filename
   3018     608       0    3626     e2a sound/soc/generic/simple-scu-card.o
   3074     544       0    3618     e22 sound/soc/generic/simple-scu-card.o

   text    data     bss     dec     hex filename
   4148    2448     768    7364    1cc4 sound/soc/intel/boards/bdw-rt5677.o
   4212    2384     768    7364    1cc4 sound/soc/intel/boards/bdw-rt5677.o

   text    data     bss     dec     hex filename
   5403    4628     384   10415    28af sound/soc/intel/boards/bxt_da7219_max98357a.o
   5531    4516     384   10431    28bf sound/soc/intel/boards/bxt_da7219_max98357a.o

   text    data     bss     dec     hex filename
   5275    4496     384   10155    27ab sound/soc/intel/boards/bxt_rt298.o
   5403    4368     384   10155    27ab sound/soc/intel/boards/bxt_rt298.o

   text    data     bss     dec     hex filename
  10017    2344      48   12409    3079 sound/soc/intel/boards/bytcr_rt5640.o
  10145    2232      48   12425    3089 sound/soc/intel/boards/bytcr_rt5640.o

   text    data     bss     dec     hex filename
   3719    2356       0    6075    17bb sound/soc/intel/boards/bytcr_rt5651.o
   3847    2244       0    6091    17cb sound/soc/intel/boards/bytcr_rt5651.o

   text    data     bss     dec     hex filename
   3598    2392       0    5990    1766 sound/soc/intel/boards/cht_bsw_max98090_ti.o
   3726    2280       0    6006    1776 sound/soc/intel/boards/cht_bsw_max98090_ti.o

   text    data     bss     dec     hex filename
   5343    3624      16    8983    2317 sound/soc/intel/boards/cht_bsw_rt5645.o
   5471    3496      16    8983    2317 sound/soc/intel/boards/cht_bsw_rt5645.o

   text    data     bss     dec     hex filename
   4662    2592     384    7638    1dd6 sound/soc/intel/boards/cht_bsw_rt5672.o
   4790    2464     384    7638    1dd6 sound/soc/intel/boards/cht_bsw_rt5672.o

   text    data     bss     dec     hex filename
   1595    2528       0    4123    101b sound/soc/intel/boards/haswell.o
   1659    2472       0    4131    1023 sound/soc/intel/boards/haswell.o

   text    data     bss     dec     hex filename
   6272    4760     416   11448    2cb8 sound/soc/intel/boards/skl_nau88l25_max98357a.o
   6464    4568     416   11448    2cb8 sound/soc/intel/boards/skl_nau88l25_max98357a.o

   text    data     bss     dec     hex filename
   7075    4888     416   12379    305b sound/soc/intel/boards/skl_nau88l25_ssm4567.o
   7267    4696     416   12379    305b sound/soc/intel/boards/skl_nau88l25_ssm4567.o

   text    data     bss     dec     hex filename
   5659    4496     384   10539    292b sound/soc/intel/boards/skl_rt286.o
   5787    4368     384   10539    292b sound/soc/intel/boards/skl_rt286.o

   text    data     bss     dec     hex filename
   1721    2048       0    3769     eb9 sound/soc/kirkwood/armada-370-db.o
   1769    1976       0    3745     ea1 sound/soc/kirkwood/armada-370-db.o

   text    data     bss     dec     hex filename
   1363    1792       0    3155     c53 sound/soc/mxs/mxs-sgtl5000.o
   1427    1728       0    3155     c53 sound/soc/mxs/mxs-sgtl5000.o

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-10-24 18:34:55 +01:00
Mengdong Lin 2f0ad49104 ASoC: Change DAI link's be_id to a generic id
The generic ID can be used by topology:
- Toplogy can create FE links and set their ID, machine drivers will
  be notified and check this ID for machine-specific init.
- Toplogy can use the ID to find existing BE & CC links and further
  configure them.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-20 17:14:43 +01:00
Pierre-Louis Bossart 2bd5bd15a5 ASoC: Intel: add bytct-rt5651 machine driver
based on bytcr-rt5640 with changes only on codec side
Quirk logic is kept as placeholder.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-05 12:43:54 +00:00