Commit Graph

1072802 Commits

Author SHA1 Message Date
Cai YiWei
390394c77d media: rockchip: ispp: fec add compat_ioctl32
Change-Id: I502f46478ffa4f79065fbdbb59f5b26753301adb
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-21 17:08:22 +08:00
Cai YiWei
2a2d61d9be media: rockchip: isp: fix stream switch when readback mode
Change-Id: I087f7d6fd266f857c05120226f2505ae51fb1144
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-21 16:58:50 +08:00
Cai YiWei
7cbb5846dc media: rockchip: isp: frame start to update buf for isp30
Change-Id: Ied04130500b7e1d33907b1be2e1baab97118dd45
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-21 11:59:35 +08:00
Cai YiWei
02ffc39dd9 media: rockchip: isp: fix fbc output for isp30 multi sensor
Change-Id: I3509d9ba0d57693976380e37092c227ee2242945
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-21 11:59:35 +08:00
Wyon Bi
6b734afe88 Revert "drm/bridge: analogix_dp: Fix sync polarity configuration in msa packet"
This reverts commit 3cf189f222.

VOP only supports the negative polarity of vsync/hsync on rk3588.

Change-Id: I67ea19f04213739149e245fa1aa5a556e92b5698
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2022-10-21 09:06:55 +08:00
Sugar Zhang
f7d4e932d8 ASoC: rockchip: i2s-tdm: Add support for platform shutdown
This patch allow driver to stop controller in shutdown flow.
A clean stage is safety to reboot. otherwise, there maybe
a risk to hang on DMAC-AXI-I2S state.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I7d04d7a128004ef371cf94bec04aedc895370cd6
2022-10-20 18:50:29 +08:00
Zhichao Yu
9c64acb34a ARM: dts: rockchip: add rv1106g-evb-v11-spi-nand-cvr.dts
Signed-off-by: Zhichao Yu <zhichao.yu@rock-chips.com>
Change-Id: I44fbf74dc8cfbd361f35dbed277a712c0d545701
2022-10-20 15:13:03 +08:00
Yiqing Zeng
d27e9147e7 media: i2c: update hi556 sensor driver
Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
Change-Id: If069f3e11074eb7635754c47b39a7b8ca3434219
2022-10-20 15:11:11 +08:00
Weiwen Chen
bf06746858 ARM: dts: rockchip: add rv1103g-evb-v11.dts
diff rv1103g-evb-v11 with rv1103g-evb-v10
1. delete USB OTG power supply
2. modify gpio
   GPIO2_D2: VICAP_VSYNC_M1/LCD_VSYNC/LED_PWM_WHITE
		--> VICAP_VSYNC_M1/LCD_VSYNC/IRC_BIN
   GPIO2_D3: VICAP_CLKOUT_M1/LCD_CLK/IRC_BIN
		--> VICAP_CLKOUT_M1/LCD_CLK/LED_PWM_WHITE
   GPIO3_C5: MIPI_RST0/LCD_PWREN
		--> MIPI_RST0/VICAP_RST
   GPIO3_C6: MIPI_RST1/VICAP_PDN/LCD_BL_PWM
		--> MIPI_RST1/VICAP_PDN/LCD_INT/LCD_PWREN

Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I6882fda9a911bbc59f2c4f3e296947f39e5b8d2c
2022-10-20 15:07:30 +08:00
Weiwen Chen
a3bf5c75fc ARM: dts: rockchip: rv1106-evb: Add adc-key
As saradc is disabled, so adc-key is disabled default.
To enable adc-key, add saradc as follow:

&saradc {
    status = "okay";
    vref-supply = <&vcc_1v8>;
};

Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: Ia111f503ed187432ca13dd9a6d37cc000ac25d2b
2022-10-20 15:06:21 +08:00
Weiwen Chen
3c9fec717e ARM: rv1106-evb.config: enable CONFIG_KEYBOARD_ADC
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I465db2552b9fb8d0839b331ed4bcea6bb70391af
2022-10-20 15:06:15 +08:00
Finley Xiao
7bd3db8109 soc: rockchip: power-domain: use power_off_work to release pd
The pd without devices also will power off when release keepon.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I3e37d5909b6fbc28400320959f448f3c92116e17
2022-10-20 14:40:17 +08:00
Finley Xiao
54d4b6b301 soc: rockchip: power-domain: Add always on configuration for power domain
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ic57f7f3a564f7d71b680e3c435d0460474b5a4a0
2022-10-20 14:40:17 +08:00
Liang Chen
61e4e95dc6 ARM: configs: rockchip_linux_defconfig: enable some ROCKCHIP configs
CONFIG_ROCKCHIP_CPUINFO=y
CONFIG_ROCKCHIP_GRF=y
CONFIG_ROCKCHIP_IODOMAIN=y
CONFIG_ROCKCHIP_IPA=y
CONFIG_ROCKCHIP_OPP=y
CONFIG_ROCKCHIP_SYSTEM_MONITOR=y

Change-Id: Ia90f5a188226426454cd98e9f8ab15d0c0e26d75
Signed-off-by: Liang Chen <cl@rock-chips.com>
2022-10-20 14:37:18 +08:00
Andy Yan
e8cba68e46 drm/rockchip: vop2: no round up parent rate for low freq
rockchip_rk3588_pll_round_rate will return a -EINVAL for
a too low or too high freq, which will make the clk framework
auto round up to a higher freq.

So there is no need to do this at clk driver.

static long rockchip_rk3588_pll_round_rate(struct clk_hw *hw,
                            unsigned long drate, unsigned long *prate)
{
        if ((drate < 37 * MHZ) || (drate > 4500 * MHZ))
                return -EINVAL;
        else
                return drate;
}

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I3f521e07b1a7639d44efbe12bdc05c4b88621a6e
2022-10-20 14:36:46 +08:00
Yu Qiaowei
7ab31ceb53 video: rockchip: rga3: modify idr
1. idr_alloc uses GFP_NOWAIT.
2. replace idr_alloc with idr_alloc_cyclic.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I52b7d4580462aa7843113777aa09a79091db4502
2022-10-20 10:57:41 +08:00
Cai YiWei
c2af7fd006 media: rockchip: isp: multi sensor for fast case
Change-Id: I47399e80066ff64fe39b026da070c64ffab0c43e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-20 09:18:59 +08:00
Cai YiWei
2209baff7f media: rockchip: isp: second frame first run for fast
Change-Id: Ia67acbcf97d2e93fbf688f4d63b7e8d92a15adff
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-20 09:17:05 +08:00
Felix Zeng
02a071c6a4 driver: rknpu: Fix build error when CONFIG_PM_DEVFREQ is not set
Signed-off-by: Felix Zeng <felix.zeng@rock-chips.com>
Change-Id: I4dda1b517b1a90e4c95bff964f8a9b58192f5132
2022-10-19 18:59:36 +08:00
Jon Lin
181dca2e09 drivers: rkflash: Support read retry for spinand read ECC fail
Change-Id: I498bc8a133a709ac66c3aeeb1cdd5a5ef2e0b466
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-10-19 18:42:12 +08:00
Guochun Huang
a0c3349037 ARM: configs: rockchip_linux_defconfig: enable CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY
enable CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY for inno mipi dphy

Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I78121f4a67fa025890c51b8c290f6c6aa79d5afa
2022-10-19 18:40:15 +08:00
Guochun Huang
2aaca40d95 ARM: dts: rockchip: rk312x: modify dsi node description
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I849b799c4346c1ab039d4650b0e7c0fd27d6cf58
2022-10-19 18:38:28 +08:00
Guochun Huang
ddaecd89d2 drm/rockchip: dsi: add rk312x support
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: Iedf823a62e28b760444f064d6ccfed6a4fe5f36c
2022-10-19 18:38:09 +08:00
Zhichao Yu
2908129ccd ARM: dts: rockchip: add rv1106g-evb-v11-cvr.dts
Add dts for CVR products which enable display panel by default.

Signed-off-by: Zhichao Yu <zhichao.yu@rock-chips.com>
Change-Id: Ief34fb5d805fc0bce7ae656eb8a8939b9f840ef7
2022-10-19 18:37:15 +08:00
Guochun Huang
b314c3296f drm/rockchip: logo: call bridge mode_set helper in rockchip_drm_show_logo
drm_bridge require a display mode which pass through by calling
mode_set hooks, but mode_set only be called after setting mode_changed
flags, so call bridge->funcs->mode_set once in advance during kernel
logo which will not setting mode_changed flags.

Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I81a9c0f05f42dd68a376b669af823c6130462df3
2022-10-19 18:20:23 +08:00
Guochun Huang
d1204038f2 drm/bridge: dw-mipi-dsi: optimize configuration procss
configure dsi host in bridge->funcs->pre_enable/enable which is
called to enable the bridge instead of in bridge->funcs->mode_set
which should be called to set the given mode on the bridge.

Change-Id: Ic242064f0b8433f8bbe8975cc7e35e1f26bf8079
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2022-10-19 18:20:17 +08:00
Tao Huang
79bbaf5328 power: supply: Remove duplicate line on Makefile
There are two identical lines for cw2015_battery.

Fixes: 93120310c3 ("power: battery/charger: move battery/charger drivers to power/supply")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I1af6546464a248534dbc71ef51e5585bff15c5ff
2022-10-19 15:34:53 +08:00
Elaine Zhang
b6a0f7cfda clk: rockchip: rk3568: mark pclk_usb as critical
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I9f7ab4a775855f2c1471c0304e4e08bf13fe3629
2022-10-19 14:22:02 +08:00
Guochun Huang
694c3fcbdb mfd: rk808: fix irq flags mismatch
genirq: Flags mismatch irq 70. 00002088 (rk816_battery) vs. 00002008 (rk816)
rk808 2-001a: Failed to request IRQ 70 for rk816_battery: -16

Fixes: 5a363f34b8 ("pinctrl: rk805: add rk816 support")
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I251634fee4f4f5b39d619c1aaefc8eaded013c35
2022-10-19 11:50:02 +08:00
Elaine Zhang
676b9d98e7 clk: rockchip: rk3588: Fixed clock properties for aclk_vop
aclk_vop->aclk_vop_root (1:1) by default.
aclk_vop->aclk_vop_div2_src->aclk_vop_root (1:2) for special case.

Fixes: af14a79ae3 ("rk3588: support aclk_vop_sub_src set parent to aclk_vop_div2_src")
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ica7ae4d614a4b0bb49d047fe0e20d9b7104df759
2022-10-18 19:22:43 +08:00
Liang Chen
5e2fae3cf7 ARM: configs: rockchip_linux_defconfig: enable CONFIG_EXTCON
Enable CONFIG_EXTCON for usb.

Change-Id: I8d0f68d50773ccb9d337a708f1bf54addbe10fae
Signed-off-by: Liang Chen <cl@rock-chips.com>
2022-10-18 15:26:26 +08:00
Sugar Zhang
de183b927e ASoC: rockchip: pdm: Clear controller when resume from PD off
This patch fix pdm hang on case PD-OFF-ON. It make sense for
controller type-RK3308 which require once clear when PD on.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I802e9b8349bb3c760dcbb6f3d788aa745411c20a
2022-10-17 16:34:07 +08:00
Yifeng Zhao
25ab581dbc drivers: rk_nand: Using kmap_atomic to build page address mapping
The virtual address of allocated __GFP_HIGHMEM pages is not mapped,
Using kmap_atomic to build it, or it will failed like:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = (ptrval)
    [00000000] *pgd=00000000
    Internal error: Oops: 17 [#1] SMP ARM
    Modules linked in:

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I5f337ed9684c5769d90aadb7bf23aae0db9968e8
2022-10-17 15:29:29 +08:00
Sandy Huang
97d06e74fb clk: rockchip: rk3128: add clk gate for PCLK_MIPIPHY
Change-Id: Icf55c315edc9514a23d00433ffe56c864ad7f3d8
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2022-10-17 11:40:55 +08:00
Yu Qiaowei
96d74e940e video: rockchip: rga3: fix use-after-free in rga_request_release_signal
Make sure the job is no longer in use before releasing the job.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I6a63c2b94fc9004bb460279e7a940ffa0f57c682
2022-10-17 09:49:05 +08:00
Sugar Zhang
10b63561fc ASoC: rockchip: pdm: Allow mclk shift around 1 ppm
This patch allow mclk shift around +/- 1ppm compared to
requested freq.

we could not always achieve the precise freq as required,
e.g. request: 98304000, but got: 98303999

there is no big deal and any side effect on the above case,
so, we allow a tiny shift for mclk.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I8da91e467cfc0306fa9069ab30079d5ddf1c0336
2022-10-15 15:45:10 +08:00
Shunhua Lan
a8de4e09e2 media: rockchip: hdmirx: Add extcon support
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: Ia19b8f7230af515b8dbc7bb953d03e8e5dbb1f7a
2022-10-15 15:03:09 +08:00
Ziyuan Xu
9e2a65010b media: rockchip: isp: improve thunder boot process
1. pm_get until rtos was done
2. wait rtos with 200ms timeout
3. disable clks until the rtos *really* EOF

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: Id8a31a848e6784cfd9f25375d6f255daa0a6e524
2022-10-15 14:53:34 +08:00
Algea Cao
828908d4a6 drm/rockchip: dw_hdmi: Add old vp id
HDMI should get old vp id when disable dclk.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I01073902d7be88642a599c29f2596bdb92f402cc
2022-10-15 14:51:20 +08:00
Jon Lin
70680c754e drivers: rkflash: Using kmap_atomic to build page address mapping
The virtual address of allocated __GFP_HIGHMEM pages is not mapped,
Using kmap_atomic to build it, or it will failed like:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = 50ec00c8
    [00000000] *pgd=00000000
    Internal error: Oops: 817 [#1] PREEMPT SMP ARM
    Modules linked in:
    CPU: 3 PID: 67 Comm: rkflash Not tainted 4.19.111 #67
    Hardware name: Generic DT based system
    PC is at memcpy+0x50/0x330
    LR is at 0x61640a68

Change-Id: I0cde9012d29e49d9ba751cb019ccfa784c01b7c7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-10-13 19:10:35 +08:00
Weiwen Chen
0e1556a339 ARM: rv1106-evb.config: enable CONFIG_NVMEM_SYSFS
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I83ecba98d3d31424e479db46f428cd4bba799ad8
2022-10-13 17:44:39 +08:00
Yandong Lin
494310d199 video: rockchip: mpp: fix the decoding buf is released issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I66906651dc3e80470d0873cae7fce8ee1e662b0a
2022-10-13 11:28:36 +08:00
Cai YiWei
7d56606706 media: rockchip: isp: make sure to free buf after isp stop
Change-Id: Ie9dd6fa1c482103d5961ff5acda07461773cf735
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-12 17:04:50 +08:00
Yongzhen
d6835708d6 media: i2c: sc200ai fix rk_cam_fps mistake
Fixes: 266443eda9 ("media: i2c: sc200ai support get config from cmdline for thunderboot")
Signed-off-by: Yongzhen <yuyz@rock-chips.com>
Change-Id: I9624bd9f36795e1fd6802990b17173c68be63bb7
2022-10-12 17:02:50 +08:00
Cai YiWei
6cfa171d7f media: rockchip: isp: fix hdr config for unite multi sensor
Change-Id: Ia164e14291b6be0e48ab5cd02c40fbaf9bb75ff8
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-12 15:26:29 +08:00
William Wu
d8db0c1fa4 phy: rockchip: inno-usb2: fix phy reset during power on for rk3588
The RK3588 USB2 PHY provides CLK12MOHCI and CLK48MOHCI to
OHCI controllers, and the two clocks are turned off upon
PHY reset, therefore it shouldn't access OHCI Controller
if USB2 PHY in reset. However, during the system PM resume,
the current USB2 PHY power on sequence with PHY reset
operation has potential risk that reset PHY accidentally
when OHCI platform resume access OHCI Controller, and
cause system hung.

The reason is EHCI/OHCI controllers resume ordering on
RK3588. In outline form, the hcd_bus_resume() of EHCI
and the ohci_resume() of OHCI operating concurrently on
different CPUs perform the following actions:

CPU 0                                   CPU 1
----------------------------            ---------------------------------
async_resume()
  usb_resume()
    hcd_bus_resume() -- EHCI
      usb_phy_roothub_resume()
        phy_power_on()
          rockchip_usb2phy_power_on()   ohci_platform_resume()
            rockchip_usb2phy_reset()      ohci_resume()
              assert phy reset              ...
                udelay(10);                 ohci_readl or ohci_writel

This patch fixes USB2 PHY reset during power on for RK3588,
only do USB2 PHY reset for RK3588 USB OTG0 and OTG1, because
their 'common_on_n' bit can be set to 1'b1 (aka REFCLK_LOGIC,
Bias, and PLL blocks are powered down) in PM runtime process.
And keep the 'common_on_n' to 1'b0 for RK3588 USB2 HOST0 and
HOST1, thus we don't need to do PHY reset during power on for
them.

This patch doesn't increase the USB2 PHY power consumption,
because the USB2 HOST0 and HOST1 don't support PM runtime
management, so actually the PHY PLL blocks of USB2 HOST0 and
HOST1 are always powered on.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ia0121a7c49bef4f0f3a1fb11a810e4ef95b29982
2022-10-12 14:10:15 +08:00
Weiwen Chen
9af1805a1b ARM: dts: rockchip: add rv1103g-battery-ipc-v11.dts
diff rv1103g_bat_ipc_demo_v11 with rv1103g_bat_ipc_demo_v10
1. camera sensor use SC3338
2. remove WiFi's PA
3. control lux_en(GPIO3_A2) inversely

Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I57b9dd35a7cddc5869d385412d47112c3b9a6222
2022-10-11 21:10:05 +08:00
William Wu
7a616cbc2f usb: host: ehci-platform: fix companion-device leak for rockchip
Make sure do drop the reference taken to the companion device
during probe/remove/resume.

Fixes: 68850661b5 ("usb: host: ehci-platform: Add device_link between the ehci and companion")
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I0bbfe77987a1c11bfaa5006d98a56480ff16224f
2022-10-11 16:38:35 +08:00
Andy Yan
f727d3ad8e drm/fourcc: Add definitions for Rockchip vendor and VPU tiled format
This introduces specific definitions for vendor Rockchip and its
associated tiled format modifier. This modifier is used for the
output format of the Video/JPEG Decoder, that can be imported
directly with the VOP2.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I03c1a51af5fd8bc0702209ae216c4706b4101c49
2022-10-11 16:38:27 +08:00
Cai YiWei
50d0d25b96 media: rockchip: isp: fix stream no output for multi sensor
Change-Id: I1eac20635753120bcd45bf3b04d45b64a6f35f0a
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-10-11 10:23:30 +08:00