All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Šerif Rami" <ramiserifpersia@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
	"Šerif Rami" <ramiserifpersia@gmail.com>
Subject: [PATCH v6 6/7] ALSA: usb-audio: us144mkii: Add deep sleep command
Date: Thu, 14 Aug 2025 19:22:21 +0200	[thread overview]
Message-ID: <20250814172222.9448-7-ramiserifpersia@gmail.com> (raw)
In-Reply-To: <20250814172222.9448-1-ramiserifpersia@gmail.com>

Add a deep sleep vendor command to be sent during suspend, allowing the
device to enter a lower power state.

Signed-off-by: Šerif Rami <ramiserifpersia@gmail.com>
---
 sound/usb/usx2y/us144mkii.c | 7 +++++++
 sound/usb/usx2y/us144mkii.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/sound/usb/usx2y/us144mkii.c b/sound/usb/usx2y/us144mkii.c
index 55d6e002a310..da53c1908c4a 100644
--- a/sound/usb/usx2y/us144mkii.c
+++ b/sound/usb/usx2y/us144mkii.c
@@ -322,6 +322,13 @@ static int tascam_suspend(struct usb_interface *intf, pm_message_t message)
 	usb_kill_anchored_urbs(&tascam->midi_in_anchor);
 	usb_kill_anchored_urbs(&tascam->midi_out_anchor);
 
+	dev_info(&intf->dev, "sending deep sleep command\n");
+	int err = usb_control_msg(tascam->dev, usb_sndctrlpipe(tascam->dev, 0),
+				  VENDOR_REQ_DEEP_SLEEP, RT_H2D_VENDOR_DEV,
+				  0x0000, 0x0000, NULL, 0, USB_CTRL_TIMEOUT_MS);
+	if (err < 0)
+		dev_err(&intf->dev, "deep sleep command failed: %d\n", err);
+
 	return 0;
 }
 
diff --git a/sound/usb/usx2y/us144mkii.h b/sound/usb/usx2y/us144mkii.h
index c740a0b5a0ea..ecc4c2fed9e6 100644
--- a/sound/usb/usx2y/us144mkii.h
+++ b/sound/usb/usx2y/us144mkii.h
@@ -46,6 +46,7 @@ enum uac_control_selector {
 
 enum tascam_vendor_request {
 	VENDOR_REQ_REGISTER_WRITE = 0x41,
+	VENDOR_REQ_DEEP_SLEEP = 0x44,
 	VENDOR_REQ_MODE_CONTROL = 0x49,
 };
 
-- 
2.39.5


  parent reply	other threads:[~2025-08-14 17:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 17:22 [PATCH v6 0/7] ALSA: usb-audio: Add driver for TASCAM US-144MKII Šerif Rami
2025-08-14 17:22 ` [PATCH v6 1/7] ALSA: usb-audio: Add initial " Šerif Rami
2025-08-30  9:55   ` Markus Elfring
2025-08-14 17:22 ` [PATCH v6 2/7] ALSA: usb-audio: us144mkii: Add PCM core infrastructure Šerif Rami
2025-08-14 17:22 ` [PATCH v6 3/7] ALSA: usb-audio: us144mkii: Implement audio playback and feedback Šerif Rami
2025-08-14 17:22 ` [PATCH v6 4/7] ALSA: usb-audio: us144mkii: Implement audio capture and decoding Šerif Rami
2025-08-14 17:22 ` [PATCH v6 5/7] ALSA: usb-audio: us144mkii: Add MIDI support and mixer controls Šerif Rami
2025-08-14 17:22 ` Šerif Rami [this message]
2025-08-14 17:22 ` [PATCH v6 7/7] ALSA: usb-audio: Add infrastructure for TASCAM US-144MKII Šerif Rami
2025-08-15 15:55 ` [PATCH v6 0/7] ALSA: usb-audio: Add driver " Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250814172222.9448-7-ramiserifpersia@gmail.com \
    --to=ramiserifpersia@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.