mirror of https://gitee.com/openkylin/linux.git
ALSA: ice1712/wtm: fix coding style
before: total: 2 errors, 0 warnings, 20 lines checked total: 49 errors, 2 warnings, 518 lines checked after: total: 0 errors, 0 warnings, 20 lines checked total: 0 errors, 0 warnings, 518 lines checked Compile tested, size and code are equal. Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
1ce211a9db
commit
f14d8e9750
|
@ -25,7 +25,7 @@
|
|||
|
||||
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/init.h>
|
||||
|
@ -73,7 +73,7 @@ static inline unsigned char stac9460_2_get(struct snd_ice1712 *ice, int reg)
|
|||
#define stac9460_dac_mute_info snd_ctl_boolean_mono_info
|
||||
|
||||
static int stac9460_dac_mute_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
unsigned char val;
|
||||
|
@ -89,13 +89,13 @@ static int stac9460_dac_mute_get(struct snd_kcontrol *kcontrol,
|
|||
if (id < 6)
|
||||
val = stac9460_get(ice, idx);
|
||||
else
|
||||
val = stac9460_2_get(ice,idx - 6);
|
||||
val = stac9460_2_get(ice, idx - 6);
|
||||
ucontrol->value.integer.value[0] = (~val >> 7) & 0x1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
unsigned char new, old;
|
||||
|
@ -105,8 +105,8 @@ static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
|
|||
if (kcontrol->private_value) {
|
||||
idx = STAC946X_MASTER_VOLUME;
|
||||
old = stac9460_get(ice, idx);
|
||||
new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) |
|
||||
(old & ~0x80);
|
||||
new = (~ucontrol->value.integer.value[0] << 7 & 0x80) |
|
||||
(old & ~0x80);
|
||||
change = (new != old);
|
||||
if (change) {
|
||||
stac9460_put(ice, idx, new);
|
||||
|
@ -119,14 +119,14 @@ static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
|
|||
old = stac9460_get(ice, idx);
|
||||
else
|
||||
old = stac9460_2_get(ice, idx - 6);
|
||||
new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) |
|
||||
new = (~ucontrol->value.integer.value[0] << 7 & 0x80) |
|
||||
(old & ~0x80);
|
||||
change = (new != old);
|
||||
if (change) {
|
||||
if (id < 6)
|
||||
stac9460_put(ice, idx, new);
|
||||
stac9460_put(ice, idx, new);
|
||||
else
|
||||
stac9460_2_put(ice, idx - 6, new);
|
||||
stac9460_2_put(ice, idx - 6, new);
|
||||
}
|
||||
}
|
||||
return change;
|
||||
|
@ -136,7 +136,7 @@ static int stac9460_dac_mute_put(struct snd_kcontrol *kcontrol,
|
|||
* DAC volume attenuation mixer control
|
||||
*/
|
||||
static int stac9460_dac_vol_info(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_info *uinfo)
|
||||
struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
||||
uinfo->count = 1;
|
||||
|
@ -146,7 +146,7 @@ static int stac9460_dac_vol_info(struct snd_kcontrol *kcontrol,
|
|||
}
|
||||
|
||||
static int stac9460_dac_vol_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
int idx, id;
|
||||
|
@ -168,7 +168,7 @@ static int stac9460_dac_vol_get(struct snd_kcontrol *kcontrol,
|
|||
}
|
||||
|
||||
static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
int idx, id;
|
||||
|
@ -182,8 +182,8 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
|
|||
ovol = 0x7f - (tmp & 0x7f);
|
||||
change = (ovol != nvol);
|
||||
if (change) {
|
||||
stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
|
||||
stac9460_2_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
|
||||
stac9460_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
|
||||
stac9460_2_put(ice, idx, (0x7f - nvol) | (tmp & 0x80));
|
||||
}
|
||||
} else {
|
||||
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
|
||||
|
@ -198,10 +198,10 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
|
|||
if (change) {
|
||||
if (id < 6)
|
||||
stac9460_put(ice, idx, (0x7f - nvol) |
|
||||
(tmp & 0x80));
|
||||
(tmp & 0x80));
|
||||
else
|
||||
stac9460_2_put(ice, idx-6, (0x7f - nvol) |
|
||||
(tmp & 0x80));
|
||||
(tmp & 0x80));
|
||||
}
|
||||
}
|
||||
return change;
|
||||
|
@ -213,7 +213,7 @@ static int stac9460_dac_vol_put(struct snd_kcontrol *kcontrol,
|
|||
#define stac9460_adc_mute_info snd_ctl_boolean_stereo_info
|
||||
|
||||
static int stac9460_adc_mute_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
unsigned char val;
|
||||
|
@ -235,7 +235,7 @@ static int stac9460_adc_mute_get(struct snd_kcontrol *kcontrol,
|
|||
}
|
||||
|
||||
static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
unsigned char new, old;
|
||||
|
@ -248,7 +248,7 @@ static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol,
|
|||
reg = STAC946X_MIC_L_VOLUME + i;
|
||||
old = stac9460_get(ice, reg);
|
||||
new = (~ucontrol->value.integer.value[i]<<7&0x80) |
|
||||
(old&~0x80);
|
||||
(old&~0x80);
|
||||
change = (new != old);
|
||||
if (change)
|
||||
stac9460_put(ice, reg, new);
|
||||
|
@ -258,7 +258,7 @@ static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol,
|
|||
reg = STAC946X_MIC_L_VOLUME + i;
|
||||
old = stac9460_2_get(ice, reg);
|
||||
new = (~ucontrol->value.integer.value[i]<<7&0x80) |
|
||||
(old&~0x80);
|
||||
(old&~0x80);
|
||||
change = (new != old);
|
||||
if (change)
|
||||
stac9460_2_put(ice, reg, new);
|
||||
|
@ -271,7 +271,7 @@ static int stac9460_adc_mute_put(struct snd_kcontrol *kcontrol,
|
|||
*ADC gain mixer control
|
||||
*/
|
||||
static int stac9460_adc_vol_info(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_info *uinfo)
|
||||
struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
||||
uinfo->count = 2;
|
||||
|
@ -281,7 +281,7 @@ static int stac9460_adc_vol_info(struct snd_kcontrol *kcontrol,
|
|||
}
|
||||
|
||||
static int stac9460_adc_vol_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
int i, reg, id;
|
||||
|
@ -305,7 +305,7 @@ static int stac9460_adc_vol_get(struct snd_kcontrol *kcontrol,
|
|||
}
|
||||
|
||||
static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
int i, reg, id;
|
||||
|
@ -321,7 +321,7 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
|
|||
change = ((ovol & 0x0f) != nvol);
|
||||
if (change)
|
||||
stac9460_put(ice, reg, (0x0f - nvol) |
|
||||
(ovol & ~0x0f));
|
||||
(ovol & ~0x0f));
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 2; ++i) {
|
||||
|
@ -331,7 +331,7 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
|
|||
change = ((ovol & 0x0f) != nvol);
|
||||
if (change)
|
||||
stac9460_2_put(ice, reg, (0x0f - nvol) |
|
||||
(ovol & ~0x0f));
|
||||
(ovol & ~0x0f));
|
||||
}
|
||||
}
|
||||
return change;
|
||||
|
@ -344,7 +344,7 @@ static int stac9460_adc_vol_put(struct snd_kcontrol *kcontrol,
|
|||
#define stac9460_mic_sw_info snd_ctl_boolean_mono_info
|
||||
|
||||
static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
unsigned char val;
|
||||
|
@ -352,15 +352,15 @@ static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
|
|||
|
||||
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
|
||||
if (id == 0)
|
||||
val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
|
||||
val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
|
||||
else
|
||||
val = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
|
||||
val = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
|
||||
ucontrol->value.integer.value[0] = ~val>>7 & 0x1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
|
||||
unsigned char new, old;
|
||||
|
@ -368,16 +368,16 @@ static int stac9460_mic_sw_put(struct snd_kcontrol *kcontrol,
|
|||
|
||||
id = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
|
||||
if (id == 0)
|
||||
old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
|
||||
old = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
|
||||
else
|
||||
old = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
|
||||
new = (~ucontrol->value.integer.value[0]<< 7 & 0x80) | (old & ~0x80);
|
||||
old = stac9460_2_get(ice, STAC946X_GENERAL_PURPOSE);
|
||||
new = (~ucontrol->value.integer.value[0] << 7 & 0x80) | (old & ~0x80);
|
||||
change = (new != old);
|
||||
if (change) {
|
||||
if (id == 0)
|
||||
stac9460_put(ice, STAC946X_GENERAL_PURPOSE, new);
|
||||
stac9460_put(ice, STAC946X_GENERAL_PURPOSE, new);
|
||||
else
|
||||
stac9460_2_put(ice, STAC946X_GENERAL_PURPOSE, new);
|
||||
stac9460_2_put(ice, STAC946X_GENERAL_PURPOSE, new);
|
||||
}
|
||||
return change;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue