diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-06-27 11:49:12 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-06-28 13:31:09 -0400 |
commit | cb9d24e4349013628259b5fee97e692173731b07 (patch) | |
tree | d936251fa32f7cbf853a78a3df72cd06a099f24e /include/sound/ak4xxx-adda.h | |
parent | cf1756e9cd7c1d160fe72944af51d87e96285a32 (diff) |
[ALSA] ak4xxx-adda - Code clean-up
Fix spaces, fold lines to fit 80 columns in ak4xxx-adda driver codes.
Split a long reset function to each codec routine just for better
readability.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'include/sound/ak4xxx-adda.h')
-rw-r--r-- | include/sound/ak4xxx-adda.h | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h index acf8cc1292e0..3d9888492026 100644 --- a/include/sound/ak4xxx-adda.h +++ b/include/sound/ak4xxx-adda.h | |||
@@ -32,8 +32,8 @@ struct snd_akm4xxx; | |||
32 | struct snd_ak4xxx_ops { | 32 | struct snd_ak4xxx_ops { |
33 | void (*lock)(struct snd_akm4xxx *ak, int chip); | 33 | void (*lock)(struct snd_akm4xxx *ak, int chip); |
34 | void (*unlock)(struct snd_akm4xxx *ak, int chip); | 34 | void (*unlock)(struct snd_akm4xxx *ak, int chip); |
35 | void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val); | 35 | void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, |
36 | // unsigned char (*read)(struct snd_akm4xxx *ak, int chip, unsigned char reg); | 36 | unsigned char val); |
37 | void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); | 37 | void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); |
38 | }; | 38 | }; |
39 | 39 | ||
@@ -41,31 +41,40 @@ struct snd_ak4xxx_ops { | |||
41 | 41 | ||
42 | struct snd_akm4xxx { | 42 | struct snd_akm4xxx { |
43 | struct snd_card *card; | 43 | struct snd_card *card; |
44 | unsigned int num_adcs; /* AK4524 or AK4528 ADCs */ | 44 | unsigned int num_adcs; /* AK4524 or AK4528 ADCs */ |
45 | unsigned int num_dacs; /* AK4524 or AK4528 DACs */ | 45 | unsigned int num_dacs; /* AK4524 or AK4528 DACs */ |
46 | unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */ | 46 | unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */ |
47 | unsigned char ipga_gain[AK4XXX_MAX_CHIPS][2]; /* saved register image for IPGA (AK4528) */ | 47 | unsigned char ipga_gain[AK4XXX_MAX_CHIPS][2]; /* saved register image |
48 | * for IPGA (AK4528) | ||
49 | */ | ||
48 | unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */ | 50 | unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */ |
49 | void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */ | 51 | void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */ |
50 | /* template should fill the following fields */ | 52 | /* template should fill the following fields */ |
51 | unsigned int idx_offset; /* control index offset */ | 53 | unsigned int idx_offset; /* control index offset */ |
52 | enum { | 54 | enum { |
53 | SND_AK4524, SND_AK4528, SND_AK4529, | 55 | SND_AK4524, SND_AK4528, SND_AK4529, |
54 | SND_AK4355, SND_AK4358, SND_AK4381 | 56 | SND_AK4355, SND_AK4358, SND_AK4381 |
55 | } type; | 57 | } type; |
56 | unsigned int *num_stereo; /* array of combined counts for the mixer */ | 58 | unsigned int *num_stereo; /* array of combined counts |
57 | char **channel_names; /* array of mixer channel names */ | 59 | * for the mixer |
60 | */ | ||
61 | char **channel_names; /* array of mixer channel names */ | ||
58 | struct snd_ak4xxx_ops ops; | 62 | struct snd_ak4xxx_ops ops; |
59 | }; | 63 | }; |
60 | 64 | ||
61 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val); | 65 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, |
66 | unsigned char val); | ||
62 | void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state); | 67 | void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state); |
63 | void snd_akm4xxx_init(struct snd_akm4xxx *ak); | 68 | void snd_akm4xxx_init(struct snd_akm4xxx *ak); |
64 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak); | 69 | int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak); |
65 | 70 | ||
66 | #define snd_akm4xxx_get(ak,chip,reg) (ak)->images[(chip) * 16 + (reg)] | 71 | #define snd_akm4xxx_get(ak,chip,reg) \ |
67 | #define snd_akm4xxx_set(ak,chip,reg,val) ((ak)->images[(chip) * 16 + (reg)] = (val)) | 72 | (ak)->images[(chip) * 16 + (reg)] |
68 | #define snd_akm4xxx_get_ipga(ak,chip,reg) (ak)->ipga_gain[chip][(reg)-4] | 73 | #define snd_akm4xxx_set(ak,chip,reg,val) \ |
69 | #define snd_akm4xxx_set_ipga(ak,chip,reg,val) ((ak)->ipga_gain[chip][(reg)-4] = (val)) | 74 | ((ak)->images[(chip) * 16 + (reg)] = (val)) |
75 | #define snd_akm4xxx_get_ipga(ak,chip,reg) \ | ||
76 | (ak)->ipga_gain[chip][(reg)-4] | ||
77 | #define snd_akm4xxx_set_ipga(ak,chip,reg,val) \ | ||
78 | ((ak)->ipga_gain[chip][(reg)-4] = (val)) | ||
70 | 79 | ||
71 | #endif /* __SOUND_AK4XXX_ADDA_H */ | 80 | #endif /* __SOUND_AK4XXX_ADDA_H */ |