Skip to contentSkip to conversation

Adaption of 5.6 kernel ABI changes

PATCH New Takashi Iwai 1 participant 4 messages Feb 10, 2020 Sound

lore
Share & tools
lore
#0 lore raw

cover Adaption of 5.6 kernel ABI changes

Hi,

this is a patch to update ABI headers copied from 5.6 kernel, which contains a couple of deprecation and the corresponding code changes.

Takashi

===

Takashi Iwai (3):
control: Remove access to the deprecated dimen fields
topology: Drop SNDRV_CTL_ELEM_ACCESS_TIMESTAMP access
uapi: Sync with 5.6 kernel ABI

 include/sound/uapi/asequencer.h |  12 +-
 include/sound/uapi/asoc.h       |   9 +-
 include/sound/uapi/asound.h     | 319 ++++++++++++++++++++++++++--------------
 include/sound/uapi/emu10k1.h    |  12 +-
 include/sound/uapi/hdsp.h       |   4 +
 include/sound/uapi/hdspm.h      |   4 +
 include/sound/uapi/sb16_csp.h   |   6 +-
 src/control/control.c           |  24 ++-
 src/topology/ctl.c              |   1 -
 9 files changed, 255 insertions(+), 136 deletions(-)
Signature · 6 lines
2.16.4

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#1 lore raw

PATCH 1/3 control: Remove access to the deprecated dimen fields

The dimen fields of control element has been deprecated, and it's finally dropped in kernel 5.6 ABI definition. Remove the corresponding accesses in alsa-lib code.

As of this patch, it's disabled via ifdef, just to be sure. The disabled code should be removed in a later stage as a cleanup.

---
 src/control/control.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
src/control/control.c +20 -4
index 33650155cac7..27f421350fb7 100644
@@ -303,6 +303,7 @@ int snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info)
 	return ctl->ops->element_info(ctl, info);
 }
 
+#if 0 /* deprecated */
 static bool validate_element_member_dimension(snd_ctl_elem_info_t *info)
 {
 	unsigned int members;
@@ -328,6 +329,9 @@ static bool validate_element_member_dimension(snd_ctl_elem_info_t *info)
 
 	return members == info->count;
 }
+#else /* deprecated */
+#define validate_element_member_dimension(info)		true
+#endif /* deprecated */
 
 /**
  * \brief Create and add some user-defined control elements of integer type.
@@ -2510,11 +2514,12 @@ const char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj)
  * #snd_ctl_elem_info_get_dimensions is deprecated without any replacement.
  */
 #ifndef DOXYGEN
-EXPORT_SYMBOL int INTERNAL(snd_ctl_elem_info_get_dimensions)(const snd_ctl_elem_info_t *obj)
+EXPORT_SYMBOL int INTERNAL(snd_ctl_elem_info_get_dimensions)(const snd_ctl_elem_info_t *obj ATTRIBUTE_UNUSED)
 #else
 int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj)
 #endif
 {
+#if 0 /* deprecated */
 	int i;
 
 	assert(obj);
@@ -2522,6 +2527,9 @@ int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj)
 		if (obj->dimen.d[i])
 			break;
 	return i + 1;
+#else
+	return -EINVAL;
+#endif
 }
 use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, snd_ctl_elem_info_get_dimensions, ALSA_0.9.3);
 
@@ -2535,15 +2543,19 @@ use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, snd_ctl_elem_info
  * #snd_ctl_elem_info_get_dimension is deprecated without any replacement.
  */
 #ifndef DOXYGEN
-EXPORT_SYMBOL int INTERNAL(snd_ctl_elem_info_get_dimension)(const snd_ctl_elem_info_t *obj, unsigned int idx)
+EXPORT_SYMBOL int INTERNAL(snd_ctl_elem_info_get_dimension)(const snd_ctl_elem_info_t *obj ATTRIBUTE_UNUSED, unsigned int idx ATTRIBUTE_UNUSED)
 #else
 int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int idx)
 #endif
 {
+#if 0 /* deprecated */
 	assert(obj);
 	if (idx > 3)
 		return 0;
 	return obj->dimen.d[idx];
+#else /* deprecated */
+	return -EINVAL;
+#endif /* deprecated */
 }
 use_default_symbol_version(__snd_ctl_elem_info_get_dimension, snd_ctl_elem_info_get_dimension, ALSA_0.9.3);
 
@@ -2565,9 +2577,10 @@ use_default_symbol_version(__snd_ctl_elem_info_get_dimension, snd_ctl_elem_info_
  * \deprecated Since 1.1.5
  * #snd_ctl_elem_info_set_dimension is deprecated without any replacement.
  */
-int snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info,
-				    const int dimension[4])
+int snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info ATTRIBUTE_UNUSED,
+				    const int dimension[4] ATTRIBUTE_UNUSED)
 {
+#if 0 /* deprecated */
 	unsigned int i;
 
 	if (info == NULL)
@@ -2581,6 +2594,9 @@ int snd_ctl_elem_info_set_dimension(snd_ctl_elem_info_t *info,
 	}
 
 	return 0;
+#else /* deprecated */
+	return -EINVAL;
+#endif /* deprecated */
 }
 
 /**
Signature · 6 lines
2.16.4

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#2 lore raw

PATCH 2/3 topology: Drop SNDRV_CTL_ELEM_ACCESS_TIMESTAMP access

In reply to Takashi Iwai

SNDRV_CTL_ELEM_ACCESS_TIMESTAMP is removed from 5.6 kernel ABI as the ctl timestamp field has been never used and deprecated. Drop the corresponding access from the topology code, too.

---
 src/topology/ctl.c | 1 -
 1 file changed, 1 deletion(-)
src/topology/ctl.c +0 -1
index b78f1c54be05..90241b6318c5 100644
@@ -35,7 +35,6 @@ static const struct ctl_access_elem ctl_access[] = {
 	{"read", SNDRV_CTL_ELEM_ACCESS_READ},
 	{"write", SNDRV_CTL_ELEM_ACCESS_WRITE},
 	{"volatile", SNDRV_CTL_ELEM_ACCESS_VOLATILE},
-	{"timestamp", SNDRV_CTL_ELEM_ACCESS_TIMESTAMP},
 	{"tlv_read", SNDRV_CTL_ELEM_ACCESS_TLV_READ},
 	{"tlv_write", SNDRV_CTL_ELEM_ACCESS_TLV_WRITE},
 	{"tlv_command", SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND},
Signature · 6 lines
2.16.4

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#3 lore raw

PATCH 3/3 uapi: Sync with 5.6 kernel ABI

In reply to Takashi Iwai

This is a sync with 5.6-rc1 kernel headers. The copy is performed from the sanitized headers installed via make headers_install.

---
 include/sound/uapi/asequencer.h |  12 +-
 include/sound/uapi/asoc.h       |   9 +-
 include/sound/uapi/asound.h     | 319 ++++++++++++++++++++++++++--------------
 include/sound/uapi/emu10k1.h    |  12 +-
 include/sound/uapi/hdsp.h       |   4 +
 include/sound/uapi/hdspm.h      |   4 +
 include/sound/uapi/sb16_csp.h   |   6 +-
 7 files changed, 235 insertions(+), 131 deletions(-)
include/sound/uapi/asequencer.h +6 -6
index a75e14edc957..2d600320e2ae 100644
@@ -20,8 +20,8 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
  */
-#ifndef _UAPI__SOUND_ASEQUENCER_H
-#define _UAPI__SOUND_ASEQUENCER_H
+#ifndef __SOUND_ASEQUENCER_H
+#define __SOUND_ASEQUENCER_H
 
 #include <sound/asound.h>
 
@@ -339,9 +339,9 @@ struct snd_seq_running_info {
 
 	/* client types */
 typedef int __bitwise snd_seq_client_type_t;
-#define	NO_CLIENT	((__force snd_seq_client_type_t) 0)
-#define	USER_CLIENT	((__force snd_seq_client_type_t) 1)
-#define	KERNEL_CLIENT	((__force snd_seq_client_type_t) 2)
+#define	NO_CLIENT	((snd_seq_client_type_t) 0)
+#define	USER_CLIENT	((snd_seq_client_type_t) 1)
+#define	KERNEL_CLIENT	((snd_seq_client_type_t) 2)
                         
 	/* event filter flags */
 #define SNDRV_SEQ_FILTER_BROADCAST	(1<<0)	/* accept broadcast messages */
@@ -609,4 +609,4 @@ struct snd_seq_query_subs {
 #define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT	_IOWR('S', 0x51, struct snd_seq_client_info)
 #define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT	_IOWR('S', 0x52, struct snd_seq_port_info)
 
-#endif /* _UAPI__SOUND_ASEQUENCER_H */
+#endif /* __SOUND_ASEQUENCER_H */
include/sound/uapi/asoc.h +4 -5
index a74ca232f1fc..4efb4ec42500 100644
@@ -17,7 +17,6 @@
 #define __LINUX_UAPI_SND_ASOC_H
 
 #include <linux/types.h>
-#include <sound/asound.h>
 
 /*
  * Maximum number of channels topology kcontrol can represent.
@@ -587,7 +586,7 @@ struct snd_soc_tplg_manifest_v4 {
 	__le32 pcm_elems;	/* number of PCM elements */
 	__le32 dai_link_elems;	/* number of DAI link elements */
 	struct snd_soc_tplg_private priv;
-} __packed;
+} __attribute__((packed));
 
 /* Stream Capabilities v4 */
 struct snd_soc_tplg_stream_caps_v4 {
@@ -605,7 +604,7 @@ struct snd_soc_tplg_stream_caps_v4 {
 	__le32 period_size_max;	/* max period size bytes */
 	__le32 buffer_size_min;	/* min buffer size bytes */
 	__le32 buffer_size_max;	/* max buffer size bytes */
-} __packed;
+} __attribute__((packed));
 
 /* PCM v4 */
 struct snd_soc_tplg_pcm_v4 {
@@ -620,7 +619,7 @@ struct snd_soc_tplg_pcm_v4 {
 	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
 	__le32 num_streams;	/* number of streams */
 	struct snd_soc_tplg_stream_caps_v4 caps[2]; /* playback and capture for DAI */
-} __packed;
+} __attribute__((packed));
 
 /* Physical link config v4 */
 struct snd_soc_tplg_link_config_v4 {
@@ -628,6 +627,6 @@ struct snd_soc_tplg_link_config_v4 {
 	__le32 id;              /* unique ID - used to match */
 	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
 	__le32 num_streams;     /* number of streams */
-} __packed;
+} __attribute__((packed));
 
 #endif
include/sound/uapi/asound.h +207 -112

502 lines not on this page · raw message

include/sound/uapi/emu10k1.h +7 -5
index 6bcd76f64c1c..78d794c03cd4 100644
@@ -20,8 +20,12 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
  */
-#ifndef _UAPI__SOUND_EMU10K1_H
-#define _UAPI__SOUND_EMU10K1_H
+#ifndef __SOUND_EMU10K1_H
+#define __SOUND_EMU10K1_H
+
+#ifdef __linux__
+#include <linux/types.h>
+#endif
 
 /*
  * ---- FX8010 ----
@@ -256,13 +260,11 @@
 #define EMU10K1_DBG_SINGLE_STEP_ADDR	0x000001ff	/* single step address */
 
 /* tank memory address line */
-#ifndef __KERNEL__
 #define TANKMEMADDRREG_ADDR_MASK 0x000fffff	/* 20 bit tank address field			*/
 #define TANKMEMADDRREG_CLEAR	 0x00800000	/* Clear tank memory				*/
 #define TANKMEMADDRREG_ALIGN	 0x00400000	/* Align read or write relative to tank access	*/
 #define TANKMEMADDRREG_WRITE	 0x00200000	/* Write to tank memory				*/
 #define TANKMEMADDRREG_READ	 0x00100000	/* Read from tank memory			*/
-#endif
 
 struct snd_emu10k1_fx8010_info {
 	unsigned int internal_tram_size;	/* in samples */
@@ -382,4 +384,4 @@ struct snd_emu10k1_fx8010_pcm_rec {
 #define SNDRV_EMU10K1_IOCTL_SINGLE_STEP	_IOW ('H', 0x83, int)
 #define SNDRV_EMU10K1_IOCTL_DBG_READ	_IOR ('H', 0x84, int)
 
-#endif /* _UAPI__SOUND_EMU10K1_H */
+#endif /* __SOUND_EMU10K1_H */
include/sound/uapi/hdsp.h +4 -0
index 7ac2d3f2a9b3..b8df62b60f4d 100644
@@ -20,6 +20,10 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#ifdef __linux__
+#include <linux/types.h>
+#endif
+
 #define HDSP_MATRIX_MIXER_SIZE 2048
 
 enum HDSP_IO_Type {
include/sound/uapi/hdspm.h +4 -0
index 3fbfd9dc5f51..14af3d00ea3f 100644
@@ -21,6 +21,10 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#ifdef __linux__
+#include <linux/types.h>
+#endif
+
 /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
 #define HDSPM_MAX_CHANNELS      64
 
include/sound/uapi/sb16_csp.h +3 -3
index e64851481d88..55db0b44a8b7 100644
@@ -20,8 +20,8 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
  */
-#ifndef _UAPI__SOUND_SB16_CSP_H
-#define _UAPI__SOUND_SB16_CSP_H
+#ifndef __SOUND_SB16_CSP_H
+#define __SOUND_SB16_CSP_H
 
 
 /* CSP modes */
@@ -120,4 +120,4 @@ struct snd_sb_csp_info {
 #define SNDRV_SB_CSP_IOCTL_RESTART	_IO('H', 0x16)
 
 
-#endif /* _UAPI__SOUND_SB16_CSP_H */
+#endif /* __SOUND_SB16_CSP_H */
Signature · 6 lines
2.16.4

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel