Path: blob/master/sound/soc/intel/boards/sof_sdw_hdmi.c
26493 views
// SPDX-License-Identifier: GPL-2.0-only1// Copyright (c) 2020 Intel Corporation23/*4* sof_sdw_hdmi - Helpers to handle HDMI from generic machine driver5*/67#include <linux/acpi.h>8#include <linux/device.h>9#include <linux/errno.h>10#include <linux/kernel.h>11#include <linux/list.h>12#include <linux/soundwire/sdw_intel.h>13#include <sound/soc.h>14#include <sound/soc-acpi.h>15#include <sound/jack.h>16#include "sof_sdw_common.h"17#include "hda_dsp_common.h"1819int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd)20{21struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(rtd->card);22struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private;23struct snd_soc_dai *dai = snd_soc_rtd_to_codec(rtd, 0);2425intel_ctx->hdmi.hdmi_comp = dai->component;2627return 0;28}2930int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card)31{32struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card);33struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private;3435if (!intel_ctx->hdmi.idisp_codec)36return 0;3738if (!intel_ctx->hdmi.hdmi_comp)39return -EINVAL;4041return hda_dsp_hdmi_build_controls(card, intel_ctx->hdmi.hdmi_comp);42}434445