diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2017-04-27 12:02:27 -0400 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2017-05-03 09:21:26 -0400 |
commit | a8562e4dec9c835e3c3b77e2ebfcef89dff9efb4 (patch) | |
tree | d0d45c7fc2ba0fb9cc431e2b3f9978caaddef57f /sound/x86 | |
parent | 20be551e6d0a59d56a593dee0998922cd80f5eb9 (diff) |
drm/i915: Clean up the LPE audio platform data
Split the LPE audio platform data into a port specific
chunk and device specific chunk. Eventually we'll have
a port specific chunk for each port, but for now we'll
stick to just one.
We'll also get rid of the intel_hdmi_lpe_audio_eld structure
which doesn't seem to have any real reason to exist.
v2: Organize per port instead of per pipe
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-9-ville.syrjala@linux.intel.com
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/x86')
-rw-r--r-- | sound/x86/intel_hdmi_audio.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index 1a095189db83..c2b78621852e 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c | |||
@@ -1556,21 +1556,20 @@ static void had_audio_wq(struct work_struct *work) | |||
1556 | struct snd_intelhad *ctx = | 1556 | struct snd_intelhad *ctx = |
1557 | container_of(work, struct snd_intelhad, hdmi_audio_wq); | 1557 | container_of(work, struct snd_intelhad, hdmi_audio_wq); |
1558 | struct intel_hdmi_lpe_audio_pdata *pdata = ctx->dev->platform_data; | 1558 | struct intel_hdmi_lpe_audio_pdata *pdata = ctx->dev->platform_data; |
1559 | struct intel_hdmi_lpe_audio_port_pdata *ppdata = &pdata->port; | ||
1559 | 1560 | ||
1560 | pm_runtime_get_sync(ctx->dev); | 1561 | pm_runtime_get_sync(ctx->dev); |
1561 | mutex_lock(&ctx->mutex); | 1562 | mutex_lock(&ctx->mutex); |
1562 | if (pdata->pipe < 0) { | 1563 | if (ppdata->pipe < 0) { |
1563 | dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG\n", | 1564 | dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG\n", |
1564 | __func__); | 1565 | __func__); |
1565 | memset(ctx->eld, 0, sizeof(ctx->eld)); /* clear the old ELD */ | 1566 | memset(ctx->eld, 0, sizeof(ctx->eld)); /* clear the old ELD */ |
1566 | had_process_hot_unplug(ctx); | 1567 | had_process_hot_unplug(ctx); |
1567 | } else { | 1568 | } else { |
1568 | struct intel_hdmi_lpe_audio_eld *eld = &pdata->eld; | ||
1569 | |||
1570 | dev_dbg(ctx->dev, "%s: HAD_NOTIFY_ELD : port = %d, tmds = %d\n", | 1569 | dev_dbg(ctx->dev, "%s: HAD_NOTIFY_ELD : port = %d, tmds = %d\n", |
1571 | __func__, eld->port_id, pdata->ls_clock); | 1570 | __func__, ppdata->port, ppdata->ls_clock); |
1572 | 1571 | ||
1573 | switch (pdata->pipe) { | 1572 | switch (ppdata->pipe) { |
1574 | case 0: | 1573 | case 0: |
1575 | ctx->had_config_offset = AUDIO_HDMI_CONFIG_A; | 1574 | ctx->had_config_offset = AUDIO_HDMI_CONFIG_A; |
1576 | break; | 1575 | break; |
@@ -1582,18 +1581,18 @@ static void had_audio_wq(struct work_struct *work) | |||
1582 | break; | 1581 | break; |
1583 | default: | 1582 | default: |
1584 | dev_dbg(ctx->dev, "Invalid pipe %d\n", | 1583 | dev_dbg(ctx->dev, "Invalid pipe %d\n", |
1585 | pdata->pipe); | 1584 | ppdata->pipe); |
1586 | break; | 1585 | break; |
1587 | } | 1586 | } |
1588 | 1587 | ||
1589 | memcpy(ctx->eld, eld->eld_data, sizeof(ctx->eld)); | 1588 | memcpy(ctx->eld, ppdata->eld, sizeof(ctx->eld)); |
1590 | 1589 | ||
1591 | ctx->dp_output = pdata->dp_output; | 1590 | ctx->dp_output = ppdata->dp_output; |
1592 | if (ctx->dp_output) { | 1591 | if (ctx->dp_output) { |
1593 | ctx->tmds_clock_speed = 0; | 1592 | ctx->tmds_clock_speed = 0; |
1594 | ctx->link_rate = pdata->ls_clock; | 1593 | ctx->link_rate = ppdata->ls_clock; |
1595 | } else { | 1594 | } else { |
1596 | ctx->tmds_clock_speed = pdata->ls_clock; | 1595 | ctx->tmds_clock_speed = ppdata->ls_clock; |
1597 | ctx->link_rate = 0; | 1596 | ctx->link_rate = 0; |
1598 | } | 1597 | } |
1599 | 1598 | ||