diff options
-rw-r--r-- | include/sound/cs8403.h | 8 | ||||
-rw-r--r-- | include/sound/cs8427.h | 17 | ||||
-rw-r--r-- | include/sound/i2c.h | 78 | ||||
-rw-r--r-- | include/sound/tea575x-tuner.h | 12 | ||||
-rw-r--r-- | include/sound/tea6330t.h | 5 | ||||
-rw-r--r-- | include/sound/uda1341.h | 4 | ||||
-rw-r--r-- | sound/i2c/cs8427.c | 142 | ||||
-rw-r--r-- | sound/i2c/i2c.c | 79 | ||||
-rw-r--r-- | sound/i2c/l3/uda1341.c | 69 | ||||
-rw-r--r-- | sound/i2c/other/ak4114.c | 122 | ||||
-rw-r--r-- | sound/i2c/other/ak4117.c | 122 | ||||
-rw-r--r-- | sound/i2c/other/ak4xxx-adda.c | 49 | ||||
-rw-r--r-- | sound/i2c/other/tea575x-tuner.c | 8 | ||||
-rw-r--r-- | sound/i2c/tea6330t.c | 84 |
14 files changed, 429 insertions, 370 deletions
diff --git a/include/sound/cs8403.h b/include/sound/cs8403.h index 0b7d216e24f1..c6c3f9f0da78 100644 --- a/include/sound/cs8403.h +++ b/include/sound/cs8403.h | |||
@@ -36,7 +36,7 @@ | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | 38 | ||
39 | SND_CS8403_DECL void SND_CS8403_DECODE(snd_aes_iec958_t *diga, unsigned char bits) | 39 | SND_CS8403_DECL void SND_CS8403_DECODE(struct snd_aes_iec958 *diga, unsigned char bits) |
40 | { | 40 | { |
41 | if (bits & 0x01) { /* consumer */ | 41 | if (bits & 0x01) { /* consumer */ |
42 | if (!(bits & 0x02)) | 42 | if (!(bits & 0x02)) |
@@ -79,7 +79,7 @@ SND_CS8403_DECL void SND_CS8403_DECODE(snd_aes_iec958_t *diga, unsigned char bit | |||
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(snd_aes_iec958_t *diga) | 82 | SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(struct snd_aes_iec958 *diga) |
83 | { | 83 | { |
84 | unsigned char bits; | 84 | unsigned char bits; |
85 | 85 | ||
@@ -166,7 +166,7 @@ SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(snd_aes_iec958_t *diga) | |||
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | 168 | ||
169 | SND_CS8404_DECL void SND_CS8404_DECODE(snd_aes_iec958_t *diga, unsigned char bits) | 169 | SND_CS8404_DECL void SND_CS8404_DECODE(struct snd_aes_iec958 *diga, unsigned char bits) |
170 | { | 170 | { |
171 | if (bits & 0x10) { /* consumer */ | 171 | if (bits & 0x10) { /* consumer */ |
172 | if (!(bits & 0x20)) | 172 | if (!(bits & 0x20)) |
@@ -205,7 +205,7 @@ SND_CS8404_DECL void SND_CS8404_DECODE(snd_aes_iec958_t *diga, unsigned char bit | |||
205 | } | 205 | } |
206 | } | 206 | } |
207 | 207 | ||
208 | SND_CS8404_DECL unsigned char SND_CS8404_ENCODE(snd_aes_iec958_t *diga) | 208 | SND_CS8404_DECL unsigned char SND_CS8404_ENCODE(struct snd_aes_iec958 *diga) |
209 | { | 209 | { |
210 | unsigned char bits; | 210 | unsigned char bits; |
211 | 211 | ||
diff --git a/include/sound/cs8427.h b/include/sound/cs8427.h index e725b7049a53..97fd9acf8028 100644 --- a/include/sound/cs8427.h +++ b/include/sound/cs8427.h | |||
@@ -186,11 +186,16 @@ | |||
186 | #define CS8427_VERSHIFT 0 | 186 | #define CS8427_VERSHIFT 0 |
187 | #define CS8427_VER8427A 0x71 | 187 | #define CS8427_VER8427A 0x71 |
188 | 188 | ||
189 | int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, | 189 | struct snd_pcm_substream; |
190 | unsigned int reset_timeout, snd_i2c_device_t **r_cs8427); | 190 | |
191 | int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val); | 191 | int snd_cs8427_create(struct snd_i2c_bus *bus, unsigned char addr, |
192 | int snd_cs8427_iec958_build(snd_i2c_device_t *cs8427, snd_pcm_substream_t *playback_substream, snd_pcm_substream_t *capture_substream); | 192 | unsigned int reset_timeout, struct snd_i2c_device **r_cs8427); |
193 | int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active); | 193 | int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg, |
194 | int snd_cs8427_iec958_pcm(snd_i2c_device_t *cs8427, unsigned int rate); | 194 | unsigned char val); |
195 | int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427, | ||
196 | struct snd_pcm_substream *playback_substream, | ||
197 | struct snd_pcm_substream *capture_substream); | ||
198 | int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active); | ||
199 | int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate); | ||
195 | 200 | ||
196 | #endif /* __SOUND_CS8427_H */ | 201 | #endif /* __SOUND_CS8427_H */ |
diff --git a/include/sound/i2c.h b/include/sound/i2c.h index a665ddf9c146..81eb23ed761f 100644 --- a/include/sound/i2c.h +++ b/include/sound/i2c.h | |||
@@ -21,82 +21,84 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | typedef struct _snd_i2c_device snd_i2c_device_t; | ||
25 | typedef struct _snd_i2c_bus snd_i2c_bus_t; | ||
26 | |||
27 | #define SND_I2C_DEVICE_ADDRTEN (1<<0) /* 10-bit I2C address */ | 24 | #define SND_I2C_DEVICE_ADDRTEN (1<<0) /* 10-bit I2C address */ |
28 | 25 | ||
29 | struct _snd_i2c_device { | 26 | struct snd_i2c_device { |
30 | struct list_head list; | 27 | struct list_head list; |
31 | snd_i2c_bus_t *bus; /* I2C bus */ | 28 | struct snd_i2c_bus *bus; /* I2C bus */ |
32 | char name[32]; /* some useful device name */ | 29 | char name[32]; /* some useful device name */ |
33 | unsigned short flags; /* device flags */ | 30 | unsigned short flags; /* device flags */ |
34 | unsigned short addr; /* device address (might be 10-bit) */ | 31 | unsigned short addr; /* device address (might be 10-bit) */ |
35 | unsigned long private_value; | 32 | unsigned long private_value; |
36 | void *private_data; | 33 | void *private_data; |
37 | void (*private_free)(snd_i2c_device_t *device); | 34 | void (*private_free)(struct snd_i2c_device *device); |
35 | }; | ||
36 | |||
37 | #define snd_i2c_device(n) list_entry(n, struct snd_i2c_device, list) | ||
38 | |||
39 | struct snd_i2c_bit_ops { | ||
40 | void (*start)(struct snd_i2c_bus *bus); /* transfer start */ | ||
41 | void (*stop)(struct snd_i2c_bus *bus); /* transfer stop */ | ||
42 | void (*direction)(struct snd_i2c_bus *bus, int clock, int data); /* set line direction (0 = write, 1 = read) */ | ||
43 | void (*setlines)(struct snd_i2c_bus *bus, int clock, int data); | ||
44 | int (*getclock)(struct snd_i2c_bus *bus); | ||
45 | int (*getdata)(struct snd_i2c_bus *bus, int ack); | ||
38 | }; | 46 | }; |
39 | 47 | ||
40 | #define snd_i2c_device(n) list_entry(n, snd_i2c_device_t, list) | 48 | struct snd_i2c_ops { |
41 | 49 | int (*sendbytes)(struct snd_i2c_device *device, unsigned char *bytes, int count); | |
42 | typedef struct _snd_i2c_bit_ops { | 50 | int (*readbytes)(struct snd_i2c_device *device, unsigned char *bytes, int count); |
43 | void (*start)(snd_i2c_bus_t *bus); /* transfer start */ | 51 | int (*probeaddr)(struct snd_i2c_bus *bus, unsigned short addr); |
44 | void (*stop)(snd_i2c_bus_t *bus); /* transfer stop */ | 52 | }; |
45 | void (*direction)(snd_i2c_bus_t *bus, int clock, int data); /* set line direction (0 = write, 1 = read) */ | 53 | |
46 | void (*setlines)(snd_i2c_bus_t *bus, int clock, int data); | 54 | struct snd_i2c_bus { |
47 | int (*getclock)(snd_i2c_bus_t *bus); | 55 | struct snd_card *card; /* card which I2C belongs to */ |
48 | int (*getdata)(snd_i2c_bus_t *bus, int ack); | ||
49 | } snd_i2c_bit_ops_t; | ||
50 | |||
51 | typedef struct _snd_i2c_ops { | ||
52 | int (*sendbytes)(snd_i2c_device_t *device, unsigned char *bytes, int count); | ||
53 | int (*readbytes)(snd_i2c_device_t *device, unsigned char *bytes, int count); | ||
54 | int (*probeaddr)(snd_i2c_bus_t *bus, unsigned short addr); | ||
55 | } snd_i2c_ops_t; | ||
56 | |||
57 | struct _snd_i2c_bus { | ||
58 | snd_card_t *card; /* card which I2C belongs to */ | ||
59 | char name[32]; /* some useful label */ | 56 | char name[32]; /* some useful label */ |
60 | 57 | ||
61 | struct semaphore lock_mutex; | 58 | struct semaphore lock_mutex; |
62 | 59 | ||
63 | snd_i2c_bus_t *master; /* master bus when SCK/SCL is shared */ | 60 | struct snd_i2c_bus *master; /* master bus when SCK/SCL is shared */ |
64 | struct list_head buses; /* master: slave buses sharing SCK/SCL, slave: link list */ | 61 | struct list_head buses; /* master: slave buses sharing SCK/SCL, slave: link list */ |
65 | 62 | ||
66 | struct list_head devices; /* attached devices to this bus */ | 63 | struct list_head devices; /* attached devices to this bus */ |
67 | 64 | ||
68 | union { | 65 | union { |
69 | snd_i2c_bit_ops_t *bit; | 66 | struct snd_i2c_bit_ops *bit; |
70 | void *ops; | 67 | void *ops; |
71 | } hw_ops; /* lowlevel operations */ | 68 | } hw_ops; /* lowlevel operations */ |
72 | snd_i2c_ops_t *ops; /* midlevel operations */ | 69 | struct snd_i2c_ops *ops; /* midlevel operations */ |
73 | 70 | ||
74 | unsigned long private_value; | 71 | unsigned long private_value; |
75 | void *private_data; | 72 | void *private_data; |
76 | void (*private_free)(snd_i2c_bus_t *bus); | 73 | void (*private_free)(struct snd_i2c_bus *bus); |
77 | }; | 74 | }; |
78 | 75 | ||
79 | #define snd_i2c_slave_bus(n) list_entry(n, snd_i2c_bus_t, buses) | 76 | #define snd_i2c_slave_bus(n) list_entry(n, struct snd_i2c_bus, buses) |
80 | 77 | ||
81 | int snd_i2c_bus_create(snd_card_t *card, const char *name, snd_i2c_bus_t *master, snd_i2c_bus_t **ri2c); | 78 | int snd_i2c_bus_create(struct snd_card *card, const char *name, |
82 | int snd_i2c_device_create(snd_i2c_bus_t *bus, const char *name, unsigned char addr, snd_i2c_device_t **rdevice); | 79 | struct snd_i2c_bus *master, struct snd_i2c_bus **ri2c); |
83 | int snd_i2c_device_free(snd_i2c_device_t *device); | 80 | int snd_i2c_device_create(struct snd_i2c_bus *bus, const char *name, |
81 | unsigned char addr, struct snd_i2c_device **rdevice); | ||
82 | int snd_i2c_device_free(struct snd_i2c_device *device); | ||
84 | 83 | ||
85 | static inline void snd_i2c_lock(snd_i2c_bus_t *bus) { | 84 | static inline void snd_i2c_lock(struct snd_i2c_bus *bus) |
85 | { | ||
86 | if (bus->master) | 86 | if (bus->master) |
87 | down(&bus->master->lock_mutex); | 87 | down(&bus->master->lock_mutex); |
88 | else | 88 | else |
89 | down(&bus->lock_mutex); | 89 | down(&bus->lock_mutex); |
90 | } | 90 | } |
91 | static inline void snd_i2c_unlock(snd_i2c_bus_t *bus) { | 91 | |
92 | static inline void snd_i2c_unlock(struct snd_i2c_bus *bus) | ||
93 | { | ||
92 | if (bus->master) | 94 | if (bus->master) |
93 | up(&bus->master->lock_mutex); | 95 | up(&bus->master->lock_mutex); |
94 | else | 96 | else |
95 | up(&bus->lock_mutex); | 97 | up(&bus->lock_mutex); |
96 | } | 98 | } |
97 | 99 | ||
98 | int snd_i2c_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count); | 100 | int snd_i2c_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count); |
99 | int snd_i2c_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count); | 101 | int snd_i2c_readbytes(struct snd_i2c_device *device, unsigned char *bytes, int count); |
100 | int snd_i2c_probeaddr(snd_i2c_bus_t *bus, unsigned short addr); | 102 | int snd_i2c_probeaddr(struct snd_i2c_bus *bus, unsigned short addr); |
101 | 103 | ||
102 | #endif /* __SOUND_I2C_H */ | 104 | #endif /* __SOUND_I2C_H */ |
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index b82e408e758f..a4f554520197 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h | |||
@@ -24,15 +24,15 @@ | |||
24 | 24 | ||
25 | #include <linux/videodev.h> | 25 | #include <linux/videodev.h> |
26 | 26 | ||
27 | typedef struct snd_tea575x tea575x_t; | 27 | struct snd_tea575x; |
28 | 28 | ||
29 | struct snd_tea575x_ops { | 29 | struct snd_tea575x_ops { |
30 | void (*write)(tea575x_t *tea, unsigned int val); | 30 | void (*write)(struct snd_tea575x *tea, unsigned int val); |
31 | unsigned int (*read)(tea575x_t *tea); | 31 | unsigned int (*read)(struct snd_tea575x *tea); |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct snd_tea575x { | 34 | struct snd_tea575x { |
35 | snd_card_t *card; | 35 | struct snd_card *card; |
36 | struct video_device vd; /* video device */ | 36 | struct video_device vd; /* video device */ |
37 | struct file_operations fops; | 37 | struct file_operations fops; |
38 | int dev_nr; /* requested device number + 1 */ | 38 | int dev_nr; /* requested device number + 1 */ |
@@ -45,7 +45,7 @@ struct snd_tea575x { | |||
45 | void *private_data; | 45 | void *private_data; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | void snd_tea575x_init(tea575x_t *tea); | 48 | void snd_tea575x_init(struct snd_tea575x *tea); |
49 | void snd_tea575x_exit(tea575x_t *tea); | 49 | void snd_tea575x_exit(struct snd_tea575x *tea); |
50 | 50 | ||
51 | #endif /* __SOUND_TEA575X_TUNER_H */ | 51 | #endif /* __SOUND_TEA575X_TUNER_H */ |
diff --git a/include/sound/tea6330t.h b/include/sound/tea6330t.h index 1b265bf24ee1..51b282b76896 100644 --- a/include/sound/tea6330t.h +++ b/include/sound/tea6330t.h | |||
@@ -24,7 +24,8 @@ | |||
24 | 24 | ||
25 | #include "i2c.h" /* generic i2c support */ | 25 | #include "i2c.h" /* generic i2c support */ |
26 | 26 | ||
27 | int snd_tea6330t_detect(snd_i2c_bus_t *bus, int equalizer); | 27 | int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer); |
28 | int snd_tea6330t_update_mixer(snd_card_t * card, snd_i2c_bus_t * bus, int equalizer, int fader); | 28 | int snd_tea6330t_update_mixer(struct snd_card *card, struct snd_i2c_bus *bus, |
29 | int equalizer, int fader); | ||
29 | 30 | ||
30 | #endif /* __SOUND_TEA6330T_H */ | 31 | #endif /* __SOUND_TEA6330T_H */ |
diff --git a/include/sound/uda1341.h b/include/sound/uda1341.h index 54a048ac6e4f..2e564bfb37fe 100644 --- a/include/sound/uda1341.h +++ b/include/sound/uda1341.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * features support | 15 | * features support |
16 | */ | 16 | */ |
17 | 17 | ||
18 | /* $Id: uda1341.h,v 1.7 2005/11/17 10:25:22 tiwai Exp $ */ | 18 | /* $Id: uda1341.h,v 1.8 2005/11/17 14:17:21 tiwai Exp $ */ |
19 | 19 | ||
20 | #define UDA1341_ALSA_NAME "snd-uda1341" | 20 | #define UDA1341_ALSA_NAME "snd-uda1341" |
21 | 21 | ||
@@ -119,7 +119,7 @@ enum write_through { | |||
119 | FLUSH, | 119 | FLUSH, |
120 | }; | 120 | }; |
121 | 121 | ||
122 | int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clnt); | 122 | int __init snd_chip_uda1341_mixer_new(struct snd_card *card, struct l3_client **clnt); |
123 | 123 | ||
124 | /* | 124 | /* |
125 | * Local variables: | 125 | * Local variables: |
diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c index 1a05cfbdc7c6..9deba80a587c 100644 --- a/sound/i2c/cs8427.c +++ b/sound/i2c/cs8427.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <sound/cs8427.h> | 30 | #include <sound/cs8427.h> |
31 | #include <sound/asoundef.h> | 31 | #include <sound/asoundef.h> |
32 | 32 | ||
33 | static void snd_cs8427_reset(snd_i2c_device_t *cs8427); | 33 | static void snd_cs8427_reset(struct snd_i2c_device *cs8427); |
34 | 34 | ||
35 | MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); | 35 | MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); |
36 | MODULE_DESCRIPTION("IEC958 (S/PDIF) receiver & transmitter by Cirrus Logic"); | 36 | MODULE_DESCRIPTION("IEC958 (S/PDIF) receiver & transmitter by Cirrus Logic"); |
@@ -38,22 +38,22 @@ MODULE_LICENSE("GPL"); | |||
38 | 38 | ||
39 | #define CS8427_ADDR (0x20>>1) /* fixed address */ | 39 | #define CS8427_ADDR (0x20>>1) /* fixed address */ |
40 | 40 | ||
41 | typedef struct { | 41 | struct cs8427_stream { |
42 | snd_pcm_substream_t *substream; | 42 | struct snd_pcm_substream *substream; |
43 | char hw_status[24]; /* hardware status */ | 43 | char hw_status[24]; /* hardware status */ |
44 | char def_status[24]; /* default status */ | 44 | char def_status[24]; /* default status */ |
45 | char pcm_status[24]; /* PCM private status */ | 45 | char pcm_status[24]; /* PCM private status */ |
46 | char hw_udata[32]; | 46 | char hw_udata[32]; |
47 | snd_kcontrol_t *pcm_ctl; | 47 | struct snd_kcontrol *pcm_ctl; |
48 | } cs8427_stream_t; | 48 | }; |
49 | 49 | ||
50 | typedef struct { | 50 | struct cs8427 { |
51 | unsigned char regmap[0x14]; /* map of first 1 + 13 registers */ | 51 | unsigned char regmap[0x14]; /* map of first 1 + 13 registers */ |
52 | unsigned int rate; | 52 | unsigned int rate; |
53 | unsigned int reset_timeout; | 53 | unsigned int reset_timeout; |
54 | cs8427_stream_t playback; | 54 | struct cs8427_stream playback; |
55 | cs8427_stream_t capture; | 55 | struct cs8427_stream capture; |
56 | } cs8427_t; | 56 | }; |
57 | 57 | ||
58 | static unsigned char swapbits(unsigned char val) | 58 | static unsigned char swapbits(unsigned char val) |
59 | { | 59 | { |
@@ -67,7 +67,8 @@ static unsigned char swapbits(unsigned char val) | |||
67 | return res; | 67 | return res; |
68 | } | 68 | } |
69 | 69 | ||
70 | int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val) | 70 | int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg, |
71 | unsigned char val) | ||
71 | { | 72 | { |
72 | int err; | 73 | int err; |
73 | unsigned char buf[2]; | 74 | unsigned char buf[2]; |
@@ -81,7 +82,7 @@ int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned c | |||
81 | return 0; | 82 | return 0; |
82 | } | 83 | } |
83 | 84 | ||
84 | static int snd_cs8427_reg_read(snd_i2c_device_t *device, unsigned char reg) | 85 | static int snd_cs8427_reg_read(struct snd_i2c_device *device, unsigned char reg) |
85 | { | 86 | { |
86 | int err; | 87 | int err; |
87 | unsigned char buf; | 88 | unsigned char buf; |
@@ -97,28 +98,29 @@ static int snd_cs8427_reg_read(snd_i2c_device_t *device, unsigned char reg) | |||
97 | return buf; | 98 | return buf; |
98 | } | 99 | } |
99 | 100 | ||
100 | static int snd_cs8427_select_corudata(snd_i2c_device_t *device, int udata) | 101 | static int snd_cs8427_select_corudata(struct snd_i2c_device *device, int udata) |
101 | { | 102 | { |
102 | cs8427_t *chip = device->private_data; | 103 | struct cs8427 *chip = device->private_data; |
103 | int err; | 104 | int err; |
104 | 105 | ||
105 | udata = udata ? CS8427_BSEL : 0; | 106 | udata = udata ? CS8427_BSEL : 0; |
106 | if (udata != (chip->regmap[CS8427_REG_CSDATABUF] & udata)) { | 107 | if (udata != (chip->regmap[CS8427_REG_CSDATABUF] & udata)) { |
107 | chip->regmap[CS8427_REG_CSDATABUF] &= ~CS8427_BSEL; | 108 | chip->regmap[CS8427_REG_CSDATABUF] &= ~CS8427_BSEL; |
108 | chip->regmap[CS8427_REG_CSDATABUF] |= udata; | 109 | chip->regmap[CS8427_REG_CSDATABUF] |= udata; |
109 | err = snd_cs8427_reg_write(device, CS8427_REG_CSDATABUF, chip->regmap[CS8427_REG_CSDATABUF]); | 110 | err = snd_cs8427_reg_write(device, CS8427_REG_CSDATABUF, |
111 | chip->regmap[CS8427_REG_CSDATABUF]); | ||
110 | if (err < 0) | 112 | if (err < 0) |
111 | return err; | 113 | return err; |
112 | } | 114 | } |
113 | return 0; | 115 | return 0; |
114 | } | 116 | } |
115 | 117 | ||
116 | static int snd_cs8427_send_corudata(snd_i2c_device_t *device, | 118 | static int snd_cs8427_send_corudata(struct snd_i2c_device *device, |
117 | int udata, | 119 | int udata, |
118 | unsigned char *ndata, | 120 | unsigned char *ndata, |
119 | int count) | 121 | int count) |
120 | { | 122 | { |
121 | cs8427_t *chip = device->private_data; | 123 | struct cs8427 *chip = device->private_data; |
122 | char *hw_data = udata ? chip->playback.hw_udata : chip->playback.hw_status; | 124 | char *hw_data = udata ? chip->playback.hw_udata : chip->playback.hw_status; |
123 | char data[32]; | 125 | char data[32]; |
124 | int err, idx; | 126 | int err, idx; |
@@ -133,7 +135,8 @@ static int snd_cs8427_send_corudata(snd_i2c_device_t *device, | |||
133 | if (memcmp(hw_data, data, count) == 0) { | 135 | if (memcmp(hw_data, data, count) == 0) { |
134 | chip->regmap[CS8427_REG_UDATABUF] &= ~CS8427_UBMMASK; | 136 | chip->regmap[CS8427_REG_UDATABUF] &= ~CS8427_UBMMASK; |
135 | chip->regmap[CS8427_REG_UDATABUF] |= CS8427_UBMZEROS | CS8427_EFTUI; | 137 | chip->regmap[CS8427_REG_UDATABUF] |= CS8427_UBMZEROS | CS8427_EFTUI; |
136 | if ((err = snd_cs8427_reg_write(device, CS8427_REG_UDATABUF, chip->regmap[CS8427_REG_UDATABUF])) < 0) | 138 | if ((err = snd_cs8427_reg_write(device, CS8427_REG_UDATABUF, |
139 | chip->regmap[CS8427_REG_UDATABUF])) < 0) | ||
137 | return err; | 140 | return err; |
138 | return 0; | 141 | return 0; |
139 | } | 142 | } |
@@ -146,15 +149,15 @@ static int snd_cs8427_send_corudata(snd_i2c_device_t *device, | |||
146 | return 1; | 149 | return 1; |
147 | } | 150 | } |
148 | 151 | ||
149 | static void snd_cs8427_free(snd_i2c_device_t *device) | 152 | static void snd_cs8427_free(struct snd_i2c_device *device) |
150 | { | 153 | { |
151 | kfree(device->private_data); | 154 | kfree(device->private_data); |
152 | } | 155 | } |
153 | 156 | ||
154 | int snd_cs8427_create(snd_i2c_bus_t *bus, | 157 | int snd_cs8427_create(struct snd_i2c_bus *bus, |
155 | unsigned char addr, | 158 | unsigned char addr, |
156 | unsigned int reset_timeout, | 159 | unsigned int reset_timeout, |
157 | snd_i2c_device_t **r_cs8427) | 160 | struct snd_i2c_device **r_cs8427) |
158 | { | 161 | { |
159 | static unsigned char initvals1[] = { | 162 | static unsigned char initvals1[] = { |
160 | CS8427_REG_CONTROL1 | CS8427_REG_AUTOINC, | 163 | CS8427_REG_CONTROL1 | CS8427_REG_AUTOINC, |
@@ -194,11 +197,12 @@ int snd_cs8427_create(snd_i2c_bus_t *bus, | |||
194 | CS8427_UD | CS8427_EFTUI | CS8427_DETUI, | 197 | CS8427_UD | CS8427_EFTUI | CS8427_DETUI, |
195 | }; | 198 | }; |
196 | int err; | 199 | int err; |
197 | cs8427_t *chip; | 200 | struct cs8427 *chip; |
198 | snd_i2c_device_t *device; | 201 | struct snd_i2c_device *device; |
199 | unsigned char buf[24]; | 202 | unsigned char buf[24]; |
200 | 203 | ||
201 | if ((err = snd_i2c_device_create(bus, "CS8427", CS8427_ADDR | (addr & 7), &device)) < 0) | 204 | if ((err = snd_i2c_device_create(bus, "CS8427", CS8427_ADDR | (addr & 7), |
205 | &device)) < 0) | ||
202 | return err; | 206 | return err; |
203 | chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL); | 207 | chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL); |
204 | if (chip == NULL) { | 208 | if (chip == NULL) { |
@@ -208,9 +212,13 @@ int snd_cs8427_create(snd_i2c_bus_t *bus, | |||
208 | device->private_free = snd_cs8427_free; | 212 | device->private_free = snd_cs8427_free; |
209 | 213 | ||
210 | snd_i2c_lock(bus); | 214 | snd_i2c_lock(bus); |
211 | if ((err = snd_cs8427_reg_read(device, CS8427_REG_ID_AND_VER)) != CS8427_VER8427A) { | 215 | if ((err = snd_cs8427_reg_read(device, CS8427_REG_ID_AND_VER)) != |
216 | CS8427_VER8427A) { | ||
212 | snd_i2c_unlock(bus); | 217 | snd_i2c_unlock(bus); |
213 | snd_printk(KERN_ERR "unable to find CS8427 signature (expected 0x%x, read 0x%x), initialization is not completed\n", CS8427_VER8427A, err); | 218 | snd_printk(KERN_ERR "unable to find CS8427 signature " |
219 | "(expected 0x%x, read 0x%x),\n", | ||
220 | CS8427_VER8427A, err); | ||
221 | snd_printk(KERN_ERR " initialization is not completed\n"); | ||
214 | return -EFAULT; | 222 | return -EFAULT; |
215 | } | 223 | } |
216 | /* turn off run bit while making changes to configuration */ | 224 | /* turn off run bit while making changes to configuration */ |
@@ -279,9 +287,9 @@ int snd_cs8427_create(snd_i2c_bus_t *bus, | |||
279 | * put back AES3INPUT. This workaround is described in latest | 287 | * put back AES3INPUT. This workaround is described in latest |
280 | * CS8427 datasheet, otherwise TXDSERIAL will not work. | 288 | * CS8427 datasheet, otherwise TXDSERIAL will not work. |
281 | */ | 289 | */ |
282 | static void snd_cs8427_reset(snd_i2c_device_t *cs8427) | 290 | static void snd_cs8427_reset(struct snd_i2c_device *cs8427) |
283 | { | 291 | { |
284 | cs8427_t *chip; | 292 | struct cs8427 *chip; |
285 | unsigned long end_time; | 293 | unsigned long end_time; |
286 | int data; | 294 | int data; |
287 | 295 | ||
@@ -289,10 +297,12 @@ static void snd_cs8427_reset(snd_i2c_device_t *cs8427) | |||
289 | chip = cs8427->private_data; | 297 | chip = cs8427->private_data; |
290 | snd_i2c_lock(cs8427->bus); | 298 | snd_i2c_lock(cs8427->bus); |
291 | chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~(CS8427_RUN | CS8427_RXDMASK); | 299 | chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~(CS8427_RUN | CS8427_RXDMASK); |
292 | snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, chip->regmap[CS8427_REG_CLOCKSOURCE]); | 300 | snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, |
301 | chip->regmap[CS8427_REG_CLOCKSOURCE]); | ||
293 | udelay(200); | 302 | udelay(200); |
294 | chip->regmap[CS8427_REG_CLOCKSOURCE] |= CS8427_RUN | CS8427_RXDILRCK; | 303 | chip->regmap[CS8427_REG_CLOCKSOURCE] |= CS8427_RUN | CS8427_RXDILRCK; |
295 | snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, chip->regmap[CS8427_REG_CLOCKSOURCE]); | 304 | snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, |
305 | chip->regmap[CS8427_REG_CLOCKSOURCE]); | ||
296 | udelay(200); | 306 | udelay(200); |
297 | snd_i2c_unlock(cs8427->bus); | 307 | snd_i2c_unlock(cs8427->bus); |
298 | end_time = jiffies + chip->reset_timeout; | 308 | end_time = jiffies + chip->reset_timeout; |
@@ -307,12 +317,13 @@ static void snd_cs8427_reset(snd_i2c_device_t *cs8427) | |||
307 | snd_i2c_lock(cs8427->bus); | 317 | snd_i2c_lock(cs8427->bus); |
308 | chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~CS8427_RXDMASK; | 318 | chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~CS8427_RXDMASK; |
309 | chip->regmap[CS8427_REG_CLOCKSOURCE] |= CS8427_RXDAES3INPUT; | 319 | chip->regmap[CS8427_REG_CLOCKSOURCE] |= CS8427_RXDAES3INPUT; |
310 | snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, chip->regmap[CS8427_REG_CLOCKSOURCE]); | 320 | snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, |
321 | chip->regmap[CS8427_REG_CLOCKSOURCE]); | ||
311 | snd_i2c_unlock(cs8427->bus); | 322 | snd_i2c_unlock(cs8427->bus); |
312 | } | 323 | } |
313 | 324 | ||
314 | static int snd_cs8427_in_status_info(snd_kcontrol_t *kcontrol, | 325 | static int snd_cs8427_in_status_info(struct snd_kcontrol *kcontrol, |
315 | snd_ctl_elem_info_t *uinfo) | 326 | struct snd_ctl_elem_info *uinfo) |
316 | { | 327 | { |
317 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 328 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
318 | uinfo->count = 1; | 329 | uinfo->count = 1; |
@@ -321,10 +332,10 @@ static int snd_cs8427_in_status_info(snd_kcontrol_t *kcontrol, | |||
321 | return 0; | 332 | return 0; |
322 | } | 333 | } |
323 | 334 | ||
324 | static int snd_cs8427_in_status_get(snd_kcontrol_t *kcontrol, | 335 | static int snd_cs8427_in_status_get(struct snd_kcontrol *kcontrol, |
325 | snd_ctl_elem_value_t *ucontrol) | 336 | struct snd_ctl_elem_value *ucontrol) |
326 | { | 337 | { |
327 | snd_i2c_device_t *device = snd_kcontrol_chip(kcontrol); | 338 | struct snd_i2c_device *device = snd_kcontrol_chip(kcontrol); |
328 | int data; | 339 | int data; |
329 | 340 | ||
330 | snd_i2c_lock(device->bus); | 341 | snd_i2c_lock(device->bus); |
@@ -336,18 +347,18 @@ static int snd_cs8427_in_status_get(snd_kcontrol_t *kcontrol, | |||
336 | return 0; | 347 | return 0; |
337 | } | 348 | } |
338 | 349 | ||
339 | static int snd_cs8427_qsubcode_info(snd_kcontrol_t *kcontrol, | 350 | static int snd_cs8427_qsubcode_info(struct snd_kcontrol *kcontrol, |
340 | snd_ctl_elem_info_t *uinfo) | 351 | struct snd_ctl_elem_info *uinfo) |
341 | { | 352 | { |
342 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; | 353 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; |
343 | uinfo->count = 10; | 354 | uinfo->count = 10; |
344 | return 0; | 355 | return 0; |
345 | } | 356 | } |
346 | 357 | ||
347 | static int snd_cs8427_qsubcode_get(snd_kcontrol_t *kcontrol, | 358 | static int snd_cs8427_qsubcode_get(struct snd_kcontrol *kcontrol, |
348 | snd_ctl_elem_value_t *ucontrol) | 359 | struct snd_ctl_elem_value *ucontrol) |
349 | { | 360 | { |
350 | snd_i2c_device_t *device = snd_kcontrol_chip(kcontrol); | 361 | struct snd_i2c_device *device = snd_kcontrol_chip(kcontrol); |
351 | unsigned char reg = CS8427_REG_QSUBCODE; | 362 | unsigned char reg = CS8427_REG_QSUBCODE; |
352 | int err; | 363 | int err; |
353 | 364 | ||
@@ -366,18 +377,18 @@ static int snd_cs8427_qsubcode_get(snd_kcontrol_t *kcontrol, | |||
366 | return 0; | 377 | return 0; |
367 | } | 378 | } |
368 | 379 | ||
369 | static int snd_cs8427_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 380 | static int snd_cs8427_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
370 | { | 381 | { |
371 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 382 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
372 | uinfo->count = 1; | 383 | uinfo->count = 1; |
373 | return 0; | 384 | return 0; |
374 | } | 385 | } |
375 | 386 | ||
376 | static int snd_cs8427_spdif_get(snd_kcontrol_t * kcontrol, | 387 | static int snd_cs8427_spdif_get(struct snd_kcontrol *kcontrol, |
377 | snd_ctl_elem_value_t * ucontrol) | 388 | struct snd_ctl_elem_value *ucontrol) |
378 | { | 389 | { |
379 | snd_i2c_device_t *device = snd_kcontrol_chip(kcontrol); | 390 | struct snd_i2c_device *device = snd_kcontrol_chip(kcontrol); |
380 | cs8427_t *chip = device->private_data; | 391 | struct cs8427 *chip = device->private_data; |
381 | 392 | ||
382 | snd_i2c_lock(device->bus); | 393 | snd_i2c_lock(device->bus); |
383 | memcpy(ucontrol->value.iec958.status, chip->playback.def_status, 24); | 394 | memcpy(ucontrol->value.iec958.status, chip->playback.def_status, 24); |
@@ -385,13 +396,15 @@ static int snd_cs8427_spdif_get(snd_kcontrol_t * kcontrol, | |||
385 | return 0; | 396 | return 0; |
386 | } | 397 | } |
387 | 398 | ||
388 | static int snd_cs8427_spdif_put(snd_kcontrol_t * kcontrol, | 399 | static int snd_cs8427_spdif_put(struct snd_kcontrol *kcontrol, |
389 | snd_ctl_elem_value_t * ucontrol) | 400 | struct snd_ctl_elem_value *ucontrol) |
390 | { | 401 | { |
391 | snd_i2c_device_t *device = snd_kcontrol_chip(kcontrol); | 402 | struct snd_i2c_device *device = snd_kcontrol_chip(kcontrol); |
392 | cs8427_t *chip = device->private_data; | 403 | struct cs8427 *chip = device->private_data; |
393 | unsigned char *status = kcontrol->private_value ? chip->playback.pcm_status : chip->playback.def_status; | 404 | unsigned char *status = kcontrol->private_value ? |
394 | snd_pcm_runtime_t *runtime = chip->playback.substream ? chip->playback.substream->runtime : NULL; | 405 | chip->playback.pcm_status : chip->playback.def_status; |
406 | struct snd_pcm_runtime *runtime = chip->playback.substream ? | ||
407 | chip->playback.substream->runtime : NULL; | ||
395 | int err, change; | 408 | int err, change; |
396 | 409 | ||
397 | snd_i2c_lock(device->bus); | 410 | snd_i2c_lock(device->bus); |
@@ -406,21 +419,22 @@ static int snd_cs8427_spdif_put(snd_kcontrol_t * kcontrol, | |||
406 | return change; | 419 | return change; |
407 | } | 420 | } |
408 | 421 | ||
409 | static int snd_cs8427_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 422 | static int snd_cs8427_spdif_mask_info(struct snd_kcontrol *kcontrol, |
423 | struct snd_ctl_elem_info *uinfo) | ||
410 | { | 424 | { |
411 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 425 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
412 | uinfo->count = 1; | 426 | uinfo->count = 1; |
413 | return 0; | 427 | return 0; |
414 | } | 428 | } |
415 | 429 | ||
416 | static int snd_cs8427_spdif_mask_get(snd_kcontrol_t * kcontrol, | 430 | static int snd_cs8427_spdif_mask_get(struct snd_kcontrol *kcontrol, |
417 | snd_ctl_elem_value_t * ucontrol) | 431 | struct snd_ctl_elem_value *ucontrol) |
418 | { | 432 | { |
419 | memset(ucontrol->value.iec958.status, 0xff, 24); | 433 | memset(ucontrol->value.iec958.status, 0xff, 24); |
420 | return 0; | 434 | return 0; |
421 | } | 435 | } |
422 | 436 | ||
423 | static snd_kcontrol_new_t snd_cs8427_iec958_controls[] = { | 437 | static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = { |
424 | { | 438 | { |
425 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 439 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
426 | .info = snd_cs8427_in_status_info, | 440 | .info = snd_cs8427_in_status_info, |
@@ -469,12 +483,12 @@ static snd_kcontrol_new_t snd_cs8427_iec958_controls[] = { | |||
469 | .get = snd_cs8427_qsubcode_get | 483 | .get = snd_cs8427_qsubcode_get |
470 | }}; | 484 | }}; |
471 | 485 | ||
472 | int snd_cs8427_iec958_build(snd_i2c_device_t *cs8427, | 486 | int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427, |
473 | snd_pcm_substream_t *play_substream, | 487 | struct snd_pcm_substream *play_substream, |
474 | snd_pcm_substream_t *cap_substream) | 488 | struct snd_pcm_substream *cap_substream) |
475 | { | 489 | { |
476 | cs8427_t *chip = cs8427->private_data; | 490 | struct cs8427 *chip = cs8427->private_data; |
477 | snd_kcontrol_t *kctl; | 491 | struct snd_kcontrol *kctl; |
478 | unsigned int idx; | 492 | unsigned int idx; |
479 | int err; | 493 | int err; |
480 | 494 | ||
@@ -498,9 +512,9 @@ int snd_cs8427_iec958_build(snd_i2c_device_t *cs8427, | |||
498 | return 0; | 512 | return 0; |
499 | } | 513 | } |
500 | 514 | ||
501 | int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active) | 515 | int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active) |
502 | { | 516 | { |
503 | cs8427_t *chip; | 517 | struct cs8427 *chip; |
504 | 518 | ||
505 | snd_assert(cs8427, return -ENXIO); | 519 | snd_assert(cs8427, return -ENXIO); |
506 | chip = cs8427->private_data; | 520 | chip = cs8427->private_data; |
@@ -512,9 +526,9 @@ int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active) | |||
512 | return 0; | 526 | return 0; |
513 | } | 527 | } |
514 | 528 | ||
515 | int snd_cs8427_iec958_pcm(snd_i2c_device_t *cs8427, unsigned int rate) | 529 | int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate) |
516 | { | 530 | { |
517 | cs8427_t *chip; | 531 | struct cs8427 *chip; |
518 | char *status; | 532 | char *status; |
519 | int err, reset; | 533 | int err, reset; |
520 | 534 | ||
diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c index e4e505b9d88b..c4e1f2c23ced 100644 --- a/sound/i2c/i2c.c +++ b/sound/i2c/i2c.c | |||
@@ -32,20 +32,23 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); | |||
32 | MODULE_DESCRIPTION("Generic i2c interface for ALSA"); | 32 | MODULE_DESCRIPTION("Generic i2c interface for ALSA"); |
33 | MODULE_LICENSE("GPL"); | 33 | MODULE_LICENSE("GPL"); |
34 | 34 | ||
35 | static int snd_i2c_bit_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count); | 35 | static int snd_i2c_bit_sendbytes(struct snd_i2c_device *device, |
36 | static int snd_i2c_bit_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count); | 36 | unsigned char *bytes, int count); |
37 | static int snd_i2c_bit_probeaddr(snd_i2c_bus_t *bus, unsigned short addr); | 37 | static int snd_i2c_bit_readbytes(struct snd_i2c_device *device, |
38 | 38 | unsigned char *bytes, int count); | |
39 | static snd_i2c_ops_t snd_i2c_bit_ops = { | 39 | static int snd_i2c_bit_probeaddr(struct snd_i2c_bus *bus, |
40 | unsigned short addr); | ||
41 | |||
42 | static struct snd_i2c_ops snd_i2c_bit_ops = { | ||
40 | .sendbytes = snd_i2c_bit_sendbytes, | 43 | .sendbytes = snd_i2c_bit_sendbytes, |
41 | .readbytes = snd_i2c_bit_readbytes, | 44 | .readbytes = snd_i2c_bit_readbytes, |
42 | .probeaddr = snd_i2c_bit_probeaddr, | 45 | .probeaddr = snd_i2c_bit_probeaddr, |
43 | }; | 46 | }; |
44 | 47 | ||
45 | static int snd_i2c_bus_free(snd_i2c_bus_t *bus) | 48 | static int snd_i2c_bus_free(struct snd_i2c_bus *bus) |
46 | { | 49 | { |
47 | snd_i2c_bus_t *slave; | 50 | struct snd_i2c_bus *slave; |
48 | snd_i2c_device_t *device; | 51 | struct snd_i2c_device *device; |
49 | 52 | ||
50 | snd_assert(bus != NULL, return -EINVAL); | 53 | snd_assert(bus != NULL, return -EINVAL); |
51 | while (!list_empty(&bus->devices)) { | 54 | while (!list_empty(&bus->devices)) { |
@@ -66,17 +69,18 @@ static int snd_i2c_bus_free(snd_i2c_bus_t *bus) | |||
66 | return 0; | 69 | return 0; |
67 | } | 70 | } |
68 | 71 | ||
69 | static int snd_i2c_bus_dev_free(snd_device_t *device) | 72 | static int snd_i2c_bus_dev_free(struct snd_device *device) |
70 | { | 73 | { |
71 | snd_i2c_bus_t *bus = device->device_data; | 74 | struct snd_i2c_bus *bus = device->device_data; |
72 | return snd_i2c_bus_free(bus); | 75 | return snd_i2c_bus_free(bus); |
73 | } | 76 | } |
74 | 77 | ||
75 | int snd_i2c_bus_create(snd_card_t *card, const char *name, snd_i2c_bus_t *master, snd_i2c_bus_t **ri2c) | 78 | int snd_i2c_bus_create(struct snd_card *card, const char *name, |
79 | struct snd_i2c_bus *master, struct snd_i2c_bus **ri2c) | ||
76 | { | 80 | { |
77 | snd_i2c_bus_t *bus; | 81 | struct snd_i2c_bus *bus; |
78 | int err; | 82 | int err; |
79 | static snd_device_ops_t ops = { | 83 | static struct snd_device_ops ops = { |
80 | .dev_free = snd_i2c_bus_dev_free, | 84 | .dev_free = snd_i2c_bus_dev_free, |
81 | }; | 85 | }; |
82 | 86 | ||
@@ -102,9 +106,10 @@ int snd_i2c_bus_create(snd_card_t *card, const char *name, snd_i2c_bus_t *master | |||
102 | return 0; | 106 | return 0; |
103 | } | 107 | } |
104 | 108 | ||
105 | int snd_i2c_device_create(snd_i2c_bus_t *bus, const char *name, unsigned char addr, snd_i2c_device_t **rdevice) | 109 | int snd_i2c_device_create(struct snd_i2c_bus *bus, const char *name, |
110 | unsigned char addr, struct snd_i2c_device **rdevice) | ||
106 | { | 111 | { |
107 | snd_i2c_device_t *device; | 112 | struct snd_i2c_device *device; |
108 | 113 | ||
109 | *rdevice = NULL; | 114 | *rdevice = NULL; |
110 | snd_assert(bus != NULL, return -EINVAL); | 115 | snd_assert(bus != NULL, return -EINVAL); |
@@ -119,7 +124,7 @@ int snd_i2c_device_create(snd_i2c_bus_t *bus, const char *name, unsigned char ad | |||
119 | return 0; | 124 | return 0; |
120 | } | 125 | } |
121 | 126 | ||
122 | int snd_i2c_device_free(snd_i2c_device_t *device) | 127 | int snd_i2c_device_free(struct snd_i2c_device *device) |
123 | { | 128 | { |
124 | if (device->bus) | 129 | if (device->bus) |
125 | list_del(&device->list); | 130 | list_del(&device->list); |
@@ -129,18 +134,18 @@ int snd_i2c_device_free(snd_i2c_device_t *device) | |||
129 | return 0; | 134 | return 0; |
130 | } | 135 | } |
131 | 136 | ||
132 | int snd_i2c_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) | 137 | int snd_i2c_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count) |
133 | { | 138 | { |
134 | return device->bus->ops->sendbytes(device, bytes, count); | 139 | return device->bus->ops->sendbytes(device, bytes, count); |
135 | } | 140 | } |
136 | 141 | ||
137 | 142 | ||
138 | int snd_i2c_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) | 143 | int snd_i2c_readbytes(struct snd_i2c_device *device, unsigned char *bytes, int count) |
139 | { | 144 | { |
140 | return device->bus->ops->readbytes(device, bytes, count); | 145 | return device->bus->ops->readbytes(device, bytes, count); |
141 | } | 146 | } |
142 | 147 | ||
143 | int snd_i2c_probeaddr(snd_i2c_bus_t *bus, unsigned short addr) | 148 | int snd_i2c_probeaddr(struct snd_i2c_bus *bus, unsigned short addr) |
144 | { | 149 | { |
145 | return bus->ops->probeaddr(bus, addr); | 150 | return bus->ops->probeaddr(bus, addr); |
146 | } | 151 | } |
@@ -149,31 +154,31 @@ int snd_i2c_probeaddr(snd_i2c_bus_t *bus, unsigned short addr) | |||
149 | * bit-operations | 154 | * bit-operations |
150 | */ | 155 | */ |
151 | 156 | ||
152 | static inline void snd_i2c_bit_hw_start(snd_i2c_bus_t *bus) | 157 | static inline void snd_i2c_bit_hw_start(struct snd_i2c_bus *bus) |
153 | { | 158 | { |
154 | if (bus->hw_ops.bit->start) | 159 | if (bus->hw_ops.bit->start) |
155 | bus->hw_ops.bit->start(bus); | 160 | bus->hw_ops.bit->start(bus); |
156 | } | 161 | } |
157 | 162 | ||
158 | static inline void snd_i2c_bit_hw_stop(snd_i2c_bus_t *bus) | 163 | static inline void snd_i2c_bit_hw_stop(struct snd_i2c_bus *bus) |
159 | { | 164 | { |
160 | if (bus->hw_ops.bit->stop) | 165 | if (bus->hw_ops.bit->stop) |
161 | bus->hw_ops.bit->stop(bus); | 166 | bus->hw_ops.bit->stop(bus); |
162 | } | 167 | } |
163 | 168 | ||
164 | static void snd_i2c_bit_direction(snd_i2c_bus_t *bus, int clock, int data) | 169 | static void snd_i2c_bit_direction(struct snd_i2c_bus *bus, int clock, int data) |
165 | { | 170 | { |
166 | if (bus->hw_ops.bit->direction) | 171 | if (bus->hw_ops.bit->direction) |
167 | bus->hw_ops.bit->direction(bus, clock, data); | 172 | bus->hw_ops.bit->direction(bus, clock, data); |
168 | } | 173 | } |
169 | 174 | ||
170 | static void snd_i2c_bit_set(snd_i2c_bus_t *bus, int clock, int data) | 175 | static void snd_i2c_bit_set(struct snd_i2c_bus *bus, int clock, int data) |
171 | { | 176 | { |
172 | bus->hw_ops.bit->setlines(bus, clock, data); | 177 | bus->hw_ops.bit->setlines(bus, clock, data); |
173 | } | 178 | } |
174 | 179 | ||
175 | #if 0 | 180 | #if 0 |
176 | static int snd_i2c_bit_clock(snd_i2c_bus_t *bus) | 181 | static int snd_i2c_bit_clock(struct snd_i2c_bus *bus) |
177 | { | 182 | { |
178 | if (bus->hw_ops.bit->getclock) | 183 | if (bus->hw_ops.bit->getclock) |
179 | return bus->hw_ops.bit->getclock(bus); | 184 | return bus->hw_ops.bit->getclock(bus); |
@@ -181,12 +186,12 @@ static int snd_i2c_bit_clock(snd_i2c_bus_t *bus) | |||
181 | } | 186 | } |
182 | #endif | 187 | #endif |
183 | 188 | ||
184 | static int snd_i2c_bit_data(snd_i2c_bus_t *bus, int ack) | 189 | static int snd_i2c_bit_data(struct snd_i2c_bus *bus, int ack) |
185 | { | 190 | { |
186 | return bus->hw_ops.bit->getdata(bus, ack); | 191 | return bus->hw_ops.bit->getdata(bus, ack); |
187 | } | 192 | } |
188 | 193 | ||
189 | static void snd_i2c_bit_start(snd_i2c_bus_t *bus) | 194 | static void snd_i2c_bit_start(struct snd_i2c_bus *bus) |
190 | { | 195 | { |
191 | snd_i2c_bit_hw_start(bus); | 196 | snd_i2c_bit_hw_start(bus); |
192 | snd_i2c_bit_direction(bus, 1, 1); /* SCL - wr, SDA - wr */ | 197 | snd_i2c_bit_direction(bus, 1, 1); /* SCL - wr, SDA - wr */ |
@@ -195,7 +200,7 @@ static void snd_i2c_bit_start(snd_i2c_bus_t *bus) | |||
195 | snd_i2c_bit_set(bus, 0, 0); | 200 | snd_i2c_bit_set(bus, 0, 0); |
196 | } | 201 | } |
197 | 202 | ||
198 | static void snd_i2c_bit_stop(snd_i2c_bus_t *bus) | 203 | static void snd_i2c_bit_stop(struct snd_i2c_bus *bus) |
199 | { | 204 | { |
200 | snd_i2c_bit_set(bus, 0, 0); | 205 | snd_i2c_bit_set(bus, 0, 0); |
201 | snd_i2c_bit_set(bus, 1, 0); | 206 | snd_i2c_bit_set(bus, 1, 0); |
@@ -203,14 +208,14 @@ static void snd_i2c_bit_stop(snd_i2c_bus_t *bus) | |||
203 | snd_i2c_bit_hw_stop(bus); | 208 | snd_i2c_bit_hw_stop(bus); |
204 | } | 209 | } |
205 | 210 | ||
206 | static void snd_i2c_bit_send(snd_i2c_bus_t *bus, int data) | 211 | static void snd_i2c_bit_send(struct snd_i2c_bus *bus, int data) |
207 | { | 212 | { |
208 | snd_i2c_bit_set(bus, 0, data); | 213 | snd_i2c_bit_set(bus, 0, data); |
209 | snd_i2c_bit_set(bus, 1, data); | 214 | snd_i2c_bit_set(bus, 1, data); |
210 | snd_i2c_bit_set(bus, 0, data); | 215 | snd_i2c_bit_set(bus, 0, data); |
211 | } | 216 | } |
212 | 217 | ||
213 | static int snd_i2c_bit_ack(snd_i2c_bus_t *bus) | 218 | static int snd_i2c_bit_ack(struct snd_i2c_bus *bus) |
214 | { | 219 | { |
215 | int ack; | 220 | int ack; |
216 | 221 | ||
@@ -223,7 +228,7 @@ static int snd_i2c_bit_ack(snd_i2c_bus_t *bus) | |||
223 | return ack ? -EIO : 0; | 228 | return ack ? -EIO : 0; |
224 | } | 229 | } |
225 | 230 | ||
226 | static int snd_i2c_bit_sendbyte(snd_i2c_bus_t *bus, unsigned char data) | 231 | static int snd_i2c_bit_sendbyte(struct snd_i2c_bus *bus, unsigned char data) |
227 | { | 232 | { |
228 | int i, err; | 233 | int i, err; |
229 | 234 | ||
@@ -234,7 +239,7 @@ static int snd_i2c_bit_sendbyte(snd_i2c_bus_t *bus, unsigned char data) | |||
234 | return 0; | 239 | return 0; |
235 | } | 240 | } |
236 | 241 | ||
237 | static int snd_i2c_bit_readbyte(snd_i2c_bus_t *bus, int last) | 242 | static int snd_i2c_bit_readbyte(struct snd_i2c_bus *bus, int last) |
238 | { | 243 | { |
239 | int i; | 244 | int i; |
240 | unsigned char data = 0; | 245 | unsigned char data = 0; |
@@ -252,9 +257,10 @@ static int snd_i2c_bit_readbyte(snd_i2c_bus_t *bus, int last) | |||
252 | return data; | 257 | return data; |
253 | } | 258 | } |
254 | 259 | ||
255 | static int snd_i2c_bit_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) | 260 | static int snd_i2c_bit_sendbytes(struct snd_i2c_device *device, |
261 | unsigned char *bytes, int count) | ||
256 | { | 262 | { |
257 | snd_i2c_bus_t *bus = device->bus; | 263 | struct snd_i2c_bus *bus = device->bus; |
258 | int err, res = 0; | 264 | int err, res = 0; |
259 | 265 | ||
260 | if (device->flags & SND_I2C_DEVICE_ADDRTEN) | 266 | if (device->flags & SND_I2C_DEVICE_ADDRTEN) |
@@ -275,9 +281,10 @@ static int snd_i2c_bit_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, | |||
275 | return res; | 281 | return res; |
276 | } | 282 | } |
277 | 283 | ||
278 | static int snd_i2c_bit_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count) | 284 | static int snd_i2c_bit_readbytes(struct snd_i2c_device *device, |
285 | unsigned char *bytes, int count) | ||
279 | { | 286 | { |
280 | snd_i2c_bus_t *bus = device->bus; | 287 | struct snd_i2c_bus *bus = device->bus; |
281 | int err, res = 0; | 288 | int err, res = 0; |
282 | 289 | ||
283 | if (device->flags & SND_I2C_DEVICE_ADDRTEN) | 290 | if (device->flags & SND_I2C_DEVICE_ADDRTEN) |
@@ -299,7 +306,7 @@ static int snd_i2c_bit_readbytes(snd_i2c_device_t *device, unsigned char *bytes, | |||
299 | return res; | 306 | return res; |
300 | } | 307 | } |
301 | 308 | ||
302 | static int snd_i2c_bit_probeaddr(snd_i2c_bus_t *bus, unsigned short addr) | 309 | static int snd_i2c_bit_probeaddr(struct snd_i2c_bus *bus, unsigned short addr) |
303 | { | 310 | { |
304 | int err; | 311 | int err; |
305 | 312 | ||
diff --git a/sound/i2c/l3/uda1341.c b/sound/i2c/l3/uda1341.c index bc7eb23e615f..746500e06950 100644 --- a/sound/i2c/l3/uda1341.c +++ b/sound/i2c/l3/uda1341.c | |||
@@ -17,7 +17,7 @@ | |||
17 | * 2002-05-12 Tomas Kasparek another code cleanup | 17 | * 2002-05-12 Tomas Kasparek another code cleanup |
18 | */ | 18 | */ |
19 | 19 | ||
20 | /* $Id: uda1341.c,v 1.17 2005/11/17 10:25:22 tiwai Exp $ */ | 20 | /* $Id: uda1341.c,v 1.18 2005/11/17 14:17:21 tiwai Exp $ */ |
21 | 21 | ||
22 | #include <sound/driver.h> | 22 | #include <sound/driver.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
@@ -140,15 +140,13 @@ static const char ** uda1341_enum_names[] = { | |||
140 | 140 | ||
141 | typedef int uda1341_cfg[CMD_LAST]; | 141 | typedef int uda1341_cfg[CMD_LAST]; |
142 | 142 | ||
143 | typedef struct uda1341 uda1341_t; | ||
144 | |||
145 | struct uda1341 { | 143 | struct uda1341 { |
146 | int (*write) (struct l3_client *uda1341, unsigned short reg, unsigned short val); | 144 | int (*write) (struct l3_client *uda1341, unsigned short reg, unsigned short val); |
147 | int (*read) (struct l3_client *uda1341, unsigned short reg); | 145 | int (*read) (struct l3_client *uda1341, unsigned short reg); |
148 | unsigned char regs[uda1341_reg_last]; | 146 | unsigned char regs[uda1341_reg_last]; |
149 | int active; | 147 | int active; |
150 | spinlock_t reg_lock; | 148 | spinlock_t reg_lock; |
151 | snd_card_t *card; | 149 | struct snd_card *card; |
152 | uda1341_cfg cfg; | 150 | uda1341_cfg cfg; |
153 | #ifdef CONFIG_PM | 151 | #ifdef CONFIG_PM |
154 | unsigned char suspend_regs[uda1341_reg_last]; | 152 | unsigned char suspend_regs[uda1341_reg_last]; |
@@ -429,8 +427,8 @@ static const char *peak_value[] = { | |||
429 | "-8.76 dB", "-7.28 dB", "-5.81 dB", "-4.34 dB", "-2.88 dB", "-1.43 dB", "0.00 dB", | 427 | "-8.76 dB", "-7.28 dB", "-5.81 dB", "-4.34 dB", "-2.88 dB", "-1.43 dB", "0.00 dB", |
430 | }; | 428 | }; |
431 | 429 | ||
432 | static void snd_uda1341_proc_read(snd_info_entry_t *entry, | 430 | static void snd_uda1341_proc_read(struct snd_info_entry *entry, |
433 | snd_info_buffer_t * buffer) | 431 | struct snd_info_buffer *buffer) |
434 | { | 432 | { |
435 | struct l3_client *clnt = entry->private_data; | 433 | struct l3_client *clnt = entry->private_data; |
436 | struct uda1341 *uda = clnt->driver_data; | 434 | struct uda1341 *uda = clnt->driver_data; |
@@ -494,8 +492,8 @@ static void snd_uda1341_proc_read(snd_info_entry_t *entry, | |||
494 | snd_iprintf(buffer, "Input Amp. Gain ch 2: %s dB\n", ig_small_value[uda->cfg[CMD_IG]]); | 492 | snd_iprintf(buffer, "Input Amp. Gain ch 2: %s dB\n", ig_small_value[uda->cfg[CMD_IG]]); |
495 | } | 493 | } |
496 | 494 | ||
497 | static void snd_uda1341_proc_regs_read(snd_info_entry_t *entry, | 495 | static void snd_uda1341_proc_regs_read(struct snd_info_entry *entry, |
498 | snd_info_buffer_t * buffer) | 496 | struct snd_info_buffer *buffer) |
499 | { | 497 | { |
500 | struct l3_client *clnt = entry->private_data; | 498 | struct l3_client *clnt = entry->private_data; |
501 | struct uda1341 *uda = clnt->driver_data; | 499 | struct uda1341 *uda = clnt->driver_data; |
@@ -514,9 +512,9 @@ static void snd_uda1341_proc_regs_read(snd_info_entry_t *entry, | |||
514 | } | 512 | } |
515 | #endif /* CONFIG_PROC_FS */ | 513 | #endif /* CONFIG_PROC_FS */ |
516 | 514 | ||
517 | static void __devinit snd_uda1341_proc_init(snd_card_t *card, struct l3_client *clnt) | 515 | static void __devinit snd_uda1341_proc_init(struct snd_card *card, struct l3_client *clnt) |
518 | { | 516 | { |
519 | snd_info_entry_t *entry; | 517 | struct snd_info_entry *entry; |
520 | 518 | ||
521 | if (! snd_card_proc_new(card, "uda1341", &entry)) | 519 | if (! snd_card_proc_new(card, "uda1341", &entry)) |
522 | snd_info_set_text_ops(entry, clnt, 1024, snd_uda1341_proc_read); | 520 | snd_info_set_text_ops(entry, clnt, 1024, snd_uda1341_proc_read); |
@@ -536,7 +534,8 @@ static void __devinit snd_uda1341_proc_init(snd_card_t *card, struct l3_client * | |||
536 | .private_value = where | (reg << 5) | (shift << 9) | (mask << 12) | (invert << 18) \ | 534 | .private_value = where | (reg << 5) | (shift << 9) | (mask << 12) | (invert << 18) \ |
537 | } | 535 | } |
538 | 536 | ||
539 | static int snd_uda1341_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 537 | static int snd_uda1341_info_single(struct snd_kcontrol *kcontrol, |
538 | struct snd_ctl_elem_info *uinfo) | ||
540 | { | 539 | { |
541 | int mask = (kcontrol->private_value >> 12) & 63; | 540 | int mask = (kcontrol->private_value >> 12) & 63; |
542 | 541 | ||
@@ -547,10 +546,11 @@ static int snd_uda1341_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
547 | return 0; | 546 | return 0; |
548 | } | 547 | } |
549 | 548 | ||
550 | static int snd_uda1341_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 549 | static int snd_uda1341_get_single(struct snd_kcontrol *kcontrol, |
550 | struct snd_ctl_elem_value *ucontrol) | ||
551 | { | 551 | { |
552 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); | 552 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); |
553 | uda1341_t *uda = clnt->driver_data; | 553 | struct uda1341 *uda = clnt->driver_data; |
554 | int where = kcontrol->private_value & 31; | 554 | int where = kcontrol->private_value & 31; |
555 | int mask = (kcontrol->private_value >> 12) & 63; | 555 | int mask = (kcontrol->private_value >> 12) & 63; |
556 | int invert = (kcontrol->private_value >> 18) & 1; | 556 | int invert = (kcontrol->private_value >> 18) & 1; |
@@ -562,10 +562,11 @@ static int snd_uda1341_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
562 | return 0; | 562 | return 0; |
563 | } | 563 | } |
564 | 564 | ||
565 | static int snd_uda1341_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 565 | static int snd_uda1341_put_single(struct snd_kcontrol *kcontrol, |
566 | struct snd_ctl_elem_value *ucontrol) | ||
566 | { | 567 | { |
567 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); | 568 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); |
568 | uda1341_t *uda = clnt->driver_data; | 569 | struct uda1341 *uda = clnt->driver_data; |
569 | int where = kcontrol->private_value & 31; | 570 | int where = kcontrol->private_value & 31; |
570 | int reg = (kcontrol->private_value >> 5) & 15; | 571 | int reg = (kcontrol->private_value >> 5) & 15; |
571 | int shift = (kcontrol->private_value >> 9) & 7; | 572 | int shift = (kcontrol->private_value >> 9) & 7; |
@@ -591,7 +592,8 @@ static int snd_uda1341_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
591 | .private_value = where | (reg << 5) | (shift << 9) | (mask << 12) | (invert << 18) \ | 592 | .private_value = where | (reg << 5) | (shift << 9) | (mask << 12) | (invert << 18) \ |
592 | } | 593 | } |
593 | 594 | ||
594 | static int snd_uda1341_info_enum(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 595 | static int snd_uda1341_info_enum(struct snd_kcontrol *kcontrol, |
596 | struct snd_ctl_elem_info *uinfo) | ||
595 | { | 597 | { |
596 | int where = kcontrol->private_value & 31; | 598 | int where = kcontrol->private_value & 31; |
597 | const char **texts; | 599 | const char **texts; |
@@ -612,20 +614,22 @@ static int snd_uda1341_info_enum(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * | |||
612 | return 0; | 614 | return 0; |
613 | } | 615 | } |
614 | 616 | ||
615 | static int snd_uda1341_get_enum(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 617 | static int snd_uda1341_get_enum(struct snd_kcontrol *kcontrol, |
618 | struct snd_ctl_elem_value *ucontrol) | ||
616 | { | 619 | { |
617 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); | 620 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); |
618 | uda1341_t *uda = clnt->driver_data; | 621 | struct uda1341 *uda = clnt->driver_data; |
619 | int where = kcontrol->private_value & 31; | 622 | int where = kcontrol->private_value & 31; |
620 | 623 | ||
621 | ucontrol->value.enumerated.item[0] = uda->cfg[where]; | 624 | ucontrol->value.enumerated.item[0] = uda->cfg[where]; |
622 | return 0; | 625 | return 0; |
623 | } | 626 | } |
624 | 627 | ||
625 | static int snd_uda1341_put_enum(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 628 | static int snd_uda1341_put_enum(struct snd_kcontrol *kcontrol, |
629 | struct snd_ctl_elem_value *ucontrol) | ||
626 | { | 630 | { |
627 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); | 631 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); |
628 | uda1341_t *uda = clnt->driver_data; | 632 | struct uda1341 *uda = clnt->driver_data; |
629 | int where = kcontrol->private_value & 31; | 633 | int where = kcontrol->private_value & 31; |
630 | int reg = (kcontrol->private_value >> 5) & 15; | 634 | int reg = (kcontrol->private_value >> 5) & 15; |
631 | int shift = (kcontrol->private_value >> 9) & 7; | 635 | int shift = (kcontrol->private_value >> 9) & 7; |
@@ -648,7 +652,8 @@ static int snd_uda1341_put_enum(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
648 | } | 652 | } |
649 | 653 | ||
650 | 654 | ||
651 | static int snd_uda1341_info_2regs(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 655 | static int snd_uda1341_info_2regs(struct snd_kcontrol *kcontrol, |
656 | struct snd_ctl_elem_info *uinfo) | ||
652 | { | 657 | { |
653 | int mask_1 = (kcontrol->private_value >> 19) & 63; | 658 | int mask_1 = (kcontrol->private_value >> 19) & 63; |
654 | int mask_2 = (kcontrol->private_value >> 25) & 63; | 659 | int mask_2 = (kcontrol->private_value >> 25) & 63; |
@@ -662,10 +667,11 @@ static int snd_uda1341_info_2regs(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
662 | return 0; | 667 | return 0; |
663 | } | 668 | } |
664 | 669 | ||
665 | static int snd_uda1341_get_2regs(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 670 | static int snd_uda1341_get_2regs(struct snd_kcontrol *kcontrol, |
671 | struct snd_ctl_elem_value *ucontrol) | ||
666 | { | 672 | { |
667 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); | 673 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); |
668 | uda1341_t *uda = clnt->driver_data; | 674 | struct uda1341 *uda = clnt->driver_data; |
669 | int where = kcontrol->private_value & 31; | 675 | int where = kcontrol->private_value & 31; |
670 | int mask_1 = (kcontrol->private_value >> 19) & 63; | 676 | int mask_1 = (kcontrol->private_value >> 19) & 63; |
671 | int mask_2 = (kcontrol->private_value >> 25) & 63; | 677 | int mask_2 = (kcontrol->private_value >> 25) & 63; |
@@ -680,10 +686,11 @@ static int snd_uda1341_get_2regs(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
680 | return 0; | 686 | return 0; |
681 | } | 687 | } |
682 | 688 | ||
683 | static int snd_uda1341_put_2regs(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 689 | static int snd_uda1341_put_2regs(struct snd_kcontrol *kcontrol, |
690 | struct snd_ctl_elem_value *ucontrol) | ||
684 | { | 691 | { |
685 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); | 692 | struct l3_client *clnt = snd_kcontrol_chip(kcontrol); |
686 | uda1341_t *uda = clnt->driver_data; | 693 | struct uda1341 *uda = clnt->driver_data; |
687 | int where = kcontrol->private_value & 31; | 694 | int where = kcontrol->private_value & 31; |
688 | int reg_1 = (kcontrol->private_value >> 5) & 15; | 695 | int reg_1 = (kcontrol->private_value >> 5) & 15; |
689 | int reg_2 = (kcontrol->private_value >> 9) & 15; | 696 | int reg_2 = (kcontrol->private_value >> 9) & 15; |
@@ -716,7 +723,7 @@ static int snd_uda1341_put_2regs(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
716 | 723 | ||
717 | /* }}} */ | 724 | /* }}} */ |
718 | 725 | ||
719 | static snd_kcontrol_new_t snd_uda1341_controls[] = { | 726 | static struct snd_kcontrol_new snd_uda1341_controls[] = { |
720 | UDA1341_SINGLE("Master Playback Switch", CMD_MUTE, data0_2, 2, 1, 1), | 727 | UDA1341_SINGLE("Master Playback Switch", CMD_MUTE, data0_2, 2, 1, 1), |
721 | UDA1341_SINGLE("Master Playback Volume", CMD_VOLUME, data0_0, 0, 63, 1), | 728 | UDA1341_SINGLE("Master Playback Volume", CMD_VOLUME, data0_0, 0, 63, 1), |
722 | 729 | ||
@@ -748,20 +755,20 @@ static snd_kcontrol_new_t snd_uda1341_controls[] = { | |||
748 | 755 | ||
749 | static void uda1341_free(struct l3_client *clnt) | 756 | static void uda1341_free(struct l3_client *clnt) |
750 | { | 757 | { |
751 | l3_detach_client(clnt); // calls kfree for driver_data (uda1341_t) | 758 | l3_detach_client(clnt); // calls kfree for driver_data (struct uda1341) |
752 | kfree(clnt); | 759 | kfree(clnt); |
753 | } | 760 | } |
754 | 761 | ||
755 | static int uda1341_dev_free(snd_device_t *device) | 762 | static int uda1341_dev_free(struct snd_device *device) |
756 | { | 763 | { |
757 | struct l3_client *clnt = device->device_data; | 764 | struct l3_client *clnt = device->device_data; |
758 | uda1341_free(clnt); | 765 | uda1341_free(clnt); |
759 | return 0; | 766 | return 0; |
760 | } | 767 | } |
761 | 768 | ||
762 | int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clntp) | 769 | int __init snd_chip_uda1341_mixer_new(struct snd_card *card, struct l3_client **clntp) |
763 | { | 770 | { |
764 | static snd_device_ops_t ops = { | 771 | static struct snd_device_ops ops = { |
765 | .dev_free = uda1341_dev_free, | 772 | .dev_free = uda1341_dev_free, |
766 | }; | 773 | }; |
767 | struct l3_client *clnt; | 774 | struct l3_client *clnt; |
@@ -792,7 +799,7 @@ int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clntp | |||
792 | 799 | ||
793 | *clntp = clnt; | 800 | *clntp = clnt; |
794 | strcpy(card->mixername, "UDA1341TS Mixer"); | 801 | strcpy(card->mixername, "UDA1341TS Mixer"); |
795 | ((uda1341_t *)uda1341->driver_data)->card = card; | 802 | ((struct uda1341 *)clnt->driver_data)->card = card; |
796 | 803 | ||
797 | snd_uda1341_proc_init(card, clnt); | 804 | snd_uda1341_proc_init(card, clnt); |
798 | 805 | ||
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c index d351b3aa1916..12ffffc9e814 100644 --- a/sound/i2c/other/ak4114.c +++ b/sound/i2c/other/ak4114.c | |||
@@ -37,7 +37,7 @@ MODULE_LICENSE("GPL"); | |||
37 | 37 | ||
38 | static void ak4114_stats(void *); | 38 | static void ak4114_stats(void *); |
39 | 39 | ||
40 | static void reg_write(ak4114_t *ak4114, unsigned char reg, unsigned char val) | 40 | static void reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char val) |
41 | { | 41 | { |
42 | ak4114->write(ak4114->private_data, reg, val); | 42 | ak4114->write(ak4114->private_data, reg, val); |
43 | if (reg <= AK4114_REG_INT1_MASK) | 43 | if (reg <= AK4114_REG_INT1_MASK) |
@@ -46,13 +46,13 @@ static void reg_write(ak4114_t *ak4114, unsigned char reg, unsigned char val) | |||
46 | ak4114->txcsb[reg-AK4114_REG_RXCSB0] = val; | 46 | ak4114->txcsb[reg-AK4114_REG_RXCSB0] = val; |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline unsigned char reg_read(ak4114_t *ak4114, unsigned char reg) | 49 | static inline unsigned char reg_read(struct ak4114 *ak4114, unsigned char reg) |
50 | { | 50 | { |
51 | return ak4114->read(ak4114->private_data, reg); | 51 | return ak4114->read(ak4114->private_data, reg); |
52 | } | 52 | } |
53 | 53 | ||
54 | #if 0 | 54 | #if 0 |
55 | static void reg_dump(ak4114_t *ak4114) | 55 | static void reg_dump(struct ak4114 *ak4114) |
56 | { | 56 | { |
57 | int i; | 57 | int i; |
58 | 58 | ||
@@ -62,7 +62,7 @@ static void reg_dump(ak4114_t *ak4114) | |||
62 | } | 62 | } |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | static void snd_ak4114_free(ak4114_t *chip) | 65 | static void snd_ak4114_free(struct ak4114 *chip) |
66 | { | 66 | { |
67 | chip->init = 1; /* don't schedule new work */ | 67 | chip->init = 1; /* don't schedule new work */ |
68 | mb(); | 68 | mb(); |
@@ -73,22 +73,22 @@ static void snd_ak4114_free(ak4114_t *chip) | |||
73 | kfree(chip); | 73 | kfree(chip); |
74 | } | 74 | } |
75 | 75 | ||
76 | static int snd_ak4114_dev_free(snd_device_t *device) | 76 | static int snd_ak4114_dev_free(struct snd_device *device) |
77 | { | 77 | { |
78 | ak4114_t *chip = device->device_data; | 78 | struct ak4114 *chip = device->device_data; |
79 | snd_ak4114_free(chip); | 79 | snd_ak4114_free(chip); |
80 | return 0; | 80 | return 0; |
81 | } | 81 | } |
82 | 82 | ||
83 | int snd_ak4114_create(snd_card_t *card, | 83 | int snd_ak4114_create(struct snd_card *card, |
84 | ak4114_read_t *read, ak4114_write_t *write, | 84 | ak4114_read_t *read, ak4114_write_t *write, |
85 | unsigned char pgm[7], unsigned char txcsb[5], | 85 | unsigned char pgm[7], unsigned char txcsb[5], |
86 | void *private_data, ak4114_t **r_ak4114) | 86 | void *private_data, struct ak4114 **r_ak4114) |
87 | { | 87 | { |
88 | ak4114_t *chip; | 88 | struct ak4114 *chip; |
89 | int err = 0; | 89 | int err = 0; |
90 | unsigned char reg; | 90 | unsigned char reg; |
91 | static snd_device_ops_t ops = { | 91 | static struct snd_device_ops ops = { |
92 | .dev_free = snd_ak4114_dev_free, | 92 | .dev_free = snd_ak4114_dev_free, |
93 | }; | 93 | }; |
94 | 94 | ||
@@ -129,7 +129,7 @@ int snd_ak4114_create(snd_card_t *card, | |||
129 | return err < 0 ? err : -EIO; | 129 | return err < 0 ? err : -EIO; |
130 | } | 130 | } |
131 | 131 | ||
132 | void snd_ak4114_reg_write(ak4114_t *chip, unsigned char reg, unsigned char mask, unsigned char val) | 132 | void snd_ak4114_reg_write(struct ak4114 *chip, unsigned char reg, unsigned char mask, unsigned char val) |
133 | { | 133 | { |
134 | if (reg <= AK4114_REG_INT1_MASK) | 134 | if (reg <= AK4114_REG_INT1_MASK) |
135 | reg_write(chip, reg, (chip->regmap[reg] & ~mask) | val); | 135 | reg_write(chip, reg, (chip->regmap[reg] & ~mask) | val); |
@@ -137,7 +137,7 @@ void snd_ak4114_reg_write(ak4114_t *chip, unsigned char reg, unsigned char mask, | |||
137 | reg_write(chip, reg, (chip->txcsb[reg] & ~mask) | val); | 137 | reg_write(chip, reg, (chip->txcsb[reg] & ~mask) | val); |
138 | } | 138 | } |
139 | 139 | ||
140 | void snd_ak4114_reinit(ak4114_t *chip) | 140 | void snd_ak4114_reinit(struct ak4114 *chip) |
141 | { | 141 | { |
142 | unsigned char old = chip->regmap[AK4114_REG_PWRDN], reg; | 142 | unsigned char old = chip->regmap[AK4114_REG_PWRDN], reg; |
143 | 143 | ||
@@ -176,8 +176,8 @@ static unsigned int external_rate(unsigned char rcs1) | |||
176 | } | 176 | } |
177 | } | 177 | } |
178 | 178 | ||
179 | static int snd_ak4114_in_error_info(snd_kcontrol_t *kcontrol, | 179 | static int snd_ak4114_in_error_info(struct snd_kcontrol *kcontrol, |
180 | snd_ctl_elem_info_t *uinfo) | 180 | struct snd_ctl_elem_info *uinfo) |
181 | { | 181 | { |
182 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 182 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
183 | uinfo->count = 1; | 183 | uinfo->count = 1; |
@@ -186,10 +186,10 @@ static int snd_ak4114_in_error_info(snd_kcontrol_t *kcontrol, | |||
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
188 | 188 | ||
189 | static int snd_ak4114_in_error_get(snd_kcontrol_t *kcontrol, | 189 | static int snd_ak4114_in_error_get(struct snd_kcontrol *kcontrol, |
190 | snd_ctl_elem_value_t *ucontrol) | 190 | struct snd_ctl_elem_value *ucontrol) |
191 | { | 191 | { |
192 | ak4114_t *chip = snd_kcontrol_chip(kcontrol); | 192 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
193 | long *ptr; | 193 | long *ptr; |
194 | 194 | ||
195 | spin_lock_irq(&chip->lock); | 195 | spin_lock_irq(&chip->lock); |
@@ -200,8 +200,8 @@ static int snd_ak4114_in_error_get(snd_kcontrol_t *kcontrol, | |||
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | 202 | ||
203 | static int snd_ak4114_in_bit_info(snd_kcontrol_t *kcontrol, | 203 | static int snd_ak4114_in_bit_info(struct snd_kcontrol *kcontrol, |
204 | snd_ctl_elem_info_t *uinfo) | 204 | struct snd_ctl_elem_info *uinfo) |
205 | { | 205 | { |
206 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 206 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
207 | uinfo->count = 1; | 207 | uinfo->count = 1; |
@@ -210,10 +210,10 @@ static int snd_ak4114_in_bit_info(snd_kcontrol_t *kcontrol, | |||
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |
212 | 212 | ||
213 | static int snd_ak4114_in_bit_get(snd_kcontrol_t *kcontrol, | 213 | static int snd_ak4114_in_bit_get(struct snd_kcontrol *kcontrol, |
214 | snd_ctl_elem_value_t *ucontrol) | 214 | struct snd_ctl_elem_value *ucontrol) |
215 | { | 215 | { |
216 | ak4114_t *chip = snd_kcontrol_chip(kcontrol); | 216 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
217 | unsigned char reg = kcontrol->private_value & 0xff; | 217 | unsigned char reg = kcontrol->private_value & 0xff; |
218 | unsigned char bit = (kcontrol->private_value >> 8) & 0xff; | 218 | unsigned char bit = (kcontrol->private_value >> 8) & 0xff; |
219 | unsigned char inv = (kcontrol->private_value >> 31) & 1; | 219 | unsigned char inv = (kcontrol->private_value >> 31) & 1; |
@@ -222,8 +222,8 @@ static int snd_ak4114_in_bit_get(snd_kcontrol_t *kcontrol, | |||
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | 224 | ||
225 | static int snd_ak4114_rate_info(snd_kcontrol_t *kcontrol, | 225 | static int snd_ak4114_rate_info(struct snd_kcontrol *kcontrol, |
226 | snd_ctl_elem_info_t *uinfo) | 226 | struct snd_ctl_elem_info *uinfo) |
227 | { | 227 | { |
228 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 228 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
229 | uinfo->count = 1; | 229 | uinfo->count = 1; |
@@ -232,26 +232,26 @@ static int snd_ak4114_rate_info(snd_kcontrol_t *kcontrol, | |||
232 | return 0; | 232 | return 0; |
233 | } | 233 | } |
234 | 234 | ||
235 | static int snd_ak4114_rate_get(snd_kcontrol_t *kcontrol, | 235 | static int snd_ak4114_rate_get(struct snd_kcontrol *kcontrol, |
236 | snd_ctl_elem_value_t *ucontrol) | 236 | struct snd_ctl_elem_value *ucontrol) |
237 | { | 237 | { |
238 | ak4114_t *chip = snd_kcontrol_chip(kcontrol); | 238 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
239 | 239 | ||
240 | ucontrol->value.integer.value[0] = external_rate(reg_read(chip, AK4114_REG_RCS1)); | 240 | ucontrol->value.integer.value[0] = external_rate(reg_read(chip, AK4114_REG_RCS1)); |
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
243 | 243 | ||
244 | static int snd_ak4114_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 244 | static int snd_ak4114_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
245 | { | 245 | { |
246 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 246 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
247 | uinfo->count = 1; | 247 | uinfo->count = 1; |
248 | return 0; | 248 | return 0; |
249 | } | 249 | } |
250 | 250 | ||
251 | static int snd_ak4114_spdif_get(snd_kcontrol_t * kcontrol, | 251 | static int snd_ak4114_spdif_get(struct snd_kcontrol *kcontrol, |
252 | snd_ctl_elem_value_t * ucontrol) | 252 | struct snd_ctl_elem_value *ucontrol) |
253 | { | 253 | { |
254 | ak4114_t *chip = snd_kcontrol_chip(kcontrol); | 254 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
255 | unsigned i; | 255 | unsigned i; |
256 | 256 | ||
257 | for (i = 0; i < AK4114_REG_RXCSB_SIZE; i++) | 257 | for (i = 0; i < AK4114_REG_RXCSB_SIZE; i++) |
@@ -259,10 +259,10 @@ static int snd_ak4114_spdif_get(snd_kcontrol_t * kcontrol, | |||
259 | return 0; | 259 | return 0; |
260 | } | 260 | } |
261 | 261 | ||
262 | static int snd_ak4114_spdif_playback_get(snd_kcontrol_t * kcontrol, | 262 | static int snd_ak4114_spdif_playback_get(struct snd_kcontrol *kcontrol, |
263 | snd_ctl_elem_value_t * ucontrol) | 263 | struct snd_ctl_elem_value *ucontrol) |
264 | { | 264 | { |
265 | ak4114_t *chip = snd_kcontrol_chip(kcontrol); | 265 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
266 | unsigned i; | 266 | unsigned i; |
267 | 267 | ||
268 | for (i = 0; i < AK4114_REG_TXCSB_SIZE; i++) | 268 | for (i = 0; i < AK4114_REG_TXCSB_SIZE; i++) |
@@ -270,10 +270,10 @@ static int snd_ak4114_spdif_playback_get(snd_kcontrol_t * kcontrol, | |||
270 | return 0; | 270 | return 0; |
271 | } | 271 | } |
272 | 272 | ||
273 | static int snd_ak4114_spdif_playback_put(snd_kcontrol_t * kcontrol, | 273 | static int snd_ak4114_spdif_playback_put(struct snd_kcontrol *kcontrol, |
274 | snd_ctl_elem_value_t * ucontrol) | 274 | struct snd_ctl_elem_value *ucontrol) |
275 | { | 275 | { |
276 | ak4114_t *chip = snd_kcontrol_chip(kcontrol); | 276 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
277 | unsigned i; | 277 | unsigned i; |
278 | 278 | ||
279 | for (i = 0; i < AK4114_REG_TXCSB_SIZE; i++) | 279 | for (i = 0; i < AK4114_REG_TXCSB_SIZE; i++) |
@@ -281,21 +281,21 @@ static int snd_ak4114_spdif_playback_put(snd_kcontrol_t * kcontrol, | |||
281 | return 0; | 281 | return 0; |
282 | } | 282 | } |
283 | 283 | ||
284 | static int snd_ak4114_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 284 | static int snd_ak4114_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
285 | { | 285 | { |
286 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 286 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
287 | uinfo->count = 1; | 287 | uinfo->count = 1; |
288 | return 0; | 288 | return 0; |
289 | } | 289 | } |
290 | 290 | ||
291 | static int snd_ak4114_spdif_mask_get(snd_kcontrol_t * kcontrol, | 291 | static int snd_ak4114_spdif_mask_get(struct snd_kcontrol *kcontrol, |
292 | snd_ctl_elem_value_t * ucontrol) | 292 | struct snd_ctl_elem_value *ucontrol) |
293 | { | 293 | { |
294 | memset(ucontrol->value.iec958.status, 0xff, AK4114_REG_RXCSB_SIZE); | 294 | memset(ucontrol->value.iec958.status, 0xff, AK4114_REG_RXCSB_SIZE); |
295 | return 0; | 295 | return 0; |
296 | } | 296 | } |
297 | 297 | ||
298 | static int snd_ak4114_spdif_pinfo(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 298 | static int snd_ak4114_spdif_pinfo(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
299 | { | 299 | { |
300 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 300 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
301 | uinfo->value.integer.min = 0; | 301 | uinfo->value.integer.min = 0; |
@@ -304,10 +304,10 @@ static int snd_ak4114_spdif_pinfo(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
304 | return 0; | 304 | return 0; |
305 | } | 305 | } |
306 | 306 | ||
307 | static int snd_ak4114_spdif_pget(snd_kcontrol_t * kcontrol, | 307 | static int snd_ak4114_spdif_pget(struct snd_kcontrol *kcontrol, |
308 | snd_ctl_elem_value_t * ucontrol) | 308 | struct snd_ctl_elem_value *ucontrol) |
309 | { | 309 | { |
310 | ak4114_t *chip = snd_kcontrol_chip(kcontrol); | 310 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
311 | unsigned short tmp; | 311 | unsigned short tmp; |
312 | 312 | ||
313 | ucontrol->value.integer.value[0] = 0xf8f2; | 313 | ucontrol->value.integer.value[0] = 0xf8f2; |
@@ -319,17 +319,17 @@ static int snd_ak4114_spdif_pget(snd_kcontrol_t * kcontrol, | |||
319 | return 0; | 319 | return 0; |
320 | } | 320 | } |
321 | 321 | ||
322 | static int snd_ak4114_spdif_qinfo(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 322 | static int snd_ak4114_spdif_qinfo(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
323 | { | 323 | { |
324 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; | 324 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; |
325 | uinfo->count = AK4114_REG_QSUB_SIZE; | 325 | uinfo->count = AK4114_REG_QSUB_SIZE; |
326 | return 0; | 326 | return 0; |
327 | } | 327 | } |
328 | 328 | ||
329 | static int snd_ak4114_spdif_qget(snd_kcontrol_t * kcontrol, | 329 | static int snd_ak4114_spdif_qget(struct snd_kcontrol *kcontrol, |
330 | snd_ctl_elem_value_t * ucontrol) | 330 | struct snd_ctl_elem_value *ucontrol) |
331 | { | 331 | { |
332 | ak4114_t *chip = snd_kcontrol_chip(kcontrol); | 332 | struct ak4114 *chip = snd_kcontrol_chip(kcontrol); |
333 | unsigned i; | 333 | unsigned i; |
334 | 334 | ||
335 | for (i = 0; i < AK4114_REG_QSUB_SIZE; i++) | 335 | for (i = 0; i < AK4114_REG_QSUB_SIZE; i++) |
@@ -338,14 +338,14 @@ static int snd_ak4114_spdif_qget(snd_kcontrol_t * kcontrol, | |||
338 | } | 338 | } |
339 | 339 | ||
340 | /* Don't forget to change AK4114_CONTROLS define!!! */ | 340 | /* Don't forget to change AK4114_CONTROLS define!!! */ |
341 | static snd_kcontrol_new_t snd_ak4114_iec958_controls[] = { | 341 | static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { |
342 | { | 342 | { |
343 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 343 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
344 | .name = "IEC958 Parity Errors", | 344 | .name = "IEC958 Parity Errors", |
345 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 345 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
346 | .info = snd_ak4114_in_error_info, | 346 | .info = snd_ak4114_in_error_info, |
347 | .get = snd_ak4114_in_error_get, | 347 | .get = snd_ak4114_in_error_get, |
348 | .private_value = offsetof(ak4114_t, parity_errors), | 348 | .private_value = offsetof(struct ak4114, parity_errors), |
349 | }, | 349 | }, |
350 | { | 350 | { |
351 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 351 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -353,7 +353,7 @@ static snd_kcontrol_new_t snd_ak4114_iec958_controls[] = { | |||
353 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 353 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
354 | .info = snd_ak4114_in_error_info, | 354 | .info = snd_ak4114_in_error_info, |
355 | .get = snd_ak4114_in_error_get, | 355 | .get = snd_ak4114_in_error_get, |
356 | .private_value = offsetof(ak4114_t, v_bit_errors), | 356 | .private_value = offsetof(struct ak4114, v_bit_errors), |
357 | }, | 357 | }, |
358 | { | 358 | { |
359 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 359 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -361,7 +361,7 @@ static snd_kcontrol_new_t snd_ak4114_iec958_controls[] = { | |||
361 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 361 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
362 | .info = snd_ak4114_in_error_info, | 362 | .info = snd_ak4114_in_error_info, |
363 | .get = snd_ak4114_in_error_get, | 363 | .get = snd_ak4114_in_error_get, |
364 | .private_value = offsetof(ak4114_t, ccrc_errors), | 364 | .private_value = offsetof(struct ak4114, ccrc_errors), |
365 | }, | 365 | }, |
366 | { | 366 | { |
367 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 367 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -369,7 +369,7 @@ static snd_kcontrol_new_t snd_ak4114_iec958_controls[] = { | |||
369 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 369 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
370 | .info = snd_ak4114_in_error_info, | 370 | .info = snd_ak4114_in_error_info, |
371 | .get = snd_ak4114_in_error_get, | 371 | .get = snd_ak4114_in_error_get, |
372 | .private_value = offsetof(ak4114_t, qcrc_errors), | 372 | .private_value = offsetof(struct ak4114, qcrc_errors), |
373 | }, | 373 | }, |
374 | { | 374 | { |
375 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 375 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -447,11 +447,11 @@ static snd_kcontrol_new_t snd_ak4114_iec958_controls[] = { | |||
447 | } | 447 | } |
448 | }; | 448 | }; |
449 | 449 | ||
450 | int snd_ak4114_build(ak4114_t *ak4114, | 450 | int snd_ak4114_build(struct ak4114 *ak4114, |
451 | snd_pcm_substream_t *ply_substream, | 451 | struct snd_pcm_substream *ply_substream, |
452 | snd_pcm_substream_t *cap_substream) | 452 | struct snd_pcm_substream *cap_substream) |
453 | { | 453 | { |
454 | snd_kcontrol_t *kctl; | 454 | struct snd_kcontrol *kctl; |
455 | unsigned int idx; | 455 | unsigned int idx; |
456 | int err; | 456 | int err; |
457 | 457 | ||
@@ -482,7 +482,7 @@ int snd_ak4114_build(ak4114_t *ak4114, | |||
482 | return 0; | 482 | return 0; |
483 | } | 483 | } |
484 | 484 | ||
485 | int snd_ak4114_external_rate(ak4114_t *ak4114) | 485 | int snd_ak4114_external_rate(struct ak4114 *ak4114) |
486 | { | 486 | { |
487 | unsigned char rcs1; | 487 | unsigned char rcs1; |
488 | 488 | ||
@@ -490,9 +490,9 @@ int snd_ak4114_external_rate(ak4114_t *ak4114) | |||
490 | return external_rate(rcs1); | 490 | return external_rate(rcs1); |
491 | } | 491 | } |
492 | 492 | ||
493 | int snd_ak4114_check_rate_and_errors(ak4114_t *ak4114, unsigned int flags) | 493 | int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags) |
494 | { | 494 | { |
495 | snd_pcm_runtime_t *runtime = ak4114->capture_substream ? ak4114->capture_substream->runtime : NULL; | 495 | struct snd_pcm_runtime *runtime = ak4114->capture_substream ? ak4114->capture_substream->runtime : NULL; |
496 | unsigned long _flags; | 496 | unsigned long _flags; |
497 | int res = 0; | 497 | int res = 0; |
498 | unsigned char rcs0, rcs1; | 498 | unsigned char rcs0, rcs1; |
@@ -563,7 +563,7 @@ int snd_ak4114_check_rate_and_errors(ak4114_t *ak4114, unsigned int flags) | |||
563 | 563 | ||
564 | static void ak4114_stats(void *data) | 564 | static void ak4114_stats(void *data) |
565 | { | 565 | { |
566 | ak4114_t *chip = (ak4114_t *)data; | 566 | struct ak4114 *chip = (struct ak4114 *)data; |
567 | 567 | ||
568 | if (chip->init) | 568 | if (chip->init) |
569 | return; | 569 | return; |
diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 35b4584483a3..4e45952dd95a 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c | |||
@@ -37,20 +37,20 @@ MODULE_LICENSE("GPL"); | |||
37 | 37 | ||
38 | static void snd_ak4117_timer(unsigned long data); | 38 | static void snd_ak4117_timer(unsigned long data); |
39 | 39 | ||
40 | static void reg_write(ak4117_t *ak4117, unsigned char reg, unsigned char val) | 40 | static void reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char val) |
41 | { | 41 | { |
42 | ak4117->write(ak4117->private_data, reg, val); | 42 | ak4117->write(ak4117->private_data, reg, val); |
43 | if (reg < sizeof(ak4117->regmap)) | 43 | if (reg < sizeof(ak4117->regmap)) |
44 | ak4117->regmap[reg] = val; | 44 | ak4117->regmap[reg] = val; |
45 | } | 45 | } |
46 | 46 | ||
47 | static inline unsigned char reg_read(ak4117_t *ak4117, unsigned char reg) | 47 | static inline unsigned char reg_read(struct ak4117 *ak4117, unsigned char reg) |
48 | { | 48 | { |
49 | return ak4117->read(ak4117->private_data, reg); | 49 | return ak4117->read(ak4117->private_data, reg); |
50 | } | 50 | } |
51 | 51 | ||
52 | #if 0 | 52 | #if 0 |
53 | static void reg_dump(ak4117_t *ak4117) | 53 | static void reg_dump(struct ak4117 *ak4117) |
54 | { | 54 | { |
55 | int i; | 55 | int i; |
56 | 56 | ||
@@ -60,26 +60,26 @@ static void reg_dump(ak4117_t *ak4117) | |||
60 | } | 60 | } |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | static void snd_ak4117_free(ak4117_t *chip) | 63 | static void snd_ak4117_free(struct ak4117 *chip) |
64 | { | 64 | { |
65 | del_timer(&chip->timer); | 65 | del_timer(&chip->timer); |
66 | kfree(chip); | 66 | kfree(chip); |
67 | } | 67 | } |
68 | 68 | ||
69 | static int snd_ak4117_dev_free(snd_device_t *device) | 69 | static int snd_ak4117_dev_free(struct snd_device *device) |
70 | { | 70 | { |
71 | ak4117_t *chip = device->device_data; | 71 | struct ak4117 *chip = device->device_data; |
72 | snd_ak4117_free(chip); | 72 | snd_ak4117_free(chip); |
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
75 | 75 | ||
76 | int snd_ak4117_create(snd_card_t *card, ak4117_read_t *read, ak4117_write_t *write, | 76 | int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t *write, |
77 | unsigned char pgm[5], void *private_data, ak4117_t **r_ak4117) | 77 | unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117) |
78 | { | 78 | { |
79 | ak4117_t *chip; | 79 | struct ak4117 *chip; |
80 | int err = 0; | 80 | int err = 0; |
81 | unsigned char reg; | 81 | unsigned char reg; |
82 | static snd_device_ops_t ops = { | 82 | static struct snd_device_ops ops = { |
83 | .dev_free = snd_ak4117_dev_free, | 83 | .dev_free = snd_ak4117_dev_free, |
84 | }; | 84 | }; |
85 | 85 | ||
@@ -115,14 +115,14 @@ int snd_ak4117_create(snd_card_t *card, ak4117_read_t *read, ak4117_write_t *wri | |||
115 | return err < 0 ? err : -EIO; | 115 | return err < 0 ? err : -EIO; |
116 | } | 116 | } |
117 | 117 | ||
118 | void snd_ak4117_reg_write(ak4117_t *chip, unsigned char reg, unsigned char mask, unsigned char val) | 118 | void snd_ak4117_reg_write(struct ak4117 *chip, unsigned char reg, unsigned char mask, unsigned char val) |
119 | { | 119 | { |
120 | if (reg >= 5) | 120 | if (reg >= 5) |
121 | return; | 121 | return; |
122 | reg_write(chip, reg, (chip->regmap[reg] & ~mask) | val); | 122 | reg_write(chip, reg, (chip->regmap[reg] & ~mask) | val); |
123 | } | 123 | } |
124 | 124 | ||
125 | void snd_ak4117_reinit(ak4117_t *chip) | 125 | void snd_ak4117_reinit(struct ak4117 *chip) |
126 | { | 126 | { |
127 | unsigned char old = chip->regmap[AK4117_REG_PWRDN], reg; | 127 | unsigned char old = chip->regmap[AK4117_REG_PWRDN], reg; |
128 | 128 | ||
@@ -157,8 +157,8 @@ static unsigned int external_rate(unsigned char rcs1) | |||
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | static int snd_ak4117_in_error_info(snd_kcontrol_t *kcontrol, | 160 | static int snd_ak4117_in_error_info(struct snd_kcontrol *kcontrol, |
161 | snd_ctl_elem_info_t *uinfo) | 161 | struct snd_ctl_elem_info *uinfo) |
162 | { | 162 | { |
163 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 163 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
164 | uinfo->count = 1; | 164 | uinfo->count = 1; |
@@ -167,10 +167,10 @@ static int snd_ak4117_in_error_info(snd_kcontrol_t *kcontrol, | |||
167 | return 0; | 167 | return 0; |
168 | } | 168 | } |
169 | 169 | ||
170 | static int snd_ak4117_in_error_get(snd_kcontrol_t *kcontrol, | 170 | static int snd_ak4117_in_error_get(struct snd_kcontrol *kcontrol, |
171 | snd_ctl_elem_value_t *ucontrol) | 171 | struct snd_ctl_elem_value *ucontrol) |
172 | { | 172 | { |
173 | ak4117_t *chip = snd_kcontrol_chip(kcontrol); | 173 | struct ak4117 *chip = snd_kcontrol_chip(kcontrol); |
174 | long *ptr; | 174 | long *ptr; |
175 | 175 | ||
176 | spin_lock_irq(&chip->lock); | 176 | spin_lock_irq(&chip->lock); |
@@ -181,8 +181,8 @@ static int snd_ak4117_in_error_get(snd_kcontrol_t *kcontrol, | |||
181 | return 0; | 181 | return 0; |
182 | } | 182 | } |
183 | 183 | ||
184 | static int snd_ak4117_in_bit_info(snd_kcontrol_t *kcontrol, | 184 | static int snd_ak4117_in_bit_info(struct snd_kcontrol *kcontrol, |
185 | snd_ctl_elem_info_t *uinfo) | 185 | struct snd_ctl_elem_info *uinfo) |
186 | { | 186 | { |
187 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 187 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
188 | uinfo->count = 1; | 188 | uinfo->count = 1; |
@@ -191,10 +191,10 @@ static int snd_ak4117_in_bit_info(snd_kcontrol_t *kcontrol, | |||
191 | return 0; | 191 | return 0; |
192 | } | 192 | } |
193 | 193 | ||
194 | static int snd_ak4117_in_bit_get(snd_kcontrol_t *kcontrol, | 194 | static int snd_ak4117_in_bit_get(struct snd_kcontrol *kcontrol, |
195 | snd_ctl_elem_value_t *ucontrol) | 195 | struct snd_ctl_elem_value *ucontrol) |
196 | { | 196 | { |
197 | ak4117_t *chip = snd_kcontrol_chip(kcontrol); | 197 | struct ak4117 *chip = snd_kcontrol_chip(kcontrol); |
198 | unsigned char reg = kcontrol->private_value & 0xff; | 198 | unsigned char reg = kcontrol->private_value & 0xff; |
199 | unsigned char bit = (kcontrol->private_value >> 8) & 0xff; | 199 | unsigned char bit = (kcontrol->private_value >> 8) & 0xff; |
200 | unsigned char inv = (kcontrol->private_value >> 31) & 1; | 200 | unsigned char inv = (kcontrol->private_value >> 31) & 1; |
@@ -203,8 +203,8 @@ static int snd_ak4117_in_bit_get(snd_kcontrol_t *kcontrol, | |||
203 | return 0; | 203 | return 0; |
204 | } | 204 | } |
205 | 205 | ||
206 | static int snd_ak4117_rx_info(snd_kcontrol_t *kcontrol, | 206 | static int snd_ak4117_rx_info(struct snd_kcontrol *kcontrol, |
207 | snd_ctl_elem_info_t *uinfo) | 207 | struct snd_ctl_elem_info *uinfo) |
208 | { | 208 | { |
209 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 209 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
210 | uinfo->count = 1; | 210 | uinfo->count = 1; |
@@ -213,19 +213,19 @@ static int snd_ak4117_rx_info(snd_kcontrol_t *kcontrol, | |||
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
215 | 215 | ||
216 | static int snd_ak4117_rx_get(snd_kcontrol_t *kcontrol, | 216 | static int snd_ak4117_rx_get(struct snd_kcontrol *kcontrol, |
217 | snd_ctl_elem_value_t *ucontrol) | 217 | struct snd_ctl_elem_value *ucontrol) |
218 | { | 218 | { |
219 | ak4117_t *chip = snd_kcontrol_chip(kcontrol); | 219 | struct ak4117 *chip = snd_kcontrol_chip(kcontrol); |
220 | 220 | ||
221 | ucontrol->value.integer.value[0] = (chip->regmap[AK4117_REG_IO] & AK4117_IPS) ? 1 : 0; | 221 | ucontrol->value.integer.value[0] = (chip->regmap[AK4117_REG_IO] & AK4117_IPS) ? 1 : 0; |
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | 224 | ||
225 | static int snd_ak4117_rx_put(snd_kcontrol_t *kcontrol, | 225 | static int snd_ak4117_rx_put(struct snd_kcontrol *kcontrol, |
226 | snd_ctl_elem_value_t *ucontrol) | 226 | struct snd_ctl_elem_value *ucontrol) |
227 | { | 227 | { |
228 | ak4117_t *chip = snd_kcontrol_chip(kcontrol); | 228 | struct ak4117 *chip = snd_kcontrol_chip(kcontrol); |
229 | int change; | 229 | int change; |
230 | u8 old_val; | 230 | u8 old_val; |
231 | 231 | ||
@@ -238,8 +238,8 @@ static int snd_ak4117_rx_put(snd_kcontrol_t *kcontrol, | |||
238 | return change; | 238 | return change; |
239 | } | 239 | } |
240 | 240 | ||
241 | static int snd_ak4117_rate_info(snd_kcontrol_t *kcontrol, | 241 | static int snd_ak4117_rate_info(struct snd_kcontrol *kcontrol, |
242 | snd_ctl_elem_info_t *uinfo) | 242 | struct snd_ctl_elem_info *uinfo) |
243 | { | 243 | { |
244 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 244 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
245 | uinfo->count = 1; | 245 | uinfo->count = 1; |
@@ -248,26 +248,26 @@ static int snd_ak4117_rate_info(snd_kcontrol_t *kcontrol, | |||
248 | return 0; | 248 | return 0; |
249 | } | 249 | } |
250 | 250 | ||
251 | static int snd_ak4117_rate_get(snd_kcontrol_t *kcontrol, | 251 | static int snd_ak4117_rate_get(struct snd_kcontrol *kcontrol, |
252 | snd_ctl_elem_value_t *ucontrol) | 252 | struct snd_ctl_elem_value *ucontrol) |
253 | { | 253 | { |
254 | ak4117_t *chip = snd_kcontrol_chip(kcontrol); | 254 | struct ak4117 *chip = snd_kcontrol_chip(kcontrol); |
255 | 255 | ||
256 | ucontrol->value.integer.value[0] = external_rate(reg_read(chip, AK4117_REG_RCS1)); | 256 | ucontrol->value.integer.value[0] = external_rate(reg_read(chip, AK4117_REG_RCS1)); |
257 | return 0; | 257 | return 0; |
258 | } | 258 | } |
259 | 259 | ||
260 | static int snd_ak4117_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 260 | static int snd_ak4117_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
261 | { | 261 | { |
262 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 262 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
263 | uinfo->count = 1; | 263 | uinfo->count = 1; |
264 | return 0; | 264 | return 0; |
265 | } | 265 | } |
266 | 266 | ||
267 | static int snd_ak4117_spdif_get(snd_kcontrol_t * kcontrol, | 267 | static int snd_ak4117_spdif_get(struct snd_kcontrol *kcontrol, |
268 | snd_ctl_elem_value_t * ucontrol) | 268 | struct snd_ctl_elem_value *ucontrol) |
269 | { | 269 | { |
270 | ak4117_t *chip = snd_kcontrol_chip(kcontrol); | 270 | struct ak4117 *chip = snd_kcontrol_chip(kcontrol); |
271 | unsigned i; | 271 | unsigned i; |
272 | 272 | ||
273 | for (i = 0; i < AK4117_REG_RXCSB_SIZE; i++) | 273 | for (i = 0; i < AK4117_REG_RXCSB_SIZE; i++) |
@@ -275,21 +275,21 @@ static int snd_ak4117_spdif_get(snd_kcontrol_t * kcontrol, | |||
275 | return 0; | 275 | return 0; |
276 | } | 276 | } |
277 | 277 | ||
278 | static int snd_ak4117_spdif_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 278 | static int snd_ak4117_spdif_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
279 | { | 279 | { |
280 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; | 280 | uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
281 | uinfo->count = 1; | 281 | uinfo->count = 1; |
282 | return 0; | 282 | return 0; |
283 | } | 283 | } |
284 | 284 | ||
285 | static int snd_ak4117_spdif_mask_get(snd_kcontrol_t * kcontrol, | 285 | static int snd_ak4117_spdif_mask_get(struct snd_kcontrol *kcontrol, |
286 | snd_ctl_elem_value_t * ucontrol) | 286 | struct snd_ctl_elem_value *ucontrol) |
287 | { | 287 | { |
288 | memset(ucontrol->value.iec958.status, 0xff, AK4117_REG_RXCSB_SIZE); | 288 | memset(ucontrol->value.iec958.status, 0xff, AK4117_REG_RXCSB_SIZE); |
289 | return 0; | 289 | return 0; |
290 | } | 290 | } |
291 | 291 | ||
292 | static int snd_ak4117_spdif_pinfo(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 292 | static int snd_ak4117_spdif_pinfo(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
293 | { | 293 | { |
294 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 294 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
295 | uinfo->value.integer.min = 0; | 295 | uinfo->value.integer.min = 0; |
@@ -298,10 +298,10 @@ static int snd_ak4117_spdif_pinfo(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
298 | return 0; | 298 | return 0; |
299 | } | 299 | } |
300 | 300 | ||
301 | static int snd_ak4117_spdif_pget(snd_kcontrol_t * kcontrol, | 301 | static int snd_ak4117_spdif_pget(struct snd_kcontrol *kcontrol, |
302 | snd_ctl_elem_value_t * ucontrol) | 302 | struct snd_ctl_elem_value *ucontrol) |
303 | { | 303 | { |
304 | ak4117_t *chip = snd_kcontrol_chip(kcontrol); | 304 | struct ak4117 *chip = snd_kcontrol_chip(kcontrol); |
305 | unsigned short tmp; | 305 | unsigned short tmp; |
306 | 306 | ||
307 | ucontrol->value.integer.value[0] = 0xf8f2; | 307 | ucontrol->value.integer.value[0] = 0xf8f2; |
@@ -313,17 +313,17 @@ static int snd_ak4117_spdif_pget(snd_kcontrol_t * kcontrol, | |||
313 | return 0; | 313 | return 0; |
314 | } | 314 | } |
315 | 315 | ||
316 | static int snd_ak4117_spdif_qinfo(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 316 | static int snd_ak4117_spdif_qinfo(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) |
317 | { | 317 | { |
318 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; | 318 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; |
319 | uinfo->count = AK4117_REG_QSUB_SIZE; | 319 | uinfo->count = AK4117_REG_QSUB_SIZE; |
320 | return 0; | 320 | return 0; |
321 | } | 321 | } |
322 | 322 | ||
323 | static int snd_ak4117_spdif_qget(snd_kcontrol_t * kcontrol, | 323 | static int snd_ak4117_spdif_qget(struct snd_kcontrol *kcontrol, |
324 | snd_ctl_elem_value_t * ucontrol) | 324 | struct snd_ctl_elem_value *ucontrol) |
325 | { | 325 | { |
326 | ak4117_t *chip = snd_kcontrol_chip(kcontrol); | 326 | struct ak4117 *chip = snd_kcontrol_chip(kcontrol); |
327 | unsigned i; | 327 | unsigned i; |
328 | 328 | ||
329 | for (i = 0; i < AK4117_REG_QSUB_SIZE; i++) | 329 | for (i = 0; i < AK4117_REG_QSUB_SIZE; i++) |
@@ -332,14 +332,14 @@ static int snd_ak4117_spdif_qget(snd_kcontrol_t * kcontrol, | |||
332 | } | 332 | } |
333 | 333 | ||
334 | /* Don't forget to change AK4117_CONTROLS define!!! */ | 334 | /* Don't forget to change AK4117_CONTROLS define!!! */ |
335 | static snd_kcontrol_new_t snd_ak4117_iec958_controls[] = { | 335 | static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = { |
336 | { | 336 | { |
337 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 337 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
338 | .name = "IEC958 Parity Errors", | 338 | .name = "IEC958 Parity Errors", |
339 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 339 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
340 | .info = snd_ak4117_in_error_info, | 340 | .info = snd_ak4117_in_error_info, |
341 | .get = snd_ak4117_in_error_get, | 341 | .get = snd_ak4117_in_error_get, |
342 | .private_value = offsetof(ak4117_t, parity_errors), | 342 | .private_value = offsetof(struct ak4117, parity_errors), |
343 | }, | 343 | }, |
344 | { | 344 | { |
345 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 345 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -347,7 +347,7 @@ static snd_kcontrol_new_t snd_ak4117_iec958_controls[] = { | |||
347 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 347 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
348 | .info = snd_ak4117_in_error_info, | 348 | .info = snd_ak4117_in_error_info, |
349 | .get = snd_ak4117_in_error_get, | 349 | .get = snd_ak4117_in_error_get, |
350 | .private_value = offsetof(ak4117_t, v_bit_errors), | 350 | .private_value = offsetof(struct ak4117, v_bit_errors), |
351 | }, | 351 | }, |
352 | { | 352 | { |
353 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 353 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -355,7 +355,7 @@ static snd_kcontrol_new_t snd_ak4117_iec958_controls[] = { | |||
355 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 355 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
356 | .info = snd_ak4117_in_error_info, | 356 | .info = snd_ak4117_in_error_info, |
357 | .get = snd_ak4117_in_error_get, | 357 | .get = snd_ak4117_in_error_get, |
358 | .private_value = offsetof(ak4117_t, ccrc_errors), | 358 | .private_value = offsetof(struct ak4117, ccrc_errors), |
359 | }, | 359 | }, |
360 | { | 360 | { |
361 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 361 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -363,7 +363,7 @@ static snd_kcontrol_new_t snd_ak4117_iec958_controls[] = { | |||
363 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | 363 | .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, |
364 | .info = snd_ak4117_in_error_info, | 364 | .info = snd_ak4117_in_error_info, |
365 | .get = snd_ak4117_in_error_get, | 365 | .get = snd_ak4117_in_error_get, |
366 | .private_value = offsetof(ak4117_t, qcrc_errors), | 366 | .private_value = offsetof(struct ak4117, qcrc_errors), |
367 | }, | 367 | }, |
368 | { | 368 | { |
369 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 369 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
@@ -434,9 +434,9 @@ static snd_kcontrol_new_t snd_ak4117_iec958_controls[] = { | |||
434 | } | 434 | } |
435 | }; | 435 | }; |
436 | 436 | ||
437 | int snd_ak4117_build(ak4117_t *ak4117, snd_pcm_substream_t *cap_substream) | 437 | int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *cap_substream) |
438 | { | 438 | { |
439 | snd_kcontrol_t *kctl; | 439 | struct snd_kcontrol *kctl; |
440 | unsigned int idx; | 440 | unsigned int idx; |
441 | int err; | 441 | int err; |
442 | 442 | ||
@@ -456,7 +456,7 @@ int snd_ak4117_build(ak4117_t *ak4117, snd_pcm_substream_t *cap_substream) | |||
456 | return 0; | 456 | return 0; |
457 | } | 457 | } |
458 | 458 | ||
459 | int snd_ak4117_external_rate(ak4117_t *ak4117) | 459 | int snd_ak4117_external_rate(struct ak4117 *ak4117) |
460 | { | 460 | { |
461 | unsigned char rcs1; | 461 | unsigned char rcs1; |
462 | 462 | ||
@@ -464,9 +464,9 @@ int snd_ak4117_external_rate(ak4117_t *ak4117) | |||
464 | return external_rate(rcs1); | 464 | return external_rate(rcs1); |
465 | } | 465 | } |
466 | 466 | ||
467 | int snd_ak4117_check_rate_and_errors(ak4117_t *ak4117, unsigned int flags) | 467 | int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags) |
468 | { | 468 | { |
469 | snd_pcm_runtime_t *runtime = ak4117->substream ? ak4117->substream->runtime : NULL; | 469 | struct snd_pcm_runtime *runtime = ak4117->substream ? ak4117->substream->runtime : NULL; |
470 | unsigned long _flags; | 470 | unsigned long _flags; |
471 | int res = 0; | 471 | int res = 0; |
472 | unsigned char rcs0, rcs1, rcs2; | 472 | unsigned char rcs0, rcs1, rcs2; |
@@ -542,7 +542,7 @@ int snd_ak4117_check_rate_and_errors(ak4117_t *ak4117, unsigned int flags) | |||
542 | 542 | ||
543 | static void snd_ak4117_timer(unsigned long data) | 543 | static void snd_ak4117_timer(unsigned long data) |
544 | { | 544 | { |
545 | ak4117_t *chip = (ak4117_t *)data; | 545 | struct ak4117 *chip = (struct ak4117 *)data; |
546 | 546 | ||
547 | if (chip->init) | 547 | if (chip->init) |
548 | return; | 548 | return; |
diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c index db2b7274a9d6..045e32a311e0 100644 --- a/sound/i2c/other/ak4xxx-adda.c +++ b/sound/i2c/other/ak4xxx-adda.c | |||
@@ -34,7 +34,7 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de>"); | |||
34 | MODULE_DESCRIPTION("Routines for control of AK452x / AK43xx AD/DA converters"); | 34 | MODULE_DESCRIPTION("Routines for control of AK452x / AK43xx AD/DA converters"); |
35 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |
36 | 36 | ||
37 | void snd_akm4xxx_write(akm4xxx_t *ak, int chip, unsigned char reg, unsigned char val) | 37 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val) |
38 | { | 38 | { |
39 | ak->ops.lock(ak, chip); | 39 | ak->ops.lock(ak, chip); |
40 | ak->ops.write(ak, chip, reg, val); | 40 | ak->ops.write(ak, chip, reg, val); |
@@ -58,7 +58,7 @@ void snd_akm4xxx_write(akm4xxx_t *ak, int chip, unsigned char reg, unsigned char | |||
58 | * | 58 | * |
59 | * assert the reset operation and restores the register values to the chips. | 59 | * assert the reset operation and restores the register values to the chips. |
60 | */ | 60 | */ |
61 | void snd_akm4xxx_reset(akm4xxx_t *ak, int state) | 61 | void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state) |
62 | { | 62 | { |
63 | unsigned int chip; | 63 | unsigned int chip; |
64 | unsigned char reg; | 64 | unsigned char reg; |
@@ -109,7 +109,7 @@ void snd_akm4xxx_reset(akm4xxx_t *ak, int state) | |||
109 | /* | 109 | /* |
110 | * initialize all the ak4xxx chips | 110 | * initialize all the ak4xxx chips |
111 | */ | 111 | */ |
112 | void snd_akm4xxx_init(akm4xxx_t *ak) | 112 | void snd_akm4xxx_init(struct snd_akm4xxx *ak) |
113 | { | 113 | { |
114 | static unsigned char inits_ak4524[] = { | 114 | static unsigned char inits_ak4524[] = { |
115 | 0x00, 0x07, /* 0: all power up */ | 115 | 0x00, 0x07, /* 0: all power up */ |
@@ -247,7 +247,8 @@ void snd_akm4xxx_init(akm4xxx_t *ak) | |||
247 | #define AK_COMPOSE(chip,addr,shift,mask) (((chip) << 8) | (addr) | ((shift) << 16) | ((mask) << 24)) | 247 | #define AK_COMPOSE(chip,addr,shift,mask) (((chip) << 8) | (addr) | ((shift) << 16) | ((mask) << 24)) |
248 | #define AK_INVERT (1<<23) | 248 | #define AK_INVERT (1<<23) |
249 | 249 | ||
250 | static int snd_akm4xxx_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 250 | static int snd_akm4xxx_volume_info(struct snd_kcontrol *kcontrol, |
251 | struct snd_ctl_elem_info *uinfo) | ||
251 | { | 252 | { |
252 | unsigned int mask = AK_GET_MASK(kcontrol->private_value); | 253 | unsigned int mask = AK_GET_MASK(kcontrol->private_value); |
253 | 254 | ||
@@ -258,9 +259,10 @@ static int snd_akm4xxx_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
258 | return 0; | 259 | return 0; |
259 | } | 260 | } |
260 | 261 | ||
261 | static int snd_akm4xxx_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 262 | static int snd_akm4xxx_volume_get(struct snd_kcontrol *kcontrol, |
263 | struct snd_ctl_elem_value *ucontrol) | ||
262 | { | 264 | { |
263 | akm4xxx_t *ak = snd_kcontrol_chip(kcontrol); | 265 | struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol); |
264 | int chip = AK_GET_CHIP(kcontrol->private_value); | 266 | int chip = AK_GET_CHIP(kcontrol->private_value); |
265 | int addr = AK_GET_ADDR(kcontrol->private_value); | 267 | int addr = AK_GET_ADDR(kcontrol->private_value); |
266 | int invert = AK_GET_INVERT(kcontrol->private_value); | 268 | int invert = AK_GET_INVERT(kcontrol->private_value); |
@@ -271,9 +273,10 @@ static int snd_akm4xxx_volume_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
271 | return 0; | 273 | return 0; |
272 | } | 274 | } |
273 | 275 | ||
274 | static int snd_akm4xxx_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 276 | static int snd_akm4xxx_volume_put(struct snd_kcontrol *kcontrol, |
277 | struct snd_ctl_elem_value *ucontrol) | ||
275 | { | 278 | { |
276 | akm4xxx_t *ak = snd_kcontrol_chip(kcontrol); | 279 | struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol); |
277 | int chip = AK_GET_CHIP(kcontrol->private_value); | 280 | int chip = AK_GET_CHIP(kcontrol->private_value); |
278 | int addr = AK_GET_ADDR(kcontrol->private_value); | 281 | int addr = AK_GET_ADDR(kcontrol->private_value); |
279 | int invert = AK_GET_INVERT(kcontrol->private_value); | 282 | int invert = AK_GET_INVERT(kcontrol->private_value); |
@@ -289,7 +292,8 @@ static int snd_akm4xxx_volume_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t | |||
289 | return change; | 292 | return change; |
290 | } | 293 | } |
291 | 294 | ||
292 | static int snd_akm4xxx_ipga_gain_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 295 | static int snd_akm4xxx_ipga_gain_info(struct snd_kcontrol *kcontrol, |
296 | struct snd_ctl_elem_info *uinfo) | ||
293 | { | 297 | { |
294 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 298 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
295 | uinfo->count = 1; | 299 | uinfo->count = 1; |
@@ -298,18 +302,20 @@ static int snd_akm4xxx_ipga_gain_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_inf | |||
298 | return 0; | 302 | return 0; |
299 | } | 303 | } |
300 | 304 | ||
301 | static int snd_akm4xxx_ipga_gain_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 305 | static int snd_akm4xxx_ipga_gain_get(struct snd_kcontrol *kcontrol, |
306 | struct snd_ctl_elem_value *ucontrol) | ||
302 | { | 307 | { |
303 | akm4xxx_t *ak = snd_kcontrol_chip(kcontrol); | 308 | struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol); |
304 | int chip = AK_GET_CHIP(kcontrol->private_value); | 309 | int chip = AK_GET_CHIP(kcontrol->private_value); |
305 | int addr = AK_GET_ADDR(kcontrol->private_value); | 310 | int addr = AK_GET_ADDR(kcontrol->private_value); |
306 | ucontrol->value.integer.value[0] = snd_akm4xxx_get_ipga(ak, chip, addr) & 0x7f; | 311 | ucontrol->value.integer.value[0] = snd_akm4xxx_get_ipga(ak, chip, addr) & 0x7f; |
307 | return 0; | 312 | return 0; |
308 | } | 313 | } |
309 | 314 | ||
310 | static int snd_akm4xxx_ipga_gain_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 315 | static int snd_akm4xxx_ipga_gain_put(struct snd_kcontrol *kcontrol, |
316 | struct snd_ctl_elem_value *ucontrol) | ||
311 | { | 317 | { |
312 | akm4xxx_t *ak = snd_kcontrol_chip(kcontrol); | 318 | struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol); |
313 | int chip = AK_GET_CHIP(kcontrol->private_value); | 319 | int chip = AK_GET_CHIP(kcontrol->private_value); |
314 | int addr = AK_GET_ADDR(kcontrol->private_value); | 320 | int addr = AK_GET_ADDR(kcontrol->private_value); |
315 | unsigned char nval = (ucontrol->value.integer.value[0] % 37) | 0x80; | 321 | unsigned char nval = (ucontrol->value.integer.value[0] % 37) | 0x80; |
@@ -319,7 +325,8 @@ static int snd_akm4xxx_ipga_gain_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_valu | |||
319 | return change; | 325 | return change; |
320 | } | 326 | } |
321 | 327 | ||
322 | static int snd_akm4xxx_deemphasis_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 328 | static int snd_akm4xxx_deemphasis_info(struct snd_kcontrol *kcontrol, |
329 | struct snd_ctl_elem_info *uinfo) | ||
323 | { | 330 | { |
324 | static char *texts[4] = { | 331 | static char *texts[4] = { |
325 | "44.1kHz", "Off", "48kHz", "32kHz", | 332 | "44.1kHz", "Off", "48kHz", "32kHz", |
@@ -333,9 +340,10 @@ static int snd_akm4xxx_deemphasis_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_in | |||
333 | return 0; | 340 | return 0; |
334 | } | 341 | } |
335 | 342 | ||
336 | static int snd_akm4xxx_deemphasis_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) | 343 | static int snd_akm4xxx_deemphasis_get(struct snd_kcontrol *kcontrol, |
344 | struct snd_ctl_elem_value *ucontrol) | ||
337 | { | 345 | { |
338 | akm4xxx_t *ak = snd_kcontrol_chip(kcontrol); | 346 | struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol); |
339 | int chip = AK_GET_CHIP(kcontrol->private_value); | 347 | int chip = AK_GET_CHIP(kcontrol->private_value); |
340 | int addr = AK_GET_ADDR(kcontrol->private_value); | 348 | int addr = AK_GET_ADDR(kcontrol->private_value); |
341 | int shift = AK_GET_SHIFT(kcontrol->private_value); | 349 | int shift = AK_GET_SHIFT(kcontrol->private_value); |
@@ -343,9 +351,10 @@ static int snd_akm4xxx_deemphasis_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_va | |||
343 | return 0; | 351 | return 0; |
344 | } | 352 | } |
345 | 353 | ||
346 | static int snd_akm4xxx_deemphasis_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) | 354 | static int snd_akm4xxx_deemphasis_put(struct snd_kcontrol *kcontrol, |
355 | struct snd_ctl_elem_value *ucontrol) | ||
347 | { | 356 | { |
348 | akm4xxx_t *ak = snd_kcontrol_chip(kcontrol); | 357 | struct snd_akm4xxx *ak = snd_kcontrol_chip(kcontrol); |
349 | int chip = AK_GET_CHIP(kcontrol->private_value); | 358 | int chip = AK_GET_CHIP(kcontrol->private_value); |
350 | int addr = AK_GET_ADDR(kcontrol->private_value); | 359 | int addr = AK_GET_ADDR(kcontrol->private_value); |
351 | int shift = AK_GET_SHIFT(kcontrol->private_value); | 360 | int shift = AK_GET_SHIFT(kcontrol->private_value); |
@@ -363,10 +372,10 @@ static int snd_akm4xxx_deemphasis_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_val | |||
363 | * build AK4xxx controls | 372 | * build AK4xxx controls |
364 | */ | 373 | */ |
365 | 374 | ||
366 | int snd_akm4xxx_build_controls(akm4xxx_t *ak) | 375 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak) |
367 | { | 376 | { |
368 | unsigned int idx, num_emphs; | 377 | unsigned int idx, num_emphs; |
369 | snd_kcontrol_t *ctl; | 378 | struct snd_kcontrol *ctl; |
370 | int err; | 379 | int err; |
371 | 380 | ||
372 | ctl = kmalloc(sizeof(*ctl), GFP_KERNEL); | 381 | ctl = kmalloc(sizeof(*ctl), GFP_KERNEL); |
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c index 0f05a2b9a370..4c2fd14c1056 100644 --- a/sound/i2c/other/tea575x-tuner.c +++ b/sound/i2c/other/tea575x-tuner.c | |||
@@ -58,7 +58,7 @@ MODULE_LICENSE("GPL"); | |||
58 | * lowlevel part | 58 | * lowlevel part |
59 | */ | 59 | */ |
60 | 60 | ||
61 | static void snd_tea575x_set_freq(tea575x_t *tea) | 61 | static void snd_tea575x_set_freq(struct snd_tea575x *tea) |
62 | { | 62 | { |
63 | unsigned long freq; | 63 | unsigned long freq; |
64 | 64 | ||
@@ -89,7 +89,7 @@ static int snd_tea575x_ioctl(struct inode *inode, struct file *file, | |||
89 | unsigned int cmd, unsigned long data) | 89 | unsigned int cmd, unsigned long data) |
90 | { | 90 | { |
91 | struct video_device *dev = video_devdata(file); | 91 | struct video_device *dev = video_devdata(file); |
92 | tea575x_t *tea = video_get_drvdata(dev); | 92 | struct snd_tea575x *tea = video_get_drvdata(dev); |
93 | void __user *arg = (void __user *)data; | 93 | void __user *arg = (void __user *)data; |
94 | 94 | ||
95 | switch(cmd) { | 95 | switch(cmd) { |
@@ -175,7 +175,7 @@ static void snd_tea575x_release(struct video_device *vfd) | |||
175 | /* | 175 | /* |
176 | * initialize all the tea575x chips | 176 | * initialize all the tea575x chips |
177 | */ | 177 | */ |
178 | void snd_tea575x_init(tea575x_t *tea) | 178 | void snd_tea575x_init(struct snd_tea575x *tea) |
179 | { | 179 | { |
180 | unsigned int val; | 180 | unsigned int val; |
181 | 181 | ||
@@ -209,7 +209,7 @@ void snd_tea575x_init(tea575x_t *tea) | |||
209 | snd_tea575x_set_freq(tea); | 209 | snd_tea575x_set_freq(tea); |
210 | } | 210 | } |
211 | 211 | ||
212 | void snd_tea575x_exit(tea575x_t *tea) | 212 | void snd_tea575x_exit(struct snd_tea575x *tea) |
213 | { | 213 | { |
214 | if (tea->vd_registered) { | 214 | if (tea->vd_registered) { |
215 | video_unregister_device(&tea->vd); | 215 | video_unregister_device(&tea->vd); |
diff --git a/sound/i2c/tea6330t.c b/sound/i2c/tea6330t.c index 7bd4948c2a3b..ae5b1e3a68ce 100644 --- a/sound/i2c/tea6330t.c +++ b/sound/i2c/tea6330t.c | |||
@@ -44,18 +44,20 @@ MODULE_LICENSE("GPL"); | |||
44 | #define TEA6330T_GMU 0x80 /* mute control, general mute */ | 44 | #define TEA6330T_GMU 0x80 /* mute control, general mute */ |
45 | #define TEA6330T_EQN 0x40 /* equalizer switchover (0=equalizer-on) */ | 45 | #define TEA6330T_EQN 0x40 /* equalizer switchover (0=equalizer-on) */ |
46 | 46 | ||
47 | typedef struct { | 47 | |
48 | snd_i2c_device_t *device; | 48 | struct tea6330t { |
49 | snd_i2c_bus_t *bus; | 49 | struct snd_i2c_device *device; |
50 | struct snd_i2c_bus *bus; | ||
50 | int equalizer; | 51 | int equalizer; |
51 | int fader; | 52 | int fader; |
52 | unsigned char regs[8]; | 53 | unsigned char regs[8]; |
53 | unsigned char mleft, mright; | 54 | unsigned char mleft, mright; |
54 | unsigned char bass, treble; | 55 | unsigned char bass, treble; |
55 | unsigned char max_bass, max_treble; | 56 | unsigned char max_bass, max_treble; |
56 | } tea6330t_t; | 57 | }; |
58 | |||
57 | 59 | ||
58 | int snd_tea6330t_detect(snd_i2c_bus_t *bus, int equalizer) | 60 | int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer) |
59 | { | 61 | { |
60 | int res; | 62 | int res; |
61 | 63 | ||
@@ -66,7 +68,7 @@ int snd_tea6330t_detect(snd_i2c_bus_t *bus, int equalizer) | |||
66 | } | 68 | } |
67 | 69 | ||
68 | #if 0 | 70 | #if 0 |
69 | static void snd_tea6330t_set(tea6330t_t *tea, | 71 | static void snd_tea6330t_set(struct tea6330t *tea, |
70 | unsigned char addr, unsigned char value) | 72 | unsigned char addr, unsigned char value) |
71 | { | 73 | { |
72 | #if 0 | 74 | #if 0 |
@@ -81,7 +83,8 @@ static void snd_tea6330t_set(tea6330t_t *tea, | |||
81 | .info = snd_tea6330t_info_master_volume, \ | 83 | .info = snd_tea6330t_info_master_volume, \ |
82 | .get = snd_tea6330t_get_master_volume, .put = snd_tea6330t_put_master_volume } | 84 | .get = snd_tea6330t_get_master_volume, .put = snd_tea6330t_put_master_volume } |
83 | 85 | ||
84 | static int snd_tea6330t_info_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 86 | static int snd_tea6330t_info_master_volume(struct snd_kcontrol *kcontrol, |
87 | struct snd_ctl_elem_info *uinfo) | ||
85 | { | 88 | { |
86 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 89 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
87 | uinfo->count = 2; | 90 | uinfo->count = 2; |
@@ -90,9 +93,10 @@ static int snd_tea6330t_info_master_volume(snd_kcontrol_t *kcontrol, snd_ctl_ele | |||
90 | return 0; | 93 | return 0; |
91 | } | 94 | } |
92 | 95 | ||
93 | static int snd_tea6330t_get_master_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 96 | static int snd_tea6330t_get_master_volume(struct snd_kcontrol *kcontrol, |
97 | struct snd_ctl_elem_value *ucontrol) | ||
94 | { | 98 | { |
95 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 99 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
96 | 100 | ||
97 | snd_i2c_lock(tea->bus); | 101 | snd_i2c_lock(tea->bus); |
98 | ucontrol->value.integer.value[0] = tea->mleft - 0x14; | 102 | ucontrol->value.integer.value[0] = tea->mleft - 0x14; |
@@ -101,9 +105,10 @@ static int snd_tea6330t_get_master_volume(snd_kcontrol_t * kcontrol, snd_ctl_ele | |||
101 | return 0; | 105 | return 0; |
102 | } | 106 | } |
103 | 107 | ||
104 | static int snd_tea6330t_put_master_volume(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 108 | static int snd_tea6330t_put_master_volume(struct snd_kcontrol *kcontrol, |
109 | struct snd_ctl_elem_value *ucontrol) | ||
105 | { | 110 | { |
106 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 111 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
107 | int change, count, err; | 112 | int change, count, err; |
108 | unsigned char bytes[3]; | 113 | unsigned char bytes[3]; |
109 | unsigned char val1, val2; | 114 | unsigned char val1, val2; |
@@ -137,7 +142,8 @@ static int snd_tea6330t_put_master_volume(snd_kcontrol_t * kcontrol, snd_ctl_ele | |||
137 | .info = snd_tea6330t_info_master_switch, \ | 142 | .info = snd_tea6330t_info_master_switch, \ |
138 | .get = snd_tea6330t_get_master_switch, .put = snd_tea6330t_put_master_switch } | 143 | .get = snd_tea6330t_get_master_switch, .put = snd_tea6330t_put_master_switch } |
139 | 144 | ||
140 | static int snd_tea6330t_info_master_switch(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 145 | static int snd_tea6330t_info_master_switch(struct snd_kcontrol *kcontrol, |
146 | struct snd_ctl_elem_info *uinfo) | ||
141 | { | 147 | { |
142 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 148 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
143 | uinfo->count = 2; | 149 | uinfo->count = 2; |
@@ -146,9 +152,10 @@ static int snd_tea6330t_info_master_switch(snd_kcontrol_t *kcontrol, snd_ctl_ele | |||
146 | return 0; | 152 | return 0; |
147 | } | 153 | } |
148 | 154 | ||
149 | static int snd_tea6330t_get_master_switch(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 155 | static int snd_tea6330t_get_master_switch(struct snd_kcontrol *kcontrol, |
156 | struct snd_ctl_elem_value *ucontrol) | ||
150 | { | 157 | { |
151 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 158 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
152 | 159 | ||
153 | snd_i2c_lock(tea->bus); | 160 | snd_i2c_lock(tea->bus); |
154 | ucontrol->value.integer.value[0] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] == 0 ? 0 : 1; | 161 | ucontrol->value.integer.value[0] = tea->regs[TEA6330T_SADDR_VOLUME_LEFT] == 0 ? 0 : 1; |
@@ -157,9 +164,10 @@ static int snd_tea6330t_get_master_switch(snd_kcontrol_t * kcontrol, snd_ctl_ele | |||
157 | return 0; | 164 | return 0; |
158 | } | 165 | } |
159 | 166 | ||
160 | static int snd_tea6330t_put_master_switch(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 167 | static int snd_tea6330t_put_master_switch(struct snd_kcontrol *kcontrol, |
168 | struct snd_ctl_elem_value *ucontrol) | ||
161 | { | 169 | { |
162 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 170 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
163 | int change, err; | 171 | int change, err; |
164 | unsigned char bytes[3]; | 172 | unsigned char bytes[3]; |
165 | unsigned char oval1, oval2, val1, val2; | 173 | unsigned char oval1, oval2, val1, val2; |
@@ -186,9 +194,10 @@ static int snd_tea6330t_put_master_switch(snd_kcontrol_t * kcontrol, snd_ctl_ele | |||
186 | .info = snd_tea6330t_info_bass, \ | 194 | .info = snd_tea6330t_info_bass, \ |
187 | .get = snd_tea6330t_get_bass, .put = snd_tea6330t_put_bass } | 195 | .get = snd_tea6330t_get_bass, .put = snd_tea6330t_put_bass } |
188 | 196 | ||
189 | static int snd_tea6330t_info_bass(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 197 | static int snd_tea6330t_info_bass(struct snd_kcontrol *kcontrol, |
198 | struct snd_ctl_elem_info *uinfo) | ||
190 | { | 199 | { |
191 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 200 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
192 | 201 | ||
193 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 202 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
194 | uinfo->count = 1; | 203 | uinfo->count = 1; |
@@ -197,17 +206,19 @@ static int snd_tea6330t_info_bass(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t | |||
197 | return 0; | 206 | return 0; |
198 | } | 207 | } |
199 | 208 | ||
200 | static int snd_tea6330t_get_bass(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 209 | static int snd_tea6330t_get_bass(struct snd_kcontrol *kcontrol, |
210 | struct snd_ctl_elem_value *ucontrol) | ||
201 | { | 211 | { |
202 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 212 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
203 | 213 | ||
204 | ucontrol->value.integer.value[0] = tea->bass; | 214 | ucontrol->value.integer.value[0] = tea->bass; |
205 | return 0; | 215 | return 0; |
206 | } | 216 | } |
207 | 217 | ||
208 | static int snd_tea6330t_put_bass(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 218 | static int snd_tea6330t_put_bass(struct snd_kcontrol *kcontrol, |
219 | struct snd_ctl_elem_value *ucontrol) | ||
209 | { | 220 | { |
210 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 221 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
211 | int change, err; | 222 | int change, err; |
212 | unsigned char bytes[2]; | 223 | unsigned char bytes[2]; |
213 | unsigned char val1; | 224 | unsigned char val1; |
@@ -230,9 +241,10 @@ static int snd_tea6330t_put_bass(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
230 | .info = snd_tea6330t_info_treble, \ | 241 | .info = snd_tea6330t_info_treble, \ |
231 | .get = snd_tea6330t_get_treble, .put = snd_tea6330t_put_treble } | 242 | .get = snd_tea6330t_get_treble, .put = snd_tea6330t_put_treble } |
232 | 243 | ||
233 | static int snd_tea6330t_info_treble(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) | 244 | static int snd_tea6330t_info_treble(struct snd_kcontrol *kcontrol, |
245 | struct snd_ctl_elem_info *uinfo) | ||
234 | { | 246 | { |
235 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 247 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
236 | 248 | ||
237 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 249 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
238 | uinfo->count = 1; | 250 | uinfo->count = 1; |
@@ -241,17 +253,19 @@ static int snd_tea6330t_info_treble(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_ | |||
241 | return 0; | 253 | return 0; |
242 | } | 254 | } |
243 | 255 | ||
244 | static int snd_tea6330t_get_treble(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 256 | static int snd_tea6330t_get_treble(struct snd_kcontrol *kcontrol, |
257 | struct snd_ctl_elem_value *ucontrol) | ||
245 | { | 258 | { |
246 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 259 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
247 | 260 | ||
248 | ucontrol->value.integer.value[0] = tea->treble; | 261 | ucontrol->value.integer.value[0] = tea->treble; |
249 | return 0; | 262 | return 0; |
250 | } | 263 | } |
251 | 264 | ||
252 | static int snd_tea6330t_put_treble(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 265 | static int snd_tea6330t_put_treble(struct snd_kcontrol *kcontrol, |
266 | struct snd_ctl_elem_value *ucontrol) | ||
253 | { | 267 | { |
254 | tea6330t_t *tea = snd_kcontrol_chip(kcontrol); | 268 | struct tea6330t *tea = snd_kcontrol_chip(kcontrol); |
255 | int change, err; | 269 | int change, err; |
256 | unsigned char bytes[2]; | 270 | unsigned char bytes[2]; |
257 | unsigned char val1; | 271 | unsigned char val1; |
@@ -269,25 +283,25 @@ static int snd_tea6330t_put_treble(snd_kcontrol_t * kcontrol, snd_ctl_elem_value | |||
269 | return change; | 283 | return change; |
270 | } | 284 | } |
271 | 285 | ||
272 | static snd_kcontrol_new_t snd_tea6330t_controls[] = { | 286 | static struct snd_kcontrol_new snd_tea6330t_controls[] = { |
273 | TEA6330T_MASTER_SWITCH("Master Playback Switch", 0), | 287 | TEA6330T_MASTER_SWITCH("Master Playback Switch", 0), |
274 | TEA6330T_MASTER_VOLUME("Master Playback Volume", 0), | 288 | TEA6330T_MASTER_VOLUME("Master Playback Volume", 0), |
275 | TEA6330T_BASS("Tone Control - Bass", 0), | 289 | TEA6330T_BASS("Tone Control - Bass", 0), |
276 | TEA6330T_TREBLE("Tone Control - Treble", 0) | 290 | TEA6330T_TREBLE("Tone Control - Treble", 0) |
277 | }; | 291 | }; |
278 | 292 | ||
279 | static void snd_tea6330_free(snd_i2c_device_t *device) | 293 | static void snd_tea6330_free(struct snd_i2c_device *device) |
280 | { | 294 | { |
281 | kfree(device->private_data); | 295 | kfree(device->private_data); |
282 | } | 296 | } |
283 | 297 | ||
284 | int snd_tea6330t_update_mixer(snd_card_t * card, | 298 | int snd_tea6330t_update_mixer(struct snd_card *card, |
285 | snd_i2c_bus_t *bus, | 299 | struct snd_i2c_bus *bus, |
286 | int equalizer, int fader) | 300 | int equalizer, int fader) |
287 | { | 301 | { |
288 | snd_i2c_device_t *device; | 302 | struct snd_i2c_device *device; |
289 | tea6330t_t *tea; | 303 | struct tea6330t *tea; |
290 | snd_kcontrol_new_t *knew; | 304 | struct snd_kcontrol_new *knew; |
291 | unsigned int idx; | 305 | unsigned int idx; |
292 | int err = -ENOMEM; | 306 | int err = -ENOMEM; |
293 | u8 default_treble, default_bass; | 307 | u8 default_treble, default_bass; |