summaryrefslogtreecommitdiff
path: root/usb/snd_usb_audio_hook_impl_whi.c
blob: be9173f0c656476a8b3075ba9a8f39a8eafacc71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2022 Google Corp.
 *
 * Author:
 *  Howard.Yen <howardyen@google.com>
 */

#include <sound/pcm.h>
#include <uapi/sound/asound.h>
#include "usbaudio.h"
#include "card.h"

#include "aoc_usb.h"

 static int snd_usb_audio_vendor_connect(struct usb_interface *intf)
{
	struct usb_device *udev;
	struct xhci_hcd *xhci;

	if (!intf) {
		pr_err("%s: Invalid parameter\n", __func__);
		return -EINVAL;
	}

	udev = interface_to_usbdev(intf);
	xhci = get_xhci_hcd_by_udev(udev);

	xhci_set_offload_state(xhci, true);

	return 0;
}

static void snd_usb_audio_vendor_disconnect(struct usb_interface *intf)
{
	struct usb_device *udev;
	struct xhci_hcd *xhci;

	if (!intf) {
		pr_err("%s: Invalid parameter\n", __func__);
		return;
	}

	udev = interface_to_usbdev(intf);
	xhci = get_xhci_hcd_by_udev(udev);

	xhci_set_offload_state(xhci, false);

	return;
}

static int snd_usb_audio_vendor_set_interface(struct usb_device *udev,
					      struct usb_host_interface *alts,
					      int iface, int alt)
{
	return 0;
}

static int snd_usb_audio_vendor_set_rate(struct usb_interface *intf, int iface, int rate,
					 int alt)
{
	return 0;
}

static int snd_usb_audio_vendor_set_pcm_buf(struct usb_device *udev, int iface)
{
	return 0;
}

static int snd_usb_audio_vendor_set_pcm_intf(struct usb_interface *intf, int iface, int alt,
					     int direction)
{
	return 0;
}

static int snd_usb_audio_vendor_set_pcm_connection(struct usb_device *udev,
						   enum snd_vendor_pcm_open_close onoff,
						   int direction)
{
	return 0;
}

static int snd_usb_audio_vendor_set_pcm_binterval(struct audioformat *fp,
						  struct audioformat *found,
						  int *cur_attr, int *attr)
{
	return 0;
}

static int snd_usb_audio_vendor_usb_add_ctls(struct snd_usb_audio *chip)
{
	return 0;
}

static struct snd_usb_audio_vendor_ops snd_usb_ops = {
	.connect = snd_usb_audio_vendor_connect,
	.disconnect = snd_usb_audio_vendor_disconnect,
	.set_interface = snd_usb_audio_vendor_set_interface,
	.set_rate = snd_usb_audio_vendor_set_rate,
	.set_pcm_buf = snd_usb_audio_vendor_set_pcm_buf,
	.set_pcm_intf = snd_usb_audio_vendor_set_pcm_intf,
	.set_pcm_connection = snd_usb_audio_vendor_set_pcm_connection,
	.set_pcm_binterval = snd_usb_audio_vendor_set_pcm_binterval,
	.usb_add_ctls = snd_usb_audio_vendor_usb_add_ctls,
};

int snd_usb_audio_vendor_helper_init(void)
{
	return snd_vendor_set_ops(&snd_usb_ops);
}