···22932293 notice the need.22942294skip_validation22952295 Skip unit descriptor validation (default: no).22962296- The option is used to ignores the validation errors with the hexdump22962296+ The option is used to ignore the validation errors with the hexdump22972297 of the unit descriptor instead of a driver probe error, so that we22982298 can check its details.22992299quirk_flags
···10631063/**10641064 * struct sdca_entity_hide - information specific to HIDE Entities10651065 * @hid: HID device structure10661066- * @hidtx_ids: HIDTx Report ID10671066 * @num_hidtx_ids: number of HIDTx Report ID10681068- * @hidrx_ids: HIDRx Report ID10691067 * @num_hidrx_ids: number of HIDRx Report ID10701070- * @hide_reside_function_num: indicating which Audio Function Numbers within this Device10711071- * @max_delay: the maximum time in microseconds allowed for the Device to change the ownership from Device to Host10721072- * @af_number_list: which Audio Function Numbers within this Device are sending/receiving the messages in this HIDE10731073- * @hid_desc: HID descriptor for the HIDE Entity10681068+ * @hidtx_ids: HIDTx Report ID10691069+ * @hidrx_ids: HIDRx Report ID10701070+ * @af_number_list: which Audio Function Numbers within this Device are10711071+ * sending/receiving the messages in this HIDE10721072+ * @hide_reside_function_num: indicating which Audio Function Numbers10731073+ * within this Device10741074+ * @max_delay: the maximum time in microseconds allowed for the Device10751075+ * to change the ownership from Device to Host10741076 * @hid_report_desc: HID Report Descriptor for the HIDE Entity10771077+ * @hid_desc: HID descriptor for the HIDE Entity10751078 */10761079struct sdca_entity_hide {10771080 struct hid_device *hid;10781081 unsigned int *hidtx_ids;10791079- int num_hidtx_ids;10801082 unsigned int *hidrx_ids;10831083+ int num_hidtx_ids;10811084 int num_hidrx_ids;10851085+ unsigned int af_number_list[SDCA_MAX_FUNCTION_COUNT];10821086 unsigned int hide_reside_function_num;10831087 unsigned int max_delay;10841084- unsigned int af_number_list[SDCA_MAX_FUNCTION_COUNT];10851085- struct hid_descriptor hid_desc;10861088 unsigned char *hid_report_desc;10891089+ struct hid_descriptor hid_desc;10871090};1088109110891092/**
···3333};3434EXPORT_SYMBOL_NS_GPL(tasdev_fct_efi_guid, "SND_HDA_SCODEC_TAS2781");35353636+/*3737+ * The order of calibrated-data writing function is a bit different from the3838+ * order in UEFI. Here is the conversion to match the order of calibrated-data3939+ * writing function.4040+ */4141+static void cali_cnv(unsigned char *data, unsigned int base, int offset)4242+{4343+ struct cali_reg reg_data;4444+4545+ memcpy(®_data, &data[base], sizeof(reg_data));4646+ /* the data order has to be swapped between r0_low_reg and inv0_reg */4747+ swap(reg_data.r0_low_reg, reg_data.invr0_reg);4848+4949+ cpu_to_be32_array((__force __be32 *)(data + offset + 1),5050+ (u32 *)®_data, TASDEV_CALIB_N);5151+}5252+3653static void tas2781_apply_calib(struct tasdevice_priv *p)3754{3855 struct calidata *cali_data = &p->cali_data;···120103121104 data[l] = k;122105 oft++;123123- for (i = 0; i < TASDEV_CALIB_N * 4; i++)124124- data[l + i + 1] = data[4 * oft + i];106106+ cali_cnv(data, 4 * oft, l);125107 k++;126108 }127109 }···146130147131 for (j = p->ndev - 1; j >= 0; j--) {148132 l = j * (cali_data->cali_dat_sz_per_dev + 1);149149- for (i = TASDEV_CALIB_N * 4; i > 0 ; i--)150150- data[l + i] = data[p->index * 5 + i];151151- data[l+i] = j;133133+ cali_cnv(data, cali_data->cali_dat_sz_per_dev * j, l);134134+ data[l] = j;152135 }153136 }154137···192177 unsigned char *data;193178 efi_status_t status;194179 int i;180180+181181+ if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) {182182+ dev_err(p->dev, "%s: NO EFI FOUND!\n", __func__);183183+ return -EINVAL;184184+ }195185196186 if (hda->catlog_id < LENOVO)197187 efi_guid = tasdev_fct_efi_guid[hda->catlog_id];
+5
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
···317317 unsigned int attr;318318 int ret, i, j, k;319319320320+ if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) {321321+ dev_err(p->dev, "%s: NO EFI FOUND!\n", __func__);322322+ return -EINVAL;323323+ }324324+320325 cd->cali_dat_sz_per_dev = TAS2563_CAL_DATA_SIZE * TASDEV_CALIB_N;321326322327 /* extra byte for each device is the device number */
+2
sound/hda/core/intel-dsp-config.c
···650650 int ret;651651652652 handle = ACPI_HANDLE(&pci->dev);653653+ if (!handle)654654+ return -ENODEV;653655654656 ret = sdw_intel_acpi_scan(handle, &info);655657 if (ret < 0)
···1890189018911891 rt712_sdca_va_io_init(rt712);18921892 } else {18931893- if (!rt712->dmic_function_found) {18941894- dev_err(&slave->dev, "%s RT712 VB detected but no SMART_MIC function exposed in ACPI\n",18931893+ if (!rt712->dmic_function_found)18941894+ dev_warn(&slave->dev, "%s RT712 VB detected but no SMART_MIC function exposed in ACPI\n",18951895 __func__);18961896- goto suspend;18971897- }1898189618991897 /* multilanes and DMIC are supported by rt712vb */19001898 prop->lane_control_support = true;
···216216 /* SSP 0 and SSP 2 are used for HDMI IN */217217 SOF_HDMI_PLAYBACK_PRESENT),218218 },219219+ {220220+ .name = "ptl_lt6911_hdmi_ssp",221221+ .driver_data = (kernel_ulong_t)(SOF_SSP_MASK_HDMI_CAPTURE(0x5) |222222+ /* SSP 0 and SSP 2 are used for HDMI IN */223223+ SOF_HDMI_PLAYBACK_PRESENT),224224+ },219225 { }220226};221227MODULE_DEVICE_TABLE(platform, board_ids);
···9090{9191 struct fwnode_handle *function_node = acpi_fwnode_handle(adev);9292 struct sdca_device_data *sdca_data = data;9393+ struct sdw_slave *slave = container_of(sdca_data, struct sdw_slave, sdca_data);9394 struct device *dev = &adev->dev;9495 struct fwnode_handle *control5; /* used to identify function type */9596 const char *function_name;···138137 return ret;139138 }140139141141- ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type);142142- if (ret < 0) {143143- dev_err(dev, "SDCA version %#x invalid function type %d\n",144144- sdca_data->interface_revision, function_type);145145- return ret;140140+ if (!sdca_device_quirk_match(slave, SDCA_QUIRKS_SKIP_FUNC_TYPE_PATCHING)) {141141+ ret = patch_sdca_function_type(sdca_data->interface_revision, &function_type);142142+ if (ret < 0) {143143+ dev_err(dev, "SDCA version %#x invalid function type %d\n",144144+ sdca_data->interface_revision, function_type);145145+ return ret;146146+ }146147 }147148148149 function_name = get_sdca_function_name(function_type);
+1-1
sound/soc/sdca/sdca_interrupts.c
···155155 SDCA_CTL_SELECTED_MODE_NAME);156156157157 if (!name)158158- return -ENOMEM;158158+ return IRQ_NONE;159159160160 kctl = snd_soc_component_get_kcontrol(component, name);161161 if (!kctl) {
+1-1
sound/soc/sdca/sdca_regmap.c
···196196197197 control = function_find_control(function, reg);198198 if (!control)199199- return false;199199+ return -EINVAL;200200201201 return clamp_val(control->nbits / BITS_PER_BYTE, sizeof(u8), sizeof(u32));202202}
+2-2
sound/soc/sof/imx/imx-common.c
···316316 }317317318318 sdev->bar[blk_type] = devm_ioremap_resource(sdev->dev, res);319319- if (!sdev->bar[blk_type])319319+ if (IS_ERR(sdev->bar[blk_type]))320320 return dev_err_probe(sdev->dev,321321- -ENOMEM,321321+ PTR_ERR(sdev->bar[blk_type]),322322 "failed to ioremap %s region\n",323323 chip_info->memory[i].name);324324 }
+1-1
sound/soc/sof/intel/hda-stream.c
···890890891891 if (num_capture >= SOF_HDA_CAPTURE_STREAMS) {892892 dev_err(sdev->dev, "error: too many capture streams %d\n",893893- num_playback);893893+ num_capture);894894 return -EINVAL;895895 }896896
+4-5
sound/usb/midi.c
···15111511{15121512 int i;1513151315141514+ if (!umidi->disconnected)15151515+ snd_usbmidi_disconnect(&umidi->list);15161516+15141517 for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {15151518 struct snd_usb_midi_endpoint *ep = &umidi->endpoints[i];15161516- if (ep->out)15171517- snd_usbmidi_out_endpoint_delete(ep->out);15181518- if (ep->in)15191519- snd_usbmidi_in_endpoint_delete(ep->in);15191519+ kfree(ep->out);15201520 }15211521 mutex_destroy(&umidi->mutex);15221522- timer_shutdown_sync(&umidi->error_timer);15231522 kfree(umidi);15241523}15251524
+23-3
sound/usb/mixer_s1810c.c
···93939494#define SC1810C_CTL_LINE_SW 09595#define SC1810C_CTL_MUTE_SW 19696+#define SC1824C_CTL_MONO_SW 29697#define SC1810C_CTL_AB_SW 39798#define SC1810C_CTL_48V_SW 49899···124123#define SC1810C_STATE_48V_SW 58125124#define SC1810C_STATE_LINE_SW 59126125#define SC1810C_STATE_MUTE_SW 60126126+#define SC1824C_STATE_MONO_SW 61127127#define SC1810C_STATE_AB_SW 62128128129129struct s1810_mixer_state {···495493 .private_value = (SC1810C_STATE_MUTE_SW | SC1810C_CTL_MUTE_SW << 8)496494};497495496496+static const struct snd_kcontrol_new snd_s1824c_mono_sw = {497497+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,498498+ .name = "Mono Main Out Switch",499499+ .info = snd_ctl_boolean_mono_info,500500+ .get = snd_s1810c_switch_get,501501+ .put = snd_s1810c_switch_set,502502+ .private_value = (SC1824C_STATE_MONO_SW | SC1824C_CTL_MONO_SW << 8)503503+};504504+498505static const struct snd_kcontrol_new snd_s1810c_48v_sw = {499506 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,500507 .name = "48V Phantom Power On Mic Inputs Switch",···590579 if (ret < 0)591580 return ret;592581593593- ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);594594- if (ret < 0)595595- return ret;582582+ // The 1824c has a Mono Main switch instead of a583583+ // A/B select switch.584584+ if (mixer->chip->usb_id == USB_ID(0x194f, 0x010d)) {585585+ ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw);586586+ if (ret < 0)587587+ return ret;588588+ } else if (mixer->chip->usb_id == USB_ID(0x194f, 0x010c)) {589589+ ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw);590590+ if (ret < 0)591591+ return ret;592592+ }593593+596594 return ret;597595}
+48-44
sound/usb/qcom/qc_audio_offload.c
···538538 umap_size, iova, mapped_iova_size);539539}540540541541+static int uaudio_iommu_map_prot(bool dma_coherent)542542+{543543+ int prot = IOMMU_READ | IOMMU_WRITE;544544+545545+ if (dma_coherent)546546+ prot |= IOMMU_CACHE;547547+ return prot;548548+}549549+541550/**542542- * uaudio_iommu_map() - maps iommu memory for adsp551551+ * uaudio_iommu_map_pa() - maps iommu memory for adsp543552 * @mtype: ring type544553 * @dma_coherent: dma coherent545554 * @pa: physical address for ring/buffer546555 * @size: size of memory region547547- * @sgt: sg table for memory region548556 *549557 * Maps the XHCI related resources to a memory region that is assigned to be550558 * used by the adsp. This will be mapped to the domain, which is created by551559 * the ASoC USB backend driver.552560 *553561 */554554-static unsigned long uaudio_iommu_map(enum mem_type mtype, bool dma_coherent,555555- phys_addr_t pa, size_t size,556556- struct sg_table *sgt)562562+static unsigned long uaudio_iommu_map_pa(enum mem_type mtype, bool dma_coherent,563563+ phys_addr_t pa, size_t size)557564{558558- struct scatterlist *sg;559565 unsigned long iova = 0;560560- size_t total_len = 0;561561- unsigned long iova_sg;562562- phys_addr_t pa_sg;563566 bool map = true;564564- size_t sg_len;565565- int prot;566566- int ret;567567- int i;568568-569569- prot = IOMMU_READ | IOMMU_WRITE;570570-571571- if (dma_coherent)572572- prot |= IOMMU_CACHE;567567+ int prot = uaudio_iommu_map_prot(dma_coherent);573568574569 switch (mtype) {575570 case MEM_EVENT_RING:···578583 &uaudio_qdev->xfer_ring_iova_size,579584 &uaudio_qdev->xfer_ring_list, size);580585 break;581581- case MEM_XFER_BUF:582582- iova = uaudio_get_iova(&uaudio_qdev->curr_xfer_buf_iova,583583- &uaudio_qdev->xfer_buf_iova_size,584584- &uaudio_qdev->xfer_buf_list, size);585585- break;586586 default:587587 dev_err(uaudio_qdev->data->dev, "unknown mem type %d\n", mtype);588588 }589589590590 if (!iova || !map)591591- goto done;591591+ return 0;592592593593- if (!sgt)594594- goto skip_sgt_map;593593+ iommu_map(uaudio_qdev->data->domain, iova, pa, size, prot, GFP_KERNEL);594594+595595+ return iova;596596+}597597+598598+static unsigned long uaudio_iommu_map_xfer_buf(bool dma_coherent, size_t size,599599+ struct sg_table *sgt)600600+{601601+ struct scatterlist *sg;602602+ unsigned long iova = 0;603603+ size_t total_len = 0;604604+ unsigned long iova_sg;605605+ phys_addr_t pa_sg;606606+ size_t sg_len;607607+ int prot = uaudio_iommu_map_prot(dma_coherent);608608+ int ret;609609+ int i;610610+611611+ prot = IOMMU_READ | IOMMU_WRITE;612612+613613+ if (dma_coherent)614614+ prot |= IOMMU_CACHE;615615+616616+ iova = uaudio_get_iova(&uaudio_qdev->curr_xfer_buf_iova,617617+ &uaudio_qdev->xfer_buf_iova_size,618618+ &uaudio_qdev->xfer_buf_list, size);619619+ if (!iova)620620+ goto done;595621596622 iova_sg = iova;597623 for_each_sg(sgt->sgl, sg, sgt->nents, i) {···634618 uaudio_iommu_unmap(MEM_XFER_BUF, iova, size, total_len);635619 iova = 0;636620 }637637- return iova;638638-639639-skip_sgt_map:640640- iommu_map(uaudio_qdev->data->domain, iova, pa, size, prot, GFP_KERNEL);641641-642621done:643622 return iova;644623}···10231012 struct sg_table xfer_buf_sgt;10241013 dma_addr_t xfer_buf_dma;10251014 void *xfer_buf;10261026- phys_addr_t xfer_buf_pa;10271015 u32 len = xfer_buf_len;10281016 bool dma_coherent;10291017 dma_addr_t xfer_buf_dma_sysdev;···10531043 if (!xfer_buf)10541044 return -ENOMEM;1055104510561056- /* Remapping is not possible if xfer_buf is outside of linear map */10571057- xfer_buf_pa = virt_to_phys(xfer_buf);10581058- if (WARN_ON(!page_is_ram(PFN_DOWN(xfer_buf_pa)))) {10591059- ret = -ENXIO;10601060- goto unmap_sync;10611061- }10621046 dma_get_sgtable(subs->dev->bus->sysdev, &xfer_buf_sgt, xfer_buf,10631047 xfer_buf_dma, len);1064104810651049 /* map the physical buffer into sysdev as well */10661066- xfer_buf_dma_sysdev = uaudio_iommu_map(MEM_XFER_BUF, dma_coherent,10671067- xfer_buf_pa, len, &xfer_buf_sgt);10501050+ xfer_buf_dma_sysdev = uaudio_iommu_map_xfer_buf(dma_coherent,10511051+ len, &xfer_buf_sgt);10681052 if (!xfer_buf_dma_sysdev) {10691053 ret = -ENOMEM;10701054 goto unmap_sync;···11391135 sg_free_table(sgt);1140113611411137 /* data transfer ring */11421142- iova = uaudio_iommu_map(MEM_XFER_RING, dma_coherent, tr_pa,11431143- PAGE_SIZE, NULL);11381138+ iova = uaudio_iommu_map_pa(MEM_XFER_RING, dma_coherent, tr_pa,11391139+ PAGE_SIZE);11441140 if (!iova) {11451141 ret = -ENOMEM;11461142 goto clear_pa;···12031199 mem_info->dma = sg_dma_address(sgt->sgl);12041200 sg_free_table(sgt);1205120112061206- iova = uaudio_iommu_map(MEM_EVENT_RING, dma_coherent, er_pa,12071207- PAGE_SIZE, NULL);12021202+ iova = uaudio_iommu_map_pa(MEM_EVENT_RING, dma_coherent, er_pa,12031203+ PAGE_SIZE);12081204 if (!iova) {12091205 ret = -ENOMEM;12101206 goto clear_pa;
-3
sound/usb/quirks.c
···15991599 /* presonus studio 1810c: skip altsets incompatible with device_setup */16001600 if (chip->usb_id == USB_ID(0x194f, 0x010c))16011601 return s1810c_skip_setting_quirk(chip, iface, altno);16021602- /* presonus studio 1824c: skip altsets incompatible with device_setup */16031603- if (chip->usb_id == USB_ID(0x194f, 0x010d))16041604- return s1810c_skip_setting_quirk(chip, iface, altno);1605160216061603 return 0;16071604}