History

ALSA: emu10k1: Make uapi/emu10k1.h compilable again

Recently we updated the content in alsa-lib uapi header files by just copying from the latest Linus kernel uapi/*.h, and noticed that it broke the build of some alsa-tools programs. The reason is that we used to have a modified version in the past, so that the program can be built without referring to the unexported stuff like snd_ctl_elem_id or __user prefix. This patch attempts to restore that, i.e. dropping the stuff that can't be referred in the user-space. For adapting the changes in uapi/emu10k1.h, the emu10k1 driver code is also slightly modified. Most of changes are pointer cast.

Takashi Iwai committed 6 years ago

Commit 2e468861 parent a032ff02 files · +40 −24Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/sound/emu10k1.h+26−12
@@ -23,9 +23,6 @@ · 22 unmodified lines
23#ifndef _UAPI__SOUND_EMU10K1_H23#ifndef _UAPI__SOUND_EMU10K1_H
24#define _UAPI__SOUND_EMU10K1_H24#define _UAPI__SOUND_EMU10K1_H
25 25
26#include <linux/types.h>
27#include <sound/asound.h>
28
29/*26/*
30 * ---- FX8010 ----27 * ---- FX8010 ----
31 */28 */
@@ -282,8 +279,22 @@ struct snd_emu10k1_fx8010_info { · 250 unmodified lines
282#define EMU10K1_GPR_TRANSLATION_TREBLE 3279#define EMU10K1_GPR_TRANSLATION_TREBLE 3
283#define EMU10K1_GPR_TRANSLATION_ONOFF 4280#define EMU10K1_GPR_TRANSLATION_ONOFF 4
284 281
282enum emu10k1_ctl_elem_iface {
283 EMU10K1_CTL_ELEM_IFACE_MIXER = 2, /* virtual mixer device */
284 EMU10K1_CTL_ELEM_IFACE_PCM = 3, /* PCM device */
285};
286
287struct emu10k1_ctl_elem_id {
288 unsigned int pad; /* don't use */
289 int iface; /* interface identifier */
290 unsigned int device; /* device/client number */
291 unsigned int subdevice; /* subdevice (substream) number */
292 unsigned char name[44]; /* ASCII name of item */
293 unsigned int index; /* index of item */
294};
295
285struct snd_emu10k1_fx8010_control_gpr {296struct snd_emu10k1_fx8010_control_gpr {
286 struct snd_ctl_elem_id id; /* full control ID definition */297 struct emu10k1_ctl_elem_id id; /* full control ID definition */
287 unsigned int vcount; /* visible count */298 unsigned int vcount; /* visible count */
288 unsigned int count; /* count of GPR (1..16) */299 unsigned int count; /* count of GPR (1..16) */
289 unsigned short gpr[32]; /* GPR number(s) */300 unsigned short gpr[32]; /* GPR number(s) */
@@ -296,7 +307,7 @@ struct snd_emu10k1_fx8010_control_gpr { · 6 unmodified lines
296 307
297/* old ABI without TLV support */308/* old ABI without TLV support */
298struct snd_emu10k1_fx8010_control_old_gpr {309struct snd_emu10k1_fx8010_control_old_gpr {
299 struct snd_ctl_elem_id id;310 struct emu10k1_ctl_elem_id id;
300 unsigned int vcount;311 unsigned int vcount;
301 unsigned int count;312 unsigned int count;
302 unsigned short gpr[32];313 unsigned short gpr[32];
@@ -310,24 +321,24 @@ struct snd_emu10k1_fx8010_code { · 7 unmodified lines
310 char name[128];321 char name[128];
311 322
312 __EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */323 __EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
313 __u32 __user *gpr_map; /* initializers */324 __u32 *gpr_map; /* initializers */
314 325
315 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */326 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
316 struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */327 struct snd_emu10k1_fx8010_control_gpr *gpr_add_controls; /* GPR controls to add/replace */
317 328
318 unsigned int gpr_del_control_count; /* count of GPR controls to remove */329 unsigned int gpr_del_control_count; /* count of GPR controls to remove */
319 struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */330 struct emu10k1_ctl_elem_id *gpr_del_controls; /* IDs of GPR controls to remove */
320 331
321 unsigned int gpr_list_control_count; /* count of GPR controls to list */332 unsigned int gpr_list_control_count; /* count of GPR controls to list */
322 unsigned int gpr_list_control_total; /* total count of GPR controls */333 unsigned int gpr_list_control_total; /* total count of GPR controls */
323 struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */334 struct snd_emu10k1_fx8010_control_gpr *gpr_list_controls; /* listed GPR controls */
324 335
325 __EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */336 __EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
326 __u32 __user *tram_data_map; /* data initializers */337 __u32 *tram_data_map; /* data initializers */
327 __u32 __user *tram_addr_map; /* map initializers */338 __u32 *tram_addr_map; /* map initializers */
328 339
329 __EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */340 __EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
330 __u32 __user *code; /* one instruction - 64 bits */341 __u32 *code; /* one instruction - 64 bits */
331};342};
332 343
333struct snd_emu10k1_fx8010_tram {344struct snd_emu10k1_fx8010_tram {
@@ -371,11 +382,14 @@ struct snd_emu10k1_fx8010_pcm_rec { · 37 unmodified lines
371#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)382#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
372#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)383#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
373 384
385#ifndef __KERNEL__
374/* typedefs for compatibility to user-space */386/* typedefs for compatibility to user-space */
375typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;387typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
376typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;388typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
377typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;389typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
378typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;390typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
379typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;391typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
392typedef struct emu10k1_ctl_elem_id emu10k1_ctl_elem_id_t;
393#endif
380 394
381#endif /* _UAPI__SOUND_EMU10K1_H */395#endif /* _UAPI__SOUND_EMU10K1_H */