summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-02-02 10:19:03 -0500
committerTakashi Iwai <tiwai@suse.de>2017-02-03 11:37:13 -0500
commit03c3437755881a9f6f1b5f8c05e62edf7898a87f (patch)
treeb2dd6fdb4d6bed979fbb2fb211dfaf27be8c17ae
parent7ceba75f21e4ecb520b110ffada72cc0c9f5c072 (diff)
ALSA: x86: Clean up unused defines and inclusions
Many defines and constants are left unused. Clean them up. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/x86/intel_hdmi_audio.c10
-rw-r--r--sound/x86/intel_hdmi_audio.h11
-rw-r--r--sound/x86/intel_hdmi_lpe_audio.h68
3 files changed, 20 insertions, 69 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index f825d514500e..82f48fbcd74b 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -21,19 +21,21 @@
21 * ALSA driver for Intel HDMI audio 21 * ALSA driver for Intel HDMI audio
22 */ 22 */
23 23
24#include <linux/types.h>
24#include <linux/platform_device.h> 25#include <linux/platform_device.h>
25#include <linux/io.h> 26#include <linux/io.h>
26#include <linux/slab.h> 27#include <linux/slab.h>
27#include <linux/module.h> 28#include <linux/module.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
29#include <linux/acpi.h> 30#include <linux/pm_runtime.h>
30#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
31#include <sound/pcm.h>
32#include <sound/core.h> 32#include <sound/core.h>
33#include <sound/asoundef.h>
34#include <sound/pcm.h>
33#include <sound/pcm_params.h> 35#include <sound/pcm_params.h>
34#include <sound/initval.h> 36#include <sound/initval.h>
35#include <sound/control.h> 37#include <sound/control.h>
36#include <sound/initval.h> 38#include <drm/drm_edid.h>
37#include <drm/intel_lpe_audio.h> 39#include <drm/intel_lpe_audio.h>
38#include "intel_hdmi_audio.h" 40#include "intel_hdmi_audio.h"
39 41
@@ -929,6 +931,8 @@ static int snd_intelhad_prog_n(u32 aud_samp_freq, u32 *n_param,
929 return 0; 931 return 0;
930} 932}
931 933
934#define MAX_CNT 0xFF
935
932static void snd_intelhad_handle_underrun(struct snd_intelhad *intelhaddata) 936static void snd_intelhad_handle_underrun(struct snd_intelhad *intelhaddata)
933{ 937{
934 u32 hdmi_status = 0, i = 0; 938 u32 hdmi_status = 0, i = 0;
diff --git a/sound/x86/intel_hdmi_audio.h b/sound/x86/intel_hdmi_audio.h
index 9dc0da474f05..dea51fcfc07f 100644
--- a/sound/x86/intel_hdmi_audio.h
+++ b/sound/x86/intel_hdmi_audio.h
@@ -30,20 +30,11 @@
30#ifndef _INTEL_HDMI_AUDIO_H_ 30#ifndef _INTEL_HDMI_AUDIO_H_
31#define _INTEL_HDMI_AUDIO_H_ 31#define _INTEL_HDMI_AUDIO_H_
32 32
33#include <linux/types.h>
34#include <sound/initval.h>
35#include <linux/version.h>
36#include <linux/pm_runtime.h>
37#include <sound/asoundef.h>
38#include <sound/control.h>
39#include <sound/pcm.h>
40#include <drm/drm_edid.h>
41#include "intel_hdmi_lpe_audio.h" 33#include "intel_hdmi_lpe_audio.h"
42 34
43#define PCM_INDEX 0 35#define PCM_INDEX 0
44#define MAX_PB_STREAMS 1 36#define MAX_PB_STREAMS 1
45#define MAX_CAP_STREAMS 0 37#define MAX_CAP_STREAMS 0
46#define HDMI_AUDIO_DRIVER "hdmi-audio"
47 38
48#define HDMI_INFO_FRAME_WORD1 0x000a0184 39#define HDMI_INFO_FRAME_WORD1 0x000a0184
49#define DP_INFO_FRAME_WORD1 0x00441b84 40#define DP_INFO_FRAME_WORD1 0x00441b84
@@ -85,7 +76,7 @@ struct ring_buf_info {
85 u8 is_valid; 76 u8 is_valid;
86}; 77};
87 78
88/** 79/*
89 * struct snd_intelhad - intelhad driver structure 80 * struct snd_intelhad - intelhad driver structure
90 * 81 *
91 * @card: ptr to hold card details 82 * @card: ptr to hold card details
diff --git a/sound/x86/intel_hdmi_lpe_audio.h b/sound/x86/intel_hdmi_lpe_audio.h
index 0e8397970e4a..5a5adb7f0cde 100644
--- a/sound/x86/intel_hdmi_lpe_audio.h
+++ b/sound/x86/intel_hdmi_lpe_audio.h
@@ -23,20 +23,6 @@
23#ifndef __INTEL_HDMI_LPE_AUDIO_H 23#ifndef __INTEL_HDMI_LPE_AUDIO_H
24#define __INTEL_HDMI_LPE_AUDIO_H 24#define __INTEL_HDMI_LPE_AUDIO_H
25 25
26#include <linux/types.h>
27#include <sound/initval.h>
28#include <linux/version.h>
29#include <linux/pm_runtime.h>
30#include <linux/platform_device.h>
31#include <sound/asoundef.h>
32#include <sound/control.h>
33#include <sound/pcm.h>
34
35#define AUD_CONFIG_VALID_BIT (1<<9)
36#define AUD_CONFIG_DP_MODE (1<<15)
37#define AUD_CONFIG_BLOCK_BIT (1<<7)
38
39#define HMDI_LPE_AUDIO_DRIVER_NAME "intel-hdmi-lpe-audio"
40#define HAD_MAX_DEVICES 1 26#define HAD_MAX_DEVICES 1
41#define HAD_MIN_CHANNEL 2 27#define HAD_MIN_CHANNEL 2
42#define HAD_MAX_CHANNEL 8 28#define HAD_MAX_CHANNEL 8
@@ -96,14 +82,6 @@
96/* Naud Value */ 82/* Naud Value */
97#define DP_NAUD_VAL 32768 83#define DP_NAUD_VAL 32768
98 84
99/* _AUD_CONFIG register MASK */
100#define AUD_CONFIG_MASK_UNDERRUN 0xC0000000
101#define AUD_CONFIG_MASK_SRDBG 0x00000002
102#define AUD_CONFIG_MASK_FUNCRST 0x00000001
103
104#define MAX_CNT 0xFF
105#define HAD_SUSPEND_DELAY 1000
106
107enum had_drv_status { 85enum had_drv_status {
108 HAD_DRV_CONNECTED, 86 HAD_DRV_CONNECTED,
109 HAD_DRV_RUNNING, 87 HAD_DRV_RUNNING,
@@ -120,17 +98,10 @@ enum intel_had_aud_buf_type {
120 HAD_BUF_TYPE_D = 3, 98 HAD_BUF_TYPE_D = 3,
121}; 99};
122 100
123enum num_aud_ch {
124 CH_STEREO = 0,
125 CH_THREE_FOUR = 1,
126 CH_FIVE_SIX = 2,
127 CH_SEVEN_EIGHT = 3
128};
129
130/* HDMI Controller register offsets - audio domain common */ 101/* HDMI Controller register offsets - audio domain common */
131/* Base address for below regs = 0x65000 */ 102/* Base address for below regs = 0x65000 */
132enum hdmi_ctrl_reg_offset_common { 103enum hdmi_ctrl_reg_offset_common {
133 AUDIO_HDMI_CONFIG_A = 0x000, 104 AUDIO_HDMI_CONFIG_A = 0x000,
134 AUDIO_HDMI_CONFIG_B = 0x800, 105 AUDIO_HDMI_CONFIG_B = 0x800,
135 AUDIO_HDMI_CONFIG_C = 0x900, 106 AUDIO_HDMI_CONFIG_C = 0x900,
136}; 107};
@@ -220,6 +191,10 @@ union aud_cfg {
220 u32 regval; 191 u32 regval;
221}; 192};
222 193
194#define AUD_CONFIG_BLOCK_BIT (1 << 7)
195#define AUD_CONFIG_VALID_BIT (1 << 9)
196#define AUD_CONFIG_DP_MODE (1 << 15)
197
223/* Audio Channel Status 0 Attributes */ 198/* Audio Channel Status 0 Attributes */
224union aud_ch_status_0 { 199union aud_ch_status_0 {
225 struct { 200 struct {
@@ -371,32 +346,13 @@ union aud_info_frame3 {
371 u32 regval; 346 u32 regval;
372}; 347};
373 348
374#define HDMI_AUDIO_UNDERRUN (1UL<<31) 349/* AUD_HDMI_STATUS bits */
375#define HDMI_AUDIO_BUFFER_DONE (1UL<<29) 350#define HDMI_AUDIO_UNDERRUN (1U << 31)
351#define HDMI_AUDIO_BUFFER_DONE (1U << 29)
376 352
377 353/* AUD_HDMI_STATUS register mask */
378#define PORT_ENABLE (1 << 31) 354#define AUD_CONFIG_MASK_UNDERRUN 0xC0000000
379#define SDVO_AUDIO_ENABLE (1 << 6) 355#define AUD_CONFIG_MASK_SRDBG 0x00000002
380 356#define AUD_CONFIG_MASK_FUNCRST 0x00000001
381enum had_caps_list {
382 HAD_GET_ELD = 1,
383 HAD_GET_DISPLAY_RATE,
384 HAD_GET_DP_OUTPUT,
385 HAD_GET_LINK_RATE,
386 HAD_SET_ENABLE_AUDIO,
387 HAD_SET_DISABLE_AUDIO,
388 HAD_SET_ENABLE_AUDIO_INT,
389 HAD_SET_DISABLE_AUDIO_INT,
390};
391
392enum had_event_type {
393 HAD_EVENT_HOT_PLUG = 1,
394 HAD_EVENT_HOT_UNPLUG,
395 HAD_EVENT_MODE_CHANGING,
396 HAD_EVENT_AUDIO_BUFFER_DONE,
397 HAD_EVENT_AUDIO_BUFFER_UNDERRUN,
398 HAD_EVENT_QUERY_IS_AUDIO_BUSY,
399 HAD_EVENT_QUERY_IS_AUDIO_SUSPENDED,
400};
401 357
402#endif 358#endif