--- Begin Message ---
- To: Wesley Cheng <quic_wcheng@xxxxxxxxxxx>, srinivas.kandagatla@xxxxxxxxxx, mathias.nyman@xxxxxxxxx, perex@xxxxxxxx, broonie@xxxxxxxxxx, lgirdwood@xxxxxxxxx, krzysztof.kozlowski+dt@xxxxxxxxxx, agross@xxxxxxxxxx, Thinh.Nguyen@xxxxxxxxxxxx, bgoswami@xxxxxxxxxxx, andersson@xxxxxxxxxx, robh+dt@xxxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, tiwai@xxxxxxxx
- Subject: Re: [PATCH v3 27/28] sound: usb: card: Allow for rediscovery of connected USB SND devices
- From: Oliver Neukum <oneukum@xxxxxxxx>
- Date: Thu, 9 Mar 2023 12:32:48 +0100
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, alsa-devel@xxxxxxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx, linux-usb@xxxxxxxxxxxxxxx, quic_jackp@xxxxxxxxxxx, quic_plai@xxxxxxxxxxx
- In-reply-to: <20230308235751.495-28-quic_wcheng@quicinc.com>
- References: <20230308235751.495-1-quic_wcheng@quicinc.com> <20230308235751.495-28-quic_wcheng@quicinc.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0
On 09.03.23 00:57, Wesley Cheng wrote:
+/*
+ * in case the platform driver was not ready at the time of USB SND
+ * device connect, expose an API to discover all connected USB devices
+ * so it can populate any dependent resources/structures.
+ */
+void snd_usb_rediscover_devices(void)
+{
+ int i;
+
+ mutex_lock(®ister_mutex);
+ for (i = 0; i < SNDRV_CARDS; i++) {
+ if (usb_chip[i])
+ if (platform_ops && platform_ops->connect_cb)
Really check this every time?
Regards
Oliver
--- End Message ---