Commit Graph

1065452 Commits

Author SHA1 Message Date
Shawn Lin
504bc07b5b PCI: rockchip: dw: Add affinity for legacy INTX
We try to avoid to create and look up parent domain hierarchy, which is
a normal way we need because it's indeed is a hierarchy. Instead we set
affinity via parent irq by using irq_set_affinity API.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I04252b956b7c29fb5c156f1c8ff59adf82d5c638
2022-03-21 11:45:11 +08:00
Huang zhibao
3a450b7a0d arm64: dts: rockchip: rk3588-nvr-demo: fix pcie3.0 startup delay time to 7500us
Signed-off-by: Huang zhibao <hzb@rock-chips.com>
Change-Id: I679305c6d5fadcba861841013b6e0a08cce4e0e2
2022-03-21 11:38:52 +08:00
Cai YiWei
26093e03f8 media: platform: rockchip: cif/isp/ispp remove vb2_dma_contig and vb2_dma_sg
reduce driver size

Change-Id: I3f7eeec74603ae9b601c68bd1b2a0633094cd531
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-21 11:33:46 +08:00
Jianqun Xu
06f898829b media: platform: rockchip: cif/isp/ispp use videobuf2-cma-sg
Fix the videobuf2-rdma-sg to videobuf2-cma-sg, and move it into
videobuf2 directory.

The videobuf2-cma-sg almost keep same as videobuf2-rdma-sg, both of them
are referenced from videobuf2-dma-sg. But the videobuf2-cma-sg also
support the videobuf2-dma-sg if the device's attr without force
contiguous attr.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I397fd5cbcd54a0575a34ecbc853dda9e53629892
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-21 11:33:09 +08:00
Simon Xue
2797eedc4f video: rockchip: mpp: enable pd/clk by av1dec_bus
Change-Id: Id7cb8b33cba90ac49b0b503aff3d0eef92174641
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2022-03-21 11:30:30 +08:00
Yandong Lin
457c8b8ba2 video: rockchip: mpp: fix av1d cannot suspend issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ifc38cf6f05b8abfe4867dfedbe708f2ecb61b7ed
2022-03-21 11:30:14 +08:00
Cai YiWei
5b8a719b6d media: common: videobuf2-cma-sg: support more pages alloc
if DMA_ATTR_FORCE_CONTIGUOUS to alloc contiguous pages and
dma alloc from rk_dma_heap default if it enable, else
alloc compacted pages.

Change-Id: Id1c020fd953e6b090ba734d1c41ed1c3d6932510
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-21 11:23:46 +08:00
David Wu
a0c01681c5 net: phy: rk630phy: Differentiate the PHYs of S40 and T22
At present, it is the best way to distinguish by address,
the two configure different registers during the initialization process.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I2bbb0cfb6f2e33e25406b7d28ac22e5e035f64e3
2022-03-19 19:44:28 +08:00
David Wu
cd5a378048 net: phy: rk630phy: Use falling edge instead of rising edge
The default voltage is high, so it is more appropriate to
use a falling edge.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I74a9ae7e0a2432c4050f2d305aeaa8d9f4f31e62
2022-03-19 19:44:17 +08:00
David Wu
4b46408341 net: phy: rk630phy: Remove unused code
Now adjust the voltage through BGS, so don't need this part
of the code.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ia915cd0b2a3ac96386f96aee6204e477c3188f2a
2022-03-19 19:44:01 +08:00
Zefa Chen
259f76f849 media: i2c: sensor adapter support write sensor register by i2c interface
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I45d7ab10c24ee4b046b3fb85ea7fd45a88c9e4a9
2022-03-19 19:14:10 +08:00
Zefa Chen
6cb6bcaf2c include: rk-camera-module: add command for sensor adapter
1.modify RKMODULE_SET_MCLK
2.add RKMODULE_SET_DEV_INFO

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ifaedf8a4ed96c9daa31fe946c6cd6eeaf7a51f02
2022-03-19 19:13:38 +08:00
Jianqun Xu
f8e84013a5 tools: testing: selftests: add iomux instance
Add a new instance for rockchip pinctrl to do selftest, and the userland
can set or get the iomux to one pin directly.

Build the iomux by gcc:
    xx-gcc tools/testing/selftests/rkpinctrl/iomux.c -o iomux

Tested on rk3588-evb1:

[root@RK3588:/]# iomux 1 15 1
[root@RK3588:/]# iomux 1 15
mux get (GPIO1-15) = 1

[root@RK3588:/]# iomux 1 15 2
[root@RK3588:/]# iomux 1 15
mux get (GPIO1-15) = 2

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Ic5271b25e55e1023caa5580346ffb82fe7a4cb65
2022-03-19 18:45:46 +08:00
Jianqun Xu
1d7ef69052 soc: rockchip: add iomux device for uapi support
Add a new driver to create a device named /dev/iomux, which allows
userland to set or get iomux by bank index and pin index.

For now the /dev/iomux supports two commands:
 - IOMUX_IOC_MUX_SET
 - IOMUX_IOC_MUX_GET

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I0467af6885863f5dc69d513601f597fca2cc6948
2022-03-19 18:23:04 +08:00
Jianqun Xu
9dff075126 pinctrl: rockchip: introduce rk_iomux_set/get
Add rk_iomux_set and rk_iomux_get functions and export them, which can
set or get iomux by bank and pin index.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I2fa94c9fe7d28c545fc31033e70c26cd5c57fed7
2022-03-19 18:23:04 +08:00
Zefa Chen
af227dbe4a media: rockchip: vicap support rv1106
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I1a8f4a8a7e80494eef9991a7551762bc4c6267f6
2022-03-19 16:27:10 +08:00
William Wu
1f622163d8 usb: gadget: f_uac1: add interface assoc desc
According to the spec "USB Interface Association Descriptor Device
Class Code and Use Model"[1], the Interface Association Descriptor
(IAD) is needed for composite device which has multiple interfaces
controlled independently of each other. Without the IAD, the device
may not work as expected because the USB system software will not
properly bind the interfaces with drivers (e.g UAC1 && UVC composite
device not recognized in Win10).

[1] https://www.usb.org/sites/default/files/iadclasscode_r10.pdf

Change-Id: If88c43d20d6133c05a2d2c90507ff03fae21ecdf
Signed-off-by: William Wu <william.wu@rock-chips.com>
2022-03-19 16:23:38 +08:00
Tao Huang
a7e405fc72 ARM: rv1106-evb.config: Enable ROCKCHIP_RGA_ASYNC/DEBUGGER/DEBUG_FS
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I1b5f3b67c086f52220b7159f6dbd417d1a34a663
2022-03-19 16:00:25 +08:00
Herman Chen
6cee981d5a video: rockchip: mpp: rkvenc2: Fix slice mode issue
1. Use MPP_CMD_POLL_HW_IRQ to handle the hw slice irq.
   Old MPP_CMD_POLL_HW_FINISH will wait hardware finish and skip hw irq.
2. Clear poll request msgs when it is handled.

NOTE: When MPP_CMD_POLL_HW_IRQ return slice with zero length the
current task is completed. This way can reduce an extra
MPP_CMD_POLL_HW_FINISH ioctl.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2c81d85c236d4290a497c1747ae2f3e5ac1ce55c
2022-03-19 15:52:42 +08:00
Herman Chen
298511efd0 video: rockchip: mpp: rkvenc2: Add task id
Use task_id in taskqueue to identify each task while task_index in
mpp_dev will have conflict in multi-core case.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ia0c5acc9139cfba177fb828daed6c87750a47ef1
2022-03-19 15:52:42 +08:00
David Wu
8fb18885c7 ethernet: stmmac: dwmac-rk: Disable split header currently
If the length of the tftp test packet exceeds 6K bytes, there
will be problems, and disabling the feature works fine.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I2eff716ac27546b76d4414cb1b30efb8b8de6285
2022-03-19 15:33:07 +08:00
Lin Jinhan
26b58799e1 crypto: rockchip: modify RK_DMA_ALIGNMENT from 64byte to 128byte
For SHA384/SHA512, the data length must be 128 bytes alignment.
Otherwise, the calculation results will be incorrect.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: If3b16a62d0eaf842ccc8bf954a489508b232a4b3
2022-03-18 18:09:05 +08:00
Hu Kejun
79bfcdd26c media: i2c: ov50c40: fix cannot get channel info on android
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: I60a02c71bd2bd8970a608d5fffdca74801ca8efc
2022-03-18 16:11:56 +08:00
Cai YiWei
33a3879e8e media: rockchip: isp: isp32 remove bls2_val
useless at struct isp32_bls_cfg

Change-Id: If8659818c04581336577ee28435be604fbc28c8f
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-18 15:47:43 +08:00
Damon Ding
69b53f960d drm: Kconfig: CONFIG_DRM select I2C_ALGOBIT if !ROCKCHIP_MINI_KERNEL
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ic58fc4efc06f585dd762b97d7117888743deb625
2022-03-18 15:21:58 +08:00
Damon Ding
7c7517b5c1 drm: Kconfig: CONFIG_DRM select CONFIG_HDMI if !ROCKCHIP_MINI_KERNEL
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I7e7fc74d737796a5c777a2d845dc9f58c0b3b5e1
2022-03-18 15:17:20 +08:00
Sugar Zhang
d4d3e9ea07 ARM: dts: rv1106-evb: Make clk always on temporarily
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Iaff298f9eccece1a8905f2b90fafc56b1d1c4140
2022-03-18 15:08:04 +08:00
Lei Chen
230ee551c9 drm/rockchip: dsi2: fix support dynamic binding to different vp port
Fixed VOP_OUTPUT_IF_MIPI being turned off when switching resolution

Signed-off-by: Lei Chen <lei.chen@rock-chips.com>
Change-Id: I4f432a7d352578baa9351e2f859afd67b4ea0152
2022-03-18 15:06:09 +08:00
Joe Perches
a596e98a98 FROMGIT: usb: gadget: f_uac2: Neaten and reduce size of afunc_validate_opts
Remove the repetition and reduce the object size a bit.

$ size drivers/usb/gadget/function/f_uac2.o* (x86-64 defconfig with gadget)
   text	   data	    bss	    dec	    hex	filename
  24515	   3136	     16	  27667	   6c13	drivers/usb/gadget/function/f_uac2.o.new
  24817	   3136	     16	  27969	   6d41	drivers/usb/gadget/function/f_uac2.o.old

Change-Id: I2a6d4b671f8c7600735676d2ad84ff5d28b46c3e
Signed-off-by: Joe Perches <joe@perches.com>
Link: https://lore.kernel.org/r/2132d97ca8d4dd5ac9426cc23af95e819079b02c.camel@perches.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 2dac5d2864
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Colin Ian King
f41d7747cc FROMGIT: usb: gadget: f_uac2: change maxpctksize/maxpcktsize to wMaxPacketSize
The spelling of maxpctksize and maxpcktsize is inconsistent, rename them
both to wMaxPacketSize instead.

Change-Id: Idc99772d903e2bff066e5dc32feb20ea9915ea90
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220202104058.590312-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 9d19d966b4
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
673a45c94c FROMGIT: usb: gadget: f_uac2: Add speed names to bInterval dbg/warn
Add speed names for better clarity of dgb/warn messages from max packet
size/bInterval checks.

Change-Id: I1ea39c8f2f0dc313fd5ee78c7f9c9f5495b98ed9
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220127114331.41367-5-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 554237f2bb
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
df8247d086 FROMGIT: usb: gadget: f_uac2: Optionally determine bInterval for HS and SS
Allow setting configfs params p_hs_bint/c_hs_bint to 0. If they are set
to 0, determine the largest bInterval (4 to 1) for which the required
bandwidth of the max samplerate fits the max allowed packet size. If the
required bandwidth exceeds max bandwidth for single-packet mode
(ep->mc=1), keep bInterval at 1.

The FS speed is left at fixed bInterval=1.

If for any speed the required bandwidth exceeds the max bandwidth
corresponding to the selected/determined bInterval, print a warning.

Change-Id: I9fcc9326e6b314604b521e7b07dfd11223b070d7
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220127114331.41367-4-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 355a05dc83
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
b74a0c9730 FROMGIT: usb: gadget: f_uac2: Add HS/SS bInterval to configfs
Allow configuring the HS/SS bInterval through configfs, via
parameters p_hs_bint/c_hs_bint separately for playback/capture.

The default param values are left at the original 4.

Change-Id: Ic155dc714b67b29eb1e360be720f9314bf79e0a4
Suggested-by: John Keeping <john@metanate.com>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220127114331.41367-2-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 4ed941a999
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
91eed275da FROMGIT: usb: gadget: f_uac2: Define specific wTerminalType
Several users have reported that their Win10 does not enumerate UAC2
gadget with the existing wTerminalType set to
UAC_INPUT_TERMINAL_UNDEFINED/UAC_INPUT_TERMINAL_UNDEFINED, e.g.
https://github.com/raspberrypi/linux/issues/4587#issuecomment-926567213.
While the constant is officially defined by the USB terminal types
document, e.g. XMOS firmware for UAC2 (commonly used for Win10) defines
no undefined output terminal type in its usbaudio20.h header.

Therefore wTerminalType of EP-IN is set to
UAC_INPUT_TERMINAL_MICROPHONE and wTerminalType of EP-OUT to
UAC_OUTPUT_TERMINAL_SPEAKER for the UAC2 gadget.

Change-Id: I1b0cf3096c4fe49c2f5a6cb73560cb999fca1e57
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220131071813.7433-1-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 5432184107
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Yunhao Tian
e528854e3a FROMGIT: usb: gadget: f_uac2: allow changing interface name via configfs
This adds "function_name" configfs entry to change string value
of the iInterface field. This field will be shown in Windows' audio
settings panel, so being able to change it is useful. It will default
to "Source/Sink" just as before.

Change-Id: I87c889452f23ace3f68f53f368f31691dade73d7
Signed-off-by: Yunhao Tian <t123yh.xyz@gmail.com>
Link: https://lore.kernel.org/r/20220122112446.1415547-2-t123yh.xyz@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 993a44fa85
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
2d476da02b UPSTREAM: docs: ABI: fixed formatting in configfs-usb-gadget-uac2
Added missing tab, line breaks.

Change-Id: I0f5ec04a4e7ad362730d083ccabe3662f277d704
Fixes: e3088ebc1b ("docs: ABI: added missing num_requests param to UAC2")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220108105608.10726-1-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit cbb4f5f435)
2022-03-18 14:48:07 +08:00
Yunhao Tian
7dcc24ef4c FROMGIT: usb: gadget: f_uac1: allow changing interface name via configfs
This adds "function_name" configfs entry to change string value
of the iInterface field. This field will be shown in Windows' audio
settings panel, so being able to change it is useful. It will default
to "AC Interface" just as before if unchanged.

Change-Id: I374c651d5ede2160ca7fe7062401c7c405079062
Signed-off-by: Yunhao Tian <t123yh.xyz@gmail.com>
Link: https://lore.kernel.org/r/20220122112446.1415547-1-t123yh.xyz@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit dfb05b5dc3
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
c2e5a60d0a FROMGIT: usb: gadget: f_uac1: Add suspend callback
Add suspend callback to f_uac1 function, calling corresponding method
of u_audio in order to stop the respective PCM streams and to notify
subscribed clients about the stop.

Change-Id: Id25cc522885c8e5d18a7735eafd7fbd7acd12c50
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-11-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit d1d11dd130
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
180e972f04 FROMGIT: usb: gadget: f_uac2: Add suspend callback
When USB cable gets disconnected, the undergoing playback/capture
stalls, without any notification to u_audio about the change.
Experiments with a dwc2 gadget revealed that Suspend interrupt is
thrown at cable disconnection, which the gadget framework translates to
calling suspend callback of a function, if it is defined.

Add the suspend callback to f_uac2 function, calling
corresponding method of u_audio in order to stop the respective PCM
streams and to notify subscribed clients at cable disconnection.

Change-Id: I51b836f3d55d1d8f80bc1e2a9bb95ee07d643be5
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-10-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 7ff4a3b548
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
7559956d2c FROMGIT: usb: gadget: u_audio: Add suspend call
Add exported method u_audio_suspend which sets stream status to
inactive and sends notifications. The method does not free any
resources.

Change-Id: I09c9b18389f7a8970c5d5386ea08b88b3a099758
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-9-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 62385cf158
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
e5ea5b99b7 FROMGIT: usb: gadget: u_audio: Rate ctl notifies about current srate (0=stopped)
The Playback/Capture ctl currently reports rate value set by USB
control selector UAC2_CS_CONTROL_SAM_FREQ (fixed for UAC1). When the
stops playback/capture, the reported value does not change.  The gadget
side has no information whether the host has started/stopped
capture/playback.

This patch sets the value reported by the respective rate ctl to zero
when the host side has stopped playback/capture. Also, it calls
snd_ctl_notify when start/stop  occurs, so that a subscribed client can
act appropriately.

Tests have confirmed that USB hosts change UAC2_CS_CONTROL_SAM_FREQ
before switching altsetting to activate playback/capture, resulting in
correct order (params->c/p_srate is set to requested rate before
u_audio_start_capture/playback is called).

The gadget rate notifications are used by user-space audio gadget
controller gaudio_ctl https://github.com/pavhofman/gaudio_ctl.

Change-Id: I813226a3bcbdedb33b2d9aa25c7e5d2682d58674
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-8-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 8fe9a03f43
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Julian Scheel
e7815ba979 FROMGIT: usb: gadget: f_uac1: Support multiple sampling rates
A list of sampling rates can be specified via configfs. All enabled
sampling rates are sent to the USB host on request. When the host
selects a sampling rate the internal active rate is updated.

Config strings with single value stay compatible with the previous version.

Multiple samplerates passed as configuration arrays to g_audio module
when built for f_uac1.

Change-Id: I11f388fe94f099a0ee61ead27ce5ad3e7f0f1c5f
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-7-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 695d39ffc2
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Julian Scheel
e9f5c24b18 FROMGIT: usb: gadget: f_uac2: Support multiple sampling rates
A list of sampling rates can be specified via configfs. All enabled
sampling rates are sent to the USB host on request. When the host
selects a sampling rate, the internal active rate (stored in
struct f_uac2) is updated.

The gadget no longer supports only one frequency. Therefore USB strings
corresponding to the clock sources are renamed from specific Hz value to
general names Input clock/Output clock.

Config strings with single value stay compatible with the previous
version.

Multiple samplerates passed as configuration arrays to g_audio module
when built for f_uac2.

Change-Id: I8b9e8c3417a6fae5767b8f5dd8a6804236579877
Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-6-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit a7339e4f57
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
5a41dd6a05 FROMGIT: usb: gadget:audio: Replace deprecated macro S_IRUGO
Use octal digits as suggested by checkpatch instead of the deprecated
macro.

Change-Id: I6d14b1a7ea64df237f3a51f92157bdee33fb86db
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-2-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit ce6a7bfbe5
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
8364c8e571 UPSTREAM: docs: ABI: fixed req_number desc in UAC1
Fixed wording of the req_number description in UAC1 docs.

Change-Id: I24dcbf4a31898daed623b060daeda635c5d4fbad
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20211225130929.205629-2-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit a8cf051603)
2022-03-18 14:48:07 +08:00
Pavel Hofman
288239ee00 UPSTREAM: docs: ABI: added missing num_requests param to UAC2
The existing configfs-usb-gadget-uac2 ABI doc for testing was missing
the num_requests param. The patch adds the parameter to the document.

Change-Id: Idd380fef7411db3ecc4f06a7d6e43ceca68f1a97
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20211225130929.205629-1-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit e3088ebc1b)
2022-03-18 14:48:07 +08:00
Mauro Carvalho Chehab
83bc257d94 UPSTREAM: ABI: configfs-usb-gadget-uac1: fix a broken table
Changeset 0356e6283c ("usb: gadget: f_uac1: add volume and mute support")
added some new elements to the table but didn't care enough to actually
adjust the columns, causing the output to be broken as warned by
Sphinx when producing the documentation.

Readjust it for it to be a valid ReST table.

Change-Id: I2c8a1dff01779e7ee5418b66aa52ddc70029fd8d
Fixes: 0356e6283c ("usb: gadget: f_uac1: add volume and mute support")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/044b0c14c35922bdcca50551fe2aa870baae9b06.1632740376.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 1b8af67cae)
2022-03-18 14:48:07 +08:00
Mauro Carvalho Chehab
21f8a7fb61 UPSTREAM: ABI: configfs-usb-gadget-uac2: fix a broken table
Changeset af6cbe09920 ("usb: gadget: f_uac2: add volume and mute support")
added some new elements to the table but didn't care enough to actually
adjust the columns, causing the output to be broken as warned by
Sphinx when producing the documentation.

Readjust it for it to be a valid ReST table.

Change-Id: I8a0ae4fbc93b0587a8b4d3459ef90829778d7da0
Fixes: eaf6cbe099 ("usb: gadget: f_uac2: add volume and mute support")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/d253819a4c201b942d754682bb91dd278300fb79.1632740376.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 5ef803538b)
2022-03-18 14:48:07 +08:00
Hu Haowen
0fb672fa56 UPSTREAM: docs: usb: fix malformed table
The tables are separated with tabs and spaces mixed together, leading
to malformation. Changed the characters all into spaces to solve this
issue.

Change-Id: I9004ca26e2ea0fbe397a1cb3e21bae639c240751
Signed-off-by: Hu Haowen <src.res@email.cn>
Link: https://lore.kernel.org/r/20210805040146.121526-1-src.res@email.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 9c0edd5649)
2022-03-18 14:48:07 +08:00
Pavel Hofman
194ea1f571 FROMGIT: usb: gadget: u_audio: Add capture/playback srate getter
UAC1/UAC2 functions will need to query u_audio about the currently set
srate. Add the getter functions.

Change-Id: I5d7e38d52eb073cdd1ab1692994cf7cd2f9e7757
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-5-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit eb3a1ce6f5
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00