Guest User

linux-099_intel_hdmi_audio_single_port.patch

a guest
Mar 9th, 2018
569
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
  2. index a0951505c7f5..96115c401292 100644
  3. --- a/sound/x86/intel_hdmi_audio.c
  4. +++ b/sound/x86/intel_hdmi_audio.c
  5. @@ -50,6 +50,7 @@
  6.  /*standard module options for ALSA. This module supports only one card*/
  7.  static int hdmi_card_index = SNDRV_DEFAULT_IDX1;
  8.  static char *hdmi_card_id = SNDRV_DEFAULT_STR1;
  9. +static bool single_port;
  10.  
  11.  module_param_named(index, hdmi_card_index, int, 0444);
  12.  MODULE_PARM_DESC(index,
  13. @@ -57,6 +58,9 @@ MODULE_PARM_DESC(index,
  14.  module_param_named(id, hdmi_card_id, charp, 0444);
  15.  MODULE_PARM_DESC(id,
  16.         "ID string for INTEL Intel HDMI Audio controller.");
  17. +module_param(single_port, bool, 0444);
  18. +MODULE_PARM_DESC(single_port,
  19. +       "Single-port mode (for compatibility)");
  20.  
  21.  /*
  22.   * ELD SA bits in the CEA Speaker Allocation data block
  23. @@ -1579,7 +1583,11 @@ static irqreturn_t display_pipe_interrupt_handler(int irq, void *dev_id)
  24.  static void notify_audio_lpe(struct platform_device *pdev, int port)
  25.  {
  26.     struct snd_intelhad_card *card_ctx = platform_get_drvdata(pdev);
  27. -   struct snd_intelhad *ctx = &card_ctx->pcm_ctx[port];
  28. +   struct snd_intelhad *ctx;
  29. +
  30. +   ctx = &card_ctx->pcm_ctx[single_port ? 0 : port];
  31. +   if (single_port)
  32. +       ctx->port = port;
  33.  
  34.     schedule_work(&ctx->hdmi_audio_wq);
  35.  }
  36. @@ -1816,7 +1824,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
  37.     init_channel_allocations();
  38.  
  39.     card_ctx->num_pipes = pdata->num_pipes;
  40. -   card_ctx->num_ports = pdata->num_ports;
  41. +   card_ctx->num_ports = single_port ? 1 : pdata->num_ports;
  42.  
  43.     for_each_port(card_ctx, port) {
  44.         struct snd_intelhad *ctx = &card_ctx->pcm_ctx[port];
  45. @@ -1824,7 +1832,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
  46.  
  47.         ctx->card_ctx = card_ctx;
  48.         ctx->dev = card_ctx->dev;
  49. -       ctx->port = port;
  50. +       ctx->port = single_port ? -1 : port;
  51.         ctx->pipe = -1;
  52.  
  53.         INIT_WORK(&ctx->hdmi_audio_wq, had_audio_wq);
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×