#define pr_fmt(fmt) …
#include <linux/device.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/mutex.h>
#include <linux/hid.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
#include "hid-ids.h"
#define pk_debug(format, arg...) …
#define pk_error(format, arg...) …
struct pcmidi_snd;
struct pcmidi_sustain { … };
#define PCMIDI_SUSTAINED_MAX …
struct pcmidi_snd { … };
#define PK_QUIRK_NOGET …
#define PCMIDI_MIDDLE_C …
#define PCMIDI_CHANNEL_MIN …
#define PCMIDI_CHANNEL_MAX …
#define PCMIDI_OCTAVE_MIN …
#define PCMIDI_OCTAVE_MAX …
#define PCMIDI_SUSTAIN_MIN …
#define PCMIDI_SUSTAIN_MAX …
static const char shortname[] = …;
static const char longname[] = …;
static int index[SNDRV_CARDS] = …;
static char *id[SNDRV_CARDS] = …;
static bool enable[SNDRV_CARDS] = …;
module_param_array(…);
module_param_array(…);
module_param_array(…);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
static ssize_t show_channel(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_channel(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(channel, S_IRUGO | S_IWUSR | S_IWGRP , show_channel,
store_channel);
static struct device_attribute *sysfs_device_attr_channel = …;
static ssize_t show_sustain(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_sustain(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(sustain, S_IRUGO | S_IWUSR | S_IWGRP, show_sustain,
store_sustain);
static struct device_attribute *sysfs_device_attr_sustain = …;
static ssize_t show_octave(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_octave(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(octave, S_IRUGO | S_IWUSR | S_IWGRP, show_octave,
store_octave);
static struct device_attribute *sysfs_device_attr_octave = …;
static void pcmidi_send_note(struct pcmidi_snd *pm,
unsigned char status, unsigned char note, unsigned char velocity)
{ … }
static void pcmidi_sustained_note_release(struct timer_list *t)
{ … }
static void init_sustain_timers(struct pcmidi_snd *pm)
{ … }
static void stop_sustain_timers(struct pcmidi_snd *pm)
{ … }
static int pcmidi_get_output_report(struct pcmidi_snd *pm)
{ … }
static void pcmidi_submit_output_report(struct pcmidi_snd *pm, int state)
{ … }
static int pcmidi_handle_report1(struct pcmidi_snd *pm, u8 *data)
{ … }
static int pcmidi_handle_report3(struct pcmidi_snd *pm, u8 *data, int size)
{ … }
static int pcmidi_handle_report4(struct pcmidi_snd *pm, u8 *data)
{ … }
static int pcmidi_handle_report(
struct pcmidi_snd *pm, unsigned report_id, u8 *data, int size)
{ … }
static void pcmidi_setup_extra_keys(
struct pcmidi_snd *pm, struct input_dev *input)
{ … }
static int pcmidi_set_operational(struct pcmidi_snd *pm)
{ … }
static int pcmidi_snd_free(struct snd_device *dev)
{ … }
static int pcmidi_in_open(struct snd_rawmidi_substream *substream)
{ … }
static int pcmidi_in_close(struct snd_rawmidi_substream *substream)
{ … }
static void pcmidi_in_trigger(struct snd_rawmidi_substream *substream, int up)
{ … }
static const struct snd_rawmidi_ops pcmidi_in_ops = …;
static int pcmidi_snd_initialise(struct pcmidi_snd *pm)
{ … }
static int pcmidi_snd_terminate(struct pcmidi_snd *pm)
{ … }
static __u8 *pk_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{ … }
static int pk_input_mapping(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{ … }
static int pk_raw_event(struct hid_device *hdev, struct hid_report *report,
u8 *data, int size)
{ … }
static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ … }
static void pk_remove(struct hid_device *hdev)
{ … }
static const struct hid_device_id pk_devices[] = …;
MODULE_DEVICE_TABLE(hid, pk_devices);
static struct hid_driver pk_driver = …;
module_hid_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;