Commit Graph

852129 Commits

Author SHA1 Message Date
Nickey Yang
c4cf9286aa drm/rockchip: dsi: update GRF_REG_FIELD
update this for support some GRF's register offset over 0x10000

Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: I8427e17fafa537980f2233483c23e8f3511fd9e9
2020-03-12 15:08:27 +08:00
Sugar Zhang
86d27c996d dt-bindings: sound: rockchip: Add binding for Audio PWM
Change-Id: Ia7d8bf6e697fbb9ff7de9c0572f9c679136be47c
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-03-12 10:11:48 +08:00
Sugar Zhang
1ad2703ce0 ASoC: rockchip: Add support for Audio PWM
The Audio PWM provides an easy and cheap solution for audio playback
in low quality. it acts as a digital-to-analog converter(DAC), which
converts the digital audio PCM data to the analog PWM signals.

Change-Id: I50ca4aebf4fc5c92ff07d2aa53e9d33b91035e46
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-03-12 10:11:00 +08:00
Sugar Zhang
c8c52ddc10 ASoC: rockchip: i2s-tdm: Simplify macro code
Change-Id: I1d18b18f878dea44428c374727fe6e03df09973b
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-03-12 08:59:38 +08:00
David Wu
6b1b956d81 ARM: dts: rockchip: Reduce the time of phy reset for rk3288-evb
It is too long to reset the time with 1000ms, which
would make the system init and resume slowly, 50ms
is enough.

Change-Id: Ifba39f401d14e161dd3d49e1b20ae102569ebb58
Signed-off-by: David Wu <david.wu@rock-chips.com>
2020-03-11 10:26:11 +08:00
Longjian Lin
6a040c72dc ARM: dts: rockchip: add uart0 cts control for rk3288-evb
Change-Id: I74c6cc8c6ba6725d66a836598c55561273b0ea85
Signed-off-by: Longjian Lin <llj@rock-chips.com>
2020-03-11 10:25:36 +08:00
Jianqun Xu
79d804defc video/rockchip: mpp: fix reg_id to int from u32
VPU without hardware id register will be set with -1 for reg_id,
so fix the reg_id from u32 to int.

Change-Id: Ic3cf15f223610428f77fd5e3291e74974a2a7981
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-11 09:06:54 +08:00
Johnson Ding
a0bff8819f arm64: dts: rockchip: rk3368 add clk_cabac for hevc
Change-Id: If02b0458e0b96230b47a4ba32add8c8c2748bd89
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
2020-03-10 19:16:18 +08:00
Jianqun Xu
8eacce33f0 pinctrl/rockchip: set mask_cache directly after write
The flag IRQ_GC_INIT_MASK_CACHE indicates to initialize the mask_cache
by reading mask reg. The gpio controllers on rockchip SoCs need enable
pclk_gpio before read/write controllers.

The irq_enable in irq_chip will be called during irq request, but the
virq needs to be get before irq request, so it causes an read without
pclk of gpio.

This patch removes flag IRQ_GC_INIT_MASK_CACHE, set mask_cache of chip
after direct setting.

Change-Id: I8e1dcf649bb8021b90ffd08bc9b44ad71232d4da
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-10 17:39:56 +08:00
Jianqun Xu
e55b428d85 video/rockchip: mpp: rkvdec fix smatch warning
[smatch] drivers/video/rockchip/mpp/mpp_rkvdec.c:1239 rkvdec_devfreq_init() warn: passing zero to 'PTR_ERR'

Change-Id: Ie3777be55262034274beaa377c25febb36e83e64
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-10 16:08:24 +08:00
Jianqun Xu
73da7c8a6b video/rockchip: mpp: read hwid with power on
Change-Id: I0da57743a92999efb9e0ebc503dc626d1ece6535
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-10 14:56:19 +08:00
Jianhui Wang
07827a3510 ARM: dts: rockchip: rk3288 support mpp
The defaultly vpu clock rate 600MHz makes reboot failure,
patch has assigned clock rates for vpu.

Change-Id: I986295b4dda6f99e524dcebeaa00128af87d51bf
Signed-off-by: Jianhui Wang <wjh@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-10 11:11:59 +08:00
Liang Chen
3be6453a90 kthread: do not preempt current task if it is going to call schedule()
when we create a kthread with ktrhead_create_on_cpu(),the child thread
entry is ktread.c:ktrhead() which will be preempted by the parent after
call complete(done) while schedule() is not called yet,then the parent
will call wait_task_inactive(child) but the child is still on the runqueue,
so the parent will schedule_hrtimeout() for 1 jiffy,it will waste a lot of
time,especially on startup.

  parent                             child
ktrhead_create_on_cpu()
  wait_fo_completion(&done) -----> ktread.c:ktrhead()
                             |----- complete(done);--wakeup and preempted by parent
 kthread_bind() <------------|  |-> schedule();--dequeue here
  wait_task_inactive(child)     |
   schedule_hrtimeout(1 jiffy) -|

So we hope the child just wakeup parent but not preempted by parent, and the
child is going to call schedule() soon,then the parent will not call
schedule_hrtimeout(1 jiffy) as the child is already dequeue.

The same issue for ktrhead_park()&&kthread_parkme().
This patch can save 120ms on rk312x startup with CONFIG_HZ=300.

Change-Id: I2ae4edb538ea6f55cf5b8f8b5dc6311d1811a4ae
Signed-off-by: Liang Chen <cl@rock-chips.com>
2020-03-09 16:51:17 +08:00
Jianqun Xu
b1ae882b40 pinctrl/rockchip: get virq by irq_find_mapping
The rockchip pinctrl creates an irq domain by irq_domain_add_linear,
but it not means all pins' irq are in linear.

Such as rk808 interrupt, it defines in node:
	rk808 {
		interrupt-parent = <&gpio1>;
		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
	}

then i2c core driver will get virq by
	irq = of_irq_get(dev->of_node, 0);
		->irq_create_of_mapping(&oirq);

finally the rk808 irq is mapping in DOMAIN_BUS_WIRED irq domain.

It's better to get virq by irq_find_mapping.

Change-Id: Ib416ace5c2212c9a704b01e78f77d3425dc8d21b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-09 15:21:48 +08:00
Jianqun Xu
fdf97ec8a2 pinctrl/rockchip: not need to create irq mapping for all pins
It takes time to create irq mapping for all pins in probe, remove
it since the mapping will be created in gpio_to_irq.

Change-Id: Idec03ea43711335190cf440fa30f9f4c654e4540
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-09 15:21:48 +08:00
Jianqun Xu
64c332acf2 pinctrl/rockchip: enable clock for gpio_to_irq
Since all pins have been created mapping in probe, the create
mapping operation in gpio_to_irq will never happen, the issue
is hidened.

The patch add clk_enable/disable for gpio_to_irq.

Change-Id: I50c945f95f9f66ed3ab83a8c332893151272e9f6
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-09 15:21:48 +08:00
Tao Huang
735784e0ea ARM: rockchip_defconfig: update by savedefconfig
Reorder some configs.

Change-Id: Ibdd8c5225932d1418de3a108819a1bc9ad550bd8
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-03-05 19:37:05 +08:00
Tao Huang
1cd75a53e9 arm64: rockchip_defconfig: update by savedefconfig
Reorder some configs.

Change-Id: Ibe56218d9577c73a9f97a7c2e7aa4ff2c6a4a67b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-03-05 19:37:05 +08:00
WeiYong Bi
f8090e57cc phy: Add support for INNO MIPI D-PHY
The INNO MIPI D-PHY is built in witch a standard digital interface
to talk to any third part Host controller.That is part of Rockchip SoCs,
like rk3368.

Change-Id: I9806882e0e3fb6b20348015d0f34923d1bc46b89
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2020-03-05 19:37:05 +08:00
Ziyuan Xu
90b0a9600d Revert "clk: rockchip: fix wrong mmc phase shift for rk3328"
This reverts commit 4ef2449889.

The description for CRU_EMMC/SDMMC/SDIO_CON[0/1] is jumble on
chapters, make it clear that the correct shift is 1 that from
IC engineer.

Change-Id: I48dce293ec6ef82a5c78db38efc083227776ea99
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2020-03-05 19:35:44 +08:00
Jianhui Wang
2cfeb140f4 arm: dts: rk3288-evb-android-rk808-edp: fix sensor layout
Change-Id: Ie4d19e6e0e39c2fceb8bae99b8c72199a4410a46
Signed-off-by: Jianhui Wang <wjh@rock-chips.com>
2020-03-05 19:32:44 +08:00
Jianqun Xu
ac76d80e1d arm64: dts: rockchip: add rk3399-sapphire-excavator-edp-avb.dtb
Change-Id: I43be2a2bb9fee1fe2c9c60397d8daeadfa044e8f
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-05 19:31:12 +08:00
Li Huang
d9a506de89 ARM: dts: rockchip: 3288-android enable rga
Signed-off-by: Li Huang <putin.li@rock-chips.com>
Change-Id: Ibb97bc1147c1b6c8f5bd3722265546950258eb9f
2020-03-05 14:08:18 +08:00
Bian Jin chen
07b65d7918 ARM: dts: rockchip: enable rng for rk3288-android
Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: I22f2c683f5a1cbc34c0636cc95709b69ccc08c63
2020-03-04 19:01:01 +08:00
Wang Panzhenzhuan
5c46471281 arm: dts: rk3288-evb-android-rk808-edp: add camera configs
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: If6b2fac5efdbdfaa530fd1f69e967bc252670ac0
2020-03-04 11:35:31 +08:00
Jacob Chen
a5ab7a2f7b FROMLIST: ARM: dts: rockchip: add rx0 mipi-phy for rk3288
It's a Designware MIPI D-PHY, used by ISP in rk3288.

(am from https://patchwork.kernel.org/patch/10119093/)
Change-Id: Ib3386c9c8b58242a2a09bcd3bc7bd66589053a9b
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2020-03-04 11:35:15 +08:00
Wang Panzhenzhuan
3ad93913eb ARM: rockchip_defconfig: rk3288 evb board: enable ov13850 & vcm149c & sgm3784
ov13850 camera module used by rk3288 evb board

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I23ad3dcb06a9f5c748a9399f5d4e9e9b1936ca52
2020-03-04 11:34:52 +08:00
Wang Panzhenzhuan
55481078e5 media: i2c: ov13850 add power gpio support
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: Ic7e707ab75e55843a348f51480a4964a888f7c55
2020-03-04 11:34:41 +08:00
Bian Jin chen
4a6058b7e5 ARM: config: rockchip_defconfig: enable CONFIG_OVERLAY_FS.
Android 10 use overlayfs to update logical partitions,
enabling this config to support adb debugging.

Test: adb root; adb remount; adb push some_file /somewhere.

Signed-off-by: Bian Jin chen <kenjc.bian@rock-chips.com>
Change-Id: Ic6d90915a88208b82f771db203521e628a74fc2d
2020-03-04 11:29:50 +08:00
Jianhui Wang
b1c20f0a91 drivers: input: sensor: add mpu6050 sensor support
Change-Id: Ieb3644db6b80f7ca241fe47fa7c1966cc490dce6
Signed-off-by: Jianhui Wang <wjh@rock-chips.com>
2020-03-03 15:26:31 +08:00
Jianhui Wang
751d452440 ARM: dts: rockchip: rk3288-evb-android-rk808-edp add mpu6050 sensor support
Change-Id: I3dc9c9e867a7cef1527af01e845019da85ff9e46
Signed-off-by: Jianhui Wang <wjh@rock-chips.com>
2020-03-03 15:13:13 +08:00
Ding Wei
75d777258b video: rockchip: mpp: add rkvenc driver
Change-Id: I9c0b4ad597a482e48b3b0d80b098d08e246b0c66
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-03-03 09:32:30 +08:00
Binyuan Lan
4ef18fc8e5 ARM: dts: rockchip: rk3288-evb add sound card support
Change-Id: Ida802e511506d99591bb8e04cab571426c231786
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2020-03-02 18:54:27 +08:00
Shunqing Chen
c26871fa42 ARM: dts: rockchip: remove ddc-i2c-bus from hdmi for rk3288-evb
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: I2810cd3d20d391f641dc412b8f1b6e048bb27fbd
2020-03-02 18:52:06 +08:00
Jianing Ren
353b583e0e Revert "arm64: dts: rockchip: Add HCLK_USB_PERI for rk3368 otg"
We have removed the driver dwc3-rockchip-inno, and the hclk_usb_peri
is controlled by clock system framework instead of USB driver.

This reverts commit 24992130f2.

Change-Id: I947342389a0f85bb7f322c3481349a3ee2d56298
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-03-02 18:50:55 +08:00
Jianing Ren
221f01aa26 clk: rockchip: add CLK_IGNORE_UNUSED for hclk_usb_peri in rk3368
We have removed the driver dwc3-rockchip-inno, and the hclk_usb_peri
is controlled by clock system framework instead of USB driver.

This reverts commit 00c75f4839.

Change-Id: I4184b074f1946f4ee8bd68c4dac5ff725272dfe7
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-03-02 18:50:55 +08:00
Li Huang
4b7f245f00 RK3368 GPU: Fixup some bug
1.Fixup memleak on pvr_create_pt_fence
	2.Fixup crash on pvr_sync_has_signal

Change-Id: I999c8e96d0cab2814f5fdfbd8ea57ae6c30cd961
Signed-off-by: Li Huang <putin.li@rock-chips.com>
2020-03-02 18:49:44 +08:00
Li Huang
b681951ea2 RK3368 GPU: fix the bad processing for return value of calling dma_fence_add_callback()
Change-Id: I98c9cfe4ab9a9c2c2bcc7d555f8848cb36207de1
Signed-off-by: Li Huang <putin.li@rock-chips.com>
2020-03-02 18:49:44 +08:00
Li Huang
69b8d30757 RK3368 GPU: CacheOpSetTimeline(): realize sw_sync_timeline_inc() on 4.19
Change-Id: I43bdae99426dd0cb4e2d03a5c8278a1da6b6834f
Signed-off-by: Li Huang <putin.li@rock-chips.com>
2020-03-02 18:49:44 +08:00
Li Huang
1ee20f30af RK3368 GPU: Rogue Q Init for 4.19.
1、Change Android sync to sync_file
2、Fixup compile error on 4.19
3、Fixup some crash on 4.19
4、Fixup some clang waring
5、Fixup clang warning

Change-Id: Ie59a9252116f6e7cc97f5f9b9a25ae6d5d5f82b1
Signed-off-by: Li Huang <putin.li@rock-chips.com>
2020-03-02 18:49:44 +08:00
Finley Xiao
4067f719f2 dt-bindings: nvmem: rockchip-otp: Make resets as optional property
Change-Id: Icd2e130548e101a41b3030e90cbec9eca43d408e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-03-02 18:47:14 +08:00
Finley Xiao
8b9f568f6e nvmem: rockchip-otp: Update driver to use reset array API
This patch also makes resets as optional.

Change-Id: I25c0be3e811fafad824dd9096a6b89b3fc7d4b47
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-03-02 18:47:14 +08:00
Finley Xiao
6ee23e43c9 nvmem: rockchip-otp: Update driver to use clk_bulk APIs
Change-Id: I684d95c617e87474843dff166e288602df9d10ad
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-03-02 18:47:14 +08:00
William Wu
d22ee08595 usb: gadget: configfs: make sure to reactivate function on unbind
If a configs function sets bind_deactivated flag, upon removal it will be
left with an unbalanced deactivation. Let's make sure that we conditionally
call usb_function_activate() from purge_configs_funcs() and make sure
purge_configs_funcs() is called from configfs_composite_unbind().

Change-Id: Ibe91837fdb7754f8af343a18138556901a0e089f
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-03-02 14:57:19 +08:00
William Wu
2686202448 usb: gadget: configfs: fix defined but not used build warnings
Fix the following build warnings in configfs driver instead of
scripts/gcc-wrapper.py.

"configfs.c:1488", # drivers/usb/gadget/configfs.c:1488:12: warning: 'configfs_composite_setup' defined but not used
"configfs.c:1513", # drivers/usb/gadget/configfs.c:1513:13: warning: 'configfs_composite_disconnect' defined but not used

Fixes: a77196fc01 ("ANDROID: usb: gadget: configfs: Add Uevent to notify userspace")
Change-Id: I58ef495d6e84af8000d0bd7a3ce3a2ed7947b71f
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-03-02 14:57:09 +08:00
Wang Jie
87ee4bbe5d arm64: dts: rockchip: rk3368: modify vcc_lcd configure for rk3368 808 evb
1.When the system starts, enable vcc_lcd.
2.when the System sleep, disable vcc_lcd.

Change-Id: I29afc3e98a8cbe7ded65a8b9de1990fa2ea26b53
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2020-03-02 14:46:04 +08:00
Ding Wei
3f291e5ffb video: rockchip: mpp: update dev_command
merge cmd:
    MPP_CMD_SET_REG              -->
    MPP_CMD_SET_VEPU22_CFG       -->
    MPP_CMD_SET_RKVENC_OSD_PLT   -->  MPP_CMD_SET_REG_WRITE
    MPP_CMD_SET_RKVENC_L2_REG    -->
change cmd:
    MPP_CMD_GET_REG              -->  MPP_CMD_SET_REG_READ

tips:
    1. the xx_WRITE cmd is to write register, while xx_READ cmd is to
        read register.
    2. move MPP_CMD_GET_REG to MPP_CMD_SET_REG_READ, then it can set
        output when input.

Change-Id: Iee1d5c6aafdfea5e0d02d1865cd06079ef5f716b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-02-28 17:18:30 +08:00
Alex Zhao
e4f54461e6 ARM: dts: rockchip: enable sdio0 for rk3288-evb
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
Change-Id: I621bdd9b4e42be40bc303448e46516648f22aed8
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-28 16:40:18 +08:00
Jianing Ren
f1b53c2ed2 usb: dwc3: gadget: fixed crash when unplugged usb cable
If the USB cable is unplugged when powered on or connected to PC,
it will cause the system to freeze. The final log is as follows:

[    5.109122] read descriptors
[    5.109180] read strings
[    5.113205] udc fe800000.dwc3: registering UDC driver [g1]

The crash is caused by visit registers of dwc3 when PD is off. the
function dwc3_gadget_set_speed is added in udc_bind_to_driver in
kernel 4.19 update. We need jump of this function when dwc3 is
suspended.

Change-Id: Ie0337aaf225543b4e9e05ee57a5eb7416797d56e
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-02-28 14:51:35 +08:00
Guochun Huang
404c1b21e0 drm/rockchip: upgrade initcall level of protect loader clocks
To avoid the potential parent PLL clock of display being
closed when PD is shutdown, excute protect loader clocks
earlier.

Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I5125590aac51b423e7e9fdc0032da9185c450be1
2020-02-28 14:34:35 +08:00