From: Takashi Iwai Date: Tue, 8 Jan 2008 17:34:36 +0000 (+0100) Subject: Remove indirect control access X-Git-Tag: v1.0.16rc1~25 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=e1e9e3ff8274b24857da083c19c47627e1a71c3e;p=alsa-lib.git Remove indirect control access The indirect control access is removed from the kernel. This patch cleans the corresponding alsa-lib part. --- diff --git a/include/sound/asound.h b/include/sound/asound.h index 18eeb073..e8fa0dab 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h @@ -723,7 +723,7 @@ struct sndrv_timer_tread { * * ****************************************************************************/ -#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3) +#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) struct sndrv_ctl_card_info { int card; /* card number */ @@ -774,8 +774,7 @@ enum sndrv_ctl_elem_iface { #define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */ #define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* flag only for kernel */ #define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */ -#define SNDRV_CTL_ELEM_ACCESS_DINDIRECT (1<<30) /* indirect access for matrix dimensions in the info structure */ -#define SNDRV_CTL_ELEM_ACCESS_INDIRECT (1<<31) /* indirect access for element value in the value structure */ +/* bits 30 and 31 are obsoleted (for indirect access) */ /* for further details see the ACPI and PCI power management specification */ #define SNDRV_CTL_POWER_D0 0x0000 /* full On */ @@ -829,30 +828,30 @@ struct sndrv_ctl_elem_info { } value; union { unsigned short d[4]; /* dimensions */ - unsigned short *d_ptr; /* indirect */ + unsigned short *d_ptr; /* (obsolete) indirect */ } dimen; unsigned char reserved[64-4*sizeof(unsigned short)]; }; struct sndrv_ctl_elem_value { struct sndrv_ctl_elem_id id; /* W: element ID */ - unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */ + unsigned int indirect: 1; /* (obsolete) W: use indirect pointer (xxx_ptr member) */ union { union { long value[128]; - long *value_ptr; + long *value_ptr; /* obsolete */ } integer; union { long long value[64]; - long long *value_ptr; + long long *value_ptr; /* obsolete */ } integer64; union { unsigned int item[128]; - unsigned int *item_ptr; + unsigned int *item_ptr; /* obsolete */ } enumerated; union { unsigned char data[512]; - unsigned char *data_ptr; + unsigned char *data_ptr; /* obsolete */ } bytes; struct sndrv_aes_iec958 iec958; } value; /* RO */ diff --git a/src/control/control.c b/src/control/control.c index 085dc634..df249ddd 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -1876,7 +1876,7 @@ int snd_ctl_elem_info_is_tlv_commandable(const snd_ctl_elem_info_t *obj) int snd_ctl_elem_info_is_indirect(const snd_ctl_elem_info_t *obj) { assert(obj); - return !!(obj->access & SNDRV_CTL_ELEM_ACCESS_INDIRECT); + return 0; } link_warning(snd_ctl_elem_info_is_indirect, "Warning: snd_ctl_elem_info_is_indirect is deprecated, do not use it"); @@ -2023,8 +2023,6 @@ int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj) int i; assert(obj); - if (obj->access & SNDRV_CTL_ELEM_ACCESS_DINDIRECT) - return 0; /* FIXME: implement indirect access as well */ for (i = 3; i >= 0; i--) if (obj->dimen.d[i]) break; @@ -2045,8 +2043,6 @@ int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int #endif { assert(obj); - if (obj->access & SNDRV_CTL_ELEM_ACCESS_DINDIRECT) - return 0; /* FIXME: implement indirect access as well */ if (idx >= 3) return 0; return obj->dimen.d[idx];