Skip to content

Commit 6ef1f08

Browse files
geoffreybennetttiwai
authored andcommitted
ALSA: scarlett2: Fix Scarlett 4th Gen 4i4 low-voltage detection
The value currently being read to determine the low-voltage state is actually the front panel state. Fix the code to use the correct offset for the low-voltage state. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Fixes: d7cfa2f ("ALSA: scarlett2: Add power status control") Signed-off-by: Takashi Iwai <tiwai@suse.de> Message-ID: <d97b7d87f43b0e54f37e1552394be2f3ae182704.1710047969.git.g@b4.vu>
1 parent 9fc91a6 commit 6ef1f08

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

sound/usb/mixer_scarlett2.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ enum {
415415
SCARLETT2_CONFIG_INPUT_SELECT_SWITCH,
416416
SCARLETT2_CONFIG_INPUT_LINK_SWITCH,
417417
SCARLETT2_CONFIG_POWER_EXT,
418-
SCARLETT2_CONFIG_POWER_STATUS,
418+
SCARLETT2_CONFIG_POWER_LOW,
419419
SCARLETT2_CONFIG_PCM_INPUT_SWITCH,
420420
SCARLETT2_CONFIG_DIRECT_MONITOR_GAIN,
421421
SCARLETT2_CONFIG_COUNT
@@ -723,8 +723,8 @@ static const struct scarlett2_config_set scarlett2_config_set_gen4_4i4 = {
723723
[SCARLETT2_CONFIG_POWER_EXT] = {
724724
.offset = 0x168 },
725725

726-
[SCARLETT2_CONFIG_POWER_STATUS] = {
727-
.offset = 0x66 }
726+
[SCARLETT2_CONFIG_POWER_LOW] = {
727+
.offset = 0x16d }
728728
}
729729
};
730730

@@ -6294,8 +6294,7 @@ static int scarlett2_update_power_status(struct usb_mixer_interface *mixer)
62946294
{
62956295
struct scarlett2_data *private = mixer->private_data;
62966296
int err;
6297-
u8 power_ext;
6298-
u8 power_status;
6297+
u8 power_ext, power_low;
62996298

63006299
private->power_status_updated = 0;
63016300

@@ -6304,12 +6303,12 @@ static int scarlett2_update_power_status(struct usb_mixer_interface *mixer)
63046303
if (err < 0)
63056304
return err;
63066305

6307-
err = scarlett2_usb_get_config(mixer, SCARLETT2_CONFIG_POWER_STATUS,
6308-
1, &power_status);
6306+
err = scarlett2_usb_get_config(mixer, SCARLETT2_CONFIG_POWER_LOW,
6307+
1, &power_low);
63096308
if (err < 0)
63106309
return err;
63116310

6312-
if (power_status > 1)
6311+
if (power_low)
63136312
private->power_status = SCARLETT2_POWER_STATUS_FAIL;
63146313
else if (power_ext)
63156314
private->power_status = SCARLETT2_POWER_STATUS_EXT;

0 commit comments

Comments
 (0)