aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-11-16 08:58:17 -0500
committerTakashi Iwai <tiwai@suse.de>2009-11-16 08:58:17 -0500
commitd5191e50b251594bdde10d4839a952ff1646ef62 (patch)
tree756194a90e641a01f0cc23e7547ee563dac38bd3 /sound/pci/hda/hda_codec.c
parent85dd662ff4d2967084acfc761a33717383297e42 (diff)
ALSA: hda - Update / add kerneldoc comments to exported functions
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c432
1 files changed, 391 insertions, 41 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5e21b35207ab..e344235da491 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -94,6 +94,13 @@ static void hda_keep_power_on(struct hda_codec *codec);
94static inline void hda_keep_power_on(struct hda_codec *codec) {} 94static inline void hda_keep_power_on(struct hda_codec *codec) {}
95#endif 95#endif
96 96
97/**
98 * snd_hda_get_jack_location - Give a location string of the jack
99 * @cfg: pin default config value
100 *
101 * Parse the pin default config value and returns the string of the
102 * jack location, e.g. "Rear", "Front", etc.
103 */
97const char *snd_hda_get_jack_location(u32 cfg) 104const char *snd_hda_get_jack_location(u32 cfg)
98{ 105{
99 static char *bases[7] = { 106 static char *bases[7] = {
@@ -121,6 +128,13 @@ const char *snd_hda_get_jack_location(u32 cfg)
121} 128}
122EXPORT_SYMBOL_HDA(snd_hda_get_jack_location); 129EXPORT_SYMBOL_HDA(snd_hda_get_jack_location);
123 130
131/**
132 * snd_hda_get_jack_connectivity - Give a connectivity string of the jack
133 * @cfg: pin default config value
134 *
135 * Parse the pin default config value and returns the string of the
136 * jack connectivity, i.e. external or internal connection.
137 */
124const char *snd_hda_get_jack_connectivity(u32 cfg) 138const char *snd_hda_get_jack_connectivity(u32 cfg)
125{ 139{
126 static char *jack_locations[4] = { "Ext", "Int", "Sep", "Oth" }; 140 static char *jack_locations[4] = { "Ext", "Int", "Sep", "Oth" };
@@ -129,6 +143,13 @@ const char *snd_hda_get_jack_connectivity(u32 cfg)
129} 143}
130EXPORT_SYMBOL_HDA(snd_hda_get_jack_connectivity); 144EXPORT_SYMBOL_HDA(snd_hda_get_jack_connectivity);
131 145
146/**
147 * snd_hda_get_jack_type - Give a type string of the jack
148 * @cfg: pin default config value
149 *
150 * Parse the pin default config value and returns the string of the
151 * jack type, i.e. the purpose of the jack, such as Line-Out or CD.
152 */
132const char *snd_hda_get_jack_type(u32 cfg) 153const char *snd_hda_get_jack_type(u32 cfg)
133{ 154{
134 static char *jack_types[16] = { 155 static char *jack_types[16] = {
@@ -822,6 +843,16 @@ int snd_hda_add_pincfg(struct hda_codec *codec, struct snd_array *list,
822 return 0; 843 return 0;
823} 844}
824 845
846/**
847 * snd_hda_codec_set_pincfg - Override a pin default configuration
848 * @codec: the HDA codec
849 * @nid: NID to set the pin config
850 * @cfg: the pin default config value
851 *
852 * Override a pin default configuration value in the cache.
853 * This value can be read by snd_hda_codec_get_pincfg() in a higher
854 * priority than the real hardware value.
855 */
825int snd_hda_codec_set_pincfg(struct hda_codec *codec, 856int snd_hda_codec_set_pincfg(struct hda_codec *codec,
826 hda_nid_t nid, unsigned int cfg) 857 hda_nid_t nid, unsigned int cfg)
827{ 858{
@@ -829,7 +860,15 @@ int snd_hda_codec_set_pincfg(struct hda_codec *codec,
829} 860}
830EXPORT_SYMBOL_HDA(snd_hda_codec_set_pincfg); 861EXPORT_SYMBOL_HDA(snd_hda_codec_set_pincfg);
831 862
832/* get the current pin config value of the given pin NID */ 863/**
864 * snd_hda_codec_get_pincfg - Obtain a pin-default configuration
865 * @codec: the HDA codec
866 * @nid: NID to get the pin config
867 *
868 * Get the current pin config value of the given pin NID.
869 * If the pincfg value is cached or overridden via sysfs or driver,
870 * returns the cached value.
871 */
833unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid) 872unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid)
834{ 873{
835 struct hda_pincfg *pin; 874 struct hda_pincfg *pin;
@@ -1028,6 +1067,15 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr
1028} 1067}
1029EXPORT_SYMBOL_HDA(snd_hda_codec_new); 1068EXPORT_SYMBOL_HDA(snd_hda_codec_new);
1030 1069
1070/**
1071 * snd_hda_codec_configure - (Re-)configure the HD-audio codec
1072 * @codec: the HDA codec
1073 *
1074 * Start parsing of the given codec tree and (re-)initialize the whole
1075 * patch instance.
1076 *
1077 * Returns 0 if successful or a negative error code.
1078 */
1031int snd_hda_codec_configure(struct hda_codec *codec) 1079int snd_hda_codec_configure(struct hda_codec *codec)
1032{ 1080{
1033 int err; 1081 int err;
@@ -1090,6 +1138,11 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1090} 1138}
1091EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream); 1139EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream);
1092 1140
1141/**
1142 * snd_hda_codec_cleanup_stream - clean up the codec for closing
1143 * @codec: the CODEC to clean up
1144 * @nid: the NID to clean up
1145 */
1093void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) 1146void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
1094{ 1147{
1095 if (!nid) 1148 if (!nid)
@@ -1165,8 +1218,17 @@ get_alloc_amp_hash(struct hda_codec *codec, u32 key)
1165 return (struct hda_amp_info *)get_alloc_hash(&codec->amp_cache, key); 1218 return (struct hda_amp_info *)get_alloc_hash(&codec->amp_cache, key);
1166} 1219}
1167 1220
1168/* 1221/**
1169 * query AMP capabilities for the given widget and direction 1222 * query_amp_caps - query AMP capabilities
1223 * @codec: the HD-auio codec
1224 * @nid: the NID to query
1225 * @direction: either #HDA_INPUT or #HDA_OUTPUT
1226 *
1227 * Query AMP capabilities for the given widget and direction.
1228 * Returns the obtained capability bits.
1229 *
1230 * When cap bits have been already read, this doesn't read again but
1231 * returns the cached value.
1170 */ 1232 */
1171u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction) 1233u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction)
1172{ 1234{
@@ -1189,6 +1251,19 @@ u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction)
1189} 1251}
1190EXPORT_SYMBOL_HDA(query_amp_caps); 1252EXPORT_SYMBOL_HDA(query_amp_caps);
1191 1253
1254/**
1255 * snd_hda_override_amp_caps - Override the AMP capabilities
1256 * @codec: the CODEC to clean up
1257 * @nid: the NID to clean up
1258 * @direction: either #HDA_INPUT or #HDA_OUTPUT
1259 * @caps: the capability bits to set
1260 *
1261 * Override the cached AMP caps bits value by the given one.
1262 * This function is useful if the driver needs to adjust the AMP ranges,
1263 * e.g. limit to 0dB, etc.
1264 *
1265 * Returns zero if successful or a negative error code.
1266 */
1192int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, 1267int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
1193 unsigned int caps) 1268 unsigned int caps)
1194{ 1269{
@@ -1224,6 +1299,17 @@ static unsigned int read_pin_cap(struct hda_codec *codec, hda_nid_t nid)
1224 return snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); 1299 return snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
1225} 1300}
1226 1301
1302/**
1303 * snd_hda_query_pin_caps - Query PIN capabilities
1304 * @codec: the HD-auio codec
1305 * @nid: the NID to query
1306 *
1307 * Query PIN capabilities for the given widget.
1308 * Returns the obtained capability bits.
1309 *
1310 * When cap bits have been already read, this doesn't read again but
1311 * returns the cached value.
1312 */
1227u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid) 1313u32 snd_hda_query_pin_caps(struct hda_codec *codec, hda_nid_t nid)
1228{ 1314{
1229 return query_caps_hash(codec, nid, HDA_HASH_PINCAP_KEY(nid), 1315 return query_caps_hash(codec, nid, HDA_HASH_PINCAP_KEY(nid),
@@ -1271,8 +1357,15 @@ static void put_vol_mute(struct hda_codec *codec, struct hda_amp_info *info,
1271 info->vol[ch] = val; 1357 info->vol[ch] = val;
1272} 1358}
1273 1359
1274/* 1360/**
1275 * read AMP value. The volume is between 0 to 0x7f, 0x80 = mute bit. 1361 * snd_hda_codec_amp_read - Read AMP value
1362 * @codec: HD-audio codec
1363 * @nid: NID to read the AMP value
1364 * @ch: channel (left=0 or right=1)
1365 * @direction: #HDA_INPUT or #HDA_OUTPUT
1366 * @index: the index value (only for input direction)
1367 *
1368 * Read AMP value. The volume is between 0 to 0x7f, 0x80 = mute bit.
1276 */ 1369 */
1277int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, 1370int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch,
1278 int direction, int index) 1371 int direction, int index)
@@ -1285,8 +1378,18 @@ int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch,
1285} 1378}
1286EXPORT_SYMBOL_HDA(snd_hda_codec_amp_read); 1379EXPORT_SYMBOL_HDA(snd_hda_codec_amp_read);
1287 1380
1288/* 1381/**
1289 * update the AMP value, mask = bit mask to set, val = the value 1382 * snd_hda_codec_amp_update - update the AMP value
1383 * @codec: HD-audio codec
1384 * @nid: NID to read the AMP value
1385 * @ch: channel (left=0 or right=1)
1386 * @direction: #HDA_INPUT or #HDA_OUTPUT
1387 * @idx: the index value (only for input direction)
1388 * @mask: bit mask to set
1389 * @val: the bits value to set
1390 *
1391 * Update the AMP value with a bit mask.
1392 * Returns 0 if the value is unchanged, 1 if changed.
1290 */ 1393 */
1291int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch, 1394int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch,
1292 int direction, int idx, int mask, int val) 1395 int direction, int idx, int mask, int val)
@@ -1305,8 +1408,17 @@ int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch,
1305} 1408}
1306EXPORT_SYMBOL_HDA(snd_hda_codec_amp_update); 1409EXPORT_SYMBOL_HDA(snd_hda_codec_amp_update);
1307 1410
1308/* 1411/**
1309 * update the AMP stereo with the same mask and value 1412 * snd_hda_codec_amp_stereo - update the AMP stereo values
1413 * @codec: HD-audio codec
1414 * @nid: NID to read the AMP value
1415 * @direction: #HDA_INPUT or #HDA_OUTPUT
1416 * @idx: the index value (only for input direction)
1417 * @mask: bit mask to set
1418 * @val: the bits value to set
1419 *
1420 * Update the AMP values like snd_hda_codec_amp_update(), but for a
1421 * stereo widget with the same mask and value.
1310 */ 1422 */
1311int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, 1423int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
1312 int direction, int idx, int mask, int val) 1424 int direction, int idx, int mask, int val)
@@ -1320,7 +1432,12 @@ int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
1320EXPORT_SYMBOL_HDA(snd_hda_codec_amp_stereo); 1432EXPORT_SYMBOL_HDA(snd_hda_codec_amp_stereo);
1321 1433
1322#ifdef SND_HDA_NEEDS_RESUME 1434#ifdef SND_HDA_NEEDS_RESUME
1323/* resume the all amp commands from the cache */ 1435/**
1436 * snd_hda_codec_resume_amp - Resume all AMP commands from the cache
1437 * @codec: HD-audio codec
1438 *
1439 * Resume the all amp commands from the cache.
1440 */
1324void snd_hda_codec_resume_amp(struct hda_codec *codec) 1441void snd_hda_codec_resume_amp(struct hda_codec *codec)
1325{ 1442{
1326 struct hda_amp_info *buffer = codec->amp_cache.buf.list; 1443 struct hda_amp_info *buffer = codec->amp_cache.buf.list;
@@ -1346,7 +1463,12 @@ void snd_hda_codec_resume_amp(struct hda_codec *codec)
1346EXPORT_SYMBOL_HDA(snd_hda_codec_resume_amp); 1463EXPORT_SYMBOL_HDA(snd_hda_codec_resume_amp);
1347#endif /* SND_HDA_NEEDS_RESUME */ 1464#endif /* SND_HDA_NEEDS_RESUME */
1348 1465
1349/* volume */ 1466/**
1467 * snd_hda_mixer_amp_volume_info - Info callback for a standard AMP mixer
1468 *
1469 * The control element is supposed to have the private_value field
1470 * set up via HDA_COMPOSE_AMP_VAL*() or related macros.
1471 */
1350int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol, 1472int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol,
1351 struct snd_ctl_elem_info *uinfo) 1473 struct snd_ctl_elem_info *uinfo)
1352{ 1474{
@@ -1402,6 +1524,12 @@ update_amp_value(struct hda_codec *codec, hda_nid_t nid,
1402 HDA_AMP_VOLMASK, val); 1524 HDA_AMP_VOLMASK, val);
1403} 1525}
1404 1526
1527/**
1528 * snd_hda_mixer_amp_volume_get - Get callback for a standard AMP mixer volume
1529 *
1530 * The control element is supposed to have the private_value field
1531 * set up via HDA_COMPOSE_AMP_VAL*() or related macros.
1532 */
1405int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, 1533int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol,
1406 struct snd_ctl_elem_value *ucontrol) 1534 struct snd_ctl_elem_value *ucontrol)
1407{ 1535{
@@ -1421,6 +1549,12 @@ int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol,
1421} 1549}
1422EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_volume_get); 1550EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_volume_get);
1423 1551
1552/**
1553 * snd_hda_mixer_amp_volume_put - Put callback for a standard AMP mixer volume
1554 *
1555 * The control element is supposed to have the private_value field
1556 * set up via HDA_COMPOSE_AMP_VAL*() or related macros.
1557 */
1424int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, 1558int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol,
1425 struct snd_ctl_elem_value *ucontrol) 1559 struct snd_ctl_elem_value *ucontrol)
1426{ 1560{
@@ -1445,6 +1579,12 @@ int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol,
1445} 1579}
1446EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_volume_put); 1580EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_volume_put);
1447 1581
1582/**
1583 * snd_hda_mixer_amp_volume_put - TLV callback for a standard AMP mixer volume
1584 *
1585 * The control element is supposed to have the private_value field
1586 * set up via HDA_COMPOSE_AMP_VAL*() or related macros.
1587 */
1448int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, 1588int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag,
1449 unsigned int size, unsigned int __user *_tlv) 1589 unsigned int size, unsigned int __user *_tlv)
1450{ 1590{
@@ -1474,8 +1614,16 @@ int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag,
1474} 1614}
1475EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_tlv); 1615EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_tlv);
1476 1616
1477/* 1617/**
1478 * set (static) TLV for virtual master volume; recalculated as max 0dB 1618 * snd_hda_set_vmaster_tlv - Set TLV for a virtual master control
1619 * @codec: HD-audio codec
1620 * @nid: NID of a reference widget
1621 * @dir: #HDA_INPUT or #HDA_OUTPUT
1622 * @tlv: TLV data to be stored, at least 4 elements
1623 *
1624 * Set (static) TLV data for a virtual master volume using the AMP caps
1625 * obtained from the reference NID.
1626 * The volume range is recalculated as if the max volume is 0dB.
1479 */ 1627 */
1480void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, 1628void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
1481 unsigned int *tlv) 1629 unsigned int *tlv)
@@ -1509,6 +1657,13 @@ _snd_hda_find_mixer_ctl(struct hda_codec *codec,
1509 return snd_ctl_find_id(codec->bus->card, &id); 1657 return snd_ctl_find_id(codec->bus->card, &id);
1510} 1658}
1511 1659
1660/**
1661 * snd_hda_find_mixer_ctl - Find a mixer control element with the given name
1662 * @codec: HD-audio codec
1663 * @name: ctl id name string
1664 *
1665 * Get the control element with the given id string and IFACE_MIXER.
1666 */
1512struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, 1667struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
1513 const char *name) 1668 const char *name)
1514{ 1669{
@@ -1516,7 +1671,24 @@ struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
1516} 1671}
1517EXPORT_SYMBOL_HDA(snd_hda_find_mixer_ctl); 1672EXPORT_SYMBOL_HDA(snd_hda_find_mixer_ctl);
1518 1673
1519/* Add a control element and assign to the codec */ 1674/**
1675 * snd_hda_ctl-add - Add a control element and assign to the codec
1676 * @codec: HD-audio codec
1677 * @nid: corresponding NID (optional)
1678 * @kctl: the control element to assign
1679 *
1680 * Add the given control element to an array inside the codec instance.
1681 * All control elements belonging to a codec are supposed to be added
1682 * by this function so that a proper clean-up works at the free or
1683 * reconfiguration time.
1684 *
1685 * If non-zero @nid is passed, the NID is assigned to the control element.
1686 * The assignment is shown in the codec proc file.
1687 *
1688 * snd_hda_ctl_add() checks the control subdev id field whether
1689 * #HDA_SUBDEV_NID_FLAG bit is set. If set (and @nid is zero), the lower
1690 * bits value is taken as the NID to assign.
1691 */
1520int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid, 1692int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
1521 struct snd_kcontrol *kctl) 1693 struct snd_kcontrol *kctl)
1522{ 1694{
@@ -1540,7 +1712,10 @@ int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid,
1540} 1712}
1541EXPORT_SYMBOL_HDA(snd_hda_ctl_add); 1713EXPORT_SYMBOL_HDA(snd_hda_ctl_add);
1542 1714
1543/* Clear all controls assigned to the given codec */ 1715/**
1716 * snd_hda_ctls_clear - Clear all controls assigned to the given codec
1717 * @codec: HD-audio codec
1718 */
1544void snd_hda_ctls_clear(struct hda_codec *codec) 1719void snd_hda_ctls_clear(struct hda_codec *codec)
1545{ 1720{
1546 int i; 1721 int i;
@@ -1572,6 +1747,16 @@ static void hda_unlock_devices(struct snd_card *card)
1572 spin_unlock(&card->files_lock); 1747 spin_unlock(&card->files_lock);
1573} 1748}
1574 1749
1750/**
1751 * snd_hda_codec_reset - Clear all objects assigned to the codec
1752 * @codec: HD-audio codec
1753 *
1754 * This frees the all PCM and control elements assigned to the codec, and
1755 * clears the caches and restores the pin default configurations.
1756 *
1757 * When a device is being used, it returns -EBSY. If successfully freed,
1758 * returns zero.
1759 */
1575int snd_hda_codec_reset(struct hda_codec *codec) 1760int snd_hda_codec_reset(struct hda_codec *codec)
1576{ 1761{
1577 struct snd_card *card = codec->bus->card; 1762 struct snd_card *card = codec->bus->card;
@@ -1635,7 +1820,22 @@ int snd_hda_codec_reset(struct hda_codec *codec)
1635 return 0; 1820 return 0;
1636} 1821}
1637 1822
1638/* create a virtual master control and add slaves */ 1823/**
1824 * snd_hda_add_vmaster - create a virtual master control and add slaves
1825 * @codec: HD-audio codec
1826 * @name: vmaster control name
1827 * @tlv: TLV data (optional)
1828 * @slaves: slave control names (optional)
1829 *
1830 * Create a virtual master control with the given name. The TLV data
1831 * must be either NULL or a valid data.
1832 *
1833 * @slaves is a NULL-terminated array of strings, each of which is a
1834 * slave control name. All controls with these names are assigned to
1835 * the new virtual master control.
1836 *
1837 * This function returns zero if successful or a negative error code.
1838 */
1639int snd_hda_add_vmaster(struct hda_codec *codec, char *name, 1839int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
1640 unsigned int *tlv, const char **slaves) 1840 unsigned int *tlv, const char **slaves)
1641{ 1841{
@@ -1677,7 +1877,12 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
1677} 1877}
1678EXPORT_SYMBOL_HDA(snd_hda_add_vmaster); 1878EXPORT_SYMBOL_HDA(snd_hda_add_vmaster);
1679 1879
1680/* switch */ 1880/**
1881 * snd_hda_mixer_amp_switch_info - Info callback for a standard AMP mixer switch
1882 *
1883 * The control element is supposed to have the private_value field
1884 * set up via HDA_COMPOSE_AMP_VAL*() or related macros.
1885 */
1681int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, 1886int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol,
1682 struct snd_ctl_elem_info *uinfo) 1887 struct snd_ctl_elem_info *uinfo)
1683{ 1888{
@@ -1691,6 +1896,12 @@ int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol,
1691} 1896}
1692EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_info); 1897EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_info);
1693 1898
1899/**
1900 * snd_hda_mixer_amp_switch_get - Get callback for a standard AMP mixer switch
1901 *
1902 * The control element is supposed to have the private_value field
1903 * set up via HDA_COMPOSE_AMP_VAL*() or related macros.
1904 */
1694int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, 1905int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol,
1695 struct snd_ctl_elem_value *ucontrol) 1906 struct snd_ctl_elem_value *ucontrol)
1696{ 1907{
@@ -1711,6 +1922,12 @@ int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol,
1711} 1922}
1712EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_get); 1923EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_get);
1713 1924
1925/**
1926 * snd_hda_mixer_amp_switch_put - Put callback for a standard AMP mixer switch
1927 *
1928 * The control element is supposed to have the private_value field
1929 * set up via HDA_COMPOSE_AMP_VAL*() or related macros.
1930 */
1714int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, 1931int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol,
1715 struct snd_ctl_elem_value *ucontrol) 1932 struct snd_ctl_elem_value *ucontrol)
1716{ 1933{
@@ -1742,6 +1959,12 @@ int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol,
1742} 1959}
1743EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put); 1960EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put);
1744 1961
1962/**
1963 * snd_hda_mixer_amp_switch_put_beep - Put callback for a beep AMP switch
1964 *
1965 * This function calls snd_hda_enable_beep_device(), which behaves differently
1966 * depending on beep_mode option.
1967 */
1745int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol, 1968int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol,
1746 struct snd_ctl_elem_value *ucontrol) 1969 struct snd_ctl_elem_value *ucontrol)
1747{ 1970{
@@ -1762,6 +1985,12 @@ EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put_beep);
1762#define AMP_VAL_IDX_SHIFT 19 1985#define AMP_VAL_IDX_SHIFT 19
1763#define AMP_VAL_IDX_MASK (0x0f<<19) 1986#define AMP_VAL_IDX_MASK (0x0f<<19)
1764 1987
1988/**
1989 * snd_hda_mixer_bind_switch_get - Get callback for a bound volume control
1990 *
1991 * The control element is supposed to have the private_value field
1992 * set up via HDA_BIND_MUTE*() macros.
1993 */
1765int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, 1994int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol,
1766 struct snd_ctl_elem_value *ucontrol) 1995 struct snd_ctl_elem_value *ucontrol)
1767{ 1996{
@@ -1779,6 +2008,12 @@ int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol,
1779} 2008}
1780EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_get); 2009EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_get);
1781 2010
2011/**
2012 * snd_hda_mixer_bind_switch_put - Put callback for a bound volume control
2013 *
2014 * The control element is supposed to have the private_value field
2015 * set up via HDA_BIND_MUTE*() macros.
2016 */
1782int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, 2017int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol,
1783 struct snd_ctl_elem_value *ucontrol) 2018 struct snd_ctl_elem_value *ucontrol)
1784{ 2019{
@@ -1803,8 +2038,11 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol,
1803} 2038}
1804EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_put); 2039EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_put);
1805 2040
1806/* 2041/**
1807 * generic bound volume/swtich controls 2042 * snd_hda_mixer_bind_ctls_info - Info callback for a generic bound control
2043 *
2044 * The control element is supposed to have the private_value field
2045 * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.
1808 */ 2046 */
1809int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, 2047int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol,
1810 struct snd_ctl_elem_info *uinfo) 2048 struct snd_ctl_elem_info *uinfo)
@@ -1823,6 +2061,12 @@ int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol,
1823} 2061}
1824EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_info); 2062EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_info);
1825 2063
2064/**
2065 * snd_hda_mixer_bind_ctls_get - Get callback for a generic bound control
2066 *
2067 * The control element is supposed to have the private_value field
2068 * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.
2069 */
1826int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, 2070int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol,
1827 struct snd_ctl_elem_value *ucontrol) 2071 struct snd_ctl_elem_value *ucontrol)
1828{ 2072{
@@ -1840,6 +2084,12 @@ int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol,
1840} 2084}
1841EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_get); 2085EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_get);
1842 2086
2087/**
2088 * snd_hda_mixer_bind_ctls_put - Put callback for a generic bound control
2089 *
2090 * The control element is supposed to have the private_value field
2091 * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.
2092 */
1843int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, 2093int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol,
1844 struct snd_ctl_elem_value *ucontrol) 2094 struct snd_ctl_elem_value *ucontrol)
1845{ 2095{
@@ -1863,6 +2113,12 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol,
1863} 2113}
1864EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_put); 2114EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_put);
1865 2115
2116/**
2117 * snd_hda_mixer_bind_tlv - TLV callback for a generic bound control
2118 *
2119 * The control element is supposed to have the private_value field
2120 * set up via HDA_BIND_VOL() macro.
2121 */
1866int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, 2122int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag,
1867 unsigned int size, unsigned int __user *tlv) 2123 unsigned int size, unsigned int __user *tlv)
1868{ 2124{
@@ -2185,6 +2441,11 @@ static struct snd_kcontrol_new spdif_share_sw = {
2185 .put = spdif_share_sw_put, 2441 .put = spdif_share_sw_put,
2186}; 2442};
2187 2443
2444/**
2445 * snd_hda_create_spdif_share_sw - create Default PCM switch
2446 * @codec: the HDA codec
2447 * @mout: multi-out instance
2448 */
2188int snd_hda_create_spdif_share_sw(struct hda_codec *codec, 2449int snd_hda_create_spdif_share_sw(struct hda_codec *codec,
2189 struct hda_multi_out *mout) 2450 struct hda_multi_out *mout)
2190{ 2451{
@@ -2352,7 +2613,12 @@ int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
2352} 2613}
2353EXPORT_SYMBOL_HDA(snd_hda_codec_write_cache); 2614EXPORT_SYMBOL_HDA(snd_hda_codec_write_cache);
2354 2615
2355/* resume the all commands from the cache */ 2616/**
2617 * snd_hda_codec_resume_cache - Resume the all commands from the cache
2618 * @codec: HD-audio codec
2619 *
2620 * Execute all verbs recorded in the command caches to resume.
2621 */
2356void snd_hda_codec_resume_cache(struct hda_codec *codec) 2622void snd_hda_codec_resume_cache(struct hda_codec *codec)
2357{ 2623{
2358 struct hda_cache_head *buffer = codec->cmd_cache.buf.list; 2624 struct hda_cache_head *buffer = codec->cmd_cache.buf.list;
@@ -2778,8 +3044,12 @@ static int snd_hda_query_supported_pcm(struct hda_codec *codec, hda_nid_t nid,
2778} 3044}
2779 3045
2780/** 3046/**
2781 * snd_hda_is_supported_format - check whether the given node supports 3047 * snd_hda_is_supported_format - Check the validity of the format
2782 * the format val 3048 * @codec: HD-audio codec
3049 * @nid: NID to check
3050 * @format: the HD-audio format value to check
3051 *
3052 * Check whether the given node supports the format value.
2783 * 3053 *
2784 * Returns 1 if supported, 0 if not. 3054 * Returns 1 if supported, 0 if not.
2785 */ 3055 */
@@ -2899,6 +3169,7 @@ static int set_pcm_default_values(struct hda_codec *codec,
2899 return 0; 3169 return 0;
2900} 3170}
2901 3171
3172/* global */
2902const char *snd_hda_pcm_type_name[HDA_PCM_NTYPES] = { 3173const char *snd_hda_pcm_type_name[HDA_PCM_NTYPES] = {
2903 "Audio", "SPDIF", "HDMI", "Modem" 3174 "Audio", "SPDIF", "HDMI", "Modem"
2904}; 3175};
@@ -3216,6 +3487,7 @@ static void hda_keep_power_on(struct hda_codec *codec)
3216 codec->power_jiffies = jiffies; 3487 codec->power_jiffies = jiffies;
3217} 3488}
3218 3489
3490/* update the power on/off account with the current jiffies */
3219void snd_hda_update_power_acct(struct hda_codec *codec) 3491void snd_hda_update_power_acct(struct hda_codec *codec)
3220{ 3492{
3221 unsigned long delta = jiffies - codec->power_jiffies; 3493 unsigned long delta = jiffies - codec->power_jiffies;
@@ -3226,6 +3498,13 @@ void snd_hda_update_power_acct(struct hda_codec *codec)
3226 codec->power_jiffies += delta; 3498 codec->power_jiffies += delta;
3227} 3499}
3228 3500
3501/**
3502 * snd_hda_power_up - Power-up the codec
3503 * @codec: HD-audio codec
3504 *
3505 * Increment the power-up counter and power up the hardware really when
3506 * not turned on yet.
3507 */
3229void snd_hda_power_up(struct hda_codec *codec) 3508void snd_hda_power_up(struct hda_codec *codec)
3230{ 3509{
3231 struct hda_bus *bus = codec->bus; 3510 struct hda_bus *bus = codec->bus;
@@ -3248,9 +3527,13 @@ EXPORT_SYMBOL_HDA(snd_hda_power_up);
3248#define power_save(codec) \ 3527#define power_save(codec) \
3249 ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) 3528 ((codec)->bus->power_save ? *(codec)->bus->power_save : 0)
3250 3529
3251#define power_save(codec) \ 3530/**
3252 ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) 3531 * snd_hda_power_down - Power-down the codec
3253 3532 * @codec: HD-audio codec
3533 *
3534 * Decrement the power-up counter and schedules the power-off work if
3535 * the counter rearches to zero.
3536 */
3254void snd_hda_power_down(struct hda_codec *codec) 3537void snd_hda_power_down(struct hda_codec *codec)
3255{ 3538{
3256 --codec->power_count; 3539 --codec->power_count;
@@ -3264,6 +3547,19 @@ void snd_hda_power_down(struct hda_codec *codec)
3264} 3547}
3265EXPORT_SYMBOL_HDA(snd_hda_power_down); 3548EXPORT_SYMBOL_HDA(snd_hda_power_down);
3266 3549
3550/**
3551 * snd_hda_check_amp_list_power - Check the amp list and update the power
3552 * @codec: HD-audio codec
3553 * @check: the object containing an AMP list and the status
3554 * @nid: NID to check / update
3555 *
3556 * Check whether the given NID is in the amp list. If it's in the list,
3557 * check the current AMP status, and update the the power-status according
3558 * to the mute status.
3559 *
3560 * This function is supposed to be set or called from the check_power_status
3561 * patch ops.
3562 */
3267int snd_hda_check_amp_list_power(struct hda_codec *codec, 3563int snd_hda_check_amp_list_power(struct hda_codec *codec,
3268 struct hda_loopback_check *check, 3564 struct hda_loopback_check *check,
3269 hda_nid_t nid) 3565 hda_nid_t nid)
@@ -3305,6 +3601,10 @@ EXPORT_SYMBOL_HDA(snd_hda_check_amp_list_power);
3305/* 3601/*
3306 * Channel mode helper 3602 * Channel mode helper
3307 */ 3603 */
3604
3605/**
3606 * snd_hda_ch_mode_info - Info callback helper for the channel mode enum
3607 */
3308int snd_hda_ch_mode_info(struct hda_codec *codec, 3608int snd_hda_ch_mode_info(struct hda_codec *codec,
3309 struct snd_ctl_elem_info *uinfo, 3609 struct snd_ctl_elem_info *uinfo,
3310 const struct hda_channel_mode *chmode, 3610 const struct hda_channel_mode *chmode,
@@ -3321,6 +3621,9 @@ int snd_hda_ch_mode_info(struct hda_codec *codec,
3321} 3621}
3322EXPORT_SYMBOL_HDA(snd_hda_ch_mode_info); 3622EXPORT_SYMBOL_HDA(snd_hda_ch_mode_info);
3323 3623
3624/**
3625 * snd_hda_ch_mode_get - Get callback helper for the channel mode enum
3626 */
3324int snd_hda_ch_mode_get(struct hda_codec *codec, 3627int snd_hda_ch_mode_get(struct hda_codec *codec,
3325 struct snd_ctl_elem_value *ucontrol, 3628 struct snd_ctl_elem_value *ucontrol,
3326 const struct hda_channel_mode *chmode, 3629 const struct hda_channel_mode *chmode,
@@ -3339,6 +3642,9 @@ int snd_hda_ch_mode_get(struct hda_codec *codec,
3339} 3642}
3340EXPORT_SYMBOL_HDA(snd_hda_ch_mode_get); 3643EXPORT_SYMBOL_HDA(snd_hda_ch_mode_get);
3341 3644
3645/**
3646 * snd_hda_ch_mode_put - Put callback helper for the channel mode enum
3647 */
3342int snd_hda_ch_mode_put(struct hda_codec *codec, 3648int snd_hda_ch_mode_put(struct hda_codec *codec,
3343 struct snd_ctl_elem_value *ucontrol, 3649 struct snd_ctl_elem_value *ucontrol,
3344 const struct hda_channel_mode *chmode, 3650 const struct hda_channel_mode *chmode,
@@ -3363,6 +3669,10 @@ EXPORT_SYMBOL_HDA(snd_hda_ch_mode_put);
3363/* 3669/*
3364 * input MUX helper 3670 * input MUX helper
3365 */ 3671 */
3672
3673/**
3674 * snd_hda_input_mux_info_info - Info callback helper for the input-mux enum
3675 */
3366int snd_hda_input_mux_info(const struct hda_input_mux *imux, 3676int snd_hda_input_mux_info(const struct hda_input_mux *imux,
3367 struct snd_ctl_elem_info *uinfo) 3677 struct snd_ctl_elem_info *uinfo)
3368{ 3678{
@@ -3381,6 +3691,9 @@ int snd_hda_input_mux_info(const struct hda_input_mux *imux,
3381} 3691}
3382EXPORT_SYMBOL_HDA(snd_hda_input_mux_info); 3692EXPORT_SYMBOL_HDA(snd_hda_input_mux_info);
3383 3693
3694/**
3695 * snd_hda_input_mux_info_put - Put callback helper for the input-mux enum
3696 */
3384int snd_hda_input_mux_put(struct hda_codec *codec, 3697int snd_hda_input_mux_put(struct hda_codec *codec,
3385 const struct hda_input_mux *imux, 3698 const struct hda_input_mux *imux,
3386 struct snd_ctl_elem_value *ucontrol, 3699 struct snd_ctl_elem_value *ucontrol,
@@ -3440,7 +3753,10 @@ static void cleanup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid)
3440 } 3753 }
3441} 3754}
3442 3755
3443/* call each reboot notifier */ 3756/**
3757 * snd_hda_bus_reboot_notify - call the reboot notifier of each codec
3758 * @bus: HD-audio bus
3759 */
3444void snd_hda_bus_reboot_notify(struct hda_bus *bus) 3760void snd_hda_bus_reboot_notify(struct hda_bus *bus)
3445{ 3761{
3446 struct hda_codec *codec; 3762 struct hda_codec *codec;
@@ -3458,8 +3774,8 @@ void snd_hda_bus_reboot_notify(struct hda_bus *bus)
3458} 3774}
3459EXPORT_SYMBOL_HDA(snd_hda_bus_reboot_notify); 3775EXPORT_SYMBOL_HDA(snd_hda_bus_reboot_notify);
3460 3776
3461/* 3777/**
3462 * open the digital out in the exclusive mode 3778 * snd_hda_multi_out_dig_open - open the digital out in the exclusive mode
3463 */ 3779 */
3464int snd_hda_multi_out_dig_open(struct hda_codec *codec, 3780int snd_hda_multi_out_dig_open(struct hda_codec *codec,
3465 struct hda_multi_out *mout) 3781 struct hda_multi_out *mout)
@@ -3474,6 +3790,9 @@ int snd_hda_multi_out_dig_open(struct hda_codec *codec,
3474} 3790}
3475EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_open); 3791EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_open);
3476 3792
3793/**
3794 * snd_hda_multi_out_dig_prepare - prepare the digital out stream
3795 */
3477int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, 3796int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
3478 struct hda_multi_out *mout, 3797 struct hda_multi_out *mout,
3479 unsigned int stream_tag, 3798 unsigned int stream_tag,
@@ -3487,6 +3806,9 @@ int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
3487} 3806}
3488EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_prepare); 3807EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_prepare);
3489 3808
3809/**
3810 * snd_hda_multi_out_dig_cleanup - clean-up the digital out stream
3811 */
3490int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec, 3812int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec,
3491 struct hda_multi_out *mout) 3813 struct hda_multi_out *mout)
3492{ 3814{
@@ -3497,8 +3819,8 @@ int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec,
3497} 3819}
3498EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_cleanup); 3820EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_cleanup);
3499 3821
3500/* 3822/**
3501 * release the digital out 3823 * snd_hda_multi_out_dig_close - release the digital out stream
3502 */ 3824 */
3503int snd_hda_multi_out_dig_close(struct hda_codec *codec, 3825int snd_hda_multi_out_dig_close(struct hda_codec *codec,
3504 struct hda_multi_out *mout) 3826 struct hda_multi_out *mout)
@@ -3510,8 +3832,12 @@ int snd_hda_multi_out_dig_close(struct hda_codec *codec,
3510} 3832}
3511EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_close); 3833EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_close);
3512 3834
3513/* 3835/**
3514 * set up more restrictions for analog out 3836 * snd_hda_multi_out_analog_open - open analog outputs
3837 *
3838 * Open analog outputs and set up the hw-constraints.
3839 * If the digital outputs can be opened as slave, open the digital
3840 * outputs, too.
3515 */ 3841 */
3516int snd_hda_multi_out_analog_open(struct hda_codec *codec, 3842int snd_hda_multi_out_analog_open(struct hda_codec *codec,
3517 struct hda_multi_out *mout, 3843 struct hda_multi_out *mout,
@@ -3556,9 +3882,11 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec,
3556} 3882}
3557EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_open); 3883EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_open);
3558 3884
3559/* 3885/**
3560 * set up the i/o for analog out 3886 * snd_hda_multi_out_analog_prepare - Preapre the analog outputs.
3561 * when the digital out is available, copy the front out to digital out, too. 3887 *
3888 * Set up the i/o for analog out.
3889 * When the digital out is available, copy the front out to digital out, too.
3562 */ 3890 */
3563int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, 3891int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
3564 struct hda_multi_out *mout, 3892 struct hda_multi_out *mout,
@@ -3615,8 +3943,8 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
3615} 3943}
3616EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_prepare); 3944EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_prepare);
3617 3945
3618/* 3946/**
3619 * clean up the setting for analog out 3947 * snd_hda_multi_out_analog_cleanup - clean up the setting for analog out
3620 */ 3948 */
3621int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, 3949int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec,
3622 struct hda_multi_out *mout) 3950 struct hda_multi_out *mout)
@@ -4002,8 +4330,14 @@ EXPORT_SYMBOL_HDA(snd_hda_resume);
4002 * generic arrays 4330 * generic arrays
4003 */ 4331 */
4004 4332
4005/* get a new element from the given array 4333/**
4006 * if it exceeds the pre-allocated array size, re-allocate the array 4334 * snd_array_new - get a new element from the given array
4335 * @array: the array object
4336 *
4337 * Get a new element from the given array. If it exceeds the
4338 * pre-allocated array size, re-allocate the array.
4339 *
4340 * Returns NULL if allocation failed.
4007 */ 4341 */
4008void *snd_array_new(struct snd_array *array) 4342void *snd_array_new(struct snd_array *array)
4009{ 4343{
@@ -4027,7 +4361,10 @@ void *snd_array_new(struct snd_array *array)
4027} 4361}
4028EXPORT_SYMBOL_HDA(snd_array_new); 4362EXPORT_SYMBOL_HDA(snd_array_new);
4029 4363
4030/* free the given array elements */ 4364/**
4365 * snd_array_free - free the given array elements
4366 * @array: the array object
4367 */
4031void snd_array_free(struct snd_array *array) 4368void snd_array_free(struct snd_array *array)
4032{ 4369{
4033 kfree(array->list); 4370 kfree(array->list);
@@ -4037,7 +4374,12 @@ void snd_array_free(struct snd_array *array)
4037} 4374}
4038EXPORT_SYMBOL_HDA(snd_array_free); 4375EXPORT_SYMBOL_HDA(snd_array_free);
4039 4376
4040/* 4377/**
4378 * snd_print_pcm_rates - Print the supported PCM rates to the string buffer
4379 * @pcm: PCM caps bits
4380 * @buf: the string buffer to write
4381 * @buflen: the max buffer length
4382 *
4041 * used by hda_proc.c and hda_eld.c 4383 * used by hda_proc.c and hda_eld.c
4042 */ 4384 */
4043void snd_print_pcm_rates(int pcm, char *buf, int buflen) 4385void snd_print_pcm_rates(int pcm, char *buf, int buflen)
@@ -4056,6 +4398,14 @@ void snd_print_pcm_rates(int pcm, char *buf, int buflen)
4056} 4398}
4057EXPORT_SYMBOL_HDA(snd_print_pcm_rates); 4399EXPORT_SYMBOL_HDA(snd_print_pcm_rates);
4058 4400
4401/**
4402 * snd_print_pcm_bits - Print the supported PCM fmt bits to the string buffer
4403 * @pcm: PCM caps bits
4404 * @buf: the string buffer to write
4405 * @buflen: the max buffer length
4406 *
4407 * used by hda_proc.c and hda_eld.c
4408 */
4059void snd_print_pcm_bits(int pcm, char *buf, int buflen) 4409void snd_print_pcm_bits(int pcm, char *buf, int buflen)
4060{ 4410{
4061 static unsigned int bits[] = { 8, 16, 20, 24, 32 }; 4411 static unsigned int bits[] = { 8, 16, 20, 24, 32 };