#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/parport.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
#include <sound/control.h>
#define CARD_NAME …
#define DRIVER_NAME …
#define PLATFORM_DRIVER …
static int index[SNDRV_CARDS] = …;
static char *id[SNDRV_CARDS] = …;
static bool enable[SNDRV_CARDS] = …;
static struct platform_device *platform_devices[SNDRV_CARDS];
static int device_count;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define PORTMAN_NUM_INPUT_PORTS …
#define PORTMAN_NUM_OUTPUT_PORTS …
struct portman { … };
static int portman_free(struct portman *pm)
{ … }
static int portman_create(struct snd_card *card,
struct pardevice *pardev,
struct portman **rchip)
{ … }
#define PP_STAT_BSY …
#define PP_STAT_ACK …
#define PP_STAT_POUT …
#define PP_STAT_SEL …
#define PP_STAT_ERR …
#define PP_CMD_IEN …
#define PP_CMD_SELI …
#define PP_CMD_INIT …
#define PP_CMD_FEED …
#define PP_CMD_STB …
#define INT_EN …
#define STROBE …
#define RXDATA0 …
#define RXDATA1 …
#define GEN_CTL …
#define SYNC_CTL …
#define TXDATA0 …
#define TXDATA1 …
#define TXDATA2 …
#define TXDATA3 …
#define ESTB …
#define INT_REQ …
#define BUSY …
#define RXAVAIL …
#define SYNC_STAT …
#define TXEMPTY …
#define RXDATA …
#define SYNC_DATA …
#define DATA_ECHO …
#define A0_ECHO …
#define A1_ECHO …
#define A2_ECHO …
#define PORTMAN2X4_MODE_INPUT_TRIGGERED …
static inline void portman_write_command(struct portman *pm, u8 value)
{ … }
static inline u8 portman_read_status(struct portman *pm)
{ … }
static inline void portman_write_data(struct portman *pm, u8 value)
{ … }
static void portman_write_midi(struct portman *pm,
int port, u8 mididata)
{ … }
static int portman_read_midi(struct portman *pm, int port)
{ … }
static int portman_data_avail(struct portman *pm, int channel)
{ … }
static void portman_flush_input(struct portman *pm, unsigned char port)
{ … }
static int portman_probe(struct parport *p)
{ … }
static int portman_device_init(struct portman *pm)
{ … }
static int snd_portman_midi_open(struct snd_rawmidi_substream *substream)
{ … }
static int snd_portman_midi_close(struct snd_rawmidi_substream *substream)
{ … }
static void snd_portman_midi_input_trigger(struct snd_rawmidi_substream *substream,
int up)
{ … }
static void snd_portman_midi_output_trigger(struct snd_rawmidi_substream *substream,
int up)
{ … }
static const struct snd_rawmidi_ops snd_portman_midi_output = …;
static const struct snd_rawmidi_ops snd_portman_midi_input = …;
static int snd_portman_rawmidi_create(struct snd_card *card)
{ … }
static void snd_portman_interrupt(void *userdata)
{ … }
static void snd_portman_attach(struct parport *p)
{ … }
static void snd_portman_detach(struct parport *p)
{ … }
static int snd_portman_dev_probe(struct pardevice *pardev)
{ … }
static struct parport_driver portman_parport_driver = …;
static void snd_portman_card_private_free(struct snd_card *card)
{ … }
static int snd_portman_probe(struct platform_device *pdev)
{ … }
static void snd_portman_remove(struct platform_device *pdev)
{ … }
static struct platform_driver snd_portman_driver = …;
static void snd_portman_unregister_all(void)
{ … }
static int __init snd_portman_module_init(void)
{ … }
static void __exit snd_portman_module_exit(void)
{ … }
module_init(…) …;
module_exit(snd_portman_module_exit);