Skip to content

Commit

Permalink
[ALSA] Remove xxx_t typedefs: I2C drivers
Browse files Browse the repository at this point in the history
Remove xxx_t typedefs from the i2c drivers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent a42dd42 commit 97f02e0
Show file tree
Hide file tree
Showing 14 changed files with 429 additions and 370 deletions.
8 changes: 4 additions & 4 deletions include/sound/cs8403.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#endif


SND_CS8403_DECL void SND_CS8403_DECODE(snd_aes_iec958_t *diga, unsigned char bits)
SND_CS8403_DECL void SND_CS8403_DECODE(struct snd_aes_iec958 *diga, unsigned char bits)
{
if (bits & 0x01) { /* consumer */
if (!(bits & 0x02))
Expand Down Expand Up @@ -79,7 +79,7 @@ SND_CS8403_DECL void SND_CS8403_DECODE(snd_aes_iec958_t *diga, unsigned char bit
}
}

SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(snd_aes_iec958_t *diga)
SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(struct snd_aes_iec958 *diga)
{
unsigned char bits;

Expand Down Expand Up @@ -166,7 +166,7 @@ SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(snd_aes_iec958_t *diga)
#endif


SND_CS8404_DECL void SND_CS8404_DECODE(snd_aes_iec958_t *diga, unsigned char bits)
SND_CS8404_DECL void SND_CS8404_DECODE(struct snd_aes_iec958 *diga, unsigned char bits)
{
if (bits & 0x10) { /* consumer */
if (!(bits & 0x20))
Expand Down Expand Up @@ -205,7 +205,7 @@ SND_CS8404_DECL void SND_CS8404_DECODE(snd_aes_iec958_t *diga, unsigned char bit
}
}

SND_CS8404_DECL unsigned char SND_CS8404_ENCODE(snd_aes_iec958_t *diga)
SND_CS8404_DECL unsigned char SND_CS8404_ENCODE(struct snd_aes_iec958 *diga)
{
unsigned char bits;

Expand Down
17 changes: 11 additions & 6 deletions include/sound/cs8427.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,16 @@
#define CS8427_VERSHIFT 0
#define CS8427_VER8427A 0x71

int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr,
unsigned int reset_timeout, snd_i2c_device_t **r_cs8427);
int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val);
int snd_cs8427_iec958_build(snd_i2c_device_t *cs8427, snd_pcm_substream_t *playback_substream, snd_pcm_substream_t *capture_substream);
int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active);
int snd_cs8427_iec958_pcm(snd_i2c_device_t *cs8427, unsigned int rate);
struct snd_pcm_substream;

int snd_cs8427_create(struct snd_i2c_bus *bus, unsigned char addr,
unsigned int reset_timeout, struct snd_i2c_device **r_cs8427);
int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg,
unsigned char val);
int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427,
struct snd_pcm_substream *playback_substream,
struct snd_pcm_substream *capture_substream);
int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active);
int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate);

#endif /* __SOUND_CS8427_H */
78 changes: 40 additions & 38 deletions include/sound/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,82 +21,84 @@
*
*/

typedef struct _snd_i2c_device snd_i2c_device_t;
typedef struct _snd_i2c_bus snd_i2c_bus_t;

#define SND_I2C_DEVICE_ADDRTEN (1<<0) /* 10-bit I2C address */

struct _snd_i2c_device {
struct snd_i2c_device {
struct list_head list;
snd_i2c_bus_t *bus; /* I2C bus */
struct snd_i2c_bus *bus; /* I2C bus */
char name[32]; /* some useful device name */
unsigned short flags; /* device flags */
unsigned short addr; /* device address (might be 10-bit) */
unsigned long private_value;
void *private_data;
void (*private_free)(snd_i2c_device_t *device);
void (*private_free)(struct snd_i2c_device *device);
};

#define snd_i2c_device(n) list_entry(n, struct snd_i2c_device, list)

struct snd_i2c_bit_ops {
void (*start)(struct snd_i2c_bus *bus); /* transfer start */
void (*stop)(struct snd_i2c_bus *bus); /* transfer stop */
void (*direction)(struct snd_i2c_bus *bus, int clock, int data); /* set line direction (0 = write, 1 = read) */
void (*setlines)(struct snd_i2c_bus *bus, int clock, int data);
int (*getclock)(struct snd_i2c_bus *bus);
int (*getdata)(struct snd_i2c_bus *bus, int ack);
};

#define snd_i2c_device(n) list_entry(n, snd_i2c_device_t, list)

typedef struct _snd_i2c_bit_ops {
void (*start)(snd_i2c_bus_t *bus); /* transfer start */
void (*stop)(snd_i2c_bus_t *bus); /* transfer stop */
void (*direction)(snd_i2c_bus_t *bus, int clock, int data); /* set line direction (0 = write, 1 = read) */
void (*setlines)(snd_i2c_bus_t *bus, int clock, int data);
int (*getclock)(snd_i2c_bus_t *bus);
int (*getdata)(snd_i2c_bus_t *bus, int ack);
} snd_i2c_bit_ops_t;

typedef struct _snd_i2c_ops {
int (*sendbytes)(snd_i2c_device_t *device, unsigned char *bytes, int count);
int (*readbytes)(snd_i2c_device_t *device, unsigned char *bytes, int count);
int (*probeaddr)(snd_i2c_bus_t *bus, unsigned short addr);
} snd_i2c_ops_t;

struct _snd_i2c_bus {
snd_card_t *card; /* card which I2C belongs to */
struct snd_i2c_ops {
int (*sendbytes)(struct snd_i2c_device *device, unsigned char *bytes, int count);
int (*readbytes)(struct snd_i2c_device *device, unsigned char *bytes, int count);
int (*probeaddr)(struct snd_i2c_bus *bus, unsigned short addr);
};

struct snd_i2c_bus {
struct snd_card *card; /* card which I2C belongs to */
char name[32]; /* some useful label */

struct semaphore lock_mutex;

snd_i2c_bus_t *master; /* master bus when SCK/SCL is shared */
struct snd_i2c_bus *master; /* master bus when SCK/SCL is shared */
struct list_head buses; /* master: slave buses sharing SCK/SCL, slave: link list */

struct list_head devices; /* attached devices to this bus */

union {
snd_i2c_bit_ops_t *bit;
struct snd_i2c_bit_ops *bit;
void *ops;
} hw_ops; /* lowlevel operations */
snd_i2c_ops_t *ops; /* midlevel operations */
struct snd_i2c_ops *ops; /* midlevel operations */

unsigned long private_value;
void *private_data;
void (*private_free)(snd_i2c_bus_t *bus);
void (*private_free)(struct snd_i2c_bus *bus);
};

#define snd_i2c_slave_bus(n) list_entry(n, snd_i2c_bus_t, buses)
#define snd_i2c_slave_bus(n) list_entry(n, struct snd_i2c_bus, buses)

int snd_i2c_bus_create(snd_card_t *card, const char *name, snd_i2c_bus_t *master, snd_i2c_bus_t **ri2c);
int snd_i2c_device_create(snd_i2c_bus_t *bus, const char *name, unsigned char addr, snd_i2c_device_t **rdevice);
int snd_i2c_device_free(snd_i2c_device_t *device);
int snd_i2c_bus_create(struct snd_card *card, const char *name,
struct snd_i2c_bus *master, struct snd_i2c_bus **ri2c);
int snd_i2c_device_create(struct snd_i2c_bus *bus, const char *name,
unsigned char addr, struct snd_i2c_device **rdevice);
int snd_i2c_device_free(struct snd_i2c_device *device);

static inline void snd_i2c_lock(snd_i2c_bus_t *bus) {
static inline void snd_i2c_lock(struct snd_i2c_bus *bus)
{
if (bus->master)
down(&bus->master->lock_mutex);
else
down(&bus->lock_mutex);
}
static inline void snd_i2c_unlock(snd_i2c_bus_t *bus) {

static inline void snd_i2c_unlock(struct snd_i2c_bus *bus)
{
if (bus->master)
up(&bus->master->lock_mutex);
else
up(&bus->lock_mutex);
}

int snd_i2c_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count);
int snd_i2c_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count);
int snd_i2c_probeaddr(snd_i2c_bus_t *bus, unsigned short addr);
int snd_i2c_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count);
int snd_i2c_readbytes(struct snd_i2c_device *device, unsigned char *bytes, int count);
int snd_i2c_probeaddr(struct snd_i2c_bus *bus, unsigned short addr);

#endif /* __SOUND_I2C_H */
12 changes: 6 additions & 6 deletions include/sound/tea575x-tuner.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@

#include <linux/videodev.h>

typedef struct snd_tea575x tea575x_t;
struct snd_tea575x;

struct snd_tea575x_ops {
void (*write)(tea575x_t *tea, unsigned int val);
unsigned int (*read)(tea575x_t *tea);
void (*write)(struct snd_tea575x *tea, unsigned int val);
unsigned int (*read)(struct snd_tea575x *tea);
};

struct snd_tea575x {
snd_card_t *card;
struct snd_card *card;
struct video_device vd; /* video device */
struct file_operations fops;
int dev_nr; /* requested device number + 1 */
Expand All @@ -45,7 +45,7 @@ struct snd_tea575x {
void *private_data;
};

void snd_tea575x_init(tea575x_t *tea);
void snd_tea575x_exit(tea575x_t *tea);
void snd_tea575x_init(struct snd_tea575x *tea);
void snd_tea575x_exit(struct snd_tea575x *tea);

#endif /* __SOUND_TEA575X_TUNER_H */
5 changes: 3 additions & 2 deletions include/sound/tea6330t.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

#include "i2c.h" /* generic i2c support */

int snd_tea6330t_detect(snd_i2c_bus_t *bus, int equalizer);
int snd_tea6330t_update_mixer(snd_card_t * card, snd_i2c_bus_t * bus, int equalizer, int fader);
int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer);
int snd_tea6330t_update_mixer(struct snd_card *card, struct snd_i2c_bus *bus,
int equalizer, int fader);

#endif /* __SOUND_TEA6330T_H */
4 changes: 2 additions & 2 deletions include/sound/uda1341.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* features support
*/

/* $Id: uda1341.h,v 1.7 2005/11/17 10:25:22 tiwai Exp $ */
/* $Id: uda1341.h,v 1.8 2005/11/17 14:17:21 tiwai Exp $ */

#define UDA1341_ALSA_NAME "snd-uda1341"

Expand Down Expand Up @@ -119,7 +119,7 @@ enum write_through {
FLUSH,
};

int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clnt);
int __init snd_chip_uda1341_mixer_new(struct snd_card *card, struct l3_client **clnt);

/*
* Local variables:
Expand Down
Loading

0 comments on commit 97f02e0

Please sign in to comment.