Message ID | 20230916001026.315-1-quic_wcheng@quicinc.com |
---|---|
Headers | show |
Series | Introduce QC USB SND audio offloading support | expand |
On 16.09.2023 02:10, Wesley Cheng wrote: > Create a USB BE component that will register a new USB port to the ASoC USB > framework. This will handle determination on if the requested audio > profile is supported by the USB device currently selected. > > Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> > --- [...] > + ret = of_parse_phandle_with_fixed_args(node, "iommus", 1, 0, &args); > + if (ret < 0) > + data->priv.sid = -1; > + else > + data->priv.sid = args.args[0] & SID_MASK; SID masking is done in the devicetree. Konrad
On 16.09.2023 02:10, Wesley Cheng wrote: > Add a dt-binding to describe the definition of enabling the Q6 USB backend > device for audio offloading. The node carries information, which is passed > along to the QC USB SND class driver counterpart. These parameters will be > utilized during QMI stream enable requests. > > Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> > --- > .../devicetree/bindings/sound/qcom,q6usb.yaml | 55 +++++++++++++++++++ > 1 file changed, 55 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6usb.yaml > > diff --git a/Documentation/devicetree/bindings/sound/qcom,q6usb.yaml b/Documentation/devicetree/bindings/sound/qcom,q6usb.yaml > new file mode 100644 > index 000000000000..51ff0b1ffa2d > --- /dev/null > +++ b/Documentation/devicetree/bindings/sound/qcom,q6usb.yaml > @@ -0,0 +1,55 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/sound/qcom,q6usb-dais.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Qualcomm ASoC DPCM USB backend DAI > + > +maintainers: > + - Wesley Cheng <quic_wcheng@quicinc.com> > + > +description: > + The USB port is a supported AFE path on the Q6 DSP. This ASoC DPCM > + backend DAI will communicate the required settings to initialize the > + XHCI host controller properly for enabling the offloaded audio stream. > + Parameters defined under this node will carry settings, which will be > + passed along during the QMI stream enable request and configuration of > + the XHCI host controller. > + > +allOf: > + - $ref: dai-common.yaml# > + > +properties: > + compatible: > + enum: > + - qcom,q6usb > + > + iommus: > + maxItems: 1 > + > + "#sound-dai-cells": > + const: 1 > + > + qcom,usb-audio-intr-num: > + description: > + Desired XHCI interrupter number to use. Depending on the audio DSP > + on the platform, it will operate on a specific XHCI interrupter. So is this the number of interrupters to be used or the index of a single interrupter? If the latter, then "num" is definitely way too ambiguous. Konrad
Hi Konrad, On 9/15/2023 5:37 PM, Konrad Dybcio wrote: > On 16.09.2023 02:10, Wesley Cheng wrote: >> Add a dt-binding to describe the definition of enabling the Q6 USB backend >> device for audio offloading. The node carries information, which is passed >> along to the QC USB SND class driver counterpart. These parameters will be >> utilized during QMI stream enable requests. >> >> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> >> --- >> .../devicetree/bindings/sound/qcom,q6usb.yaml | 55 +++++++++++++++++++ >> 1 file changed, 55 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6usb.yaml >> >> diff --git a/Documentation/devicetree/bindings/sound/qcom,q6usb.yaml b/Documentation/devicetree/bindings/sound/qcom,q6usb.yaml >> new file mode 100644 >> index 000000000000..51ff0b1ffa2d >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/sound/qcom,q6usb.yaml >> @@ -0,0 +1,55 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/sound/qcom,q6usb-dais.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Qualcomm ASoC DPCM USB backend DAI >> + >> +maintainers: >> + - Wesley Cheng <quic_wcheng@quicinc.com> >> + >> +description: >> + The USB port is a supported AFE path on the Q6 DSP. This ASoC DPCM >> + backend DAI will communicate the required settings to initialize the >> + XHCI host controller properly for enabling the offloaded audio stream. >> + Parameters defined under this node will carry settings, which will be >> + passed along during the QMI stream enable request and configuration of >> + the XHCI host controller. >> + >> +allOf: >> + - $ref: dai-common.yaml# >> + >> +properties: >> + compatible: >> + enum: >> + - qcom,q6usb >> + >> + iommus: >> + maxItems: 1 >> + >> + "#sound-dai-cells": >> + const: 1 >> + >> + qcom,usb-audio-intr-num: >> + description: >> + Desired XHCI interrupter number to use. Depending on the audio DSP >> + on the platform, it will operate on a specific XHCI interrupter. > So is this the number of interrupters to be used or the index of > a single interrupter? If the latter, then "num" is definitely way > too ambiguous. > It defines the index of a single interrupter. I'll change the naming of this property. Thanks Wesley Cheng
On Fri, 15 Sep 2023 17:10:16 -0700, Wesley Cheng wrote: > Add a dt-binding to describe the definition of enabling the Q6 USB backend > device for audio offloading. The node carries information, which is passed > along to the QC USB SND class driver counterpart. These parameters will be > utilized during QMI stream enable requests. > > Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> > --- > .../devicetree/bindings/sound/qcom,q6usb.yaml | 55 +++++++++++++++++++ > 1 file changed, 55 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6usb.yaml > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/qcom,q6usb.yaml: $id: Cannot determine base path from $id, relative path/filename doesn't match actual path or filename $id: http://devicetree.org/schemas/sound/qcom,q6usb-dais.yaml file: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/qcom,q6usb.yaml /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/qcom,q6usb.example.dtb: dais: qcom,usb-audio-intr-num:0: [0, 2] is too long from schema $id: http://devicetree.org/schemas/sound/qcom,q6usb-dais.yaml# /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/qcom,q6usb.example.dtb: dais: qcom,usb-audio-intr-num:0: [0, 2] is too long from schema $id: http://devicetree.org/schemas/sound/qcom,q6usb-dais.yaml# doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230916001026.315-24-quic_wcheng@quicinc.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On Fri, 15 Sep 2023 17:09:56 -0700 Wesley Cheng <quic_wcheng@quicinc.com> > +static int > +xhci_ring_to_sgtable(struct xhci_sideband *sb, struct xhci_ring *ring, struct device *dev) > +{ > + struct sg_table *sgt; > + struct xhci_segment *seg; > + struct page **pages; > + unsigned int n_pages; > + size_t sz; > + int i; > + > + sz = ring->num_segs * TRB_SEGMENT_SIZE; > + n_pages = PAGE_ALIGN(sz) >> PAGE_SHIFT; > + pages = kvmalloc_array(n_pages, sizeof(struct page *), GFP_KERNEL); > + if (!pages) > + return 0; > + > + sgt = kzalloc(sizeof(struct sg_table), GFP_KERNEL); > + if (!sgt) { > + kvfree(pages); > + return 0; > + } > + > + seg = ring->first_seg; > + > + /* > + * Rings can potentially have multiple segments, create an array that > + * carries page references to allocated segments. Utilize the > + * sg_alloc_table_from_pages() to create the sg table, and to ensure > + * that page links are created. > + */ > + for (i = 0; i < ring->num_segs; i++) { > + pages[i] = vmalloc_to_page(seg->trbs); > + seg = seg->next; > + } Given dma_pool_zalloc() in xhci_segment_alloc() and dma_alloc_coherent() in pool_alloc_page(), it is incorrect to get page from the cpu address returned by the dma alloc routine.