diff options
Diffstat (limited to 'sound/pci/hda/hda_controller.c')
-rw-r--r-- | sound/pci/hda/hda_controller.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 8276a743e22e..0cfc9c8c4b4e 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c | |||
@@ -1922,10 +1922,18 @@ int azx_mixer_create(struct azx *chip) | |||
1922 | EXPORT_SYMBOL_GPL(azx_mixer_create); | 1922 | EXPORT_SYMBOL_GPL(azx_mixer_create); |
1923 | 1923 | ||
1924 | 1924 | ||
1925 | static bool is_input_stream(struct azx *chip, unsigned char index) | ||
1926 | { | ||
1927 | return (index >= chip->capture_index_offset && | ||
1928 | index < chip->capture_index_offset + chip->capture_streams); | ||
1929 | } | ||
1930 | |||
1925 | /* initialize SD streams */ | 1931 | /* initialize SD streams */ |
1926 | int azx_init_stream(struct azx *chip) | 1932 | int azx_init_stream(struct azx *chip) |
1927 | { | 1933 | { |
1928 | int i; | 1934 | int i; |
1935 | int in_stream_tag = 0; | ||
1936 | int out_stream_tag = 0; | ||
1929 | 1937 | ||
1930 | /* initialize each stream (aka device) | 1938 | /* initialize each stream (aka device) |
1931 | * assign the starting bdl address to each stream (device) | 1939 | * assign the starting bdl address to each stream (device) |
@@ -1938,9 +1946,21 @@ int azx_init_stream(struct azx *chip) | |||
1938 | azx_dev->sd_addr = chip->remap_addr + (0x20 * i + 0x80); | 1946 | azx_dev->sd_addr = chip->remap_addr + (0x20 * i + 0x80); |
1939 | /* int mask: SDI0=0x01, SDI1=0x02, ... SDO3=0x80 */ | 1947 | /* int mask: SDI0=0x01, SDI1=0x02, ... SDO3=0x80 */ |
1940 | azx_dev->sd_int_sta_mask = 1 << i; | 1948 | azx_dev->sd_int_sta_mask = 1 << i; |
1941 | /* stream tag: must be non-zero and unique */ | ||
1942 | azx_dev->index = i; | 1949 | azx_dev->index = i; |
1943 | azx_dev->stream_tag = i + 1; | 1950 | |
1951 | /* stream tag must be unique throughout | ||
1952 | * the stream direction group, | ||
1953 | * valid values 1...15 | ||
1954 | * use separate stream tag if the flag | ||
1955 | * AZX_DCAPS_SEPARATE_STREAM_TAG is used | ||
1956 | */ | ||
1957 | if (chip->driver_caps & AZX_DCAPS_SEPARATE_STREAM_TAG) | ||
1958 | azx_dev->stream_tag = | ||
1959 | is_input_stream(chip, i) ? | ||
1960 | ++in_stream_tag : | ||
1961 | ++out_stream_tag; | ||
1962 | else | ||
1963 | azx_dev->stream_tag = i + 1; | ||
1944 | } | 1964 | } |
1945 | 1965 | ||
1946 | return 0; | 1966 | return 0; |