aboutsummaryrefslogtreecommitdiffstats
path: root/sound/sparc/dbri.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 09:11:51 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:20:08 -0500
commit475675d6931ec03cf9575b26e30800fe64898ee0 (patch)
tree1c54092e096066777f4cebc2b63a92a82003d8b6 /sound/sparc/dbri.c
parentdcc94db78362759931ff538f1579d4a1cec8bd64 (diff)
[ALSA] Remove xxx_t typedefs: SPARC DBRI
Modules: SPARC DBRI driver Remove xxx_t typedefs from the SPARC DBRI driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/sparc/dbri.c')
-rw-r--r--sound/sparc/dbri.c218
1 files changed, 109 insertions, 109 deletions
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index 59a771294709..012c636019c7 100644
--- a/sound/sparc/dbri.c
+++ b/sound/sparc/dbri.c
@@ -299,8 +299,8 @@ struct dbri_desc {
299}; 299};
300 300
301/* Per stream (playback or record) information */ 301/* Per stream (playback or record) information */
302typedef struct dbri_streaminfo { 302struct dbri_streaminfo {
303 snd_pcm_substream_t *substream; 303 struct snd_pcm_substream *substream;
304 u32 dvma_buffer; /* Device view of Alsa DMA buffer */ 304 u32 dvma_buffer; /* Device view of Alsa DMA buffer */
305 int left; /* # of bytes left in DMA buffer */ 305 int left; /* # of bytes left in DMA buffer */
306 int size; /* Size of DMA buffer */ 306 int size; /* Size of DMA buffer */
@@ -309,12 +309,12 @@ typedef struct dbri_streaminfo {
309 int left_gain; /* mixer elements */ 309 int left_gain; /* mixer elements */
310 int right_gain; 310 int right_gain;
311 int balance; 311 int balance;
312} dbri_streaminfo_t; 312};
313 313
314/* This structure holds the information for both chips (DBRI & CS4215) */ 314/* This structure holds the information for both chips (DBRI & CS4215) */
315typedef struct snd_dbri { 315struct snd_dbri {
316 snd_card_t *card; /* ALSA card */ 316 struct snd_card *card; /* ALSA card */
317 snd_pcm_t *pcm; 317 struct snd_pcm *pcm;
318 318
319 int regs_size, irq; /* Needed for unload */ 319 int regs_size, irq; /* Needed for unload */
320 struct sbus_dev *sdev; /* SBUS device info */ 320 struct sbus_dev *sdev; /* SBUS device info */
@@ -341,7 +341,7 @@ typedef struct snd_dbri {
341 struct dbri_streaminfo stream_info[DBRI_NO_STREAMS]; 341 struct dbri_streaminfo stream_info[DBRI_NO_STREAMS];
342 342
343 struct snd_dbri *next; 343 struct snd_dbri *next;
344} snd_dbri_t; 344};
345 345
346#define DBRI_MAX_VOLUME 63 /* Output volume */ 346#define DBRI_MAX_VOLUME 63 /* Output volume */
347#define DBRI_MAX_GAIN 15 /* Input gain */ 347#define DBRI_MAX_GAIN 15 /* Input gain */
@@ -593,7 +593,7 @@ typedef struct snd_dbri {
593/* Return a pointer to dbri_streaminfo */ 593/* Return a pointer to dbri_streaminfo */
594#define DBRI_STREAM(dbri, substream) &dbri->stream_info[DBRI_STREAMNO(substream)] 594#define DBRI_STREAM(dbri, substream) &dbri->stream_info[DBRI_STREAMNO(substream)]
595 595
596static snd_dbri_t *dbri_list = NULL; /* All DBRI devices */ 596static struct snd_dbri *dbri_list = NULL; /* All DBRI devices */
597 597
598/* 598/*
599 * Short data pipes transmit LSB first. The CS4215 receives MSB first. Grrr. 599 * Short data pipes transmit LSB first. The CS4215 receives MSB first. Grrr.
@@ -652,12 +652,12 @@ to the DBRI.
652 652
653*/ 653*/
654 654
655static void dbri_process_interrupt_buffer(snd_dbri_t * dbri); 655static void dbri_process_interrupt_buffer(struct snd_dbri * dbri);
656 656
657enum dbri_lock_t { NoGetLock, GetLock }; 657enum dbri_lock { NoGetLock, GetLock };
658#define MAXLOOPS 10 658#define MAXLOOPS 10
659 659
660static volatile s32 *dbri_cmdlock(snd_dbri_t * dbri, enum dbri_lock_t get) 660static volatile s32 *dbri_cmdlock(struct snd_dbri * dbri, enum dbri_lock get)
661{ 661{
662 int maxloops = MAXLOOPS; 662 int maxloops = MAXLOOPS;
663 663
@@ -687,7 +687,7 @@ static volatile s32 *dbri_cmdlock(snd_dbri_t * dbri, enum dbri_lock_t get)
687 return &dbri->dma->cmd[0]; 687 return &dbri->dma->cmd[0];
688} 688}
689 689
690static void dbri_cmdsend(snd_dbri_t * dbri, volatile s32 * cmd) 690static void dbri_cmdsend(struct snd_dbri * dbri, volatile s32 * cmd)
691{ 691{
692 volatile s32 *ptr; 692 volatile s32 *ptr;
693 u32 reg; 693 u32 reg;
@@ -717,7 +717,7 @@ static void dbri_cmdsend(snd_dbri_t * dbri, volatile s32 * cmd)
717} 717}
718 718
719/* Lock must be held when calling this */ 719/* Lock must be held when calling this */
720static void dbri_reset(snd_dbri_t * dbri) 720static void dbri_reset(struct snd_dbri * dbri)
721{ 721{
722 int i; 722 int i;
723 723
@@ -732,7 +732,7 @@ static void dbri_reset(snd_dbri_t * dbri)
732} 732}
733 733
734/* Lock must not be held before calling this */ 734/* Lock must not be held before calling this */
735static void dbri_initialize(snd_dbri_t * dbri) 735static void dbri_initialize(struct snd_dbri * dbri)
736{ 736{
737 volatile s32 *cmd; 737 volatile s32 *cmd;
738 u32 dma_addr, tmp; 738 u32 dma_addr, tmp;
@@ -795,7 +795,7 @@ list ordering, among other things. The transmit and receive functions
795here interface closely with the transmit and receive interrupt code. 795here interface closely with the transmit and receive interrupt code.
796 796
797*/ 797*/
798static int pipe_active(snd_dbri_t * dbri, int pipe) 798static int pipe_active(struct snd_dbri * dbri, int pipe)
799{ 799{
800 return ((pipe >= 0) && (dbri->pipes[pipe].desc != -1)); 800 return ((pipe >= 0) && (dbri->pipes[pipe].desc != -1));
801} 801}
@@ -805,7 +805,7 @@ static int pipe_active(snd_dbri_t * dbri, int pipe)
805 * Called on an in-use pipe to clear anything being transmitted or received 805 * Called on an in-use pipe to clear anything being transmitted or received
806 * Lock must be held before calling this. 806 * Lock must be held before calling this.
807 */ 807 */
808static void reset_pipe(snd_dbri_t * dbri, int pipe) 808static void reset_pipe(struct snd_dbri * dbri, int pipe)
809{ 809{
810 int sdp; 810 int sdp;
811 int desc; 811 int desc;
@@ -838,7 +838,7 @@ static void reset_pipe(snd_dbri_t * dbri, int pipe)
838} 838}
839 839
840/* FIXME: direction as an argument? */ 840/* FIXME: direction as an argument? */
841static void setup_pipe(snd_dbri_t * dbri, int pipe, int sdp) 841static void setup_pipe(struct snd_dbri * dbri, int pipe, int sdp)
842{ 842{
843 if (pipe < 0 || pipe > 31) { 843 if (pipe < 0 || pipe > 31) {
844 printk(KERN_ERR "DBRI: setup_pipe called with illegal pipe number\n"); 844 printk(KERN_ERR "DBRI: setup_pipe called with illegal pipe number\n");
@@ -869,7 +869,7 @@ static void setup_pipe(snd_dbri_t * dbri, int pipe, int sdp)
869} 869}
870 870
871/* FIXME: direction not needed */ 871/* FIXME: direction not needed */
872static void link_time_slot(snd_dbri_t * dbri, int pipe, 872static void link_time_slot(struct snd_dbri * dbri, int pipe,
873 enum in_or_out direction, int basepipe, 873 enum in_or_out direction, int basepipe,
874 int length, int cycle) 874 int length, int cycle)
875{ 875{
@@ -959,7 +959,7 @@ static void link_time_slot(snd_dbri_t * dbri, int pipe,
959 dbri_cmdsend(dbri, cmd); 959 dbri_cmdsend(dbri, cmd);
960} 960}
961 961
962static void unlink_time_slot(snd_dbri_t * dbri, int pipe, 962static void unlink_time_slot(struct snd_dbri * dbri, int pipe,
963 enum in_or_out direction, int prevpipe, 963 enum in_or_out direction, int prevpipe,
964 int nextpipe) 964 int nextpipe)
965{ 965{
@@ -1003,7 +1003,7 @@ static void unlink_time_slot(snd_dbri_t * dbri, int pipe,
1003 * in the low-order 8 bits, filled either MSB-first or LSB-first, 1003 * in the low-order 8 bits, filled either MSB-first or LSB-first,
1004 * depending on the settings passed to setup_pipe() 1004 * depending on the settings passed to setup_pipe()
1005 */ 1005 */
1006static void xmit_fixed(snd_dbri_t * dbri, int pipe, unsigned int data) 1006static void xmit_fixed(struct snd_dbri * dbri, int pipe, unsigned int data)
1007{ 1007{
1008 volatile s32 *cmd; 1008 volatile s32 *cmd;
1009 1009
@@ -1040,7 +1040,7 @@ static void xmit_fixed(snd_dbri_t * dbri, int pipe, unsigned int data)
1040 dbri_cmdsend(dbri, cmd); 1040 dbri_cmdsend(dbri, cmd);
1041} 1041}
1042 1042
1043static void recv_fixed(snd_dbri_t * dbri, int pipe, volatile __u32 * ptr) 1043static void recv_fixed(struct snd_dbri * dbri, int pipe, volatile __u32 * ptr)
1044{ 1044{
1045 if (pipe < 16 || pipe > 31) { 1045 if (pipe < 16 || pipe > 31) {
1046 printk(KERN_ERR "DBRI: recv_fixed called with illegal pipe number\n"); 1046 printk(KERN_ERR "DBRI: recv_fixed called with illegal pipe number\n");
@@ -1072,9 +1072,9 @@ static void recv_fixed(snd_dbri_t * dbri, int pipe, volatile __u32 * ptr)
1072 * data buffers. Buffers too large for a single descriptor will 1072 * data buffers. Buffers too large for a single descriptor will
1073 * be spread across multiple descriptors. 1073 * be spread across multiple descriptors.
1074 */ 1074 */
1075static int setup_descs(snd_dbri_t * dbri, int streamno, unsigned int period) 1075static int setup_descs(struct snd_dbri * dbri, int streamno, unsigned int period)
1076{ 1076{
1077 dbri_streaminfo_t *info = &dbri->stream_info[streamno]; 1077 struct dbri_streaminfo *info = &dbri->stream_info[streamno];
1078 __u32 dvma_buffer; 1078 __u32 dvma_buffer;
1079 int desc = 0; 1079 int desc = 0;
1080 int len; 1080 int len;
@@ -1207,7 +1207,7 @@ multiplexed serial interface which the DBRI can operate in either master
1207 1207
1208enum master_or_slave { CHImaster, CHIslave }; 1208enum master_or_slave { CHImaster, CHIslave };
1209 1209
1210static void reset_chi(snd_dbri_t * dbri, enum master_or_slave master_or_slave, 1210static void reset_chi(struct snd_dbri * dbri, enum master_or_slave master_or_slave,
1211 int bits_per_frame) 1211 int bits_per_frame)
1212{ 1212{
1213 volatile s32 *cmd; 1213 volatile s32 *cmd;
@@ -1308,7 +1308,7 @@ In the standard SPARC audio configuration, the CS4215 codec is attached
1308to the DBRI via the CHI interface and few of the DBRI's PIO pins. 1308to the DBRI via the CHI interface and few of the DBRI's PIO pins.
1309 1309
1310*/ 1310*/
1311static void cs4215_setup_pipes(snd_dbri_t * dbri) 1311static void cs4215_setup_pipes(struct snd_dbri * dbri)
1312{ 1312{
1313 /* 1313 /*
1314 * Data mode: 1314 * Data mode:
@@ -1369,7 +1369,7 @@ static int cs4215_init_data(struct cs4215 *mm)
1369 return 0; 1369 return 0;
1370} 1370}
1371 1371
1372static void cs4215_setdata(snd_dbri_t * dbri, int muted) 1372static void cs4215_setdata(struct snd_dbri * dbri, int muted)
1373{ 1373{
1374 if (muted) { 1374 if (muted) {
1375 dbri->mm.data[0] |= 63; 1375 dbri->mm.data[0] |= 63;
@@ -1378,7 +1378,7 @@ static void cs4215_setdata(snd_dbri_t * dbri, int muted)
1378 dbri->mm.data[3] &= ~15; 1378 dbri->mm.data[3] &= ~15;
1379 } else { 1379 } else {
1380 /* Start by setting the playback attenuation. */ 1380 /* Start by setting the playback attenuation. */
1381 dbri_streaminfo_t *info = &dbri->stream_info[DBRI_PLAY]; 1381 struct dbri_streaminfo *info = &dbri->stream_info[DBRI_PLAY];
1382 int left_gain = info->left_gain % 64; 1382 int left_gain = info->left_gain % 64;
1383 int right_gain = info->right_gain % 64; 1383 int right_gain = info->right_gain % 64;
1384 1384
@@ -1409,7 +1409,7 @@ static void cs4215_setdata(snd_dbri_t * dbri, int muted)
1409/* 1409/*
1410 * Set the CS4215 to data mode. 1410 * Set the CS4215 to data mode.
1411 */ 1411 */
1412static void cs4215_open(snd_dbri_t * dbri) 1412static void cs4215_open(struct snd_dbri * dbri)
1413{ 1413{
1414 int data_width; 1414 int data_width;
1415 u32 tmp; 1415 u32 tmp;
@@ -1471,7 +1471,7 @@ static void cs4215_open(snd_dbri_t * dbri)
1471/* 1471/*
1472 * Send the control information (i.e. audio format) 1472 * Send the control information (i.e. audio format)
1473 */ 1473 */
1474static int cs4215_setctrl(snd_dbri_t * dbri) 1474static int cs4215_setctrl(struct snd_dbri * dbri)
1475{ 1475{
1476 int i, val; 1476 int i, val;
1477 u32 tmp; 1477 u32 tmp;
@@ -1570,7 +1570,7 @@ static int cs4215_setctrl(snd_dbri_t * dbri)
1570 * As part of the process we resend the settings for the data 1570 * As part of the process we resend the settings for the data
1571 * timeslots as well. 1571 * timeslots as well.
1572 */ 1572 */
1573static int cs4215_prepare(snd_dbri_t * dbri, unsigned int rate, 1573static int cs4215_prepare(struct snd_dbri * dbri, unsigned int rate,
1574 snd_pcm_format_t format, unsigned int channels) 1574 snd_pcm_format_t format, unsigned int channels)
1575{ 1575{
1576 int freq_idx; 1576 int freq_idx;
@@ -1628,7 +1628,7 @@ static int cs4215_prepare(snd_dbri_t * dbri, unsigned int rate,
1628/* 1628/*
1629 * 1629 *
1630 */ 1630 */
1631static int cs4215_init(snd_dbri_t * dbri) 1631static int cs4215_init(struct snd_dbri * dbri)
1632{ 1632{
1633 u32 reg2 = sbus_readl(dbri->regs + REG2); 1633 u32 reg2 = sbus_readl(dbri->regs + REG2);
1634 dprintk(D_MM, "cs4215_init: reg2=0x%x\n", reg2); 1634 dprintk(D_MM, "cs4215_init: reg2=0x%x\n", reg2);
@@ -1697,8 +1697,8 @@ even if we're running cli'ed.
1697 */ 1697 */
1698static void xmit_descs(unsigned long data) 1698static void xmit_descs(unsigned long data)
1699{ 1699{
1700 snd_dbri_t *dbri = (snd_dbri_t *) data; 1700 struct snd_dbri *dbri = (struct snd_dbri *) data;
1701 dbri_streaminfo_t *info; 1701 struct dbri_streaminfo *info;
1702 volatile s32 *cmd; 1702 volatile s32 *cmd;
1703 unsigned long flags; 1703 unsigned long flags;
1704 int first_td; 1704 int first_td;
@@ -1780,9 +1780,9 @@ static DECLARE_TASKLET(xmit_descs_task, xmit_descs, 0);
1780 * done by the xmit_descs() tasklet above since that could take longer. 1780 * done by the xmit_descs() tasklet above since that could take longer.
1781 */ 1781 */
1782 1782
1783static void transmission_complete_intr(snd_dbri_t * dbri, int pipe) 1783static void transmission_complete_intr(struct snd_dbri * dbri, int pipe)
1784{ 1784{
1785 dbri_streaminfo_t *info; 1785 struct dbri_streaminfo *info;
1786 int td; 1786 int td;
1787 int status; 1787 int status;
1788 1788
@@ -1830,9 +1830,9 @@ static void transmission_complete_intr(snd_dbri_t * dbri, int pipe)
1830 snd_pcm_period_elapsed(info->substream); 1830 snd_pcm_period_elapsed(info->substream);
1831} 1831}
1832 1832
1833static void reception_complete_intr(snd_dbri_t * dbri, int pipe) 1833static void reception_complete_intr(struct snd_dbri * dbri, int pipe)
1834{ 1834{
1835 dbri_streaminfo_t *info; 1835 struct dbri_streaminfo *info;
1836 int rd = dbri->pipes[pipe].desc; 1836 int rd = dbri->pipes[pipe].desc;
1837 s32 status; 1837 s32 status;
1838 1838
@@ -1874,7 +1874,7 @@ static void reception_complete_intr(snd_dbri_t * dbri, int pipe)
1874 snd_pcm_period_elapsed(info->substream); 1874 snd_pcm_period_elapsed(info->substream);
1875} 1875}
1876 1876
1877static void dbri_process_one_interrupt(snd_dbri_t * dbri, int x) 1877static void dbri_process_one_interrupt(struct snd_dbri * dbri, int x)
1878{ 1878{
1879 int val = D_INTR_GETVAL(x); 1879 int val = D_INTR_GETVAL(x);
1880 int channel = D_INTR_GETCHAN(x); 1880 int channel = D_INTR_GETCHAN(x);
@@ -1950,7 +1950,7 @@ static void dbri_process_one_interrupt(snd_dbri_t * dbri, int x)
1950 * order is important since we might recurse back into this function 1950 * order is important since we might recurse back into this function
1951 * and need to make sure the pointer has been advanced first. 1951 * and need to make sure the pointer has been advanced first.
1952 */ 1952 */
1953static void dbri_process_interrupt_buffer(snd_dbri_t * dbri) 1953static void dbri_process_interrupt_buffer(struct snd_dbri * dbri)
1954{ 1954{
1955 s32 x; 1955 s32 x;
1956 1956
@@ -1969,7 +1969,7 @@ static void dbri_process_interrupt_buffer(snd_dbri_t * dbri)
1969static irqreturn_t snd_dbri_interrupt(int irq, void *dev_id, 1969static irqreturn_t snd_dbri_interrupt(int irq, void *dev_id,
1970 struct pt_regs *regs) 1970 struct pt_regs *regs)
1971{ 1971{
1972 snd_dbri_t *dbri = dev_id; 1972 struct snd_dbri *dbri = dev_id;
1973 static int errcnt = 0; 1973 static int errcnt = 0;
1974 int x; 1974 int x;
1975 1975
@@ -2030,7 +2030,7 @@ static irqreturn_t snd_dbri_interrupt(int irq, void *dev_id,
2030/**************************************************************************** 2030/****************************************************************************
2031 PCM Interface 2031 PCM Interface
2032****************************************************************************/ 2032****************************************************************************/
2033static snd_pcm_hardware_t snd_dbri_pcm_hw = { 2033static struct snd_pcm_hardware snd_dbri_pcm_hw = {
2034 .info = (SNDRV_PCM_INFO_MMAP | 2034 .info = (SNDRV_PCM_INFO_MMAP |
2035 SNDRV_PCM_INFO_INTERLEAVED | 2035 SNDRV_PCM_INFO_INTERLEAVED |
2036 SNDRV_PCM_INFO_BLOCK_TRANSFER | 2036 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -2051,11 +2051,11 @@ static snd_pcm_hardware_t snd_dbri_pcm_hw = {
2051 .periods_max = 1024, 2051 .periods_max = 1024,
2052}; 2052};
2053 2053
2054static int snd_dbri_open(snd_pcm_substream_t * substream) 2054static int snd_dbri_open(struct snd_pcm_substream *substream)
2055{ 2055{
2056 snd_dbri_t *dbri = snd_pcm_substream_chip(substream); 2056 struct snd_dbri *dbri = snd_pcm_substream_chip(substream);
2057 snd_pcm_runtime_t *runtime = substream->runtime; 2057 struct snd_pcm_runtime *runtime = substream->runtime;
2058 dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); 2058 struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream);
2059 unsigned long flags; 2059 unsigned long flags;
2060 2060
2061 dprintk(D_USR, "open audio output.\n"); 2061 dprintk(D_USR, "open audio output.\n");
@@ -2074,10 +2074,10 @@ static int snd_dbri_open(snd_pcm_substream_t * substream)
2074 return 0; 2074 return 0;
2075} 2075}
2076 2076
2077static int snd_dbri_close(snd_pcm_substream_t * substream) 2077static int snd_dbri_close(struct snd_pcm_substream *substream)
2078{ 2078{
2079 snd_dbri_t *dbri = snd_pcm_substream_chip(substream); 2079 struct snd_dbri *dbri = snd_pcm_substream_chip(substream);
2080 dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); 2080 struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream);
2081 2081
2082 dprintk(D_USR, "close audio output.\n"); 2082 dprintk(D_USR, "close audio output.\n");
2083 info->substream = NULL; 2083 info->substream = NULL;
@@ -2087,12 +2087,12 @@ static int snd_dbri_close(snd_pcm_substream_t * substream)
2087 return 0; 2087 return 0;
2088} 2088}
2089 2089
2090static int snd_dbri_hw_params(snd_pcm_substream_t * substream, 2090static int snd_dbri_hw_params(struct snd_pcm_substream *substream,
2091 snd_pcm_hw_params_t * hw_params) 2091 struct snd_pcm_hw_params *hw_params)
2092{ 2092{
2093 snd_pcm_runtime_t *runtime = substream->runtime; 2093 struct snd_pcm_runtime *runtime = substream->runtime;
2094 snd_dbri_t *dbri = snd_pcm_substream_chip(substream); 2094 struct snd_dbri *dbri = snd_pcm_substream_chip(substream);
2095 dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); 2095 struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream);
2096 int direction; 2096 int direction;
2097 int ret; 2097 int ret;
2098 2098
@@ -2129,10 +2129,10 @@ static int snd_dbri_hw_params(snd_pcm_substream_t * substream,
2129 return 0; 2129 return 0;
2130} 2130}
2131 2131
2132static int snd_dbri_hw_free(snd_pcm_substream_t * substream) 2132static int snd_dbri_hw_free(struct snd_pcm_substream *substream)
2133{ 2133{
2134 snd_dbri_t *dbri = snd_pcm_substream_chip(substream); 2134 struct snd_dbri *dbri = snd_pcm_substream_chip(substream);
2135 dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); 2135 struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream);
2136 int direction; 2136 int direction;
2137 dprintk(D_USR, "hw_free.\n"); 2137 dprintk(D_USR, "hw_free.\n");
2138 2138
@@ -2153,11 +2153,11 @@ static int snd_dbri_hw_free(snd_pcm_substream_t * substream)
2153 return snd_pcm_lib_free_pages(substream); 2153 return snd_pcm_lib_free_pages(substream);
2154} 2154}
2155 2155
2156static int snd_dbri_prepare(snd_pcm_substream_t * substream) 2156static int snd_dbri_prepare(struct snd_pcm_substream *substream)
2157{ 2157{
2158 snd_dbri_t *dbri = snd_pcm_substream_chip(substream); 2158 struct snd_dbri *dbri = snd_pcm_substream_chip(substream);
2159 dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); 2159 struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream);
2160 snd_pcm_runtime_t *runtime = substream->runtime; 2160 struct snd_pcm_runtime *runtime = substream->runtime;
2161 int ret; 2161 int ret;
2162 2162
2163 info->size = snd_pcm_lib_buffer_bytes(substream); 2163 info->size = snd_pcm_lib_buffer_bytes(substream);
@@ -2184,10 +2184,10 @@ static int snd_dbri_prepare(snd_pcm_substream_t * substream)
2184 return ret; 2184 return ret;
2185} 2185}
2186 2186
2187static int snd_dbri_trigger(snd_pcm_substream_t * substream, int cmd) 2187static int snd_dbri_trigger(struct snd_pcm_substream *substream, int cmd)
2188{ 2188{
2189 snd_dbri_t *dbri = snd_pcm_substream_chip(substream); 2189 struct snd_dbri *dbri = snd_pcm_substream_chip(substream);
2190 dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); 2190 struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream);
2191 int ret = 0; 2191 int ret = 0;
2192 2192
2193 switch (cmd) { 2193 switch (cmd) {
@@ -2211,10 +2211,10 @@ static int snd_dbri_trigger(snd_pcm_substream_t * substream, int cmd)
2211 return ret; 2211 return ret;
2212} 2212}
2213 2213
2214static snd_pcm_uframes_t snd_dbri_pointer(snd_pcm_substream_t * substream) 2214static snd_pcm_uframes_t snd_dbri_pointer(struct snd_pcm_substream *substream)
2215{ 2215{
2216 snd_dbri_t *dbri = snd_pcm_substream_chip(substream); 2216 struct snd_dbri *dbri = snd_pcm_substream_chip(substream);
2217 dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); 2217 struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream);
2218 snd_pcm_uframes_t ret; 2218 snd_pcm_uframes_t ret;
2219 2219
2220 ret = bytes_to_frames(substream->runtime, info->offset) 2220 ret = bytes_to_frames(substream->runtime, info->offset)
@@ -2224,7 +2224,7 @@ static snd_pcm_uframes_t snd_dbri_pointer(snd_pcm_substream_t * substream)
2224 return ret; 2224 return ret;
2225} 2225}
2226 2226
2227static snd_pcm_ops_t snd_dbri_ops = { 2227static struct snd_pcm_ops snd_dbri_ops = {
2228 .open = snd_dbri_open, 2228 .open = snd_dbri_open,
2229 .close = snd_dbri_close, 2229 .close = snd_dbri_close,
2230 .ioctl = snd_pcm_lib_ioctl, 2230 .ioctl = snd_pcm_lib_ioctl,
@@ -2235,9 +2235,9 @@ static snd_pcm_ops_t snd_dbri_ops = {
2235 .pointer = snd_dbri_pointer, 2235 .pointer = snd_dbri_pointer,
2236}; 2236};
2237 2237
2238static int __devinit snd_dbri_pcm(snd_dbri_t * dbri) 2238static int __devinit snd_dbri_pcm(struct snd_dbri * dbri)
2239{ 2239{
2240 snd_pcm_t *pcm; 2240 struct snd_pcm *pcm;
2241 int err; 2241 int err;
2242 2242
2243 if ((err = snd_pcm_new(dbri->card, 2243 if ((err = snd_pcm_new(dbri->card,
@@ -2270,8 +2270,8 @@ static int __devinit snd_dbri_pcm(snd_dbri_t * dbri)
2270 Mixer interface 2270 Mixer interface
2271*****************************************************************************/ 2271*****************************************************************************/
2272 2272
2273static int snd_cs4215_info_volume(snd_kcontrol_t * kcontrol, 2273static int snd_cs4215_info_volume(struct snd_kcontrol *kcontrol,
2274 snd_ctl_elem_info_t * uinfo) 2274 struct snd_ctl_elem_info *uinfo)
2275{ 2275{
2276 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 2276 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
2277 uinfo->count = 2; 2277 uinfo->count = 2;
@@ -2284,11 +2284,11 @@ static int snd_cs4215_info_volume(snd_kcontrol_t * kcontrol,
2284 return 0; 2284 return 0;
2285} 2285}
2286 2286
2287static int snd_cs4215_get_volume(snd_kcontrol_t * kcontrol, 2287static int snd_cs4215_get_volume(struct snd_kcontrol *kcontrol,
2288 snd_ctl_elem_value_t * ucontrol) 2288 struct snd_ctl_elem_value *ucontrol)
2289{ 2289{
2290 snd_dbri_t *dbri = snd_kcontrol_chip(kcontrol); 2290 struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol);
2291 dbri_streaminfo_t *info; 2291 struct dbri_streaminfo *info;
2292 snd_assert(dbri != NULL, return -EINVAL); 2292 snd_assert(dbri != NULL, return -EINVAL);
2293 info = &dbri->stream_info[kcontrol->private_value]; 2293 info = &dbri->stream_info[kcontrol->private_value];
2294 snd_assert(info != NULL, return -EINVAL); 2294 snd_assert(info != NULL, return -EINVAL);
@@ -2298,11 +2298,11 @@ static int snd_cs4215_get_volume(snd_kcontrol_t * kcontrol,
2298 return 0; 2298 return 0;
2299} 2299}
2300 2300
2301static int snd_cs4215_put_volume(snd_kcontrol_t * kcontrol, 2301static int snd_cs4215_put_volume(struct snd_kcontrol *kcontrol,
2302 snd_ctl_elem_value_t * ucontrol) 2302 struct snd_ctl_elem_value *ucontrol)
2303{ 2303{
2304 snd_dbri_t *dbri = snd_kcontrol_chip(kcontrol); 2304 struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol);
2305 dbri_streaminfo_t *info = &dbri->stream_info[kcontrol->private_value]; 2305 struct dbri_streaminfo *info = &dbri->stream_info[kcontrol->private_value];
2306 unsigned long flags; 2306 unsigned long flags;
2307 int changed = 0; 2307 int changed = 0;
2308 2308
@@ -2329,8 +2329,8 @@ static int snd_cs4215_put_volume(snd_kcontrol_t * kcontrol,
2329 return changed; 2329 return changed;
2330} 2330}
2331 2331
2332static int snd_cs4215_info_single(snd_kcontrol_t * kcontrol, 2332static int snd_cs4215_info_single(struct snd_kcontrol *kcontrol,
2333 snd_ctl_elem_info_t * uinfo) 2333 struct snd_ctl_elem_info *uinfo)
2334{ 2334{
2335 int mask = (kcontrol->private_value >> 16) & 0xff; 2335 int mask = (kcontrol->private_value >> 16) & 0xff;
2336 2336
@@ -2342,10 +2342,10 @@ static int snd_cs4215_info_single(snd_kcontrol_t * kcontrol,
2342 return 0; 2342 return 0;
2343} 2343}
2344 2344
2345static int snd_cs4215_get_single(snd_kcontrol_t * kcontrol, 2345static int snd_cs4215_get_single(struct snd_kcontrol *kcontrol,
2346 snd_ctl_elem_value_t * ucontrol) 2346 struct snd_ctl_elem_value *ucontrol)
2347{ 2347{
2348 snd_dbri_t *dbri = snd_kcontrol_chip(kcontrol); 2348 struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol);
2349 int elem = kcontrol->private_value & 0xff; 2349 int elem = kcontrol->private_value & 0xff;
2350 int shift = (kcontrol->private_value >> 8) & 0xff; 2350 int shift = (kcontrol->private_value >> 8) & 0xff;
2351 int mask = (kcontrol->private_value >> 16) & 0xff; 2351 int mask = (kcontrol->private_value >> 16) & 0xff;
@@ -2367,10 +2367,10 @@ static int snd_cs4215_get_single(snd_kcontrol_t * kcontrol,
2367 return 0; 2367 return 0;
2368} 2368}
2369 2369
2370static int snd_cs4215_put_single(snd_kcontrol_t * kcontrol, 2370static int snd_cs4215_put_single(struct snd_kcontrol *kcontrol,
2371 snd_ctl_elem_value_t * ucontrol) 2371 struct snd_ctl_elem_value *ucontrol)
2372{ 2372{
2373 snd_dbri_t *dbri = snd_kcontrol_chip(kcontrol); 2373 struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol);
2374 unsigned long flags; 2374 unsigned long flags;
2375 int elem = kcontrol->private_value & 0xff; 2375 int elem = kcontrol->private_value & 0xff;
2376 int shift = (kcontrol->private_value >> 8) & 0xff; 2376 int shift = (kcontrol->private_value >> 8) & 0xff;
@@ -2425,7 +2425,7 @@ static int snd_cs4215_put_single(snd_kcontrol_t * kcontrol,
2425 .get = snd_cs4215_get_single, .put = snd_cs4215_put_single, \ 2425 .get = snd_cs4215_get_single, .put = snd_cs4215_put_single, \
2426 .private_value = entry | (shift << 8) | (mask << 16) | (invert << 24) }, 2426 .private_value = entry | (shift << 8) | (mask << 16) | (invert << 24) },
2427 2427
2428static snd_kcontrol_new_t dbri_controls[] __devinitdata = { 2428static struct snd_kcontrol_new dbri_controls[] __devinitdata = {
2429 { 2429 {
2430 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2430 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2431 .name = "Playback Volume", 2431 .name = "Playback Volume",
@@ -2452,11 +2452,11 @@ static snd_kcontrol_new_t dbri_controls[] __devinitdata = {
2452 CS4215_SINGLE("Mic boost", 4, 4, 1, 1) 2452 CS4215_SINGLE("Mic boost", 4, 4, 1, 1)
2453}; 2453};
2454 2454
2455#define NUM_CS4215_CONTROLS (sizeof(dbri_controls)/sizeof(snd_kcontrol_new_t)) 2455#define NUM_CS4215_CONTROLS (sizeof(dbri_controls)/sizeof(struct snd_kcontrol_new))
2456 2456
2457static int __init snd_dbri_mixer(snd_dbri_t * dbri) 2457static int __init snd_dbri_mixer(struct snd_dbri * dbri)
2458{ 2458{
2459 snd_card_t *card; 2459 struct snd_card *card;
2460 int idx, err; 2460 int idx, err;
2461 2461
2462 snd_assert(dbri != NULL && dbri->card != NULL, return -EINVAL); 2462 snd_assert(dbri != NULL && dbri->card != NULL, return -EINVAL);
@@ -2482,9 +2482,9 @@ static int __init snd_dbri_mixer(snd_dbri_t * dbri)
2482/**************************************************************************** 2482/****************************************************************************
2483 /proc interface 2483 /proc interface
2484****************************************************************************/ 2484****************************************************************************/
2485static void dbri_regs_read(snd_info_entry_t * entry, snd_info_buffer_t * buffer) 2485static void dbri_regs_read(struct snd_info_entry * entry, struct snd_info_buffer *buffer)
2486{ 2486{
2487 snd_dbri_t *dbri = entry->private_data; 2487 struct snd_dbri *dbri = entry->private_data;
2488 2488
2489 snd_iprintf(buffer, "REG0: 0x%x\n", sbus_readl(dbri->regs + REG0)); 2489 snd_iprintf(buffer, "REG0: 0x%x\n", sbus_readl(dbri->regs + REG0));
2490 snd_iprintf(buffer, "REG2: 0x%x\n", sbus_readl(dbri->regs + REG2)); 2490 snd_iprintf(buffer, "REG2: 0x%x\n", sbus_readl(dbri->regs + REG2));
@@ -2493,10 +2493,10 @@ static void dbri_regs_read(snd_info_entry_t * entry, snd_info_buffer_t * buffer)
2493} 2493}
2494 2494
2495#ifdef DBRI_DEBUG 2495#ifdef DBRI_DEBUG
2496static void dbri_debug_read(snd_info_entry_t * entry, 2496static void dbri_debug_read(struct snd_info_entry * entry,
2497 snd_info_buffer_t * buffer) 2497 struct snd_info_buffer *buffer)
2498{ 2498{
2499 snd_dbri_t *dbri = entry->private_data; 2499 struct snd_dbri *dbri = entry->private_data;
2500 int pipe; 2500 int pipe;
2501 snd_iprintf(buffer, "debug=%d\n", dbri_debug); 2501 snd_iprintf(buffer, "debug=%d\n", dbri_debug);
2502 2502
@@ -2516,9 +2516,9 @@ static void dbri_debug_read(snd_info_entry_t * entry,
2516} 2516}
2517#endif 2517#endif
2518 2518
2519void snd_dbri_proc(snd_dbri_t * dbri) 2519void snd_dbri_proc(struct snd_dbri * dbri)
2520{ 2520{
2521 snd_info_entry_t *entry; 2521 struct snd_info_entry *entry;
2522 int err; 2522 int err;
2523 2523
2524 err = snd_card_proc_new(dbri->card, "regs", &entry); 2524 err = snd_card_proc_new(dbri->card, "regs", &entry);
@@ -2536,13 +2536,13 @@ void snd_dbri_proc(snd_dbri_t * dbri)
2536**************************** Initialization ******************************** 2536**************************** Initialization ********************************
2537**************************************************************************** 2537****************************************************************************
2538*/ 2538*/
2539static void snd_dbri_free(snd_dbri_t * dbri); 2539static void snd_dbri_free(struct snd_dbri * dbri);
2540 2540
2541static int __init snd_dbri_create(snd_card_t * card, 2541static int __init snd_dbri_create(struct snd_card *card,
2542 struct sbus_dev *sdev, 2542 struct sbus_dev *sdev,
2543 struct linux_prom_irqs *irq, int dev) 2543 struct linux_prom_irqs *irq, int dev)
2544{ 2544{
2545 snd_dbri_t *dbri = card->private_data; 2545 struct snd_dbri *dbri = card->private_data;
2546 int err; 2546 int err;
2547 2547
2548 spin_lock_init(&dbri->lock); 2548 spin_lock_init(&dbri->lock);
@@ -2593,7 +2593,7 @@ static int __init snd_dbri_create(snd_card_t * card,
2593 return 0; 2593 return 0;
2594} 2594}
2595 2595
2596static void snd_dbri_free(snd_dbri_t * dbri) 2596static void snd_dbri_free(struct snd_dbri * dbri)
2597{ 2597{
2598 dprintk(D_GEN, "snd_dbri_free\n"); 2598 dprintk(D_GEN, "snd_dbri_free\n");
2599 dbri_reset(dbri); 2599 dbri_reset(dbri);
@@ -2611,10 +2611,10 @@ static void snd_dbri_free(snd_dbri_t * dbri)
2611 2611
2612static int __init dbri_attach(int prom_node, struct sbus_dev *sdev) 2612static int __init dbri_attach(int prom_node, struct sbus_dev *sdev)
2613{ 2613{
2614 snd_dbri_t *dbri; 2614 struct snd_dbri *dbri;
2615 struct linux_prom_irqs irq; 2615 struct linux_prom_irqs irq;
2616 struct resource *rp; 2616 struct resource *rp;
2617 snd_card_t *card; 2617 struct snd_card *card;
2618 static int dev = 0; 2618 static int dev = 0;
2619 int err; 2619 int err;
2620 2620
@@ -2638,7 +2638,7 @@ static int __init dbri_attach(int prom_node, struct sbus_dev *sdev)
2638 } 2638 }
2639 2639
2640 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 2640 card = snd_card_new(index[dev], id[dev], THIS_MODULE,
2641 sizeof(snd_dbri_t)); 2641 sizeof(struct snd_dbri));
2642 if (card == NULL) 2642 if (card == NULL)
2643 return -ENOMEM; 2643 return -ENOMEM;
2644 2644
@@ -2654,7 +2654,7 @@ static int __init dbri_attach(int prom_node, struct sbus_dev *sdev)
2654 return err; 2654 return err;
2655 } 2655 }
2656 2656
2657 dbri = (snd_dbri_t *) card->private_data; 2657 dbri = card->private_data;
2658 if ((err = snd_dbri_pcm(dbri)) < 0) 2658 if ((err = snd_dbri_pcm(dbri)) < 0)
2659 goto _err; 2659 goto _err;
2660 2660
@@ -2709,11 +2709,11 @@ static int __init dbri_init(void)
2709 2709
2710static void __exit dbri_exit(void) 2710static void __exit dbri_exit(void)
2711{ 2711{
2712 snd_dbri_t *this = dbri_list; 2712 struct snd_dbri *this = dbri_list;
2713 2713
2714 while (this != NULL) { 2714 while (this != NULL) {
2715 snd_dbri_t *next = this->next; 2715 struct snd_dbri *next = this->next;
2716 snd_card_t *card = this->card; 2716 struct snd_card *card = this->card;
2717 2717
2718 snd_dbri_free(this); 2718 snd_dbri_free(this);
2719 snd_card_free(card); 2719 snd_card_free(card);