| 1 |
struct snd_ac97 { |
| 2 |
// snip |
| 3 |
unsigned int id; |
| 4 |
// snip |
| 5 |
}; |
| 6 |
|
| 7 |
int snd_ac97_valid_reg(struct snd_ac97 *ac97, unsigned short reg) { |
| 8 |
|
| 9 |
switch (ac97->id) { |
| 10 |
case 0x53544d02: |
| 11 |
if (reg == 0x22 || reg == 0x7a) |
| 12 |
return 1; |
| 13 |
__attribute__((__fallthrough__)); |
| 14 |
case 0x414b4d00: |
| 15 |
return 0; |
| 16 |
} |
| 17 |
return 1; |
| 18 |
} |
| 19 |
|
| 20 |
int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg) { |
| 21 |
if (ac97->id == 0x414c4781) |
| 22 |
{ |
| 23 |
if (!snd_ac97_valid_reg(ac97, reg)) |
| 24 |
return -22; |
| 25 |
} |
| 26 |
return 0; |
| 27 |
} |