aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/sof_sdw_rt711_sdca.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-07-15ASoC: Intel: sof_sdw: avoid oops in error handlingPierre-Louis Bossart1-0/+3
While tinkering with ACPI work-arounds for the HP Omen 16 support, we identified a corner case where the headset codec device properties are not set in the codec .init when -EPROBE_DEFER is returned, but released unconditionally in the .exit(). This leads to a kernel oops [ 4.186891] sof_sdw sof_sdw: snd_soc_register_card failed -517 [ 4.186896] BUG: kernel NULL pointer dereference, address: 00000000000003f0 [ 4.186914] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 4.186926] RIP: 0010:dev_fwnode+0x5/0x20 [ 4.186974] device_remove_software_node+0x10/0x80 [ 4.186982] sof_sdw_rt711_exit+0x19/0x30 [snd_soc_sof_sdw] [ 4.186990] mc_dailink_exit_loop+0x94/0xc0 [snd_soc_sof_sdw] [ 4.186996] ? rt711_rtd_init+0x170/0x170 [snd_soc_sof_sdw] A similar error case can occur if the addition of the device property fails. We need to test if the property was successfully added before removing it. BugLink: https://github.com/thesofproject/linux/issues/3727 Fixes: 768ad6d80db2d ("ASoC: Intel: sof_sdw: handle errors on card registration") Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20220715144144.274770-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-14ASoC: soc-card: Create jack kcontrol without pinsAkihiko Odaki1-7/+7
snd_soc_card_jack_new() allowed to create jack kcontrol without pins, but did not create kcontrols. The jack would not have kcontrols if pins were not going to be added. This renames the old snd_soc_card_jack_new() to snd_soc_card_jack_new_pins() for use when pins are provided or will be added later. The new snd_soc_card_jack_new() appropriately creates a jack for use without pins and adds a kcontrol. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: use software node API in SoundWire machinesPierre-Louis Bossart1-2/+12
The function device_add_properties() is going to be removed. Replacing it with software node API equivalents. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Co-developed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: sof_sdw_rt711*: keep codec device reference until removePierre-Louis Bossart1-24/+19
Follow the example of Intel Atom drivers and keep a reference to the headset codec until the properties are removed. There is no guarantee that the module for the codec driver is loaded before the machine driver probe, the use of the deferred probe mechanism is required. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: sof_sdw: pass card information to init/exit functionsPierre-Louis Bossart1-2/+3
If we want to handle a context in init/exit function, we have to pass the card information. This will be necessary to better deal with device properties in the follow-up commits. No functional change other than prototype update. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-24ASoC: intel: sof_sdw: add rt711 rt1316 rt714 SDCA codec support.Bard Liao1-0/+174
Add rt711, rt1316, and rt714 SDCA codecs support in sof_sdw machine driver. Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200821195603.215535-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>