mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-20 13:24:17 -04:00
Add DisplayPort sound support for Fairphone 5
Merge series from Luca Weiss <luca.weiss@fairphone.com>: Add the necessary sound card bits and some dts additions to enable sound over DisplayPort-over-USB-C, e.g. to a connected TV or monitor. The UCM files can be found here: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/tree/master/device/testing/device-fairphone-fp5/ucm This series - in spirit - depends on the series enabling DisplayPort in the first place, but can land pretty independently, especially the ASoC bits: https://lore.kernel.org/linux-arm-msm/20250312-fp5-pmic-glink-dp-v2-0-a55927749d77@fairphone.com/
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include "usb_offload_utils.h"
|
||||
#include "sdw.h"
|
||||
|
||||
#define DRIVER_NAME "sm8250"
|
||||
#define MI2S_BCLK_RATE 1536000
|
||||
|
||||
struct sm8250_snd_data {
|
||||
@@ -26,6 +25,7 @@ struct sm8250_snd_data {
|
||||
struct snd_soc_jack jack;
|
||||
struct snd_soc_jack usb_offload_jack;
|
||||
bool usb_offload_jack_setup;
|
||||
struct snd_soc_jack dp_jack;
|
||||
bool jack_setup;
|
||||
};
|
||||
|
||||
@@ -33,14 +33,16 @@ static int sm8250_snd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
struct sm8250_snd_data *data = snd_soc_card_get_drvdata(rtd->card);
|
||||
struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
|
||||
int ret;
|
||||
|
||||
if (cpu_dai->id == USB_RX)
|
||||
ret = qcom_snd_usb_offload_jack_setup(rtd, &data->usb_offload_jack,
|
||||
&data->usb_offload_jack_setup);
|
||||
else
|
||||
ret = qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup);
|
||||
return ret;
|
||||
switch (cpu_dai->id) {
|
||||
case DISPLAY_PORT_RX:
|
||||
return qcom_snd_dp_jack_setup(rtd, &data->dp_jack, 0);
|
||||
case USB_RX:
|
||||
return qcom_snd_usb_offload_jack_setup(rtd, &data->usb_offload_jack,
|
||||
&data->usb_offload_jack_setup);
|
||||
default:
|
||||
return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup);
|
||||
}
|
||||
}
|
||||
|
||||
static void sm8250_snd_exit(struct snd_soc_pcm_runtime *rtd)
|
||||
@@ -200,15 +202,16 @@ static int sm8250_platform_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
card->driver_name = DRIVER_NAME;
|
||||
card->driver_name = of_device_get_match_data(dev);
|
||||
sm8250_add_be_ops(card);
|
||||
return devm_snd_soc_register_card(dev, card);
|
||||
}
|
||||
|
||||
static const struct of_device_id snd_sm8250_dt_match[] = {
|
||||
{.compatible = "qcom,sm8250-sndcard"},
|
||||
{.compatible = "qcom,qrb4210-rb2-sndcard"},
|
||||
{.compatible = "qcom,qrb5165-rb5-sndcard"},
|
||||
{ .compatible = "fairphone,fp5-sndcard", .data = "qcm6490" },
|
||||
{ .compatible = "qcom,qrb4210-rb2-sndcard", .data = "sm4250" },
|
||||
{ .compatible = "qcom,qrb5165-rb5-sndcard", .data = "sm8250" },
|
||||
{ .compatible = "qcom,sm8250-sndcard", .data = "sm8250" },
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user