linux/drivers/usb/gadget/function/u_midi.h
Victor Krawiec 1c93738177 usb: gadget: f_midi: allow customizing the USB MIDI interface string through configfs
When using f_midi from configfs the USB MIDI interface string is hardcoded
to 'MIDI function'.

This USB string descriptor is used by some third-party OS or software to
display the name of the MIDI device

Since we add an additional string option a new macro block was created to
factorize declarations

Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20251209164006.143219-1-victor.krawiec@arturia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-12-17 14:43:01 +01:00

37 lines
710 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* u_midi.h
*
* Utility definitions for the midi function
*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
*/
#ifndef U_MIDI_H
#define U_MIDI_H
#include <linux/usb/composite.h>
struct f_midi_opts {
struct usb_function_instance func_inst;
int index;
char *id;
char *interface_string;
unsigned int in_ports;
unsigned int out_ports;
unsigned int buflen;
unsigned int qlen;
/*
* Protect the data form concurrent access by read/write
* and create symlink/remove symlink.
*/
struct mutex lock;
int refcnt;
};
#endif /* U_MIDI_H */