提交 a6505620 编写于 作者: T Takashi Iwai

Merge branch 'topic/hda' into to-push

...@@ -757,6 +757,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. ...@@ -757,6 +757,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
model - force the model name model - force the model name
position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF) position_fix - Fix DMA pointer (0 = auto, 1 = use LPIB, 2 = POSBUF)
probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) probe_mask - Bitmask to probe codecs (default = -1, meaning all slots)
probe_only - Only probing and no codec initialization (default=off);
Useful to check the initial codec status for debugging
bdl_pos_adj - Specifies the DMA IRQ timing delay in samples. bdl_pos_adj - Specifies the DMA IRQ timing delay in samples.
Passing -1 will make the driver to choose the appropriate Passing -1 will make the driver to choose the appropriate
value based on the controller chip. value based on the controller chip.
...@@ -772,327 +774,23 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. ...@@ -772,327 +774,23 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
This module supports multiple cards and autoprobe. This module supports multiple cards and autoprobe.
See Documentation/sound/alsa/HD-Audio.txt for more details about
HD-audio driver.
Each codec may have a model table for different configurations. Each codec may have a model table for different configurations.
If your machine isn't listed there, the default (usually minimal) If your machine isn't listed there, the default (usually minimal)
configuration is set up. You can pass "model=<name>" option to configuration is set up. You can pass "model=<name>" option to
specify a certain model in such a case. There are different specify a certain model in such a case. There are different
models depending on the codec chip. models depending on the codec chip. The list of available models
is found in HD-Audio-Models.txt
Model name Description
---------- -----------
ALC880
3stack 3-jack in back and a headphone out
3stack-digout 3-jack in back, a HP out and a SPDIF out
5stack 5-jack in back, 2-jack in front
5stack-digout 5-jack in back, 2-jack in front, a SPDIF out
6stack 6-jack in back, 2-jack in front
6stack-digout 6-jack with a SPDIF out
w810 3-jack
z71v 3-jack (HP shared SPDIF)
asus 3-jack (ASUS Mobo)
asus-w1v ASUS W1V
asus-dig ASUS with SPDIF out
asus-dig2 ASUS with SPDIF out (using GPIO2)
uniwill 3-jack
fujitsu Fujitsu Laptops (Pi1536)
F1734 2-jack
lg LG laptop (m1 express dual)
lg-lw LG LW20/LW25 laptop
tcl TCL S700
clevo Clevo laptops (m520G, m665n)
medion Medion Rim 2150
test for testing/debugging purpose, almost all controls can be
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)
ALC260
hp HP machines
hp-3013 HP machines (3013-variant)
hp-dc7600 HP DC7600
fujitsu Fujitsu S7020
acer Acer TravelMate
will Will laptops (PB V7900)
replacer Replacer 672V
basic fixed pin assignment (old default model)
test for testing/debugging purpose, almost all controls can
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)
ALC262
fujitsu Fujitsu Laptop
hp-bpc HP xw4400/6400/8400/9400 laptops
hp-bpc-d7000 HP BPC D7000
hp-tc-t5735 HP Thin Client T5735
hp-rp5700 HP RP5700
benq Benq ED8
benq-t31 Benq T31
hippo Hippo (ATI) with jack detection, Sony UX-90s
hippo_1 Hippo (Benq) with jack detection
sony-assamd Sony ASSAMD
toshiba-s06 Toshiba S06
toshiba-rx1 Toshiba RX1
ultra Samsung Q1 Ultra Vista model
lenovo-3000 Lenovo 3000 y410
nec NEC Versa S9100
basic fixed pin assignment w/o SPDIF
auto auto-config reading BIOS (default)
ALC267/268
quanta-il1 Quanta IL1 mini-notebook
3stack 3-stack model
toshiba Toshiba A205
acer Acer laptops
acer-aspire Acer Aspire One
dell Dell OEM laptops (Vostro 1200)
zepto Zepto laptops
test for testing/debugging purpose, almost all controls can
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)
ALC269
basic Basic preset
quanta Quanta FL1
eeepc-p703 ASUS Eeepc P703 P900A
eeepc-p901 ASUS Eeepc P901 S101
ALC662/663
3stack-dig 3-stack (2-channel) with SPDIF
3stack-6ch 3-stack (6-channel)
3stack-6ch-dig 3-stack (6-channel) with SPDIF
6stack-dig 6-stack with SPDIF
lenovo-101e Lenovo laptop
eeepc-p701 ASUS Eeepc P701
eeepc-ep20 ASUS Eeepc EP20
ecs ECS/Foxconn mobo
m51va ASUS M51VA
g71v ASUS G71V
h13 ASUS H13
g50v ASUS G50V
asus-mode1 ASUS
asus-mode2 ASUS
asus-mode3 ASUS
asus-mode4 ASUS
asus-mode5 ASUS
asus-mode6 ASUS
auto auto-config reading BIOS (default)
ALC882/885
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack digital with SPDIF I/O
arima Arima W820Di1
targa Targa T8, MSI-1049 T8
asus-a7j ASUS A7J
asus-a7m ASUS A7M
macpro MacPro support
mbp3 Macbook Pro rev3
imac24 iMac 24'' with jack detection
w2jc ASUS W2JC
auto auto-config reading BIOS (default)
ALC883/888
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack digital with SPDIF I/O
3stack-6ch 3-jack 6-channel
3stack-6ch-dig 3-jack 6-channel with SPDIF I/O
6stack-dig-demo 6-jack digital for Intel demo board
acer Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc)
acer-aspire Acer Aspire 9810
medion Medion Laptops
medion-md2 Medion MD2
targa-dig Targa/MSI
targa-2ch-dig Targs/MSI with 2-channel
laptop-eapd 3-jack with SPDIF I/O and EAPD (Clevo M540JE, M550JE)
lenovo-101e Lenovo 101E
lenovo-nb0763 Lenovo NB0763
lenovo-ms7195-dig Lenovo MS7195
lenovo-sky Lenovo Sky
haier-w66 Haier W66
3stack-hp HP machines with 3stack (Lucknow, Samba boards)
6stack-dell Dell machines with 6stack (Inspiron 530)
mitac Mitac 8252D
clevo-m720 Clevo M720 laptop series
fujitsu-pi2515 Fujitsu AMILO Pi2515
3stack-6ch-intel Intel DG33* boards
auto auto-config reading BIOS (default)
ALC861/660
3stack 3-jack
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack with SPDIF I/O
3stack-660 3-jack (for ALC660)
uniwill-m31 Uniwill M31 laptop
toshiba Toshiba laptop support
asus Asus laptop support
asus-laptop ASUS F2/F3 laptops
auto auto-config reading BIOS (default)
ALC861VD/660VD
3stack 3-jack
3stack-dig 3-jack with SPDIF OUT
6stack-dig 6-jack with SPDIF OUT
3stack-660 3-jack (for ALC660VD)
3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD)
lenovo Lenovo 3000 C200
dallas Dallas laptops
hp HP TX1000
auto auto-config reading BIOS (default)
CMI9880
minimal 3-jack in back
min_fp 3-jack in back, 2-jack in front
full 6-jack in back, 2-jack in front
full_dig 6-jack in back, 2-jack in front, SPDIF I/O
allout 5-jack in back, 2-jack in front, SPDIF out
auto auto-config reading BIOS (default)
AD1882 / AD1882A
3stack 3-stack mode (default)
6stack 6-stack mode
AD1884A / AD1883 / AD1984A / AD1984B
desktop 3-stack desktop (default)
laptop laptop with HP jack sensing
mobile mobile devices with HP jack sensing
thinkpad Lenovo Thinkpad X300
AD1884
N/A
AD1981
basic 3-jack (default)
hp HP nx6320
thinkpad Lenovo Thinkpad T60/X60/Z60
toshiba Toshiba U205
AD1983
N/A
AD1984
basic default configuration
thinkpad Lenovo Thinkpad T61/X61
dell Dell T3400
AD1986A
6stack 6-jack, separate surrounds (default)
3stack 3-stack, shared surrounds
laptop 2-channel only (FSC V2060, Samsung M50)
laptop-eapd 2-channel with EAPD (Samsung R65, ASUS A6J)
laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
ultra 2-channel with EAPD (Samsung Ultra tablet PC)
AD1988/AD1988B/AD1989A/AD1989B
6stack 6-jack
6stack-dig ditto with SPDIF
3stack 3-jack
3stack-dig ditto with SPDIF
laptop 3-jack with hp-jack automute
laptop-dig ditto with SPDIF
auto auto-config reading BIOS (default)
Conexant 5045
laptop-hpsense Laptop with HP sense (old model laptop)
laptop-micsense Laptop with Mic sense (old model fujitsu)
laptop-hpmicsense Laptop with HP and Mic senses
benq Benq R55E
test for testing/debugging purpose, almost all controls
can be adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
Conexant 5047
laptop Basic Laptop config
laptop-hp Laptop config for some HP models (subdevice 30A5)
laptop-eapd Laptop config with EAPD support
test for testing/debugging purpose, almost all controls
can be adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
Conexant 5051
laptop Basic Laptop config (default)
hp HP Spartan laptop
STAC9200
ref Reference board
dell-d21 Dell (unknown)
dell-d22 Dell (unknown)
dell-d23 Dell (unknown)
dell-m21 Dell Inspiron 630m, Dell Inspiron 640m
dell-m22 Dell Latitude D620, Dell Latitude D820
dell-m23 Dell XPS M1710, Dell Precision M90
dell-m24 Dell Latitude 120L
dell-m25 Dell Inspiron E1505n
dell-m26 Dell Inspiron 1501
dell-m27 Dell Inspiron E1705/9400
gateway Gateway laptops with EAPD control
panasonic Panasonic CF-74
STAC9205/9254
ref Reference board
dell-m42 Dell (unknown)
dell-m43 Dell Precision
dell-m44 Dell Inspiron
STAC9220/9221
ref Reference board
3stack D945 3stack
5stack D945 5stack + SPDIF
intel-mac-v1 Intel Mac Type 1
intel-mac-v2 Intel Mac Type 2
intel-mac-v3 Intel Mac Type 3
intel-mac-v4 Intel Mac Type 4
intel-mac-v5 Intel Mac Type 5
intel-mac-auto Intel Mac (detect type according to subsystem id)
macmini Intel Mac Mini (equivalent with type 3)
macbook Intel Mac Book (eq. type 5)
macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3)
macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3)
imac-intel Intel iMac (eq. type 2)
imac-intel-20 Intel iMac (newer version) (eq. type 3)
dell-d81 Dell (unknown)
dell-d82 Dell (unknown)
dell-m81 Dell (unknown)
dell-m82 Dell XPS M1210
STAC9202/9250/9251
ref Reference board, base config
m2-2 Some Gateway MX series laptops
m6 Some Gateway NX series laptops
pa6 Gateway NX860 series
STAC9227/9228/9229/927x
ref Reference board
ref-no-jd Reference board without HP/Mic jack detection
3stack D965 3stack
5stack D965 5stack + SPDIF
dell-3stack Dell Dimension E520
dell-bios Fixes with Dell BIOS setup
STAC92HD71B*
ref Reference board
dell-m4-1 Dell desktops
dell-m4-2 Dell desktops
dell-m4-3 Dell desktops
STAC92HD73*
ref Reference board
no-jd BIOS setup but without jack-detection
dell-m6-amic Dell desktops/laptops with analog mics
dell-m6-dmic Dell desktops/laptops with digital mics
dell-m6 Dell desktops/laptops with both type of mics
STAC9872
vaio Setup for VAIO FE550G/SZ110
vaio-ar Setup for VAIO AR
The model name "genric" is treated as a special case. When this The model name "genric" is treated as a special case. When this
model is given, the driver uses the generic codec parser without model is given, the driver uses the generic codec parser without
"codec-patch". It's sometimes good for testing and debugging. "codec-patch". It's sometimes good for testing and debugging.
If the default configuration doesn't work and one of the above If the default configuration doesn't work and one of the above
matches with your device, report it together with the PCI matches with your device, report it together with alsa-info.sh
subsystem ID (output of "lspci -nv") to ALSA BTS or alsa-devel output (with --no-upload option) to kernel bugzilla or alsa-devel
ML (see the section "Links and Addresses"). ML (see the section "Links and Addresses").
power_save and power_save_controller options are for power-saving power_save and power_save_controller options are for power-saving
...@@ -2409,8 +2107,11 @@ Links and Addresses ...@@ -2409,8 +2107,11 @@ Links and Addresses
ALSA project homepage ALSA project homepage
http://www.alsa-project.org http://www.alsa-project.org
ALSA Bug Tracking System Kernel Bugzilla
https://bugtrack.alsa-project.org/bugs/ http://bugzilla.kernel.org/
ALSA Developers ML ALSA Developers ML
mailto:alsa-devel@alsa-project.org mailto:alsa-devel@alsa-project.org
alsa-info.sh script
http://www.alsa-project.org/alsa-info.sh
Model name Description
---------- -----------
ALC880
======
3stack 3-jack in back and a headphone out
3stack-digout 3-jack in back, a HP out and a SPDIF out
5stack 5-jack in back, 2-jack in front
5stack-digout 5-jack in back, 2-jack in front, a SPDIF out
6stack 6-jack in back, 2-jack in front
6stack-digout 6-jack with a SPDIF out
w810 3-jack
z71v 3-jack (HP shared SPDIF)
asus 3-jack (ASUS Mobo)
asus-w1v ASUS W1V
asus-dig ASUS with SPDIF out
asus-dig2 ASUS with SPDIF out (using GPIO2)
uniwill 3-jack
fujitsu Fujitsu Laptops (Pi1536)
F1734 2-jack
lg LG laptop (m1 express dual)
lg-lw LG LW20/LW25 laptop
tcl TCL S700
clevo Clevo laptops (m520G, m665n)
medion Medion Rim 2150
test for testing/debugging purpose, almost all controls can be
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)
ALC260
======
hp HP machines
hp-3013 HP machines (3013-variant)
hp-dc7600 HP DC7600
fujitsu Fujitsu S7020
acer Acer TravelMate
will Will laptops (PB V7900)
replacer Replacer 672V
basic fixed pin assignment (old default model)
test for testing/debugging purpose, almost all controls can
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)
ALC262
======
fujitsu Fujitsu Laptop
hp-bpc HP xw4400/6400/8400/9400 laptops
hp-bpc-d7000 HP BPC D7000
hp-tc-t5735 HP Thin Client T5735
hp-rp5700 HP RP5700
benq Benq ED8
benq-t31 Benq T31
hippo Hippo (ATI) with jack detection, Sony UX-90s
hippo_1 Hippo (Benq) with jack detection
sony-assamd Sony ASSAMD
toshiba-s06 Toshiba S06
toshiba-rx1 Toshiba RX1
ultra Samsung Q1 Ultra Vista model
lenovo-3000 Lenovo 3000 y410
nec NEC Versa S9100
basic fixed pin assignment w/o SPDIF
auto auto-config reading BIOS (default)
ALC267/268
==========
quanta-il1 Quanta IL1 mini-notebook
3stack 3-stack model
toshiba Toshiba A205
acer Acer laptops
acer-dmic Acer laptops with digital-mic
acer-aspire Acer Aspire One
dell Dell OEM laptops (Vostro 1200)
zepto Zepto laptops
test for testing/debugging purpose, almost all controls can
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)
ALC269
======
basic Basic preset
quanta Quanta FL1
eeepc-p703 ASUS Eeepc P703 P900A
eeepc-p901 ASUS Eeepc P901 S101
fujitsu FSC Amilo
auto auto-config reading BIOS (default)
ALC662/663
==========
3stack-dig 3-stack (2-channel) with SPDIF
3stack-6ch 3-stack (6-channel)
3stack-6ch-dig 3-stack (6-channel) with SPDIF
6stack-dig 6-stack with SPDIF
lenovo-101e Lenovo laptop
eeepc-p701 ASUS Eeepc P701
eeepc-ep20 ASUS Eeepc EP20
ecs ECS/Foxconn mobo
m51va ASUS M51VA
g71v ASUS G71V
h13 ASUS H13
g50v ASUS G50V
asus-mode1 ASUS
asus-mode2 ASUS
asus-mode3 ASUS
asus-mode4 ASUS
asus-mode5 ASUS
asus-mode6 ASUS
auto auto-config reading BIOS (default)
ALC882/885
==========
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack digital with SPDIF I/O
arima Arima W820Di1
targa Targa T8, MSI-1049 T8
asus-a7j ASUS A7J
asus-a7m ASUS A7M
macpro MacPro support
mbp3 Macbook Pro rev3
imac24 iMac 24'' with jack detection
w2jc ASUS W2JC
auto auto-config reading BIOS (default)
ALC883/888
==========
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack digital with SPDIF I/O
3stack-6ch 3-jack 6-channel
3stack-6ch-dig 3-jack 6-channel with SPDIF I/O
6stack-dig-demo 6-jack digital for Intel demo board
acer Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc)
acer-aspire Acer Aspire 9810
acer-aspire-4930g Acer Aspire 4930G
medion Medion Laptops
medion-md2 Medion MD2
targa-dig Targa/MSI
targa-2ch-dig Targs/MSI with 2-channel
laptop-eapd 3-jack with SPDIF I/O and EAPD (Clevo M540JE, M550JE)
lenovo-101e Lenovo 101E
lenovo-nb0763 Lenovo NB0763
lenovo-ms7195-dig Lenovo MS7195
lenovo-sky Lenovo Sky
haier-w66 Haier W66
3stack-hp HP machines with 3stack (Lucknow, Samba boards)
6stack-dell Dell machines with 6stack (Inspiron 530)
mitac Mitac 8252D
clevo-m720 Clevo M720 laptop series
fujitsu-pi2515 Fujitsu AMILO Pi2515
fujitsu-xa3530 Fujitsu AMILO XA3530
3stack-6ch-intel Intel DG33* boards
auto auto-config reading BIOS (default)
ALC861/660
==========
3stack 3-jack
3stack-dig 3-jack with SPDIF I/O
6stack-dig 6-jack with SPDIF I/O
3stack-660 3-jack (for ALC660)
uniwill-m31 Uniwill M31 laptop
toshiba Toshiba laptop support
asus Asus laptop support
asus-laptop ASUS F2/F3 laptops
auto auto-config reading BIOS (default)
ALC861VD/660VD
==============
3stack 3-jack
3stack-dig 3-jack with SPDIF OUT
6stack-dig 6-jack with SPDIF OUT
3stack-660 3-jack (for ALC660VD)
3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD)
lenovo Lenovo 3000 C200
dallas Dallas laptops
hp HP TX1000
asus-v1s ASUS V1Sn
auto auto-config reading BIOS (default)
CMI9880
=======
minimal 3-jack in back
min_fp 3-jack in back, 2-jack in front
full 6-jack in back, 2-jack in front
full_dig 6-jack in back, 2-jack in front, SPDIF I/O
allout 5-jack in back, 2-jack in front, SPDIF out
auto auto-config reading BIOS (default)
AD1882 / AD1882A
================
3stack 3-stack mode (default)
6stack 6-stack mode
AD1884A / AD1883 / AD1984A / AD1984B
====================================
desktop 3-stack desktop (default)
laptop laptop with HP jack sensing
mobile mobile devices with HP jack sensing
thinkpad Lenovo Thinkpad X300
AD1884
======
N/A
AD1981
======
basic 3-jack (default)
hp HP nx6320
thinkpad Lenovo Thinkpad T60/X60/Z60
toshiba Toshiba U205
AD1983
======
N/A
AD1984
======
basic default configuration
thinkpad Lenovo Thinkpad T61/X61
dell Dell T3400
AD1986A
=======
6stack 6-jack, separate surrounds (default)
3stack 3-stack, shared surrounds
laptop 2-channel only (FSC V2060, Samsung M50)
laptop-eapd 2-channel with EAPD (ASUS A6J)
laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
ultra 2-channel with EAPD (Samsung Ultra tablet PC)
samsung 2-channel with EAPD (Samsung R65)
AD1988/AD1988B/AD1989A/AD1989B
==============================
6stack 6-jack
6stack-dig ditto with SPDIF
3stack 3-jack
3stack-dig ditto with SPDIF
laptop 3-jack with hp-jack automute
laptop-dig ditto with SPDIF
auto auto-config reading BIOS (default)
Conexant 5045
=============
laptop-hpsense Laptop with HP sense (old model laptop)
laptop-micsense Laptop with Mic sense (old model fujitsu)
laptop-hpmicsense Laptop with HP and Mic senses
benq Benq R55E
test for testing/debugging purpose, almost all controls
can be adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
Conexant 5047
=============
laptop Basic Laptop config
laptop-hp Laptop config for some HP models (subdevice 30A5)
laptop-eapd Laptop config with EAPD support
test for testing/debugging purpose, almost all controls
can be adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
Conexant 5051
=============
laptop Basic Laptop config (default)
hp HP Spartan laptop
STAC9200
========
ref Reference board
dell-d21 Dell (unknown)
dell-d22 Dell (unknown)
dell-d23 Dell (unknown)
dell-m21 Dell Inspiron 630m, Dell Inspiron 640m
dell-m22 Dell Latitude D620, Dell Latitude D820
dell-m23 Dell XPS M1710, Dell Precision M90
dell-m24 Dell Latitude 120L
dell-m25 Dell Inspiron E1505n
dell-m26 Dell Inspiron 1501
dell-m27 Dell Inspiron E1705/9400
gateway Gateway laptops with EAPD control
panasonic Panasonic CF-74
STAC9205/9254
=============
ref Reference board
dell-m42 Dell (unknown)
dell-m43 Dell Precision
dell-m44 Dell Inspiron
STAC9220/9221
=============
ref Reference board
3stack D945 3stack
5stack D945 5stack + SPDIF
intel-mac-v1 Intel Mac Type 1
intel-mac-v2 Intel Mac Type 2
intel-mac-v3 Intel Mac Type 3
intel-mac-v4 Intel Mac Type 4
intel-mac-v5 Intel Mac Type 5
intel-mac-auto Intel Mac (detect type according to subsystem id)
macmini Intel Mac Mini (equivalent with type 3)
macbook Intel Mac Book (eq. type 5)
macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3)
macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3)
imac-intel Intel iMac (eq. type 2)
imac-intel-20 Intel iMac (newer version) (eq. type 3)
dell-d81 Dell (unknown)
dell-d82 Dell (unknown)
dell-m81 Dell (unknown)
dell-m82 Dell XPS M1210
STAC9202/9250/9251
==================
ref Reference board, base config
m2-2 Some Gateway MX series laptops
m6 Some Gateway NX series laptops
pa6 Gateway NX860 series
STAC9227/9228/9229/927x
=======================
ref Reference board
ref-no-jd Reference board without HP/Mic jack detection
3stack D965 3stack
5stack D965 5stack + SPDIF
dell-3stack Dell Dimension E520
dell-bios Fixes with Dell BIOS setup
STAC92HD71B*
============
ref Reference board
dell-m4-1 Dell desktops
dell-m4-2 Dell desktops
dell-m4-3 Dell desktops
STAC92HD73*
===========
ref Reference board
no-jd BIOS setup but without jack-detection
dell-m6-amic Dell desktops/laptops with analog mics
dell-m6-dmic Dell desktops/laptops with digital mics
dell-m6 Dell desktops/laptops with both type of mics
STAC92HD83*
===========
ref Reference board
STAC9872
========
vaio Setup for VAIO FE550G/SZ110
vaio-ar Setup for VAIO AR
此差异已折叠。
...@@ -153,6 +153,16 @@ card*/codec#* ...@@ -153,6 +153,16 @@ card*/codec#*
Shows the general codec information and the attribute of each Shows the general codec information and the attribute of each
widget node. widget node.
card*/eld#*
Available for HDMI or DisplayPort interfaces.
Shows ELD(EDID Like Data) info retrieved from the attached HDMI sink,
and describes its audio capabilities and configurations.
Some ELD fields may be modified by doing `echo name hex_value > eld#*`.
Only do this if you are sure the HDMI sink provided value is wrong.
And if that makes your HDMI audio work, please report to us so that we
can fix it in future kernel releases.
Sequencer Information Sequencer Information
--------------------- ---------------------
......
...@@ -659,6 +659,7 @@ struct input_absinfo { ...@@ -659,6 +659,7 @@ struct input_absinfo {
#define SW_RADIO SW_RFKILL_ALL /* deprecated */ #define SW_RADIO SW_RFKILL_ALL /* deprecated */
#define SW_MICROPHONE_INSERT 0x04 /* set = inserted */ #define SW_MICROPHONE_INSERT 0x04 /* set = inserted */
#define SW_DOCK 0x05 /* set = plugged into dock */ #define SW_DOCK 0x05 /* set = plugged into dock */
#define SW_LINEOUT_INSERT 0x06 /* set = inserted */
#define SW_MAX 0x0f #define SW_MAX 0x0f
#define SW_CNT (SW_MAX+1) #define SW_CNT (SW_MAX+1)
......
...@@ -35,6 +35,7 @@ enum snd_jack_types { ...@@ -35,6 +35,7 @@ enum snd_jack_types {
SND_JACK_HEADPHONE = 0x0001, SND_JACK_HEADPHONE = 0x0001,
SND_JACK_MICROPHONE = 0x0002, SND_JACK_MICROPHONE = 0x0002,
SND_JACK_HEADSET = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE, SND_JACK_HEADSET = SND_JACK_HEADPHONE | SND_JACK_MICROPHONE,
SND_JACK_LINEOUT = 0x0004,
}; };
struct snd_jack { struct snd_jack {
......
...@@ -34,6 +34,7 @@ static int snd_jack_dev_free(struct snd_device *device) ...@@ -34,6 +34,7 @@ static int snd_jack_dev_free(struct snd_device *device)
else else
input_free_device(jack->input_dev); input_free_device(jack->input_dev);
kfree(jack->id);
kfree(jack); kfree(jack);
return 0; return 0;
...@@ -87,7 +88,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, ...@@ -87,7 +88,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
if (jack == NULL) if (jack == NULL)
return -ENOMEM; return -ENOMEM;
jack->id = id; jack->id = kstrdup(id, GFP_KERNEL);
jack->input_dev = input_allocate_device(); jack->input_dev = input_allocate_device();
if (jack->input_dev == NULL) { if (jack->input_dev == NULL) {
...@@ -102,6 +103,9 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, ...@@ -102,6 +103,9 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
if (type & SND_JACK_HEADPHONE) if (type & SND_JACK_HEADPHONE)
input_set_capability(jack->input_dev, EV_SW, input_set_capability(jack->input_dev, EV_SW,
SW_HEADPHONE_INSERT); SW_HEADPHONE_INSERT);
if (type & SND_JACK_LINEOUT)
input_set_capability(jack->input_dev, EV_SW,
SW_LINEOUT_INSERT);
if (type & SND_JACK_MICROPHONE) if (type & SND_JACK_MICROPHONE)
input_set_capability(jack->input_dev, EV_SW, input_set_capability(jack->input_dev, EV_SW,
SW_MICROPHONE_INSERT); SW_MICROPHONE_INSERT);
...@@ -153,6 +157,9 @@ void snd_jack_report(struct snd_jack *jack, int status) ...@@ -153,6 +157,9 @@ void snd_jack_report(struct snd_jack *jack, int status)
if (jack->type & SND_JACK_HEADPHONE) if (jack->type & SND_JACK_HEADPHONE)
input_report_switch(jack->input_dev, SW_HEADPHONE_INSERT, input_report_switch(jack->input_dev, SW_HEADPHONE_INSERT,
status & SND_JACK_HEADPHONE); status & SND_JACK_HEADPHONE);
if (jack->type & SND_JACK_LINEOUT)
input_report_switch(jack->input_dev, SW_LINEOUT_INSERT,
status & SND_JACK_LINEOUT);
if (jack->type & SND_JACK_MICROPHONE) if (jack->type & SND_JACK_MICROPHONE)
input_report_switch(jack->input_dev, SW_MICROPHONE_INSERT, input_report_switch(jack->input_dev, SW_MICROPHONE_INSERT,
status & SND_JACK_MICROPHONE); status & SND_JACK_MICROPHONE);
......
...@@ -497,129 +497,7 @@ config SND_FM801_TEA575X ...@@ -497,129 +497,7 @@ config SND_FM801_TEA575X
depends on SND_FM801_TEA575X_BOOL depends on SND_FM801_TEA575X_BOOL
default SND_FM801 default SND_FM801
config SND_HDA_INTEL source "sound/pci/hda/Kconfig"
tristate "Intel HD Audio"
select SND_PCM
select SND_VMASTER
help
Say Y here to include support for Intel "High Definition
Audio" (Azalia) motherboard devices.
To compile this driver as a module, choose M here: the module
will be called snd-hda-intel.
config SND_HDA_HWDEP
bool "Build hwdep interface for HD-audio driver"
depends on SND_HDA_INTEL
select SND_HWDEP
help
Say Y here to build a hwdep interface for HD-audio driver.
This interface can be used for out-of-band communication
with codecs for debugging purposes.
config SND_HDA_INPUT_BEEP
bool "Support digital beep via input layer"
depends on SND_HDA_INTEL
depends on INPUT=y || INPUT=SND_HDA_INTEL
help
Say Y here to build a digital beep interface for HD-audio
driver. This interface is used to generate digital beeps.
config SND_HDA_CODEC_REALTEK
bool "Build Realtek HD-audio codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include Realtek HD-audio codec support in
snd-hda-intel driver, such as ALC880.
config SND_HDA_CODEC_ANALOG
bool "Build Analog Device HD-audio codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include Analog Device HD-audio codec support in
snd-hda-intel driver, such as AD1986A.
config SND_HDA_CODEC_SIGMATEL
bool "Build IDT/Sigmatel HD-audio codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include IDT (Sigmatel) HD-audio codec support in
snd-hda-intel driver, such as STAC9200.
config SND_HDA_CODEC_VIA
bool "Build VIA HD-audio codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include VIA HD-audio codec support in
snd-hda-intel driver, such as VT1708.
config SND_HDA_CODEC_ATIHDMI
bool "Build ATI HDMI HD-audio codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include ATI HDMI HD-audio codec support in
snd-hda-intel driver, such as ATI RS600 HDMI.
config SND_HDA_CODEC_NVHDMI
bool "Build NVIDIA HDMI HD-audio codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include NVIDIA HDMI HD-audio codec support in
snd-hda-intel driver, such as NVIDIA MCP78 HDMI.
config SND_HDA_CODEC_CONEXANT
bool "Build Conexant HD-audio codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include Conexant HD-audio codec support in
snd-hda-intel driver, such as CX20549.
config SND_HDA_CODEC_CMEDIA
bool "Build C-Media HD-audio codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include C-Media HD-audio codec support in
snd-hda-intel driver, such as CMI9880.
config SND_HDA_CODEC_SI3054
bool "Build Silicon Labs 3054 HD-modem codec support"
depends on SND_HDA_INTEL
default y
help
Say Y here to include Silicon Labs 3054 HD-modem codec
(and compatibles) support in snd-hda-intel driver.
config SND_HDA_GENERIC
bool "Enable generic HD-audio codec parser"
depends on SND_HDA_INTEL
default y
help
Say Y here to enable the generic HD-audio codec parser
in snd-hda-intel driver.
config SND_HDA_POWER_SAVE
bool "Aggressive power-saving on HD-audio"
depends on SND_HDA_INTEL && EXPERIMENTAL
help
Say Y here to enable more aggressive power-saving mode on
HD-audio driver. The power-saving timeout can be configured
via power_save option or over sysfs on-the-fly.
config SND_HDA_POWER_SAVE_DEFAULT
int "Default time-out for HD-audio power-save mode"
depends on SND_HDA_POWER_SAVE
default 0
help
The default time-out value in seconds for HD-audio automatic
power-save mode. 0 means to disable the power-save mode.
config SND_HDSP config SND_HDSP
tristate "RME Hammerfall DSP Audio" tristate "RME Hammerfall DSP Audio"
......
menuconfig SND_HDA_INTEL
tristate "Intel HD Audio"
select SND_PCM
select SND_VMASTER
select SND_JACK if INPUT=y || INPUT=SND
help
Say Y here to include support for Intel "High Definition
Audio" (Azalia) and its compatible devices.
This option enables the HD-audio controller. Don't forget
to choose the appropriate codec options below.
To compile this driver as a module, choose M here: the module
will be called snd-hda-intel.
if SND_HDA_INTEL
config SND_HDA_HWDEP
bool "Build hwdep interface for HD-audio driver"
select SND_HWDEP
help
Say Y here to build a hwdep interface for HD-audio driver.
This interface can be used for out-of-band communication
with codecs for debugging purposes.
config SND_HDA_RECONFIG
bool "Allow dynamic codec reconfiguration (EXPERIMENTAL)"
depends on SND_HDA_HWDEP && EXPERIMENTAL
help
Say Y here to enable the HD-audio codec re-configuration feature.
This adds the sysfs interfaces to allow user to clear the whole
codec configuration, change the codec setup, add extra verbs,
and re-configure the codec dynamically.
config SND_HDA_INPUT_BEEP
bool "Support digital beep via input layer"
depends on INPUT=y || INPUT=SND_HDA_INTEL
help
Say Y here to build a digital beep interface for HD-audio
driver. This interface is used to generate digital beeps.
config SND_HDA_CODEC_REALTEK
bool "Build Realtek HD-audio codec support"
default y
help
Say Y here to include Realtek HD-audio codec support in
snd-hda-intel driver, such as ALC880.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-realtek.
This module is automatically loaded at probing.
config SND_HDA_CODEC_ANALOG
bool "Build Analog Device HD-audio codec support"
default y
help
Say Y here to include Analog Device HD-audio codec support in
snd-hda-intel driver, such as AD1986A.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-analog.
This module is automatically loaded at probing.
config SND_HDA_CODEC_SIGMATEL
bool "Build IDT/Sigmatel HD-audio codec support"
default y
help
Say Y here to include IDT (Sigmatel) HD-audio codec support in
snd-hda-intel driver, such as STAC9200.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-idt.
This module is automatically loaded at probing.
config SND_HDA_CODEC_VIA
bool "Build VIA HD-audio codec support"
default y
help
Say Y here to include VIA HD-audio codec support in
snd-hda-intel driver, such as VT1708.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-via.
This module is automatically loaded at probing.
config SND_HDA_CODEC_ATIHDMI
bool "Build ATI HDMI HD-audio codec support"
default y
help
Say Y here to include ATI HDMI HD-audio codec support in
snd-hda-intel driver, such as ATI RS600 HDMI.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-atihdmi.
This module is automatically loaded at probing.
config SND_HDA_CODEC_NVHDMI
bool "Build NVIDIA HDMI HD-audio codec support"
default y
help
Say Y here to include NVIDIA HDMI HD-audio codec support in
snd-hda-intel driver, such as NVIDIA MCP78 HDMI.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-nvhdmi.
This module is automatically loaded at probing.
config SND_HDA_CODEC_INTELHDMI
bool "Build INTEL HDMI HD-audio codec support"
default y
help
Say Y here to include INTEL HDMI HD-audio codec support in
snd-hda-intel driver, such as Eaglelake integrated HDMI.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-intelhdmi.
This module is automatically loaded at probing.
config SND_HDA_ELD
def_bool y
depends on SND_HDA_CODEC_INTELHDMI
config SND_HDA_CODEC_CONEXANT
bool "Build Conexant HD-audio codec support"
default y
help
Say Y here to include Conexant HD-audio codec support in
snd-hda-intel driver, such as CX20549.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-conexant.
This module is automatically loaded at probing.
config SND_HDA_CODEC_CMEDIA
bool "Build C-Media HD-audio codec support"
default y
help
Say Y here to include C-Media HD-audio codec support in
snd-hda-intel driver, such as CMI9880.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-cmedia.
This module is automatically loaded at probing.
config SND_HDA_CODEC_SI3054
bool "Build Silicon Labs 3054 HD-modem codec support"
default y
help
Say Y here to include Silicon Labs 3054 HD-modem codec
(and compatibles) support in snd-hda-intel driver.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-si3054.
This module is automatically loaded at probing.
config SND_HDA_GENERIC
bool "Enable generic HD-audio codec parser"
default y
help
Say Y here to enable the generic HD-audio codec parser
in snd-hda-intel driver.
config SND_HDA_POWER_SAVE
bool "Aggressive power-saving on HD-audio"
help
Say Y here to enable more aggressive power-saving mode on
HD-audio driver. The power-saving timeout can be configured
via power_save option or over sysfs on-the-fly.
config SND_HDA_POWER_SAVE_DEFAULT
int "Default time-out for HD-audio power-save mode"
depends on SND_HDA_POWER_SAVE
default 0
help
The default time-out value in seconds for HD-audio automatic
power-save mode. 0 means to disable the power-save mode.
endif
snd-hda-intel-y := hda_intel.o snd-hda-intel-objs := hda_intel.o
# since snd-hda-intel is the only driver using hda-codec,
# merge it into a single module although it was originally
# designed to be individual modules
snd-hda-intel-y += hda_codec.o
snd-hda-intel-$(CONFIG_PROC_FS) += hda_proc.o
snd-hda-intel-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o
snd-hda-intel-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o
snd-hda-intel-$(CONFIG_SND_HDA_GENERIC) += hda_generic.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_REALTEK) += patch_realtek.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_CMEDIA) += patch_cmedia.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_ANALOG) += patch_analog.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_SIGMATEL) += patch_sigmatel.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_SI3054) += patch_si3054.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_ATIHDMI) += patch_atihdmi.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_CONEXANT) += patch_conexant.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_VIA) += patch_via.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_NVHDMI) += patch_nvhdmi.o
snd-hda-codec-y := hda_codec.o
snd-hda-codec-$(CONFIG_SND_HDA_GENERIC) += hda_generic.o
snd-hda-codec-$(CONFIG_PROC_FS) += hda_proc.o
# snd-hda-codec-$(CONFIG_SND_HDA_ELD) += hda_eld.o
snd-hda-codec-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o
snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o
snd-hda-codec-realtek-objs := patch_realtek.o
snd-hda-codec-cmedia-objs := patch_cmedia.o
snd-hda-codec-analog-objs := patch_analog.o
snd-hda-codec-idt-objs := patch_sigmatel.o
snd-hda-codec-si3054-objs := patch_si3054.o
snd-hda-codec-atihdmi-objs := patch_atihdmi.o
snd-hda-codec-conexant-objs := patch_conexant.o
snd-hda-codec-via-objs := patch_via.o
snd-hda-codec-nvhdmi-objs := patch_nvhdmi.o
snd-hda-codec-intelhdmi-objs := patch_intelhdmi.o hda_eld.o
# common driver
obj-$(CONFIG_SND_HDA_INTEL) := snd-hda-codec.o
# codec drivers (note: CONFIG_SND_HDA_CODEC_XXX are booleans)
ifdef CONFIG_SND_HDA_CODEC_REALTEK
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-realtek.o
endif
ifdef CONFIG_SND_HDA_CODEC_CMEDIA
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-cmedia.o
endif
ifdef CONFIG_SND_HDA_CODEC_ANALOG
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-analog.o
endif
ifdef CONFIG_SND_HDA_CODEC_SIGMATEL
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-idt.o
endif
ifdef CONFIG_SND_HDA_CODEC_SI3054
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-si3054.o
endif
ifdef CONFIG_SND_HDA_CODEC_ATIHDMI
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-atihdmi.o
endif
ifdef CONFIG_SND_HDA_CODEC_CONEXANT
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-conexant.o
endif
ifdef CONFIG_SND_HDA_CODEC_VIA
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-via.o
endif
ifdef CONFIG_SND_HDA_CODEC_NVHDMI
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-nvhdmi.o
endif
ifdef CONFIG_SND_HDA_CODEC_INTELHDMI
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-intelhdmi.o
endif
# this must be the last entry after codec drivers;
# otherwise the codec patches won't be hooked before the PCI probe
# when built in kernel
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o
...@@ -128,6 +128,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) ...@@ -128,6 +128,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
return 0; return 0;
} }
EXPORT_SYMBOL_HDA(snd_hda_attach_beep_device);
void snd_hda_detach_beep_device(struct hda_codec *codec) void snd_hda_detach_beep_device(struct hda_codec *codec)
{ {
...@@ -140,3 +141,4 @@ void snd_hda_detach_beep_device(struct hda_codec *codec) ...@@ -140,3 +141,4 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)
kfree(beep); kfree(beep);
} }
} }
EXPORT_SYMBOL_HDA(snd_hda_detach_beep_device);
此差异已折叠。
...@@ -519,6 +519,36 @@ enum { ...@@ -519,6 +519,36 @@ enum {
/* max. codec address */ /* max. codec address */
#define HDA_MAX_CODEC_ADDRESS 0x0f #define HDA_MAX_CODEC_ADDRESS 0x0f
/*
* generic arrays
*/
struct snd_array {
unsigned int used;
unsigned int alloced;
unsigned int elem_size;
unsigned int alloc_align;
void *list;
};
void *snd_array_new(struct snd_array *array);
void snd_array_free(struct snd_array *array);
static inline void snd_array_init(struct snd_array *array, unsigned int size,
unsigned int align)
{
array->elem_size = size;
array->alloc_align = align;
}
static inline void *snd_array_elem(struct snd_array *array, unsigned int idx)
{
return array->list + idx * array->elem_size;
}
static inline unsigned int snd_array_index(struct snd_array *array, void *ptr)
{
return (unsigned long)(ptr - array->list) / array->elem_size;
}
/* /*
* Structures * Structures
*/ */
...@@ -536,15 +566,17 @@ typedef u16 hda_nid_t; ...@@ -536,15 +566,17 @@ typedef u16 hda_nid_t;
/* bus operators */ /* bus operators */
struct hda_bus_ops { struct hda_bus_ops {
/* send a single command */ /* send a single command */
int (*command)(struct hda_codec *codec, hda_nid_t nid, int direct, int (*command)(struct hda_bus *bus, unsigned int cmd);
unsigned int verb, unsigned int parm);
/* get a response from the last command */ /* get a response from the last command */
unsigned int (*get_response)(struct hda_codec *codec); unsigned int (*get_response)(struct hda_bus *bus);
/* free the private data */ /* free the private data */
void (*private_free)(struct hda_bus *); void (*private_free)(struct hda_bus *);
/* attach a PCM stream */
int (*attach_pcm)(struct hda_bus *bus, struct hda_codec *codec,
struct hda_pcm *pcm);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
/* notify power-up/down from codec to controller */ /* notify power-up/down from codec to controller */
void (*pm_notify)(struct hda_codec *codec); void (*pm_notify)(struct hda_bus *bus);
#endif #endif
}; };
...@@ -553,6 +585,7 @@ struct hda_bus_template { ...@@ -553,6 +585,7 @@ struct hda_bus_template {
void *private_data; void *private_data;
struct pci_dev *pci; struct pci_dev *pci;
const char *modelname; const char *modelname;
int *power_save;
struct hda_bus_ops ops; struct hda_bus_ops ops;
}; };
...@@ -569,6 +602,7 @@ struct hda_bus { ...@@ -569,6 +602,7 @@ struct hda_bus {
void *private_data; void *private_data;
struct pci_dev *pci; struct pci_dev *pci;
const char *modelname; const char *modelname;
int *power_save;
struct hda_bus_ops ops; struct hda_bus_ops ops;
/* codec linked list */ /* codec linked list */
...@@ -581,10 +615,12 @@ struct hda_bus { ...@@ -581,10 +615,12 @@ struct hda_bus {
/* unsolicited event queue */ /* unsolicited event queue */
struct hda_bus_unsolicited *unsol; struct hda_bus_unsolicited *unsol;
struct snd_info_entry *proc; /* assigned PCMs */
DECLARE_BITMAP(pcm_dev_bits, SNDRV_PCM_DEVICES);
/* misc op flags */ /* misc op flags */
unsigned int needs_damn_long_delay :1; unsigned int needs_damn_long_delay :1;
unsigned int shutdown :1; /* being unloaded */
}; };
/* /*
...@@ -604,6 +640,16 @@ struct hda_codec_preset { ...@@ -604,6 +640,16 @@ struct hda_codec_preset {
int (*patch)(struct hda_codec *codec); int (*patch)(struct hda_codec *codec);
}; };
struct hda_codec_preset_list {
const struct hda_codec_preset *preset;
struct module *owner;
struct list_head list;
};
/* initial hook */
int snd_hda_add_codec_preset(struct hda_codec_preset_list *preset);
int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset);
/* ops set by the preset patch */ /* ops set by the preset patch */
struct hda_codec_ops { struct hda_codec_ops {
int (*build_controls)(struct hda_codec *codec); int (*build_controls)(struct hda_codec *codec);
...@@ -635,10 +681,7 @@ struct hda_amp_info { ...@@ -635,10 +681,7 @@ struct hda_amp_info {
struct hda_cache_rec { struct hda_cache_rec {
u16 hash[64]; /* hash table for index */ u16 hash[64]; /* hash table for index */
unsigned int num_entries; /* number of assigned entries */ struct snd_array buf; /* record entries */
unsigned int size; /* allocated size */
unsigned int record_size; /* record size (including header) */
void *buffer; /* hash table entries */
}; };
/* PCM callbacks */ /* PCM callbacks */
...@@ -680,7 +723,8 @@ struct hda_pcm { ...@@ -680,7 +723,8 @@ struct hda_pcm {
char *name; char *name;
struct hda_pcm_stream stream[2]; struct hda_pcm_stream stream[2];
unsigned int pcm_type; /* HDA_PCM_TYPE_XXX */ unsigned int pcm_type; /* HDA_PCM_TYPE_XXX */
int device; /* assigned device number */ int device; /* device number to assign */
struct snd_pcm *pcm; /* assigned PCM instance */
}; };
/* codec information */ /* codec information */
...@@ -699,6 +743,9 @@ struct hda_codec { ...@@ -699,6 +743,9 @@ struct hda_codec {
/* detected preset */ /* detected preset */
const struct hda_codec_preset *preset; const struct hda_codec_preset *preset;
struct module *owner;
const char *name; /* codec name */
const char *modelname; /* model name for preset */
/* set by patch */ /* set by patch */
struct hda_codec_ops patch_ops; struct hda_codec_ops patch_ops;
...@@ -718,6 +765,8 @@ struct hda_codec { ...@@ -718,6 +765,8 @@ struct hda_codec {
hda_nid_t start_nid; hda_nid_t start_nid;
u32 *wcaps; u32 *wcaps;
struct snd_array mixers; /* list of assigned mixer elements */
struct hda_cache_rec amp_cache; /* cache for amp access */ struct hda_cache_rec amp_cache; /* cache for amp access */
struct hda_cache_rec cmd_cache; /* cache for other commands */ struct hda_cache_rec cmd_cache; /* cache for other commands */
...@@ -727,7 +776,11 @@ struct hda_codec { ...@@ -727,7 +776,11 @@ struct hda_codec {
unsigned int spdif_in_enable; /* SPDIF input enable? */ unsigned int spdif_in_enable; /* SPDIF input enable? */
hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */ hda_nid_t *slave_dig_outs; /* optional digital out slave widgets */
#ifdef CONFIG_SND_HDA_HWDEP
struct snd_hwdep *hwdep; /* assigned hwdep device */ struct snd_hwdep *hwdep; /* assigned hwdep device */
struct snd_array init_verbs; /* additional init verbs */
struct snd_array hints; /* additional hints */
#endif
/* misc flags */ /* misc flags */
unsigned int spdif_status_reset :1; /* needs to toggle SPDIF for each unsigned int spdif_status_reset :1; /* needs to toggle SPDIF for each
...@@ -740,6 +793,10 @@ struct hda_codec { ...@@ -740,6 +793,10 @@ struct hda_codec {
int power_count; /* current (global) power refcount */ int power_count; /* current (global) power refcount */
struct delayed_work power_work; /* delayed task for powerdown */ struct delayed_work power_work; /* delayed task for powerdown */
#endif #endif
/* codec-specific additional proc output */
void (*proc_widget_hook)(struct snd_info_buffer *buffer,
struct hda_codec *codec, hda_nid_t nid);
}; };
/* direction */ /* direction */
...@@ -754,7 +811,7 @@ enum { ...@@ -754,7 +811,7 @@ enum {
int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp, int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp,
struct hda_bus **busp); struct hda_bus **busp);
int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
struct hda_codec **codecp); int do_init, struct hda_codec **codecp);
/* /*
* low level functions * low level functions
...@@ -799,11 +856,13 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec); ...@@ -799,11 +856,13 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec);
* Mixer * Mixer
*/ */
int snd_hda_build_controls(struct hda_bus *bus); int snd_hda_build_controls(struct hda_bus *bus);
int snd_hda_codec_build_controls(struct hda_codec *codec);
/* /*
* PCM * PCM
*/ */
int snd_hda_build_pcms(struct hda_bus *bus); int snd_hda_build_pcms(struct hda_bus *bus);
int snd_hda_codec_build_pcms(struct hda_codec *codec);
void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
u32 stream_tag, u32 stream_tag,
int channel_id, int format); int channel_id, int format);
...@@ -812,8 +871,6 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate, ...@@ -812,8 +871,6 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
unsigned int channels, unsigned int channels,
unsigned int format, unsigned int format,
unsigned int maxbps); unsigned int maxbps);
int snd_hda_query_supported_pcm(struct hda_codec *codec, hda_nid_t nid,
u32 *ratesp, u64 *formatsp, unsigned int *bpsp);
int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid, int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid,
unsigned int format); unsigned int format);
...@@ -830,6 +887,13 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state); ...@@ -830,6 +887,13 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state);
int snd_hda_resume(struct hda_bus *bus); int snd_hda_resume(struct hda_bus *bus);
#endif #endif
/*
* get widget information
*/
const char *snd_hda_get_jack_connectivity(u32 cfg);
const char *snd_hda_get_jack_type(u32 cfg);
const char *snd_hda_get_jack_location(u32 cfg);
/* /*
* power saving * power saving
*/ */
...@@ -837,12 +901,25 @@ int snd_hda_resume(struct hda_bus *bus); ...@@ -837,12 +901,25 @@ int snd_hda_resume(struct hda_bus *bus);
void snd_hda_power_up(struct hda_codec *codec); void snd_hda_power_up(struct hda_codec *codec);
void snd_hda_power_down(struct hda_codec *codec); void snd_hda_power_down(struct hda_codec *codec);
#define snd_hda_codec_needs_resume(codec) codec->power_count #define snd_hda_codec_needs_resume(codec) codec->power_count
int snd_hda_codecs_inuse(struct hda_bus *bus);
#else #else
static inline void snd_hda_power_up(struct hda_codec *codec) {} static inline void snd_hda_power_up(struct hda_codec *codec) {}
static inline void snd_hda_power_down(struct hda_codec *codec) {} static inline void snd_hda_power_down(struct hda_codec *codec) {}
#define snd_hda_codec_needs_resume(codec) 1 #define snd_hda_codec_needs_resume(codec) 1
#define snd_hda_codecs_inuse(bus) 1 #endif
/*
* Codec modularization
*/
/* Export symbols only for communication with codec drivers;
* When built in kernel, all HD-audio drivers are supposed to be statically
* linked to the kernel. Thus, the symbols don't have to (or shouldn't) be
* exported unless it's built as a module.
*/
#ifdef MODULE
#define EXPORT_SYMBOL_HDA(sym) EXPORT_SYMBOL_GPL(sym)
#else
#define EXPORT_SYMBOL_HDA(sym)
#endif #endif
#endif /* __SOUND_HDA_CODEC_H */ #endif /* __SOUND_HDA_CODEC_H */
/*
* Generic routines and proc interface for ELD(EDID Like Data) information
*
* Copyright(c) 2008 Intel Corporation.
*
* Authors:
* Wu Fengguang <wfg@linux.intel.com>
*
* This driver is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This driver is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/init.h>
#include <sound/core.h>
#include <asm/unaligned.h>
#include "hda_codec.h"
#include "hda_local.h"
enum eld_versions {
ELD_VER_CEA_861D = 2,
ELD_VER_PARTIAL = 31,
};
enum cea_edid_versions {
CEA_EDID_VER_NONE = 0,
CEA_EDID_VER_CEA861 = 1,
CEA_EDID_VER_CEA861A = 2,
CEA_EDID_VER_CEA861BCD = 3,
CEA_EDID_VER_RESERVED = 4,
};
static char *cea_speaker_allocation_names[] = {
/* 0 */ "FL/FR",
/* 1 */ "LFE",
/* 2 */ "FC",
/* 3 */ "RL/RR",
/* 4 */ "RC",
/* 5 */ "FLC/FRC",
/* 6 */ "RLC/RRC",
/* 7 */ "FLW/FRW",
/* 8 */ "FLH/FRH",
/* 9 */ "TC",
/* 10 */ "FCH",
};
static char *eld_connection_type_names[4] = {
"HDMI",
"DisplayPort",
"2-reserved",
"3-reserved"
};
enum cea_audio_coding_types {
AUDIO_CODING_TYPE_REF_STREAM_HEADER = 0,
AUDIO_CODING_TYPE_LPCM = 1,
AUDIO_CODING_TYPE_AC3 = 2,
AUDIO_CODING_TYPE_MPEG1 = 3,
AUDIO_CODING_TYPE_MP3 = 4,
AUDIO_CODING_TYPE_MPEG2 = 5,
AUDIO_CODING_TYPE_AACLC = 6,
AUDIO_CODING_TYPE_DTS = 7,
AUDIO_CODING_TYPE_ATRAC = 8,
AUDIO_CODING_TYPE_SACD = 9,
AUDIO_CODING_TYPE_EAC3 = 10,
AUDIO_CODING_TYPE_DTS_HD = 11,
AUDIO_CODING_TYPE_MLP = 12,
AUDIO_CODING_TYPE_DST = 13,
AUDIO_CODING_TYPE_WMAPRO = 14,
AUDIO_CODING_TYPE_REF_CXT = 15,
/* also include valid xtypes below */
AUDIO_CODING_TYPE_HE_AAC = 15,
AUDIO_CODING_TYPE_HE_AAC2 = 16,
AUDIO_CODING_TYPE_MPEG_SURROUND = 17,
};
enum cea_audio_coding_xtypes {
AUDIO_CODING_XTYPE_HE_REF_CT = 0,
AUDIO_CODING_XTYPE_HE_AAC = 1,
AUDIO_CODING_XTYPE_HE_AAC2 = 2,
AUDIO_CODING_XTYPE_MPEG_SURROUND = 3,
AUDIO_CODING_XTYPE_FIRST_RESERVED = 4,
};
static char *cea_audio_coding_type_names[] = {
/* 0 */ "undefined",
/* 1 */ "LPCM",
/* 2 */ "AC-3",
/* 3 */ "MPEG1",
/* 4 */ "MP3",
/* 5 */ "MPEG2",
/* 6 */ "AAC-LC",
/* 7 */ "DTS",
/* 8 */ "ATRAC",
/* 9 */ "DSD (One Bit Audio)",
/* 10 */ "E-AC-3/DD+ (Dolby Digital Plus)",
/* 11 */ "DTS-HD",
/* 12 */ "MLP (Dolby TrueHD)",
/* 13 */ "DST",
/* 14 */ "WMAPro",
/* 15 */ "HE-AAC",
/* 16 */ "HE-AACv2",
/* 17 */ "MPEG Surround",
};
/*
* The following two lists are shared between
* - HDMI audio InfoFrame (source to sink)
* - CEA E-EDID Extension (sink to source)
*/
/*
* SS1:SS0 index => sample size
*/
static int cea_sample_sizes[4] = {
0, /* 0: Refer to Stream Header */
AC_SUPPCM_BITS_16, /* 1: 16 bits */
AC_SUPPCM_BITS_20, /* 2: 20 bits */
AC_SUPPCM_BITS_24, /* 3: 24 bits */
};
/*
* SF2:SF1:SF0 index => sampling frequency
*/
static int cea_sampling_frequencies[8] = {
0, /* 0: Refer to Stream Header */
SNDRV_PCM_RATE_32000, /* 1: 32000Hz */
SNDRV_PCM_RATE_44100, /* 2: 44100Hz */
SNDRV_PCM_RATE_48000, /* 3: 48000Hz */
SNDRV_PCM_RATE_88200, /* 4: 88200Hz */
SNDRV_PCM_RATE_96000, /* 5: 96000Hz */
SNDRV_PCM_RATE_176400, /* 6: 176400Hz */
SNDRV_PCM_RATE_192000, /* 7: 192000Hz */
};
static unsigned char hdmi_get_eld_byte(struct hda_codec *codec, hda_nid_t nid,
int byte_index)
{
unsigned int val;
val = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_HDMI_ELDD, byte_index);
#ifdef BE_PARANOID
printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val);
#endif
if ((val & AC_ELDD_ELD_VALID) == 0) {
snd_printd(KERN_INFO "HDMI: invalid ELD data byte %d\n",
byte_index);
val = 0;
}
return val & AC_ELDD_ELD_DATA;
}
#define GRAB_BITS(buf, byte, lowbit, bits) \
({ \
BUILD_BUG_ON(lowbit > 7); \
BUILD_BUG_ON(bits > 8); \
BUILD_BUG_ON(bits <= 0); \
\
(buf[byte] >> (lowbit)) & ((1 << (bits)) - 1); \
})
static void hdmi_update_short_audio_desc(struct cea_sad *a,
const unsigned char *buf)
{
int i;
int val;
val = GRAB_BITS(buf, 1, 0, 7);
a->rates = 0;
for (i = 0; i < 7; i++)
if (val & (1 << i))
a->rates |= cea_sampling_frequencies[i + 1];
a->channels = GRAB_BITS(buf, 0, 0, 3);
a->channels++;
a->format = GRAB_BITS(buf, 0, 3, 4);
switch (a->format) {
case AUDIO_CODING_TYPE_REF_STREAM_HEADER:
snd_printd(KERN_INFO
"HDMI: audio coding type 0 not expected\n");
break;
case AUDIO_CODING_TYPE_LPCM:
val = GRAB_BITS(buf, 2, 0, 3);
a->sample_bits = 0;
for (i = 0; i < 3; i++)
if (val & (1 << i))
a->sample_bits |= cea_sample_sizes[i + 1];
break;
case AUDIO_CODING_TYPE_AC3:
case AUDIO_CODING_TYPE_MPEG1:
case AUDIO_CODING_TYPE_MP3:
case AUDIO_CODING_TYPE_MPEG2:
case AUDIO_CODING_TYPE_AACLC:
case AUDIO_CODING_TYPE_DTS:
case AUDIO_CODING_TYPE_ATRAC:
a->max_bitrate = GRAB_BITS(buf, 2, 0, 8);
a->max_bitrate *= 8000;
break;
case AUDIO_CODING_TYPE_SACD:
break;
case AUDIO_CODING_TYPE_EAC3:
break;
case AUDIO_CODING_TYPE_DTS_HD:
break;
case AUDIO_CODING_TYPE_MLP:
break;
case AUDIO_CODING_TYPE_DST:
break;
case AUDIO_CODING_TYPE_WMAPRO:
a->profile = GRAB_BITS(buf, 2, 0, 3);
break;
case AUDIO_CODING_TYPE_REF_CXT:
a->format = GRAB_BITS(buf, 2, 3, 5);
if (a->format == AUDIO_CODING_XTYPE_HE_REF_CT ||
a->format >= AUDIO_CODING_XTYPE_FIRST_RESERVED) {
snd_printd(KERN_INFO
"HDMI: audio coding xtype %d not expected\n",
a->format);
a->format = 0;
} else
a->format += AUDIO_CODING_TYPE_HE_AAC -
AUDIO_CODING_XTYPE_HE_AAC;
break;
}
}
/*
* Be careful, ELD buf could be totally rubbish!
*/
static int hdmi_update_eld(struct hdmi_eld *e,
const unsigned char *buf, int size)
{
int mnl;
int i;
e->eld_ver = GRAB_BITS(buf, 0, 3, 5);
if (e->eld_ver != ELD_VER_CEA_861D &&
e->eld_ver != ELD_VER_PARTIAL) {
snd_printd(KERN_INFO "HDMI: Unknown ELD version %d\n",
e->eld_ver);
goto out_fail;
}
e->eld_size = size;
e->baseline_len = GRAB_BITS(buf, 2, 0, 8);
mnl = GRAB_BITS(buf, 4, 0, 5);
e->cea_edid_ver = GRAB_BITS(buf, 4, 5, 3);
e->support_hdcp = GRAB_BITS(buf, 5, 0, 1);
e->support_ai = GRAB_BITS(buf, 5, 1, 1);
e->conn_type = GRAB_BITS(buf, 5, 2, 2);
e->sad_count = GRAB_BITS(buf, 5, 4, 4);
e->aud_synch_delay = GRAB_BITS(buf, 6, 0, 8) * 2;
e->spk_alloc = GRAB_BITS(buf, 7, 0, 7);
e->port_id = get_unaligned_le64(buf + 8);
/* not specified, but the spec's tendency is little endian */
e->manufacture_id = get_unaligned_le16(buf + 16);
e->product_id = get_unaligned_le16(buf + 18);
if (mnl > ELD_MAX_MNL) {
snd_printd(KERN_INFO "HDMI: MNL is reserved value %d\n", mnl);
goto out_fail;
} else if (ELD_FIXED_BYTES + mnl > size) {
snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl);
goto out_fail;
} else
strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl);
for (i = 0; i < e->sad_count; i++) {
if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) {
snd_printd(KERN_INFO "HDMI: out of range SAD %d\n", i);
goto out_fail;
}
hdmi_update_short_audio_desc(e->sad + i,
buf + ELD_FIXED_BYTES + mnl + 3 * i);
}
return 0;
out_fail:
e->eld_ver = 0;
return -EINVAL;
}
static int hdmi_present_sense(struct hda_codec *codec, hda_nid_t nid)
{
return snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0);
}
static int hdmi_eld_valid(struct hda_codec *codec, hda_nid_t nid)
{
int eldv;
int present;
present = hdmi_present_sense(codec, nid);
eldv = (present & AC_PINSENSE_ELDV);
present = (present & AC_PINSENSE_PRESENCE);
#ifdef CONFIG_SND_DEBUG_VERBOSE
printk(KERN_INFO "HDMI: sink_present = %d, eld_valid = %d\n",
!!present, !!eldv);
#endif
return eldv && present;
}
int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid)
{
return snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_HDMI_DIP_SIZE,
AC_DIPSIZE_ELD_BUF);
}
int snd_hdmi_get_eld(struct hdmi_eld *eld,
struct hda_codec *codec, hda_nid_t nid)
{
int i;
int ret;
int size;
unsigned char *buf;
if (!hdmi_eld_valid(codec, nid))
return -ENOENT;
size = snd_hdmi_get_eld_size(codec, nid);
if (size == 0) {
/* wfg: workaround for ASUS P5E-VM HDMI board */
snd_printd(KERN_INFO "HDMI: ELD buf size is 0, force 128\n");
size = 128;
}
if (size < ELD_FIXED_BYTES || size > PAGE_SIZE) {
snd_printd(KERN_INFO "HDMI: invalid ELD buf size %d\n", size);
return -ERANGE;
}
buf = kmalloc(size, GFP_KERNEL);
if (!buf)
return -ENOMEM;
for (i = 0; i < size; i++)
buf[i] = hdmi_get_eld_byte(codec, nid, i);
ret = hdmi_update_eld(eld, buf, size);
kfree(buf);
return ret;
}
static void hdmi_show_short_audio_desc(struct cea_sad *a)
{
char buf[SND_PRINT_RATES_ADVISED_BUFSIZE];
char buf2[8 + SND_PRINT_BITS_ADVISED_BUFSIZE] = ", bits =";
if (!a->format)
return;
snd_print_pcm_rates(a->rates, buf, sizeof(buf));
if (a->format == AUDIO_CODING_TYPE_LPCM)
snd_print_pcm_bits(a->sample_bits, buf2 + 8, sizeof(buf2 - 8));
else if (a->max_bitrate)
snprintf(buf2, sizeof(buf2),
", max bitrate = %d", a->max_bitrate);
else
buf2[0] = '\0';
printk(KERN_INFO "HDMI: supports coding type %s:"
" channels = %d, rates =%s%s\n",
cea_audio_coding_type_names[a->format],
a->channels,
buf,
buf2);
}
void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen)
{
int i, j;
for (i = 0, j = 0; i < ARRAY_SIZE(cea_speaker_allocation_names); i++) {
if (spk_alloc & (1 << i))
j += snprintf(buf + j, buflen - j, " %s",
cea_speaker_allocation_names[i]);
}
buf[j] = '\0'; /* necessary when j == 0 */
}
void snd_hdmi_show_eld(struct hdmi_eld *e)
{
int i;
printk(KERN_INFO "HDMI: detected monitor %s at connection type %s\n",
e->monitor_name,
eld_connection_type_names[e->conn_type]);
if (e->spk_alloc) {
char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
printk(KERN_INFO "HDMI: available speakers:%s\n", buf);
}
for (i = 0; i < e->sad_count; i++)
hdmi_show_short_audio_desc(e->sad + i);
}
#ifdef CONFIG_PROC_FS
static void hdmi_print_sad_info(int i, struct cea_sad *a,
struct snd_info_buffer *buffer)
{
char buf[SND_PRINT_RATES_ADVISED_BUFSIZE];
snd_iprintf(buffer, "sad%d_coding_type\t[0x%x] %s\n",
i, a->format, cea_audio_coding_type_names[a->format]);
snd_iprintf(buffer, "sad%d_channels\t\t%d\n", i, a->channels);
snd_print_pcm_rates(a->rates, buf, sizeof(buf));
snd_iprintf(buffer, "sad%d_rates\t\t[0x%x]%s\n", i, a->rates, buf);
if (a->format == AUDIO_CODING_TYPE_LPCM) {
snd_print_pcm_bits(a->sample_bits, buf, sizeof(buf));
snd_iprintf(buffer, "sad%d_bits\t\t[0x%x]%s\n",
i, a->sample_bits, buf);
}
if (a->max_bitrate)
snd_iprintf(buffer, "sad%d_max_bitrate\t%d\n",
i, a->max_bitrate);
if (a->profile)
snd_iprintf(buffer, "sad%d_profile\t\t%d\n", i, a->profile);
}
static void hdmi_print_eld_info(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct hdmi_eld *e = entry->private_data;
char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
int i;
static char *eld_versoin_names[32] = {
"reserved",
"reserved",
"CEA-861D or below",
[3 ... 30] = "reserved",
[31] = "partial"
};
static char *cea_edid_version_names[8] = {
"no CEA EDID Timing Extension block present",
"CEA-861",
"CEA-861-A",
"CEA-861-B, C or D",
[4 ... 7] = "reserved"
};
snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name);
snd_iprintf(buffer, "connection_type\t\t%s\n",
eld_connection_type_names[e->conn_type]);
snd_iprintf(buffer, "eld_version\t\t[0x%x] %s\n", e->eld_ver,
eld_versoin_names[e->eld_ver]);
snd_iprintf(buffer, "edid_version\t\t[0x%x] %s\n", e->cea_edid_ver,
cea_edid_version_names[e->cea_edid_ver]);
snd_iprintf(buffer, "manufacture_id\t\t0x%x\n", e->manufacture_id);
snd_iprintf(buffer, "product_id\t\t0x%x\n", e->product_id);
snd_iprintf(buffer, "port_id\t\t\t0x%llx\n", (long long)e->port_id);
snd_iprintf(buffer, "support_hdcp\t\t%d\n", e->support_hdcp);
snd_iprintf(buffer, "support_ai\t\t%d\n", e->support_ai);
snd_iprintf(buffer, "audio_sync_delay\t%d\n", e->aud_synch_delay);
snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
snd_iprintf(buffer, "speakers\t\t[0x%x]%s\n", e->spk_alloc, buf);
snd_iprintf(buffer, "sad_count\t\t%d\n", e->sad_count);
for (i = 0; i < e->sad_count; i++)
hdmi_print_sad_info(i, e->sad + i, buffer);
}
static void hdmi_write_eld_info(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct hdmi_eld *e = entry->private_data;
char line[64];
char name[64];
char *sname;
long long val;
int n;
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%s %llx", name, &val) != 2)
continue;
/*
* We don't allow modification to these fields:
* monitor_name manufacture_id product_id
* eld_version edid_version
*/
if (!strcmp(name, "connection_type"))
e->conn_type = val;
else if (!strcmp(name, "port_id"))
e->port_id = val;
else if (!strcmp(name, "support_hdcp"))
e->support_hdcp = val;
else if (!strcmp(name, "support_ai"))
e->support_ai = val;
else if (!strcmp(name, "audio_sync_delay"))
e->aud_synch_delay = val;
else if (!strcmp(name, "speakers"))
e->spk_alloc = val;
else if (!strcmp(name, "sad_count"))
e->sad_count = val;
else if (!strncmp(name, "sad", 3)) {
sname = name + 4;
n = name[3] - '0';
if (name[4] >= '0' && name[4] <= '9') {
sname++;
n = 10 * n + name[4] - '0';
}
if (n < 0 || n > 31) /* double the CEA limit */
continue;
if (!strcmp(sname, "_coding_type"))
e->sad[n].format = val;
else if (!strcmp(sname, "_channels"))
e->sad[n].channels = val;
else if (!strcmp(sname, "_rates"))
e->sad[n].rates = val;
else if (!strcmp(sname, "_bits"))
e->sad[n].sample_bits = val;
else if (!strcmp(sname, "_max_bitrate"))
e->sad[n].max_bitrate = val;
else if (!strcmp(sname, "_profile"))
e->sad[n].profile = val;
if (n >= e->sad_count)
e->sad_count = n + 1;
}
}
}
int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld)
{
char name[32];
struct snd_info_entry *entry;
int err;
snprintf(name, sizeof(name), "eld#%d", codec->addr);
err = snd_card_proc_new(codec->bus->card, name, &entry);
if (err < 0)
return err;
snd_info_set_text_ops(entry, eld, hdmi_print_eld_info);
entry->c.text.write = hdmi_write_eld_info;
entry->mode |= S_IWUSR;
eld->proc_entry = entry;
return 0;
}
void snd_hda_eld_proc_free(struct hda_codec *codec, struct hdmi_eld *eld)
{
if (!codec->bus->shutdown && eld->proc_entry) {
snd_device_free(codec->bus->card, eld->proc_entry);
eld->proc_entry = NULL;
}
}
#endif /* CONFIG_PROC_FS */
...@@ -723,7 +723,8 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node, ...@@ -723,7 +723,8 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node,
if (is_loopback) if (is_loopback)
add_input_loopback(codec, node->nid, HDA_INPUT, index); add_input_loopback(codec, node->nid, HDA_INPUT, index);
snd_printdd("[%s] NID=0x%x, DIR=IN, IDX=0x%x\n", name, node->nid, index); snd_printdd("[%s] NID=0x%x, DIR=IN, IDX=0x%x\n", name, node->nid, index);
if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0) err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
if (err < 0)
return err; return err;
created = 1; created = 1;
} else if ((node->wid_caps & AC_WCAP_OUT_AMP) && } else if ((node->wid_caps & AC_WCAP_OUT_AMP) &&
...@@ -732,7 +733,8 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node, ...@@ -732,7 +733,8 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node,
if (is_loopback) if (is_loopback)
add_input_loopback(codec, node->nid, HDA_OUTPUT, 0); add_input_loopback(codec, node->nid, HDA_OUTPUT, 0);
snd_printdd("[%s] NID=0x%x, DIR=OUT\n", name, node->nid); snd_printdd("[%s] NID=0x%x, DIR=OUT\n", name, node->nid);
if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0) err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
if (err < 0)
return err; return err;
created = 1; created = 1;
} }
...@@ -745,14 +747,16 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node, ...@@ -745,14 +747,16 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node,
(node->amp_in_caps & AC_AMPCAP_NUM_STEPS)) { (node->amp_in_caps & AC_AMPCAP_NUM_STEPS)) {
knew = (struct snd_kcontrol_new)HDA_CODEC_VOLUME(name, node->nid, index, HDA_INPUT); knew = (struct snd_kcontrol_new)HDA_CODEC_VOLUME(name, node->nid, index, HDA_INPUT);
snd_printdd("[%s] NID=0x%x, DIR=IN, IDX=0x%x\n", name, node->nid, index); snd_printdd("[%s] NID=0x%x, DIR=IN, IDX=0x%x\n", name, node->nid, index);
if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0) err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
if (err < 0)
return err; return err;
created = 1; created = 1;
} else if ((node->wid_caps & AC_WCAP_OUT_AMP) && } else if ((node->wid_caps & AC_WCAP_OUT_AMP) &&
(node->amp_out_caps & AC_AMPCAP_NUM_STEPS)) { (node->amp_out_caps & AC_AMPCAP_NUM_STEPS)) {
knew = (struct snd_kcontrol_new)HDA_CODEC_VOLUME(name, node->nid, 0, HDA_OUTPUT); knew = (struct snd_kcontrol_new)HDA_CODEC_VOLUME(name, node->nid, 0, HDA_OUTPUT);
snd_printdd("[%s] NID=0x%x, DIR=OUT\n", name, node->nid); snd_printdd("[%s] NID=0x%x, DIR=OUT\n", name, node->nid);
if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0) err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
if (err < 0)
return err; return err;
created = 1; created = 1;
} }
...@@ -849,8 +853,8 @@ static int build_input_controls(struct hda_codec *codec) ...@@ -849,8 +853,8 @@ static int build_input_controls(struct hda_codec *codec)
} }
/* create input MUX if multiple sources are available */ /* create input MUX if multiple sources are available */
if ((err = snd_ctl_add(codec->bus->card, err = snd_hda_ctl_add(codec, snd_ctl_new1(&cap_sel, codec));
snd_ctl_new1(&cap_sel, codec))) < 0) if (err < 0)
return err; return err;
/* no volume control? */ /* no volume control? */
...@@ -867,8 +871,8 @@ static int build_input_controls(struct hda_codec *codec) ...@@ -867,8 +871,8 @@ static int build_input_controls(struct hda_codec *codec)
HDA_CODEC_VOLUME(name, adc_node->nid, HDA_CODEC_VOLUME(name, adc_node->nid,
spec->input_mux.items[i].index, spec->input_mux.items[i].index,
HDA_INPUT); HDA_INPUT);
if ((err = snd_ctl_add(codec->bus->card, err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
snd_ctl_new1(&knew, codec))) < 0) if (err < 0)
return err; return err;
} }
...@@ -1097,3 +1101,4 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec) ...@@ -1097,3 +1101,4 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec)
snd_hda_generic_free(codec); snd_hda_generic_free(codec);
return err; return err;
} }
EXPORT_SYMBOL(snd_hda_parse_generic_codec);
...@@ -23,10 +23,12 @@ ...@@ -23,10 +23,12 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/ctype.h>
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include <sound/hda_hwdep.h> #include <sound/hda_hwdep.h>
#include <sound/minors.h>
/* /*
* write/read an out-of-bound verb * write/read an out-of-bound verb
...@@ -95,7 +97,26 @@ static int hda_hwdep_open(struct snd_hwdep *hw, struct file *file) ...@@ -95,7 +97,26 @@ static int hda_hwdep_open(struct snd_hwdep *hw, struct file *file)
return 0; return 0;
} }
int __devinit snd_hda_create_hwdep(struct hda_codec *codec) static void clear_hwdep_elements(struct hda_codec *codec)
{
char **head;
int i;
/* clear init verbs */
snd_array_free(&codec->init_verbs);
/* clear hints */
head = codec->hints.list;
for (i = 0; i < codec->hints.used; i++, head++)
kfree(*head);
snd_array_free(&codec->hints);
}
static void hwdep_free(struct snd_hwdep *hwdep)
{
clear_hwdep_elements(hwdep->private_data);
}
int /*__devinit*/ snd_hda_create_hwdep(struct hda_codec *codec)
{ {
char hwname[16]; char hwname[16];
struct snd_hwdep *hwdep; struct snd_hwdep *hwdep;
...@@ -109,6 +130,7 @@ int __devinit snd_hda_create_hwdep(struct hda_codec *codec) ...@@ -109,6 +130,7 @@ int __devinit snd_hda_create_hwdep(struct hda_codec *codec)
sprintf(hwdep->name, "HDA Codec %d", codec->addr); sprintf(hwdep->name, "HDA Codec %d", codec->addr);
hwdep->iface = SNDRV_HWDEP_IFACE_HDA; hwdep->iface = SNDRV_HWDEP_IFACE_HDA;
hwdep->private_data = codec; hwdep->private_data = codec;
hwdep->private_free = hwdep_free;
hwdep->exclusive = 1; hwdep->exclusive = 1;
hwdep->ops.open = hda_hwdep_open; hwdep->ops.open = hda_hwdep_open;
...@@ -117,5 +139,215 @@ int __devinit snd_hda_create_hwdep(struct hda_codec *codec) ...@@ -117,5 +139,215 @@ int __devinit snd_hda_create_hwdep(struct hda_codec *codec)
hwdep->ops.ioctl_compat = hda_hwdep_ioctl_compat; hwdep->ops.ioctl_compat = hda_hwdep_ioctl_compat;
#endif #endif
snd_array_init(&codec->init_verbs, sizeof(struct hda_verb), 32);
snd_array_init(&codec->hints, sizeof(char *), 32);
return 0; return 0;
} }
#ifdef CONFIG_SND_HDA_RECONFIG
/*
* sysfs interface
*/
static int clear_codec(struct hda_codec *codec)
{
snd_hda_codec_reset(codec);
clear_hwdep_elements(codec);
return 0;
}
static int reconfig_codec(struct hda_codec *codec)
{
int err;
snd_printk(KERN_INFO "hda-codec: reconfiguring\n");
snd_hda_codec_reset(codec);
err = snd_hda_codec_configure(codec);
if (err < 0)
return err;
/* rebuild PCMs */
err = snd_hda_codec_build_pcms(codec);
if (err < 0)
return err;
/* rebuild mixers */
err = snd_hda_codec_build_controls(codec);
if (err < 0)
return err;
return 0;
}
/*
* allocate a string at most len chars, and remove the trailing EOL
*/
static char *kstrndup_noeol(const char *src, size_t len)
{
char *s = kstrndup(src, len, GFP_KERNEL);
char *p;
if (!s)
return NULL;
p = strchr(s, '\n');
if (p)
*p = 0;
return s;
}
#define CODEC_INFO_SHOW(type) \
static ssize_t type##_show(struct device *dev, \
struct device_attribute *attr, \
char *buf) \
{ \
struct snd_hwdep *hwdep = dev_get_drvdata(dev); \
struct hda_codec *codec = hwdep->private_data; \
return sprintf(buf, "0x%x\n", codec->type); \
}
#define CODEC_INFO_STR_SHOW(type) \
static ssize_t type##_show(struct device *dev, \
struct device_attribute *attr, \
char *buf) \
{ \
struct snd_hwdep *hwdep = dev_get_drvdata(dev); \
struct hda_codec *codec = hwdep->private_data; \
return sprintf(buf, "%s\n", \
codec->type ? codec->type : ""); \
}
CODEC_INFO_SHOW(vendor_id);
CODEC_INFO_SHOW(subsystem_id);
CODEC_INFO_SHOW(revision_id);
CODEC_INFO_SHOW(afg);
CODEC_INFO_SHOW(mfg);
CODEC_INFO_STR_SHOW(name);
CODEC_INFO_STR_SHOW(modelname);
#define CODEC_INFO_STORE(type) \
static ssize_t type##_store(struct device *dev, \
struct device_attribute *attr, \
const char *buf, size_t count) \
{ \
struct snd_hwdep *hwdep = dev_get_drvdata(dev); \
struct hda_codec *codec = hwdep->private_data; \
char *after; \
codec->type = simple_strtoul(buf, &after, 0); \
return count; \
}
#define CODEC_INFO_STR_STORE(type) \
static ssize_t type##_store(struct device *dev, \
struct device_attribute *attr, \
const char *buf, size_t count) \
{ \
struct snd_hwdep *hwdep = dev_get_drvdata(dev); \
struct hda_codec *codec = hwdep->private_data; \
char *s = kstrndup_noeol(buf, 64); \
if (!s) \
return -ENOMEM; \
kfree(codec->type); \
codec->type = s; \
return count; \
}
CODEC_INFO_STORE(vendor_id);
CODEC_INFO_STORE(subsystem_id);
CODEC_INFO_STORE(revision_id);
CODEC_INFO_STR_STORE(name);
CODEC_INFO_STR_STORE(modelname);
#define CODEC_ACTION_STORE(type) \
static ssize_t type##_store(struct device *dev, \
struct device_attribute *attr, \
const char *buf, size_t count) \
{ \
struct snd_hwdep *hwdep = dev_get_drvdata(dev); \
struct hda_codec *codec = hwdep->private_data; \
int err = 0; \
if (*buf) \
err = type##_codec(codec); \
return err < 0 ? err : count; \
}
CODEC_ACTION_STORE(reconfig);
CODEC_ACTION_STORE(clear);
static ssize_t init_verbs_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct snd_hwdep *hwdep = dev_get_drvdata(dev);
struct hda_codec *codec = hwdep->private_data;
char *p;
struct hda_verb verb, *v;
verb.nid = simple_strtoul(buf, &p, 0);
verb.verb = simple_strtoul(p, &p, 0);
verb.param = simple_strtoul(p, &p, 0);
if (!verb.nid || !verb.verb || !verb.param)
return -EINVAL;
v = snd_array_new(&codec->init_verbs);
if (!v)
return -ENOMEM;
*v = verb;
return count;
}
static ssize_t hints_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct snd_hwdep *hwdep = dev_get_drvdata(dev);
struct hda_codec *codec = hwdep->private_data;
char *p;
char **hint;
if (!*buf || isspace(*buf) || *buf == '#' || *buf == '\n')
return count;
p = kstrndup_noeol(buf, 1024);
if (!p)
return -ENOMEM;
hint = snd_array_new(&codec->hints);
if (!hint) {
kfree(p);
return -ENOMEM;
}
*hint = p;
return count;
}
#define CODEC_ATTR_RW(type) \
__ATTR(type, 0644, type##_show, type##_store)
#define CODEC_ATTR_RO(type) \
__ATTR_RO(type)
#define CODEC_ATTR_WO(type) \
__ATTR(type, 0200, NULL, type##_store)
static struct device_attribute codec_attrs[] = {
CODEC_ATTR_RW(vendor_id),
CODEC_ATTR_RW(subsystem_id),
CODEC_ATTR_RW(revision_id),
CODEC_ATTR_RO(afg),
CODEC_ATTR_RO(mfg),
CODEC_ATTR_RW(name),
CODEC_ATTR_RW(modelname),
CODEC_ATTR_WO(init_verbs),
CODEC_ATTR_WO(hints),
CODEC_ATTR_WO(reconfig),
CODEC_ATTR_WO(clear),
};
/*
* create sysfs files on hwdep directory
*/
int snd_hda_hwdep_add_sysfs(struct hda_codec *codec)
{
struct snd_hwdep *hwdep = codec->hwdep;
int i;
for (i = 0; i < ARRAY_SIZE(codec_attrs); i++)
snd_add_device_sysfs_file(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card,
hwdep->device, &codec_attrs[i]);
return 0;
}
#endif /* CONFIG_SND_HDA_RECONFIG */
...@@ -58,6 +58,7 @@ static char *model[SNDRV_CARDS]; ...@@ -58,6 +58,7 @@ static char *model[SNDRV_CARDS];
static int position_fix[SNDRV_CARDS]; static int position_fix[SNDRV_CARDS];
static int bdl_pos_adj[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; static int bdl_pos_adj[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1};
static int probe_only[SNDRV_CARDS];
static int single_cmd; static int single_cmd;
static int enable_msi; static int enable_msi;
...@@ -76,6 +77,8 @@ module_param_array(bdl_pos_adj, int, NULL, 0644); ...@@ -76,6 +77,8 @@ module_param_array(bdl_pos_adj, int, NULL, 0644);
MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset.");
module_param_array(probe_mask, int, NULL, 0444); module_param_array(probe_mask, int, NULL, 0444);
MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1).");
module_param_array(probe_only, bool, NULL, 0444);
MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization.");
module_param(single_cmd, bool, 0444); module_param(single_cmd, bool, 0444);
MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs " MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs "
"(for debugging only)."); "(for debugging only).");
...@@ -83,7 +86,10 @@ module_param(enable_msi, int, 0444); ...@@ -83,7 +86,10 @@ module_param(enable_msi, int, 0444);
MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)"); MODULE_PARM_DESC(enable_msi, "Enable Message Signaled Interrupt (MSI)");
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
/* power_save option is defined in hda_codec.c */ static int power_save = CONFIG_SND_HDA_POWER_SAVE_DEFAULT;
module_param(power_save, int, 0644);
MODULE_PARM_DESC(power_save, "Automatic power-saving timeout "
"(in second, 0 = disable).");
/* reset the HD-audio controller in power save mode. /* reset the HD-audio controller in power save mode.
* this may give more power-saving, but will take longer time to * this may give more power-saving, but will take longer time to
...@@ -292,6 +298,8 @@ enum { ...@@ -292,6 +298,8 @@ enum {
/* Define VIA HD Audio Device ID*/ /* Define VIA HD Audio Device ID*/
#define VIA_HDAC_DEVICE_ID 0x3288 #define VIA_HDAC_DEVICE_ID 0x3288
/* HD Audio class code */
#define PCI_CLASS_MULTIMEDIA_HD_AUDIO 0x0403
/* /*
*/ */
...@@ -392,6 +400,7 @@ struct azx { ...@@ -392,6 +400,7 @@ struct azx {
unsigned int msi :1; unsigned int msi :1;
unsigned int irq_pending_warned :1; unsigned int irq_pending_warned :1;
unsigned int via_dmapos_patch :1; /* enable DMA-position fix for VIA */ unsigned int via_dmapos_patch :1; /* enable DMA-position fix for VIA */
unsigned int probing :1; /* codec probing phase */
/* for debugging */ /* for debugging */
unsigned int last_cmd; /* last issued command (to sync) */ unsigned int last_cmd; /* last issued command (to sync) */
...@@ -414,6 +423,7 @@ enum { ...@@ -414,6 +423,7 @@ enum {
AZX_DRIVER_ULI, AZX_DRIVER_ULI,
AZX_DRIVER_NVIDIA, AZX_DRIVER_NVIDIA,
AZX_DRIVER_TERA, AZX_DRIVER_TERA,
AZX_DRIVER_GENERIC,
AZX_NUM_DRIVERS, /* keep this as last entry */ AZX_NUM_DRIVERS, /* keep this as last entry */
}; };
...@@ -427,6 +437,7 @@ static char *driver_short_names[] __devinitdata = { ...@@ -427,6 +437,7 @@ static char *driver_short_names[] __devinitdata = {
[AZX_DRIVER_ULI] = "HDA ULI M5461", [AZX_DRIVER_ULI] = "HDA ULI M5461",
[AZX_DRIVER_NVIDIA] = "HDA NVidia", [AZX_DRIVER_NVIDIA] = "HDA NVidia",
[AZX_DRIVER_TERA] = "HDA Teradici", [AZX_DRIVER_TERA] = "HDA Teradici",
[AZX_DRIVER_GENERIC] = "HD-Audio Generic",
}; };
/* /*
...@@ -527,9 +538,9 @@ static void azx_free_cmd_io(struct azx *chip) ...@@ -527,9 +538,9 @@ static void azx_free_cmd_io(struct azx *chip)
} }
/* send a command */ /* send a command */
static int azx_corb_send_cmd(struct hda_codec *codec, u32 val) static int azx_corb_send_cmd(struct hda_bus *bus, u32 val)
{ {
struct azx *chip = codec->bus->private_data; struct azx *chip = bus->private_data;
unsigned int wp; unsigned int wp;
/* add command to corb */ /* add command to corb */
...@@ -577,9 +588,9 @@ static void azx_update_rirb(struct azx *chip) ...@@ -577,9 +588,9 @@ static void azx_update_rirb(struct azx *chip)
} }
/* receive a response */ /* receive a response */
static unsigned int azx_rirb_get_response(struct hda_codec *codec) static unsigned int azx_rirb_get_response(struct hda_bus *bus)
{ {
struct azx *chip = codec->bus->private_data; struct azx *chip = bus->private_data;
unsigned long timeout; unsigned long timeout;
again: again:
...@@ -596,7 +607,7 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) ...@@ -596,7 +607,7 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec)
} }
if (time_after(jiffies, timeout)) if (time_after(jiffies, timeout))
break; break;
if (codec->bus->needs_damn_long_delay) if (bus->needs_damn_long_delay)
msleep(2); /* temporary workaround */ msleep(2); /* temporary workaround */
else { else {
udelay(10); udelay(10);
...@@ -624,6 +635,14 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) ...@@ -624,6 +635,14 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec)
goto again; goto again;
} }
if (chip->probing) {
/* If this critical timeout happens during the codec probing
* phase, this is likely an access to a non-existing codec
* slot. Better to return an error and reset the system.
*/
return -1;
}
snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, " snd_printk(KERN_ERR "hda_intel: azx_get_response timeout, "
"switching to single_cmd mode: last cmd=0x%08x\n", "switching to single_cmd mode: last cmd=0x%08x\n",
chip->last_cmd); chip->last_cmd);
...@@ -646,9 +665,9 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec) ...@@ -646,9 +665,9 @@ static unsigned int azx_rirb_get_response(struct hda_codec *codec)
*/ */
/* send a command */ /* send a command */
static int azx_single_send_cmd(struct hda_codec *codec, u32 val) static int azx_single_send_cmd(struct hda_bus *bus, u32 val)
{ {
struct azx *chip = codec->bus->private_data; struct azx *chip = bus->private_data;
int timeout = 50; int timeout = 50;
while (timeout--) { while (timeout--) {
...@@ -671,9 +690,9 @@ static int azx_single_send_cmd(struct hda_codec *codec, u32 val) ...@@ -671,9 +690,9 @@ static int azx_single_send_cmd(struct hda_codec *codec, u32 val)
} }
/* receive a response */ /* receive a response */
static unsigned int azx_single_get_response(struct hda_codec *codec) static unsigned int azx_single_get_response(struct hda_bus *bus)
{ {
struct azx *chip = codec->bus->private_data; struct azx *chip = bus->private_data;
int timeout = 50; int timeout = 50;
while (timeout--) { while (timeout--) {
...@@ -696,38 +715,29 @@ static unsigned int azx_single_get_response(struct hda_codec *codec) ...@@ -696,38 +715,29 @@ static unsigned int azx_single_get_response(struct hda_codec *codec)
*/ */
/* send a command */ /* send a command */
static int azx_send_cmd(struct hda_codec *codec, hda_nid_t nid, static int azx_send_cmd(struct hda_bus *bus, unsigned int val)
int direct, unsigned int verb,
unsigned int para)
{ {
struct azx *chip = codec->bus->private_data; struct azx *chip = bus->private_data;
u32 val;
val = (u32)(codec->addr & 0x0f) << 28;
val |= (u32)direct << 27;
val |= (u32)nid << 20;
val |= verb << 8;
val |= para;
chip->last_cmd = val;
chip->last_cmd = val;
if (chip->single_cmd) if (chip->single_cmd)
return azx_single_send_cmd(codec, val); return azx_single_send_cmd(bus, val);
else else
return azx_corb_send_cmd(codec, val); return azx_corb_send_cmd(bus, val);
} }
/* get a response */ /* get a response */
static unsigned int azx_get_response(struct hda_codec *codec) static unsigned int azx_get_response(struct hda_bus *bus)
{ {
struct azx *chip = codec->bus->private_data; struct azx *chip = bus->private_data;
if (chip->single_cmd) if (chip->single_cmd)
return azx_single_get_response(codec); return azx_single_get_response(bus);
else else
return azx_rirb_get_response(codec); return azx_rirb_get_response(bus);
} }
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
static void azx_power_notify(struct hda_codec *codec); static void azx_power_notify(struct hda_bus *bus);
#endif #endif
/* reset codec link */ /* reset codec link */
...@@ -1184,6 +1194,28 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev) ...@@ -1184,6 +1194,28 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev)
return 0; return 0;
} }
/*
* Probe the given codec address
*/
static int probe_codec(struct azx *chip, int addr)
{
unsigned int cmd = (addr << 28) | (AC_NODE_ROOT << 20) |
(AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
unsigned int res;
chip->probing = 1;
azx_send_cmd(chip->bus, cmd);
res = azx_get_response(chip->bus);
chip->probing = 0;
if (res == -1)
return -EIO;
snd_printdd("hda_intel: codec #%d probed OK\n", addr);
return 0;
}
static int azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
struct hda_pcm *cpcm);
static void azx_stop_chip(struct azx *chip);
/* /*
* Codec initialization * Codec initialization
...@@ -1194,21 +1226,13 @@ static unsigned int azx_max_codecs[AZX_NUM_DRIVERS] __devinitdata = { ...@@ -1194,21 +1226,13 @@ static unsigned int azx_max_codecs[AZX_NUM_DRIVERS] __devinitdata = {
[AZX_DRIVER_TERA] = 1, [AZX_DRIVER_TERA] = 1,
}; };
/* number of slots to probe as default
* this can be different from azx_max_codecs[] -- e.g. some boards
* report wrongly the non-existing 4th slot availability
*/
static unsigned int azx_default_codecs[AZX_NUM_DRIVERS] __devinitdata = {
[AZX_DRIVER_ICH] = 3,
[AZX_DRIVER_ATI] = 3,
};
static int __devinit azx_codec_create(struct azx *chip, const char *model, static int __devinit azx_codec_create(struct azx *chip, const char *model,
unsigned int codec_probe_mask) unsigned int codec_probe_mask,
int no_init)
{ {
struct hda_bus_template bus_temp; struct hda_bus_template bus_temp;
int c, codecs, audio_codecs, err; int c, codecs, err;
int def_slots, max_slots; int max_slots;
memset(&bus_temp, 0, sizeof(bus_temp)); memset(&bus_temp, 0, sizeof(bus_temp));
bus_temp.private_data = chip; bus_temp.private_data = chip;
...@@ -1216,7 +1240,9 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model, ...@@ -1216,7 +1240,9 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model,
bus_temp.pci = chip->pci; bus_temp.pci = chip->pci;
bus_temp.ops.command = azx_send_cmd; bus_temp.ops.command = azx_send_cmd;
bus_temp.ops.get_response = azx_get_response; bus_temp.ops.get_response = azx_get_response;
bus_temp.ops.attach_pcm = azx_attach_pcm_stream;
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
bus_temp.power_save = &power_save;
bus_temp.ops.pm_notify = azx_power_notify; bus_temp.ops.pm_notify = azx_power_notify;
#endif #endif
...@@ -1227,33 +1253,43 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model, ...@@ -1227,33 +1253,43 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model,
if (chip->driver_type == AZX_DRIVER_NVIDIA) if (chip->driver_type == AZX_DRIVER_NVIDIA)
chip->bus->needs_damn_long_delay = 1; chip->bus->needs_damn_long_delay = 1;
codecs = audio_codecs = 0; codecs = 0;
max_slots = azx_max_codecs[chip->driver_type]; max_slots = azx_max_codecs[chip->driver_type];
if (!max_slots) if (!max_slots)
max_slots = AZX_MAX_CODECS; max_slots = AZX_MAX_CODECS;
def_slots = azx_default_codecs[chip->driver_type];
if (!def_slots) /* First try to probe all given codec slots */
def_slots = max_slots; for (c = 0; c < max_slots; c++) {
for (c = 0; c < def_slots; c++) { if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
if (probe_codec(chip, c) < 0) {
/* Some BIOSen give you wrong codec addresses
* that don't exist
*/
snd_printk(KERN_WARNING
"hda_intel: Codec #%d probe error; "
"disabling it...\n", c);
chip->codec_mask &= ~(1 << c);
/* More badly, accessing to a non-existing
* codec often screws up the controller chip,
* and distrubs the further communications.
* Thus if an error occurs during probing,
* better to reset the controller chip to
* get back to the sanity state.
*/
azx_stop_chip(chip);
azx_init_chip(chip);
}
}
}
/* Then create codec instances */
for (c = 0; c < max_slots; c++) {
if ((chip->codec_mask & (1 << c)) & codec_probe_mask) { if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
struct hda_codec *codec; struct hda_codec *codec;
err = snd_hda_codec_new(chip->bus, c, &codec); err = snd_hda_codec_new(chip->bus, c, !no_init, &codec);
if (err < 0) if (err < 0)
continue; continue;
codecs++; codecs++;
if (codec->afg)
audio_codecs++;
}
}
if (!audio_codecs) {
/* probe additional slots if no codec is found */
for (; c < max_slots; c++) {
if ((chip->codec_mask & (1 << c)) & codec_probe_mask) {
err = snd_hda_codec_new(chip->bus, c, NULL);
if (err < 0)
continue;
codecs++;
}
} }
} }
if (!codecs) { if (!codecs) {
...@@ -1722,111 +1758,59 @@ static struct snd_pcm_ops azx_pcm_ops = { ...@@ -1722,111 +1758,59 @@ static struct snd_pcm_ops azx_pcm_ops = {
static void azx_pcm_free(struct snd_pcm *pcm) static void azx_pcm_free(struct snd_pcm *pcm)
{ {
kfree(pcm->private_data); struct azx_pcm *apcm = pcm->private_data;
if (apcm) {
apcm->chip->pcm[pcm->device] = NULL;
kfree(apcm);
}
} }
static int __devinit create_codec_pcm(struct azx *chip, struct hda_codec *codec, static int
struct hda_pcm *cpcm) azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
struct hda_pcm *cpcm)
{ {
int err; struct azx *chip = bus->private_data;
struct snd_pcm *pcm; struct snd_pcm *pcm;
struct azx_pcm *apcm; struct azx_pcm *apcm;
int pcm_dev = cpcm->device;
int s, err;
/* if no substreams are defined for both playback and capture, if (pcm_dev >= AZX_MAX_PCMS) {
* it's just a placeholder. ignore it. snd_printk(KERN_ERR SFX "Invalid PCM device number %d\n",
*/ pcm_dev);
if (!cpcm->stream[0].substreams && !cpcm->stream[1].substreams)
return 0;
if (snd_BUG_ON(!cpcm->name))
return -EINVAL; return -EINVAL;
}
err = snd_pcm_new(chip->card, cpcm->name, cpcm->device, if (chip->pcm[pcm_dev]) {
cpcm->stream[0].substreams, snd_printk(KERN_ERR SFX "PCM %d already exists\n", pcm_dev);
cpcm->stream[1].substreams, return -EBUSY;
}
err = snd_pcm_new(chip->card, cpcm->name, pcm_dev,
cpcm->stream[SNDRV_PCM_STREAM_PLAYBACK].substreams,
cpcm->stream[SNDRV_PCM_STREAM_CAPTURE].substreams,
&pcm); &pcm);
if (err < 0) if (err < 0)
return err; return err;
strcpy(pcm->name, cpcm->name); strcpy(pcm->name, cpcm->name);
apcm = kmalloc(sizeof(*apcm), GFP_KERNEL); apcm = kzalloc(sizeof(*apcm), GFP_KERNEL);
if (apcm == NULL) if (apcm == NULL)
return -ENOMEM; return -ENOMEM;
apcm->chip = chip; apcm->chip = chip;
apcm->codec = codec; apcm->codec = codec;
apcm->hinfo[0] = &cpcm->stream[0];
apcm->hinfo[1] = &cpcm->stream[1];
pcm->private_data = apcm; pcm->private_data = apcm;
pcm->private_free = azx_pcm_free; pcm->private_free = azx_pcm_free;
if (cpcm->stream[0].substreams) if (cpcm->pcm_type == HDA_PCM_TYPE_MODEM)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &azx_pcm_ops); pcm->dev_class = SNDRV_PCM_CLASS_MODEM;
if (cpcm->stream[1].substreams) chip->pcm[pcm_dev] = pcm;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &azx_pcm_ops); cpcm->pcm = pcm;
for (s = 0; s < 2; s++) {
apcm->hinfo[s] = &cpcm->stream[s];
if (cpcm->stream[s].substreams)
snd_pcm_set_ops(pcm, s, &azx_pcm_ops);
}
/* buffer pre-allocation */
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
snd_dma_pci_data(chip->pci), snd_dma_pci_data(chip->pci),
1024 * 64, 32 * 1024 * 1024); 1024 * 64, 32 * 1024 * 1024);
chip->pcm[cpcm->device] = pcm;
return 0;
}
static int __devinit azx_pcm_create(struct azx *chip)
{
static const char *dev_name[HDA_PCM_NTYPES] = {
"Audio", "SPDIF", "HDMI", "Modem"
};
/* starting device index for each PCM type */
static int dev_idx[HDA_PCM_NTYPES] = {
[HDA_PCM_TYPE_AUDIO] = 0,
[HDA_PCM_TYPE_SPDIF] = 1,
[HDA_PCM_TYPE_HDMI] = 3,
[HDA_PCM_TYPE_MODEM] = 6
};
/* normal audio device indices; not linear to keep compatibility */
static int audio_idx[4] = { 0, 2, 4, 5 };
struct hda_codec *codec;
int c, err;
int num_devs[HDA_PCM_NTYPES];
err = snd_hda_build_pcms(chip->bus);
if (err < 0)
return err;
/* create audio PCMs */
memset(num_devs, 0, sizeof(num_devs));
list_for_each_entry(codec, &chip->bus->codec_list, list) {
for (c = 0; c < codec->num_pcms; c++) {
struct hda_pcm *cpcm = &codec->pcm_info[c];
int type = cpcm->pcm_type;
switch (type) {
case HDA_PCM_TYPE_AUDIO:
if (num_devs[type] >= ARRAY_SIZE(audio_idx)) {
snd_printk(KERN_WARNING
"Too many audio devices\n");
continue;
}
cpcm->device = audio_idx[num_devs[type]];
break;
case HDA_PCM_TYPE_SPDIF:
case HDA_PCM_TYPE_HDMI:
case HDA_PCM_TYPE_MODEM:
if (num_devs[type]) {
snd_printk(KERN_WARNING
"%s already defined\n",
dev_name[type]);
continue;
}
cpcm->device = dev_idx[type];
break;
default:
snd_printk(KERN_WARNING
"Invalid PCM type %d\n", type);
continue;
}
num_devs[type]++;
err = create_codec_pcm(chip, codec, cpcm);
if (err < 0)
return err;
}
}
return 0; return 0;
} }
...@@ -1903,13 +1887,13 @@ static void azx_stop_chip(struct azx *chip) ...@@ -1903,13 +1887,13 @@ static void azx_stop_chip(struct azx *chip)
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
/* power-up/down the controller */ /* power-up/down the controller */
static void azx_power_notify(struct hda_codec *codec) static void azx_power_notify(struct hda_bus *bus)
{ {
struct azx *chip = codec->bus->private_data; struct azx *chip = bus->private_data;
struct hda_codec *c; struct hda_codec *c;
int power_on = 0; int power_on = 0;
list_for_each_entry(c, &codec->bus->codec_list, list) { list_for_each_entry(c, &bus->codec_list, list) {
if (c->power_on) { if (c->power_on) {
power_on = 1; power_on = 1;
break; break;
...@@ -1926,6 +1910,18 @@ static void azx_power_notify(struct hda_codec *codec) ...@@ -1926,6 +1910,18 @@ static void azx_power_notify(struct hda_codec *codec)
/* /*
* power management * power management
*/ */
static int snd_hda_codecs_inuse(struct hda_bus *bus)
{
struct hda_codec *codec;
list_for_each_entry(codec, &bus->codec_list, list) {
if (snd_hda_codec_needs_resume(codec))
return 1;
}
return 0;
}
static int azx_suspend(struct pci_dev *pci, pm_message_t state) static int azx_suspend(struct pci_dev *pci, pm_message_t state)
{ {
struct snd_card *card = pci_get_drvdata(pci); struct snd_card *card = pci_get_drvdata(pci);
...@@ -1951,13 +1947,16 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state) ...@@ -1951,13 +1947,16 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state)
return 0; return 0;
} }
static int azx_resume_early(struct pci_dev *pci)
{
return pci_restore_state(pci);
}
static int azx_resume(struct pci_dev *pci) static int azx_resume(struct pci_dev *pci)
{ {
struct snd_card *card = pci_get_drvdata(pci); struct snd_card *card = pci_get_drvdata(pci);
struct azx *chip = card->private_data; struct azx *chip = card->private_data;
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) { if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "hda-intel: pci_enable_device failed, " printk(KERN_ERR "hda-intel: pci_enable_device failed, "
"disabling device\n"); "disabling device\n");
...@@ -2095,6 +2094,10 @@ static struct snd_pci_quirk probe_mask_list[] __devinitdata = { ...@@ -2095,6 +2094,10 @@ static struct snd_pci_quirk probe_mask_list[] __devinitdata = {
SND_PCI_QUIRK(0x1014, 0x05b7, "Thinkpad Z60", 0x01), SND_PCI_QUIRK(0x1014, 0x05b7, "Thinkpad Z60", 0x01),
SND_PCI_QUIRK(0x17aa, 0x2010, "Thinkpad X/T/R60", 0x01), SND_PCI_QUIRK(0x17aa, 0x2010, "Thinkpad X/T/R60", 0x01),
SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X/T/R61", 0x01), SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X/T/R61", 0x01),
/* broken BIOS */
SND_PCI_QUIRK(0x1028, 0x20ac, "Dell Studio Desktop", 0x01),
/* including bogus ALC268 in slot#2 that conflicts with ALC888 */
SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01),
{} {}
}; };
...@@ -2229,6 +2232,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, ...@@ -2229,6 +2232,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
chip->playback_streams = ATIHDMI_NUM_PLAYBACK; chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
chip->capture_streams = ATIHDMI_NUM_CAPTURE; chip->capture_streams = ATIHDMI_NUM_CAPTURE;
break; break;
case AZX_DRIVER_GENERIC:
default: default:
chip->playback_streams = ICH6_NUM_PLAYBACK; chip->playback_streams = ICH6_NUM_PLAYBACK;
chip->capture_streams = ICH6_NUM_CAPTURE; chip->capture_streams = ICH6_NUM_CAPTURE;
...@@ -2338,40 +2342,31 @@ static int __devinit azx_probe(struct pci_dev *pci, ...@@ -2338,40 +2342,31 @@ static int __devinit azx_probe(struct pci_dev *pci,
} }
err = azx_create(card, pci, dev, pci_id->driver_data, &chip); err = azx_create(card, pci, dev, pci_id->driver_data, &chip);
if (err < 0) { if (err < 0)
snd_card_free(card); goto out_free;
return err;
}
card->private_data = chip; card->private_data = chip;
/* create codec instances */ /* create codec instances */
err = azx_codec_create(chip, model[dev], probe_mask[dev]); err = azx_codec_create(chip, model[dev], probe_mask[dev],
if (err < 0) { probe_only[dev]);
snd_card_free(card); if (err < 0)
return err; goto out_free;
}
/* create PCM streams */ /* create PCM streams */
err = azx_pcm_create(chip); err = snd_hda_build_pcms(chip->bus);
if (err < 0) { if (err < 0)
snd_card_free(card); goto out_free;
return err;
}
/* create mixer controls */ /* create mixer controls */
err = azx_mixer_create(chip); err = azx_mixer_create(chip);
if (err < 0) { if (err < 0)
snd_card_free(card); goto out_free;
return err;
}
snd_card_set_dev(card, &pci->dev); snd_card_set_dev(card, &pci->dev);
err = snd_card_register(card); err = snd_card_register(card);
if (err < 0) { if (err < 0)
snd_card_free(card); goto out_free;
return err;
}
pci_set_drvdata(pci, card); pci_set_drvdata(pci, card);
chip->running = 1; chip->running = 1;
...@@ -2380,6 +2375,9 @@ static int __devinit azx_probe(struct pci_dev *pci, ...@@ -2380,6 +2375,9 @@ static int __devinit azx_probe(struct pci_dev *pci,
dev++; dev++;
return err; return err;
out_free:
snd_card_free(card);
return err;
} }
static void __devexit azx_remove(struct pci_dev *pci) static void __devexit azx_remove(struct pci_dev *pci)
...@@ -2453,6 +2451,11 @@ static struct pci_device_id azx_ids[] = { ...@@ -2453,6 +2451,11 @@ static struct pci_device_id azx_ids[] = {
{ PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA }, { PCI_DEVICE(0x10de, 0x0bd7), .driver_data = AZX_DRIVER_NVIDIA },
/* Teradici */ /* Teradici */
{ PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA }, { PCI_DEVICE(0x6549, 0x1200), .driver_data = AZX_DRIVER_TERA },
/* AMD Generic, PCI class code and Vendor ID for HD Audio */
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
.class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
.class_mask = 0xffffff,
.driver_data = AZX_DRIVER_GENERIC },
{ 0, } { 0, }
}; };
MODULE_DEVICE_TABLE(pci, azx_ids); MODULE_DEVICE_TABLE(pci, azx_ids);
...@@ -2465,6 +2468,7 @@ static struct pci_driver driver = { ...@@ -2465,6 +2468,7 @@ static struct pci_driver driver = {
.remove = __devexit_p(azx_remove), .remove = __devexit_p(azx_remove),
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = azx_suspend, .suspend = azx_suspend,
.resume_early = azx_resume_early,
.resume = azx_resume, .resume = azx_resume,
#endif #endif
}; };
......
此差异已折叠。
/*
* HDA Patches - included by hda_codec.c
*/
/* Realtek codecs */
extern struct hda_codec_preset snd_hda_preset_realtek[];
/* C-Media codecs */
extern struct hda_codec_preset snd_hda_preset_cmedia[];
/* Analog Devices codecs */
extern struct hda_codec_preset snd_hda_preset_analog[];
/* SigmaTel codecs */
extern struct hda_codec_preset snd_hda_preset_sigmatel[];
/* SiLabs 3054/3055 modem codecs */
extern struct hda_codec_preset snd_hda_preset_si3054[];
/* ATI HDMI codecs */
extern struct hda_codec_preset snd_hda_preset_atihdmi[];
/* Conexant audio codec */
extern struct hda_codec_preset snd_hda_preset_conexant[];
/* VIA codecs */
extern struct hda_codec_preset snd_hda_preset_via[];
/* NVIDIA HDMI codecs */
extern struct hda_codec_preset snd_hda_preset_nvhdmi[];
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册