Commit Graph

615465 Commits

Author SHA1 Message Date
Ruslan Bilovol
ef10d9e1b8 UPSTREAM: usb: gadget: f_uac2: split out audio core
Abstract the peripheral side ALSA sound card code from
the f_uac2 function into a component that can be called
by various functions, so the various flavors can be split
apart and selectively reused.

Visible changes:
 - add uac_params structure to pass audio paramteres for
   g_audio_setup
 - make ALSA sound card's name configurable
 - add [in/out]_ep_maxpsize
 - allocate snd_uac_chip structure during g_audio_setup
 - add u_audio_[start/stop]_[capture/playback] functions

Change-Id: Ideb3c18f0a1ce86cedab91abc321b378b9834685
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit eb9fecb9e6)
2019-03-11 10:15:42 +08:00
Ruslan Bilovol
dc1680347e UPSTREAM: usb: gadget: f_uac2: remove platform driver/device creation
Simplify f_uac2 by removing platform driver/device
creation; use composite's usb_gadget device as
parent for sound card and for debug prints.
This removes extra layer of code without any functional
change.

Change-Id: Idaccfe309b0d3c95d44a403c447b2c9ef67be58c
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 7158b57a49)
2019-03-11 10:15:42 +08:00
Sekhar Nori
7d1ddce949 UPSTREAM: usb: gadget: f_uac2: calculate wMaxPacketSize before endpoint match
Calculate wMaxPacketSize before endpoint matching the
descriptor is found.

This allows audio gadget to be used with controllers
which have a shortage or unavailability of endpoints
that can handle max packet size of 1023 (FS) or 1024
(HS).

With this audio gadget can be used on TI's OMAP-L138 SoC
which has a MUSB HS controller with endpoints having max
packet size much less than 1023 or 1024. See mode_2_cfg in
drivers/usb/musb/musb_core.c

Change-Id: Ic86bcebd4d6ab95fc19cbdd38e95d35ed5b71c56
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 0db56e4335)
2019-03-11 10:15:42 +08:00
Peter Chen
4f76843f71 UPSTREAM: usb: gadget: uac2: add req_number as parameter
There are only two requests for uac2, it may not be enough at high
loading system which usb interrupt handler can't be serviced on
time, then the data will be lost since it is isoc transfer for audio.

In this patch, we introduce a parameter for the number for usb request,
and the user can override it if current number for request is not enough
for his/her use case.

Besides, update this parameter for legacy audio gadget and documentation.

Change-Id: I09c3a048f3ed50b8725e7009e5927800bd2434d6
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit e92b9d449d)
2019-03-11 10:15:42 +08:00
Peter Chen
2b9c1a8e8d UPSTREAM: usb: gadget: f_uac2: improve error handling
If it is out of memory, we should return -ENOMEM;

Change-Id: I8ad67d982849b96ea94420e568032c2de9339ce7
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 88f950a691)
2019-03-11 10:15:42 +08:00
Krzysztof Opasiak
70f45374cd UPSTREAM: usb: gadget: uac2: Drop unused device qualifier descriptor
This descriptor is never used. Currently device qualifier
descriptor is generated by compossite code so no need to
keep it in function file.

Change-Id: I52d441fcc2d25525152e90b3ebfe313770b3f7cd
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Krzysztof Opasiak <kopasiak90@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit d4529f9be1)
2019-03-11 10:15:42 +08:00
Jianqun Xu
91b5605689 arm64: dts: rockchip: modify io driver strength for rk1808
For rk1808 SoCs, set EMMC 4ma, SDMMC 8ma, SDIO 4ma.

Change-Id: I217d10b16f901c257069829315b79f86ce54dab1
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-03-08 17:38:51 +08:00
Elaine Zhang
5684cddad9 arm64: dts: rockchip: rk1808: assigned-clock-parents for clk_32k_ioe
set 32k as input mode:
  assigned-clocks = <&cru SCLK_32K_IOE>;
  assigned-clock-parents = <&xin32k>;
set 32k as output mode:
  assigned-clocks = <&cru SCLK_32K_IOE>;
  assigned-clock-parents = <&cru SCLK_RTC32K_PMU>;

Change-Id: Iaebd0a8b8b882c42b800dd3fba9ff5a597c966ae
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-08 17:37:05 +08:00
Elaine Zhang
8d550430b6 clk: rockchip: rk1808: export SCLK_32K_IOE clock id
Add clk_32k_ioe to select 32k io as input or output.

Change-Id: Id1d32b913e9739c4462eab6e565b3fcac370e531
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-08 17:37:05 +08:00
Elaine Zhang
da355404b3 clk: rockchip: add a clock-type for muxes based in the pmugrf
Rockchip socs often have some tiny number of muxes not controlled from
the core clock controller but through bits set in the pmugrf.
Use MUXPMUGRF() to cover this special clock-type.

Change-Id: Iac962a27a3c88ce188d03c416cb4b3b45a462c0a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-08 17:37:05 +08:00
Lin Jianhua
1deb7f8c26 ARM: dts: rockchip: enable 2 micbias properties for rk3308 voice module board
Change-Id: Icb17b81c9809079355fac440467d6e9781649a30
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
2019-03-08 17:12:32 +08:00
Jon Lin
cb508201ff drivers: rkflash: don't update vpc when record vpc equals 0 in gc progress
1.don't update vpc when record vpc equals 0 in gc progress
2.increase the number of read retry
3.avoid danger of abnormal power lost
4.change flash_read_page_raw return to error_ecc_bits
5.add nand buildin ecc support
6.skip ECC error page instead of marking as bad block
7.adjust the way of building tables to increase ftl init

Change-Id: I9ba24980c06d61a5a1d66019378075e0171a5887
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2019-03-08 12:01:45 +08:00
Leo Wen
281b14365e arm64: dts: rockchip: Add adc-keys node for px30 robot
Change-Id: Iecf0d89e8b8659b836f6f019b68fa2633009c7bb
Signed-off-by: Leo Wen <leo.wen@rock-chips.com>
2019-03-08 10:45:24 +08:00
Leo Wen
c53f3a5ea7 arm64: dts: rockchip: Add adc-keys node for rk3326 robot
Change-Id: Ib7bae5b08ad8695359d3fcdea3893e707fdae522
Signed-off-by: Leo Wen <leo.wen@rock-chips.com>
2019-03-08 10:45:24 +08:00
Leo Wen
20146875d2 arm64: dts: rockchip: Add drm node for px30 robot
Change-Id: I1196cdfe29d2e182490fadf3ef529055573b3a40
Signed-off-by: Leo Wen <leo.wen@rock-chips.com>
2019-03-08 10:45:24 +08:00
Leo Wen
d2c1611ef9 arm64: configs: Add drm/mpp/initrd configs for px30 robot
Change-Id: I37e443b8ed20ce4a188fd0519996659b40ad8323
Signed-off-by: Leo Wen <leo.wen@rock-chips.com>
2019-03-08 10:45:24 +08:00
Leo Wen
cf8f9d188e arm64: dts: rockchip: Add drm node for rk3326 robot
Change-Id: Ibe37002afdfa6b306eaef604d0ee2cda5321ec77
Signed-off-by: Leo Wen <leo.wen@rock-chips.com>
2019-03-08 10:45:24 +08:00
Leo Wen
59294e61a2 arm64: configs: Add drm/mpp/initrd configs for rk3326 robot
Change-Id: Ib6ae122e533b3e9d610db570d15484c803028e3c
Signed-off-by: Leo Wen <leo.wen@rock-chips.com>
2019-03-08 10:45:24 +08:00
Finley Xiao
b736585b63 soc: rockchip: Change the parameter of power model for cpu and npu
Change-Id: I73724946fce82311d29de4538b8446e87d67dc92
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-08 10:27:18 +08:00
Finley Xiao
e51ed31ccd cpufreq: dt: Add support to get static power
Change-Id: I1d69fa83c039a5487571901da9b1d3baa3bea3ea
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-08 10:27:18 +08:00
Finley Xiao
039fa1a285 thermal: trace: Add trace for staitc power
Change-Id: I65fa7e60c606d414e6f5941c5a73347db9874c27
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-08 10:27:18 +08:00
Finley Xiao
0ef7dd26e3 soc: rockchip: Add support to change static power according to leakage
Change-Id: Ie25e42ab14a46676819711957afa8aef8dfd0785
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-08 10:27:18 +08:00
Finley Xiao
667aaaf977 cpufreq: dt: Implement rockchip_of_get_leakage()
Change-Id: I6d1bf9ee6957455c2cb6623aa112d918a9fea4d4
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-08 10:27:18 +08:00
Ville Syrjälä
0c17d3a6a0 UPSTREAM: drm/edid: Set YQ bits in the AVI infoframe according to CEA-861-F
CEA-861-F tells us:
"When transmitting any RGB colorimetry, the Source should set the
 YQ-field to match the RGB Quantization Range being transmitted
 (e.g., when Limited Range RGB, set YQ=0 or when Full Range RGB,
 set YQ=1) and the Sink shall ignore the YQ-field."

So let's go ahead and do that. Perhaps there are sinks that don't
ignore the YQ as they should for RGB?

I wasn't able to find similar text in CEA-861-E, so it would seem
to be a fairly "recent" addition.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170111125725.8086-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit fcc8a22cc9)

Change-Id: I355b86175d2b33e88bd384a01f7e6378b21d13fd
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-03-08 08:49:30 +08:00
Ville Syrjälä
2b882c1f35 UPSTREAM: drm/edid: Set AVI infoframe Q even when QS=0
HDMI 2.0 recommends that we set the Q bits in the AVI infoframe
even when the sink does not support quantization range selection (QS=0).
According to CEA-861 we can do that as long as the Q we send matches
the default quantization range for the mode.

Previously I think I had misread the spec as saying that you can't
send a non-zero Q at all when QS=0. But that's not what the spec
actually says.

v2: Fix typo in commit message (Jani)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170111125725.8086-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 779c4c2866)

Change-Id: Ic006e2a2a9ac2f1ab105c595bc4a62c0918c6dff
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-03-08 08:49:30 +08:00
Ville Syrjälä
6255a9fe86 UPSTREAM: drm/edid: Introduce drm_hdmi_avi_infoframe_quant_range()
Pull the logic to populate the quantization range information
in the AVI infoframe into a small helper. We'll be adding a bit
more logic to it, and having it in a central place seems like a
good idea since it's based on the CEA-861 spec.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170111125725.8086-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a2ce26f815)

Change-Id: Ic41983b3298461644658d89c31408b06efc33c69
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-03-08 08:49:30 +08:00
Ville Syrjälä
738f34027f UPSTREAM: drm/edid: Introduce drm_default_rgb_quant_range()
Make the code selecting the RGB quantization range a little less magicy
by wrapping it up in a small helper.

v2: s/adjusted_mode/mode in vc4 to make it actually compile
v3: Add a comment proposed by Eric

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170111141835.25369-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c8127cf08a)

Change-Id: I33894c6e3a2033b168f78918e4a8dbf167201632
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2019-03-08 08:49:30 +08:00
Zhang Zhijie
6ff461709c OPTEE: do uart port config when driver probe
Some logs may appear before tee-supplicant start,
so uart port config should be done as early as possible.

Change-Id: I51bdb6a9d0f5160a6dc66ad015577a77df6897b4
Signed-off-by: Zhang Zhijie <zhangzj@rock-chips.com>
2019-03-07 10:13:22 +08:00
Zhang Zhijie
7757813f89 OPTEE: check psci state when driver init
Kernel is running in secure mode on some platforms(e.g. rk3128/rv1108),
which has no secure OS to support TEE service.

Change-Id: I275413230b2a8ec3864fc5a5ba043a155d724ced
Signed-off-by: Zhang Zhijie <zhangzj@rock-chips.com>
2019-03-07 10:07:47 +08:00
YouMin Chen
a6a1e20286 PM / devfreq: rockchip-dfi: fix lpddr4 calculation error
Fix lpddr4 calculation error about access.
LPDDR4 BL(burst length) = 16,other DDR type BL(burst length) = 8.

Change-Id: Icc1b4f6764fa0b23ec1f7722bda8ffeff1da4ab7
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2019-03-06 14:58:34 +08:00
Liang Chen
8d976db24b arm: dts: rk3128-fireprime: remove custom cma region@88000000
The address@88000000 is out of memory on rk3128-fireprime, so remove
the cma region@88000000, just delete the property <reg>, so that
system will alloc cma region automatically.

Change-Id: I2b9fdf1cd19d9fcecd59421fd551d709f9054cae
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-03-06 11:39:07 +08:00
Jianqun Xu
09eb63fae4 arm64: dts: rockchip: rk3399-sapphire remove dvs2
The RK3399 sapphire board hasn't use dvs2 of pmic rk808,
remove it from dts.

Change-Id: I6b18f2ac48d2f32ba53cc6f16303be0f42d74fe5
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-03-06 09:24:16 +08:00
Sugar Zhang
96e7d814e7 dt-bindings: sound: add compatible for rk1808es vad
Change-Id: I9eff5ec7ff87f2c26fdd4264cad1169a42889992
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2019-03-05 15:33:10 +08:00
Sugar Zhang
1be8a3602e ASoC: rockchip: vad: compatible with rk1808es/rk1808
Change-Id: I54c968f8fcf37cc4d7a52137ac0aac57d4367dc7
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2019-03-05 15:33:10 +08:00
Tao Huang
43dbf7220c arm64: dts: rockchip: disable uart2 for rk3399 board
Change-Id: I0934141d4a943f9bd21f74652c78a4e2eefc1e57
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:48:00 +08:00
Tao Huang
55a2b35ff5 arm64: dts: rockchip: disable uart2 for rk3368-r88-dcdc
ttyS2 and fiq debugger don't use the same uart2

Change-Id: I442bb34a5a9a7c836b01b693b199b82284539ca6
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:47:44 +08:00
Tao Huang
5d99473a36 arm64: dts: rockchip: disable uart2 for rk3368-r88
ttyS2 and fiq debugger don't use the same uart2

Change-Id: Id93080187e99089b590cdd29e98713d4e2b50dee
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:47:44 +08:00
Tao Huang
2a2fd97236 arm64: dts: rockchip: disable uart4 for rk3368-px5-evb-android
ttyS4 and fiq debugger don't use the same uart4

Change-Id: I9e73cd663b5a16615e727d65d3e67a2368390615
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:47:44 +08:00
Tao Huang
f1b9929d7d ARM: dts: rockchip: disable uart2 for rk3288-popmetal
Change-Id: Ib4cc44eabe6711efd91cb79867397479ab799ed9
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:26:03 +08:00
Tao Huang
6ba0fc8afd ARM: dts: rockchip: disable uart2 for rk3288-phycore-rdk
ttyS2 and fiq debugger don't use the same uart2

Change-Id: I4ca2df8a763f0dba7a28cd9b8e2b32e885feaa0b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:26:03 +08:00
Tao Huang
56dd8723fd ARM: dts: rockchip: disable uart2 for rk3288-miqi
ttyS2 and fiq debugger don't use the same uart2

Change-Id: I40fc4010624abf6b687bc56b739b81b992f9d61a
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:26:03 +08:00
Tao Huang
6de0a2904b ARM: dts: rockchip: disable uart2 for rk3288-fennec
ttyS2 and fiq debugger don't use the same uart2

Change-Id: Id726872e68ef873a77b0a5bf5c60f0525f789b0f
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:26:03 +08:00
Tao Huang
746156e739 ARM: dts: rockchip: disable uart2 for rk3288-evb-act8846
ttyS2 and fiq debugger don't use the same uart2

Change-Id: I9c6b26c51174e86621fd8369d9231c7b4d20c89f
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:26:03 +08:00
Tao Huang
7d0b5029ca ARM: dts: rockchip: disable uart2 for rk3288 board
ttyS2 and fiq debugger don't use the same uart2

Change-Id: Ia178159f240b30abe29312c8dd94ab4711834bbf
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:26:03 +08:00
Tao Huang
1273e50839 ARM: dts: rockchip: disable uart2 for rk3229-at-som
ttyS2 and fiq debugger don't use the same uart2

Change-Id: Ibb9db5ff84d334d77787ea6f39a0802ba489781c
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-05 14:26:03 +08:00
Huibin Hong
8fe83c079f arm64: dts: rockchip: disable uart2 for rk3328-rock64
Change-Id: Iad59c8564b10d429e2bef4c2fe0fd4a9e9ada761
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2019-03-05 14:09:46 +08:00
Huibin Hong
43d72c2716 ARM: dts: rockchip: disable uart2 for rk3036-kylin
ttyS2 and fiq debugger don't use the same uart2

Change-Id: Ic6d2aa936586869197101593ac9b8056be128406
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2019-03-05 08:35:17 +08:00
Huibin Hong
13f611e70a fiq debugger: ttyS2 and fiq debugger don't use the same uart2
Someone may enable uart2 and fiq debugger, which is illegal.

&uart2 {
	status = "okay";
};

&fiq_debugger {
	status = "okay";
};

Change-Id: Ibecd3c3ca69de1216103d7c373a4d282cf93cb30
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2019-03-04 16:33:09 +08:00
Huibin Hong
4aeda7a47f fiq debugger: support dummy console
Maybe you need to use uart2 as normal ttyS2, firstly disable the
uart2 debug function. Set "rockchip,serial-id" as -1, it means
fiq debugger still have a /dev/ttyFIQ0, but it doesn't have any uart
hardware.

&fiq_debugger {
	rockchip,serial-id = <0xffffffff>;
	status = "okay";
};

Change-Id: I80065eed852eb50139520c5c1fdceb882773d79d
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2019-03-04 16:32:53 +08:00
Leo Wen
33f7355319 arm64: dts: rockchip: Add rk3326-evb-ai-va-v11-linux.dts
Change-Id: I4a363a3f36ac6a7195389b085c59437c2bb66fb6
Signed-off-by: Leo Wen <leo.wen@rock-chips.com>
2019-03-04 11:54:13 +08:00