#include <linux/types.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/pm_runtime.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <sound/core.h>
#include <sound/asoundef.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/initval.h>
#include <sound/control.h>
#include <sound/jack.h>
#include <drm/drm_edid.h>
#include <drm/drm_eld.h>
#include <drm/intel/intel_lpe_audio.h>
#include "intel_hdmi_audio.h"
#define INTEL_HDMI_AUDIO_SUSPEND_DELAY_MS …
#define for_each_pipe(card_ctx, pipe) …
#define for_each_port(card_ctx, port) …
static int hdmi_card_index = …;
static char *hdmi_card_id = …;
static bool single_port;
module_param_named(index, hdmi_card_index, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(id, hdmi_card_id, charp, 0444);
MODULE_PARM_DESC(…) …;
module_param(single_port, bool, 0444);
MODULE_PARM_DESC(…) …;
static const int eld_speaker_allocation_bits[] = …;
static struct cea_channel_speaker_allocation channel_allocations[] = …;
static const struct channel_map_table map_tables[] = …;
static const struct snd_pcm_hardware had_pcm_hardware = …;
static struct snd_pcm_substream *
had_substream_get(struct snd_intelhad *intelhaddata)
{ … }
static void had_substream_put(struct snd_intelhad *intelhaddata)
{ … }
static u32 had_config_offset(int pipe)
{ … }
static u32 had_read_register_raw(struct snd_intelhad_card *card_ctx,
int pipe, u32 reg)
{ … }
static void had_write_register_raw(struct snd_intelhad_card *card_ctx,
int pipe, u32 reg, u32 val)
{ … }
static void had_read_register(struct snd_intelhad *ctx, u32 reg, u32 *val)
{ … }
static void had_write_register(struct snd_intelhad *ctx, u32 reg, u32 val)
{ … }
static void had_enable_audio(struct snd_intelhad *intelhaddata,
bool enable)
{ … }
static void had_ack_irqs(struct snd_intelhad *ctx)
{ … }
static void had_reset_audio(struct snd_intelhad *intelhaddata)
{ … }
static int had_prog_status_reg(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata)
{ … }
static int had_init_audio_ctrl(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata)
{ … }
static void init_channel_allocations(void)
{ … }
static int had_channel_allocation(struct snd_intelhad *intelhaddata,
int channels)
{ … }
static int spk_to_chmap(int spk)
{ … }
static void had_build_channel_allocation_map(struct snd_intelhad *intelhaddata)
{ … }
static int had_chmap_ctl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int had_chmap_ctl_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int had_register_chmap_ctls(struct snd_intelhad *intelhaddata,
struct snd_pcm *pcm)
{ … }
static void had_prog_dip(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata)
{ … }
static int had_calculate_maud_value(u32 aud_samp_freq, u32 link_rate)
{ … }
static void had_prog_cts(u32 aud_samp_freq, u32 tmds, u32 link_rate,
u32 n_param, struct snd_intelhad *intelhaddata)
{ … }
static int had_calculate_n_value(u32 aud_samp_freq)
{ … }
static int had_prog_n(u32 aud_samp_freq, u32 *n_param,
struct snd_intelhad *intelhaddata)
{ … }
#define AUD_BUF_ADDR(x) …
#define AUD_BUF_LEN(x) …
static void had_prog_bd(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata)
{ … }
static void had_invalidate_bd(struct snd_intelhad *intelhaddata,
int idx)
{ … }
static void had_init_ringbuf(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata)
{ … }
static void had_advance_ringbuf(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata)
{ … }
static int had_process_ringbuf(struct snd_pcm_substream *substream,
struct snd_intelhad *intelhaddata)
{ … }
static void had_process_buffer_done(struct snd_intelhad *intelhaddata)
{ … }
static void wait_clear_underrun_bit(struct snd_intelhad *intelhaddata)
{ … }
static int had_pcm_sync_stop(struct snd_pcm_substream *substream)
{ … }
static void had_process_buffer_underrun(struct snd_intelhad *intelhaddata)
{ … }
static int had_pcm_open(struct snd_pcm_substream *substream)
{ … }
static int had_pcm_close(struct snd_pcm_substream *substream)
{ … }
static int had_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{ … }
static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
static int had_pcm_prepare(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t had_pcm_pointer(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops had_pcm_ops = …;
static int had_process_mode_change(struct snd_intelhad *intelhaddata)
{ … }
static void had_process_hot_plug(struct snd_intelhad *intelhaddata)
{ … }
static void had_process_hot_unplug(struct snd_intelhad *intelhaddata)
{ … }
static int had_iec958_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int had_iec958_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int had_iec958_mask_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int had_iec958_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int had_ctl_eld_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int had_ctl_eld_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const struct snd_kcontrol_new had_controls[] = …;
static irqreturn_t display_pipe_interrupt_handler(int irq, void *dev_id)
{ … }
static void notify_audio_lpe(struct platform_device *pdev, int port)
{ … }
static void had_audio_wq(struct work_struct *work)
{ … }
static int had_create_jack(struct snd_intelhad *ctx,
struct snd_pcm *pcm)
{ … }
static int __maybe_unused hdmi_lpe_audio_suspend(struct device *dev)
{ … }
static int __maybe_unused hdmi_lpe_audio_resume(struct device *dev)
{ … }
static void hdmi_lpe_audio_free(struct snd_card *card)
{ … }
static int __hdmi_lpe_audio_probe(struct platform_device *pdev)
{ … }
static int hdmi_lpe_audio_probe(struct platform_device *pdev)
{ … }
static const struct dev_pm_ops hdmi_lpe_audio_pm = …;
static struct platform_driver hdmi_lpe_audio_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;