Commit Graph

1065433 Commits

Author SHA1 Message Date
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
Pavel Hofman
f948999ac8 FROMGIT: usb: gadget: u_audio: Move dynamic srate from params to rtd
Parameters uac_params.p_srate/c_srate are dynamic now and are not part
of parametric configuration anymore. Move them to the
runtime struct uac_rtd_params for each stream.

Change-Id: I4ce2dcf8b342d86f5b82167194a438af267837bc
Suggested-by: John Keeping <john@metanate.com>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220121155308.48794-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 8722a949e6
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Julian Scheel
7ab40ff566 FROMGIT: usb: gadget: u_audio: Support multiple sampling rates
Implement support for multiple sampling rates in u_audio part of the
audio gadget. The currently configured rates are exposed through
read-only amixer controls 'Capture Rate' and 'Playback Rate'.

Change-Id: Idcdcddf34a165553753b2a9af17a688b0e8ab4f0
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-3-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 c565ad07ef
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
2022-03-18 14:48:07 +08:00
Pavel Hofman
1fc9aac7c0 UPSTREAM: usb: gadget: u_audio: Subdevice 0 for capture ctls
Both capture and playback alsa devices use subdevice 0. Yet capture-side
ctls are defined for subdevice 1. The patch sets subdevice 0 for them.

Change-Id: I18ebe7c5f59c108fb48b205af4a3f84839b5f71d
Fixes: 02de698ca8 ("usb: gadget: u_audio: add bi-directional volume and mute support")
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220105104643.90125-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 601a5bc1ae)
2022-03-18 14:48:07 +08:00
John Keeping
3e3779b910 UPSTREAM: usb: gadget: u_audio: fix calculations for small bInterval
If bInterval is 1, then p_interval is 8000 and p_interval_mil is 8E9,
which is too big for a 32-bit value.  While the storage is indeed
64-bit, this value is used as the divisor in do_div() which will
truncate it into a uint32_t leading to incorrect calculated values.

Switch back to keeping the base value in struct snd_uac_chip which fits
easily into an int, meaning that the division can be done in two steps
with the divisor fitting safely into a uint32_t on both steps.

Change-Id: I602559a8977803545ef2b83021cc9cbac2db24b5
Fixes: 6fec018a7e ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback")
Tested-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/20220104183243.718258-1-john@metanate.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit f2f69bf65d)
2022-03-18 14:48:07 +08:00
Pavel Hofman
7c0605bc8d UPSTREAM: usb:gadget: f_uac1: fixed sync playback
The u_audio param fb_max was not set to its default value in f_uac1.c.
As a result the maximum value of Playback Pitch ctl was kept at 1000000,
not allowing to set faster playback pitch for UAC1.

The setting required moving the default constant UAC2_DEF_FB_MAX from
u_uac2.h to FBACK_FAST_MAX in u_audio.h as that header is common for
f_uac1.c and f_uac2.c.

Change-Id: Ie85199656e096dc931dffa465e706a8526b5856d
Fixes: 6fec018a7e ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback")
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20211022140339.248669-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 d9f2734843)
2022-03-18 14:48:07 +08:00
Pavel Hofman
46889912f2 UPSTREAM: usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback
EP IN is hard-coded as ASYNC both in f_uac1 and f_uac2 but u_audio sends
steady number of audio frames in each USB packet, without any control.

This patch adds 'Playback Pitch 1000000' ctl analogous to the existing
'Capture Pitch 1000000' ctl. The calculation of playback req->length in
u_audio_iso_complete respects the Playback Pitch ctl value to 1ppm now.

Max. value for Playback Pitch is configured by the existing parameter
uac2_opts->fb_max, used also for the Capture Pitch.

Since the EP IN packet size can be increased by uac2_opts->fb_max now,
maxPacketSize for the playback direction is calculated by the same
algorithm as for the async capture direction in
f_uac2.c:set_ep_max_packet_size.

Change-Id: Id19a55560a23497c75fc62debcb7dd6de98a53fe
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20211013073934.36476-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 6fec018a7e)
2022-03-18 14:48:07 +08:00
Colin Ian King
f1cef857d5 UPSTREAM: usb: gadget: f_uac2: clean up some inconsistent indenting
There are bunch of statements where the indentation is not correct,
clean these up.

Change-Id: I6540cf83e40dd7f825b315f035273e37f4ea7287
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210902224758.57600-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 18d6b39ee8)
2022-03-18 14:48:07 +08:00
Pavel Hofman
4d7a4c3d18 UPSTREAM: usb: gadget: f_uac1: fixing inconsistent indenting
Fixing inconsistent indenting identified by kernel test
robot.

Change-Id: If5831eafe2909a5a0d4955ecbddc3b176415e1a0
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Acked-By: Felipe Balbi <balbi@kernel.org>
Link: https://lore.kernel.org/r/20210817100555.4437-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 1bc2208355)
2022-03-18 14:48:07 +08:00
Colin Ian King
6c4eefb07f UPSTREAM: usb: gadget: f_uac2: remove redundant assignments to pointer i_feature
Pointer i_feature is being initialized with a value and then immediately
re-assigned a new value in the next statement. Fix this by replacing the
the redundant initialization with the following assigned value.

Change-Id: I1cf2dd348b049a0dcb902ea674386daec68ee07e
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/20210804125907.111654-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 59e477af7b)
2022-03-18 14:48:07 +08:00
Ruslan Bilovol
7cff8ea0d7 UPSTREAM: usb: gadget: f_uac1: add volume and mute support
This adds bi-directional (host->device, device->host)
volume/mute support to the f_uac1 driver by adding
Feature Units and interrupt endpoint.

Currently only master channel is supported.

Volume and mute are configurable through configfs,
by default volume has -100..0 dB range with 1 dB step.

Similar to existing flexible endpoints configuration,
Feature Unit won't be added to the topology if both
mute and volume are not enabled, also interrupt endpoint
isn't added to the device if no feature unit is present

Change-Id: I9454a92291d5055286db4ef73a0038e30420fd24
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20210712125529.76070-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 0356e6283c)
2022-03-18 14:48:07 +08:00
Ruslan Bilovol
fe9da54e56 UPSTREAM: usb: gadget: f_uac2: add volume and mute support
This adds bi-directional (host->device, device->host)
volume/mute support to the f_uac2 driver by adding
Feature Units and interrupt endpoint.

Currently only master channel is supported.

Volume and mute are configurable through configfs,
by default volume has -100..0 dB range with 1 dB step.

Similar to existing flexible endpoints configuration,
Feature Unit won't be added to the topology if both
mute and volume are not enabled, also interrupt endpoint
isn't added to the device if no feature unit is present

Change-Id: I6666075ac963745c450fb5eeb81ff058572fad66
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20210712125529.76070-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 eaf6cbe099)
2022-03-18 14:48:07 +08:00
Ruslan Bilovol
a5ae50658a UPSTREAM: usb: gadget: u_audio: add bi-directional volume and mute support
USB Audio Class 1/2 have ability to change device's
volume and mute by USB Host through class-specific control
requests. Device also can notify Host about volume/mute
change on its side through optional interrupt endpoint.

This patch adds Volume and Mute ALSA controls which can be
used by user to send and receive notifications to/from
the USB Host about Volume and Mute change.

These params come from f_uac* so volume and mute controls
will be created only if the function support and enable
each explicitly

Change-Id: I5ac616d8b37b31a6be7c3114e407c17cd4b87369
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20210712125529.76070-3-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 02de698ca8)
2022-03-18 14:48:07 +08:00
Ruslan Bilovol
1fad4be082 UPSTREAM: usb: audio-v2: add ability to define feature unit descriptor
Similar to UAC1 spec, UAC2 feature unit descriptor
has variable size.

Current audio-v2 feature unit descriptor structure
is used for parsing descriptors, but can't be used
to define your own descriptor.

Add a new macro similar to what audio v1 already has.

Change-Id: I253f2a6eefe74055132920e0e56ac908500147ae
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20210712125529.76070-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 b48f8939b9)
2022-03-18 14:48:07 +08:00
Ruslan Bilovol
ec18ff031f UPSTREAM: usb: gadget: f_uac1: disable IN/OUT ep if unused
User can configure f_uac1 function via p_chmask/c_chmask
whether uac1 shall support playback and/or capture,
but it has only effect on the created ALSA device,
but not on the USB descriptor.

This patch adds playback/capture descriptors
dependent on that parameter. It is similar to
the same conversion done earlier for f_uac2

Change-Id: Ie25ef738a2dbc4a781a874bd7f1f015afda33b1b
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Link: https://lore.kernel.org/r/1614599375-8803-6-git-send-email-ruslan.bilovol@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 254cb1e0d7)
2022-03-18 14:48:07 +08:00
Yiqing Zeng
75a2a7aa38 media: i2c: add sc530ai sensor driver
Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
Change-Id: Icc4feae09b7497777e2f1bc586bd220caeac92a5
2022-03-18 14:31:07 +08:00
Sugar Zhang
6745dcaff6 ARM: dts: rv1106-evb: Fix root partition
Because partition 'envparam' has been removed, so, fix it.
OTOH, uboot will also override this if 'sys_bootargs' specified
in env partition.

e.g. env_emmc

blkdevparts=mmcblk0:32K(env),512K@32K(idblock),4M(uboot),32M(boot),2G(rootfs),1G(oem),2G(userdata),-(media)
sys_bootargs=root=/dev/mmcblk0p5 rootfstype=ext4

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I7917dee2e642cc18c926e99eae623083453c4693
2022-03-18 14:29:43 +08:00
Chen Shunqing
8dca81808b media: rockchip: hdmirx: fix power on abnormal
Signed-off-by: Chen Shunqing <csq@rock-chips.com>
Change-Id: Ic02eff1f8dd1cae6ef1c1de87fc4e6839dfdceb0
2022-03-18 14:23:59 +08:00
Lin Jianhua
c1e51c428e arm64: dts: rockchip: rk3588s-evb2-lp5: fixup iomux of dp0
from dp1m2_pins to dp0m2_pins.

Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
Change-Id: Id6c2aef3307bcc5670497cf32355bb78c7cc1f7c
2022-03-18 14:14:39 +08:00
Weng Tao
e0f5e518d4 clk: rockchip: rk3588: Add pll rate table for 955Mhz and 785Mhz
Signed-off-by: Weng Tao <tao.weng@rock-chips.com>
Change-Id: I669f79667fce318cc0ae919a52babd3cdbb52610
2022-03-18 14:12:53 +08:00