mirror of
https://github.com/torvalds/linux.git
synced 2025-08-15 14:11:42 +02:00
Merge branch 'for-next'
This commit is contained in:
commit
291dbad1b4
3 changed files with 11 additions and 13 deletions
|
@ -360,8 +360,8 @@ int snd_hda_override_conn_list(struct hda_codec *codec, hda_nid_t nid, int nums,
|
||||||
int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,
|
int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,
|
||||||
hda_nid_t nid, int recursive);
|
hda_nid_t nid, int recursive);
|
||||||
unsigned int snd_hda_get_num_devices(struct hda_codec *codec, hda_nid_t nid);
|
unsigned int snd_hda_get_num_devices(struct hda_codec *codec, hda_nid_t nid);
|
||||||
int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid,
|
unsigned int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid,
|
||||||
u8 *dev_list, int max_devices);
|
u8 *dev_list, unsigned int max_devices);
|
||||||
int snd_hda_get_dev_select(struct hda_codec *codec, hda_nid_t nid);
|
int snd_hda_get_dev_select(struct hda_codec *codec, hda_nid_t nid);
|
||||||
int snd_hda_set_dev_select(struct hda_codec *codec, hda_nid_t nid, int dev_id);
|
int snd_hda_set_dev_select(struct hda_codec *codec, hda_nid_t nid, int dev_id);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/minmax.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/pm.h>
|
#include <linux/pm.h>
|
||||||
|
@ -323,18 +324,16 @@ EXPORT_SYMBOL_GPL(snd_hda_get_num_devices);
|
||||||
* Copy the device list. This info is dynamic and so not cached.
|
* Copy the device list. This info is dynamic and so not cached.
|
||||||
* Currently called only from hda_proc.c, so not exported.
|
* Currently called only from hda_proc.c, so not exported.
|
||||||
*/
|
*/
|
||||||
int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid,
|
unsigned int snd_hda_get_devices(struct hda_codec *codec, hda_nid_t nid,
|
||||||
u8 *dev_list, int max_devices)
|
u8 *dev_list, unsigned int max_devices)
|
||||||
{
|
{
|
||||||
unsigned int parm;
|
unsigned int parm, i, dev_len, devices;
|
||||||
int i, dev_len, devices;
|
|
||||||
|
|
||||||
parm = snd_hda_get_num_devices(codec, nid);
|
parm = snd_hda_get_num_devices(codec, nid);
|
||||||
if (!parm) /* not multi-stream capable */
|
if (!parm) /* not multi-stream capable */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
dev_len = parm + 1;
|
dev_len = min(parm + 1, max_devices);
|
||||||
dev_len = dev_len < max_devices ? dev_len : max_devices;
|
|
||||||
|
|
||||||
devices = 0;
|
devices = 0;
|
||||||
while (devices < dev_len) {
|
while (devices < dev_len) {
|
||||||
|
|
|
@ -716,16 +716,15 @@ static void print_device_list(struct snd_info_buffer *buffer,
|
||||||
{
|
{
|
||||||
int i, curr = -1;
|
int i, curr = -1;
|
||||||
u8 dev_list[AC_MAX_DEV_LIST_LEN];
|
u8 dev_list[AC_MAX_DEV_LIST_LEN];
|
||||||
int devlist_len;
|
unsigned int devlist_len;
|
||||||
|
|
||||||
devlist_len = snd_hda_get_devices(codec, nid, dev_list,
|
devlist_len = snd_hda_get_devices(codec, nid, dev_list,
|
||||||
AC_MAX_DEV_LIST_LEN);
|
AC_MAX_DEV_LIST_LEN);
|
||||||
snd_iprintf(buffer, " Devices: %d\n", devlist_len);
|
snd_iprintf(buffer, " Devices: %u\n", devlist_len);
|
||||||
if (devlist_len <= 0)
|
if (devlist_len == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
curr = snd_hda_codec_read(codec, nid, 0,
|
curr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_DEVICE_SEL, 0);
|
||||||
AC_VERB_GET_DEVICE_SEL, 0);
|
|
||||||
|
|
||||||
for (i = 0; i < devlist_len; i++) {
|
for (i = 0; i < devlist_len; i++) {
|
||||||
if (i == curr)
|
if (i == curr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue