mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
Merge commit '243363ccfdc2f2ed3be8e210d1687d7a8b14a97a'
* commit '243363ccfdc2f2ed3be8e210d1687d7a8b14a97a': misc: rockchip: pcie-rkep: Remove redundancy vm_flags media: i2c: add support sc485sl sensor driver media: i2c: add support os04e10 sensor driver for v6.1 media: rockchip: vicap support get error info include: rk-camera-module: add cmd RKMODULE_GET_ERROR_INFO arm64: dts: rockchip: rv1126b-evb1-v10&rv1126b-evb2-v10: enable low power aoa dt-bindings: suspend: add RKPM_SLP_LP_AOA macro for rv1126b video: rockchip: rga3: fix error of using DMA_MAPPING_ERROR directly video: rockchip: rga3: fix image size cal error in BPP format arm64: dts: rockchip: Remove property support-psr of eDP nodes drm/rockchip: Move the init/cleanup of self refresh helper from VOP/VOP2 to eDP/RGB drivers drm/rockchip: vop: Add errno if &vop->lut memory allocation failed in vop_create_crtc() drm/bridge: analogix_dp: Add &analogix_dp_plat_data.disable_psr to check whether to disable PSR PCI: rockchip: dw-dmatest: Fix compile warning Change-Id: I2fec17a7e13f8f317b5bf767ccb53b800c3b1625
This commit is contained in:
@@ -88,7 +88,6 @@
|
||||
|
||||
&edp {
|
||||
force-hpd;
|
||||
support-psr;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
|
||||
&edp0 {
|
||||
force-hpd;
|
||||
support-psr;
|
||||
status = "okay";
|
||||
|
||||
ports {
|
||||
|
||||
@@ -416,7 +416,6 @@
|
||||
};
|
||||
|
||||
&edp0 {
|
||||
support-psr;
|
||||
force-hpd;
|
||||
status = "okay";
|
||||
|
||||
|
||||
@@ -363,7 +363,6 @@
|
||||
};
|
||||
|
||||
&edp0 {
|
||||
support-psr;
|
||||
force-hpd;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
| RKPM_SLP_PMU_PMUALIVE_32K
|
||||
| RKPM_SLP_PMU_DIS_OSC
|
||||
| RKPM_SLP_32K_EXT
|
||||
| RKPM_SLP_LP_AOA
|
||||
)
|
||||
>;
|
||||
|
||||
@@ -156,6 +157,13 @@
|
||||
| RKPM_IO_CFG_ID(25)
|
||||
)
|
||||
>;
|
||||
|
||||
rockchip,wakeup-config = <
|
||||
(0
|
||||
| RKPM_GPIO0_WKUP_EN
|
||||
| RKPM_AAD_WKUP_EN
|
||||
)
|
||||
>;
|
||||
};
|
||||
|
||||
&rtc {
|
||||
|
||||
@@ -21,6 +21,16 @@
|
||||
&rockchip_suspend {
|
||||
status = "okay";
|
||||
|
||||
rockchip,sleep-mode-config = <
|
||||
(0
|
||||
| RKPM_SLP_ARMOFF_LOGOFF
|
||||
| RKPM_SLP_PMU_PMUALIVE_32K
|
||||
| RKPM_SLP_PMU_DIS_OSC
|
||||
| RKPM_SLP_32K_EXT
|
||||
| RKPM_SLP_LP_AOA
|
||||
)
|
||||
>;
|
||||
|
||||
rockchip,sleep-pin-config = <
|
||||
(0
|
||||
| RKPM_SLEEP_PIN0_EN
|
||||
@@ -30,6 +40,13 @@
|
||||
)
|
||||
>;
|
||||
|
||||
rockchip,wakeup-config = <
|
||||
(0
|
||||
| RKPM_GPIO0_WKUP_EN
|
||||
| RKPM_AAD_WKUP_EN
|
||||
)
|
||||
>;
|
||||
|
||||
rockchip,sleep-io-config = <
|
||||
/* pmic_sleep */
|
||||
(0
|
||||
|
||||
@@ -191,7 +191,7 @@ static bool analogix_dp_detect_sink_psr(struct analogix_dp_device *dp)
|
||||
unsigned char psr_version;
|
||||
int ret;
|
||||
|
||||
if (!device_property_read_bool(dp->dev, "support-psr"))
|
||||
if (dp->plat_data->disable_psr)
|
||||
return 0;
|
||||
|
||||
ret = drm_dp_dpcd_readb(&dp->aux, DP_PSR_SUPPORT, &psr_version);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_self_refresh_helper.h>
|
||||
#include <drm/drm_simple_kms_helper.h>
|
||||
|
||||
#include "rockchip_drm_drv.h"
|
||||
@@ -634,6 +635,38 @@ static int rockchip_dp_drm_create_encoder(struct rockchip_dp_device *dp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rockchip_dp_drm_self_refresh_helper_init(struct rockchip_dp_device *dp)
|
||||
{
|
||||
struct drm_encoder *encoder = &dp->encoder.encoder;
|
||||
struct drm_crtc *crtc;
|
||||
int ret;
|
||||
|
||||
if (!dp->plat_data.disable_psr) {
|
||||
drm_for_each_crtc(crtc, encoder->dev) {
|
||||
if (drm_encoder_crtc_ok(encoder, crtc)) {
|
||||
ret = drm_self_refresh_helper_init(crtc);
|
||||
if (ret)
|
||||
dev_warn(dp->dev,
|
||||
"Failed to init self refresh helper for crtc-%d\n",
|
||||
drm_crtc_index(crtc));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void rockchip_dp_drm_self_refresh_helper_cleanup(struct rockchip_dp_device *dp)
|
||||
{
|
||||
struct drm_encoder *encoder = &dp->encoder.encoder;
|
||||
struct drm_crtc *crtc;
|
||||
|
||||
if (!dp->plat_data.disable_psr) {
|
||||
drm_for_each_crtc(crtc, encoder->dev) {
|
||||
if (drm_encoder_crtc_ok(encoder, crtc))
|
||||
drm_self_refresh_helper_cleanup(crtc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int rockchip_dp_bind(struct device *dev, struct device *master,
|
||||
void *data)
|
||||
{
|
||||
@@ -657,6 +690,8 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
|
||||
if (ret)
|
||||
goto err_unregister_audio_pdev;
|
||||
|
||||
rockchip_dp_drm_self_refresh_helper_init(dp);
|
||||
|
||||
return 0;
|
||||
|
||||
err_unregister_audio_pdev:
|
||||
@@ -672,6 +707,7 @@ static void rockchip_dp_unbind(struct device *dev, struct device *master,
|
||||
|
||||
if (dp->audio_pdev)
|
||||
platform_device_unregister(dp->audio_pdev);
|
||||
rockchip_dp_drm_self_refresh_helper_cleanup(dp);
|
||||
analogix_dp_unbind(dp->adp);
|
||||
dp->encoder.encoder.funcs->destroy(&dp->encoder.encoder);
|
||||
}
|
||||
@@ -733,6 +769,7 @@ static int rockchip_dp_probe(struct platform_device *pdev)
|
||||
dp->plat_data.convert_to_origin_mode = drm_mode_convert_to_origin_mode;
|
||||
dp->plat_data.skip_connector = rockchip_dp_skip_connector(bridge);
|
||||
dp->plat_data.bridge = bridge;
|
||||
dp->plat_data.disable_psr = device_property_read_bool(dp->dev, "rockchip,disable-psr");
|
||||
|
||||
ret = rockchip_dp_of_probe(dp);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <drm/drm_gem_atomic_helper.h>
|
||||
#include <drm/drm_gem_framebuffer_helper.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_self_refresh_helper.h>
|
||||
#include <drm/drm_vblank.h>
|
||||
#include <drm/drm_writeback.h>
|
||||
|
||||
@@ -5744,11 +5743,6 @@ static int vop_create_crtc(struct vop *vop)
|
||||
VOP_ATTACH_MODE_CONFIG_PROP(tv_bottom_margin_property, 100);
|
||||
#undef VOP_ATTACH_MODE_CONFIG_PROP
|
||||
vop_crtc_create_feature_property(vop, crtc);
|
||||
ret = drm_self_refresh_helper_init(crtc);
|
||||
if (ret)
|
||||
DRM_DEV_DEBUG_KMS(vop->dev,
|
||||
"Failed to init %s with SR helpers %d, ignoring\n",
|
||||
crtc->name, ret);
|
||||
|
||||
if (vop->lut_regs) {
|
||||
u16 *r_base, *g_base, *b_base;
|
||||
@@ -5756,8 +5750,10 @@ static int vop_create_crtc(struct vop *vop)
|
||||
|
||||
vop->lut = devm_kmalloc_array(dev, lut_len, sizeof(*vop->lut),
|
||||
GFP_KERNEL);
|
||||
if (!vop->lut)
|
||||
if (!vop->lut) {
|
||||
ret = -ENOMEM;
|
||||
goto err_unregister_crtc_funcs;
|
||||
}
|
||||
|
||||
if (vop_of_init_display_lut(vop)) {
|
||||
for (i = 0; i < lut_len; i++) {
|
||||
@@ -5800,8 +5796,6 @@ static void vop_destroy_crtc(struct vop *vop)
|
||||
struct drm_device *drm_dev = vop->drm_dev;
|
||||
struct drm_plane *plane, *tmp;
|
||||
|
||||
drm_self_refresh_helper_cleanup(crtc);
|
||||
|
||||
of_node_put(crtc->port);
|
||||
|
||||
/*
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <drm/drm_gem_framebuffer_helper.h>
|
||||
#include <drm/drm_plane_helper.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_self_refresh_helper.h>
|
||||
|
||||
#include <drm/drm_writeback.h>
|
||||
#ifdef CONFIG_DRM_ANALOGIX_DP
|
||||
@@ -15370,12 +15369,6 @@ static int vop2_create_crtc(struct vop2 *vop2, uint8_t enabled_vp_mask)
|
||||
vop2_crtc_create_feature_property(vop2, crtc);
|
||||
vop2_crtc_create_vrr_property(vop2, crtc);
|
||||
|
||||
ret = drm_self_refresh_helper_init(crtc);
|
||||
if (ret)
|
||||
DRM_DEV_DEBUG_KMS(vop2->dev,
|
||||
"Failed to init %s with SR helpers %d, ignoring\n",
|
||||
crtc->name, ret);
|
||||
|
||||
if (vp_data->feature & (VOP_FEATURE_VIVID_HDR | VOP_FEATURE_DOVI))
|
||||
vop2_crtc_create_hdr_property(vop2, crtc);
|
||||
if (vp_data->feature & VOP_FEATURE_POST_ACM)
|
||||
@@ -15463,7 +15456,6 @@ static void vop2_destroy_crtc(struct drm_crtc *crtc)
|
||||
{
|
||||
struct vop2_video_port *vp = to_vop2_video_port(crtc);
|
||||
|
||||
drm_self_refresh_helper_cleanup(crtc);
|
||||
if (vp->hdr_lut_gem_obj)
|
||||
rockchip_gem_free_object(&vp->hdr_lut_gem_obj->base);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_panel.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_self_refresh_helper.h>
|
||||
|
||||
#include <uapi/linux/videodev2.h>
|
||||
|
||||
@@ -914,6 +915,38 @@ static struct backlight_device *rockchip_mcu_panel_find_backlight(struct rockchi
|
||||
return bd;
|
||||
}
|
||||
|
||||
static void rockchip_rgb_drm_self_refresh_helper_init(struct rockchip_rgb *rgb)
|
||||
{
|
||||
struct drm_encoder *encoder = &rgb->encoder;
|
||||
struct drm_crtc *crtc;
|
||||
int ret;
|
||||
|
||||
if (rgb->np_mcu_panel && rgb->support_psr) {
|
||||
drm_for_each_crtc(crtc, encoder->dev) {
|
||||
if (drm_encoder_crtc_ok(encoder, crtc)) {
|
||||
ret = drm_self_refresh_helper_init(crtc);
|
||||
if (ret)
|
||||
dev_warn(rgb->dev,
|
||||
"Failed to init self refresh helper for crtc-%d\n",
|
||||
drm_crtc_index(crtc));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void rockchip_rgb_drm_self_refresh_helper_cleanup(struct rockchip_rgb *rgb)
|
||||
{
|
||||
struct drm_encoder *encoder = &rgb->encoder;
|
||||
struct drm_crtc *crtc;
|
||||
|
||||
if (rgb->np_mcu_panel && rgb->support_psr) {
|
||||
drm_for_each_crtc(crtc, encoder->dev) {
|
||||
if (drm_encoder_crtc_ok(encoder, crtc))
|
||||
drm_self_refresh_helper_cleanup(crtc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int rockchip_rgb_bind(struct device *dev, struct device *master,
|
||||
void *data)
|
||||
{
|
||||
@@ -1019,6 +1052,8 @@ static int rockchip_rgb_bind(struct device *dev, struct device *master,
|
||||
rockchip_drm_register_sub_dev(&rgb->sub_dev);
|
||||
}
|
||||
|
||||
rockchip_rgb_drm_self_refresh_helper_init(rgb);
|
||||
|
||||
return 0;
|
||||
|
||||
err_free_connector:
|
||||
@@ -1033,6 +1068,8 @@ static void rockchip_rgb_unbind(struct device *dev, struct device *master,
|
||||
{
|
||||
struct rockchip_rgb *rgb = dev_get_drvdata(dev);
|
||||
|
||||
rockchip_rgb_drm_self_refresh_helper_cleanup(rgb);
|
||||
|
||||
if (rgb->sub_dev.connector)
|
||||
rockchip_drm_unregister_sub_dev(&rgb->sub_dev);
|
||||
if (rgb->panel)
|
||||
|
||||
@@ -1131,6 +1131,17 @@ config VIDEO_OS04D10
|
||||
This is a Video4Linux2 sensor driver for the OmniVision
|
||||
OS04D10 camera.
|
||||
|
||||
config VIDEO_OS04E10
|
||||
tristate "OmniVision OS04E10 sensor support"
|
||||
depends on I2C && VIDEO_DEV
|
||||
depends on MEDIA_CAMERA_SUPPORT
|
||||
select MEDIA_CONTROLLER
|
||||
select VIDEO_V4L2_SUBDEV_API
|
||||
select V4L2_FWNODE
|
||||
help
|
||||
This is a Video4Linux2 sensor driver for the OmniVision
|
||||
OS04E10 camera.
|
||||
|
||||
config VIDEO_OS05A20
|
||||
tristate "OmniVision OS05A20 sensor support"
|
||||
depends on I2C && VIDEO_DEV
|
||||
@@ -2098,6 +2109,16 @@ config VIDEO_SC450AI
|
||||
This is a Video4Linux2 sensor driver for the SmartSens
|
||||
SC450ai camera.
|
||||
|
||||
config VIDEO_SC485SL
|
||||
tristate "SmartSens SC485SL sensor support"
|
||||
depends on I2C && VIDEO_DEV
|
||||
select MEDIA_CONTROLLER
|
||||
select VIDEO_V4L2_SUBDEV_API
|
||||
select V4L2_FWNODE
|
||||
help
|
||||
This is a Video4Linux2 sensor driver for the SmartSens
|
||||
sc485sl camera.
|
||||
|
||||
config VIDEO_SC500AI
|
||||
tristate "SmartSens SC500AI sensor support"
|
||||
depends on I2C && VIDEO_DEV
|
||||
|
||||
@@ -159,6 +159,7 @@ obj-$(CONFIG_VIDEO_OS02K10) += os02k10.o
|
||||
obj-$(CONFIG_VIDEO_OS03B10) += os03b10.o
|
||||
obj-$(CONFIG_VIDEO_OS04A10) += os04a10.o
|
||||
obj-$(CONFIG_VIDEO_OS04D10) += os04d10.o
|
||||
obj-$(CONFIG_VIDEO_OS04E10) += os04e10.o
|
||||
obj-$(CONFIG_VIDEO_OS05A20) += os05a20.o
|
||||
obj-$(CONFIG_VIDEO_OS05L10) += os05l10.o
|
||||
obj-$(CONFIG_VIDEO_OS08A20) += os08a20.o
|
||||
@@ -257,6 +258,7 @@ obj-$(CONFIG_VIDEO_SC430CS) += sc430cs.o
|
||||
obj-$(CONFIG_VIDEO_SC4336) += sc4336.o
|
||||
obj-$(CONFIG_VIDEO_SC4336P) += sc4336p.o
|
||||
obj-$(CONFIG_VIDEO_SC450AI) += sc450ai.o
|
||||
obj-$(CONFIG_VIDEO_SC485SL) += sc485sl.o
|
||||
obj-$(CONFIG_VIDEO_SC500AI) += sc500ai.o
|
||||
obj-$(CONFIG_VIDEO_SC501AI) += sc501ai.o
|
||||
obj-$(CONFIG_VIDEO_SC530AI) += sc530ai.o
|
||||
|
||||
2391
drivers/media/i2c/os04e10.c
Normal file
2391
drivers/media/i2c/os04e10.c
Normal file
File diff suppressed because it is too large
Load Diff
3291
drivers/media/i2c/sc485sl.c
Normal file
3291
drivers/media/i2c/sc485sl.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6912,20 +6912,8 @@ void rkcif_do_stop_stream(struct rkcif_stream *stream,
|
||||
ret = dev->pipe.close(&dev->pipe);
|
||||
if (ret < 0)
|
||||
v4l2_err(v4l2_dev, "pipeline close failed error:%d\n", ret);
|
||||
if (dev->hdr.hdr_mode == HDR_X2) {
|
||||
if (dev->stream[RKCIF_STREAM_MIPI_ID0].state == RKCIF_STATE_READY &&
|
||||
dev->stream[RKCIF_STREAM_MIPI_ID1].state == RKCIF_STATE_READY) {
|
||||
dev->can_be_reset = true;
|
||||
}
|
||||
} else if (dev->hdr.hdr_mode == HDR_X3) {
|
||||
if (dev->stream[RKCIF_STREAM_MIPI_ID0].state == RKCIF_STATE_READY &&
|
||||
dev->stream[RKCIF_STREAM_MIPI_ID1].state == RKCIF_STATE_READY &&
|
||||
dev->stream[RKCIF_STREAM_MIPI_ID2].state == RKCIF_STATE_READY) {
|
||||
dev->can_be_reset = true;
|
||||
}
|
||||
} else {
|
||||
if (atomic_read(&dev->pipe.stream_cnt) == 0)
|
||||
dev->can_be_reset = true;
|
||||
}
|
||||
mutex_lock(&hw_dev->dev_lock);
|
||||
for (i = 0; i < hw_dev->dev_num; i++) {
|
||||
if (atomic_read(&hw_dev->cif_dev[i]->pipe.stream_cnt) != 0) {
|
||||
@@ -9903,6 +9891,55 @@ void rkcif_flip_end_wait_work(struct work_struct *work)
|
||||
mutex_unlock(&dev->stream_lock);
|
||||
}
|
||||
|
||||
static int rkcif_get_error_info(struct rkcif_device *cif_dev,
|
||||
struct rkmodule_error_info *err_info)
|
||||
{
|
||||
int count = 0;
|
||||
int is_dvp = (cif_dev->inf_id == RKCIF_DVP);
|
||||
|
||||
memset(err_info, 0, sizeof(*err_info));
|
||||
|
||||
if (is_dvp)
|
||||
count = snprintf(err_info->detail, sizeof(err_info->detail), "rkcif_dvp:");
|
||||
else
|
||||
count = snprintf(err_info->detail, sizeof(err_info->detail), "rkcif_mipi%d:", cif_dev->csi_host_idx);
|
||||
|
||||
#define APPEND_STAT(field) \
|
||||
do {\
|
||||
ssize_t remaining = sizeof(err_info->detail) - count;\
|
||||
if (remaining > 0) { \
|
||||
int written = snprintf(err_info->detail + count, remaining, "%lld,", cif_dev->irq_stats.field); \
|
||||
if (written >= 0) { \
|
||||
count += written; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
APPEND_STAT(bus0_err);
|
||||
APPEND_STAT(bus1_err);
|
||||
|
||||
if (is_dvp) {
|
||||
APPEND_STAT(dvp_overflow_cnt);
|
||||
APPEND_STAT(dvp_bwidth_lack_cnt);
|
||||
APPEND_STAT(dvp_size_err_cnt);
|
||||
} else {
|
||||
APPEND_STAT(csi_overflow_cnt);
|
||||
APPEND_STAT(csi_bwidth_lack_cnt);
|
||||
APPEND_STAT(csi_size_err_cnt);
|
||||
}
|
||||
|
||||
count += snprintf(err_info->detail + count, sizeof(err_info->detail) - count,
|
||||
"%lld,%lld,%lld,%lld,",
|
||||
cif_dev->irq_stats.not_active_buf_cnt[0],
|
||||
cif_dev->irq_stats.not_active_buf_cnt[1],
|
||||
cif_dev->irq_stats.not_active_buf_cnt[2],
|
||||
cif_dev->irq_stats.not_active_buf_cnt[3]);
|
||||
|
||||
err_info->err_code = cif_dev->irq_stats.all_err_cnt ? BIT(0) : 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rkcif_do_reset_work(struct rkcif_device *cif_dev,
|
||||
enum rkmodule_reset_src reset_src);
|
||||
|
||||
@@ -9933,6 +9970,7 @@ static long rkcif_ioctl_default(struct file *file, void *fh,
|
||||
u32 vblank = 0;
|
||||
struct rkisp_vicap_mode vicap_mode;
|
||||
struct v4l2_subdev *sd = NULL;
|
||||
struct rkmodule_error_info *err_info;
|
||||
|
||||
switch (cmd) {
|
||||
case RKCIF_CMD_GET_CSI_MEMORY_MODE:
|
||||
@@ -10235,6 +10273,10 @@ static long rkcif_ioctl_default(struct file *file, void *fh,
|
||||
else
|
||||
dev->is_support_get_exp = false;
|
||||
break;
|
||||
case RKMODULE_GET_ERROR_INFO:
|
||||
err_info = (struct rkmodule_error_info *)arg;
|
||||
ret = rkcif_get_error_info(dev, err_info);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -14102,12 +14144,16 @@ unsigned int rkcif_irq_global(struct rkcif_device *cif_dev)
|
||||
v4l2_err(&cif_dev->v4l2_dev,
|
||||
"ERROR: AXI0 bus err intstat_glb:0x%x !!\n",
|
||||
intstat_glb);
|
||||
cif_dev->irq_stats.bus0_err++;
|
||||
cif_dev->irq_stats.all_err_cnt++;
|
||||
return 0;
|
||||
}
|
||||
if (cif_dev->chip_id == CHIP_RK3588_CIF && intstat_glb & SCALE_TOISP_AXI1_ERR) {
|
||||
v4l2_err(&cif_dev->v4l2_dev,
|
||||
"ERROR: AXI1 bus err intstat_glb:0x%x !!\n",
|
||||
intstat_glb);
|
||||
cif_dev->irq_stats.bus1_err++;
|
||||
cif_dev->irq_stats.all_err_cnt++;
|
||||
return 0;
|
||||
}
|
||||
return intstat_glb;
|
||||
@@ -15029,12 +15075,14 @@ void rkcif_irq_pingpong_v1(struct rkcif_device *cif_dev)
|
||||
if (cif_dev->chip_id >= CHIP_RV1103B_CIF)
|
||||
rkcif_write_register_and(cif_dev, CIF_REG_MIPI_LVDS_CTRL, ~0x000f0000);
|
||||
}
|
||||
cif_dev->irq_stats.all_err_cnt++;
|
||||
return;
|
||||
}
|
||||
|
||||
if (intstat & CSI_FIFO_OVERFLOW_V1) {
|
||||
cif_dev->irq_stats.csi_overflow_cnt++;
|
||||
cif_dev->err_state |= RKCIF_ERR_OVERFLOW;
|
||||
cif_dev->irq_stats.all_err_cnt++;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -398,6 +398,8 @@ struct rkcif_irq_stats {
|
||||
u64 frm_end_cnt[RKCIF_MAX_STREAM_MIPI];
|
||||
u64 not_active_buf_cnt[RKCIF_MAX_STREAM_MIPI];
|
||||
u64 trig_simult_cnt[RKCIF_MAX_STREAM_MIPI];
|
||||
u64 bus0_err;
|
||||
u64 bus1_err;
|
||||
u64 all_err_cnt;
|
||||
};
|
||||
|
||||
|
||||
@@ -641,12 +641,51 @@ static void csi2_quick_stream_off(struct csi2_dev *csi2)
|
||||
}
|
||||
}
|
||||
|
||||
static int csi2_get_error_info(struct csi2_dev *csi2,
|
||||
struct rkmodule_error_info *err_info)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
memset(err_info, 0, sizeof(*err_info));
|
||||
|
||||
count = snprintf(err_info->detail, sizeof(err_info->detail), "%s:", csi2->dev_name);
|
||||
|
||||
#define APPEND_STAT(field) \
|
||||
do {\
|
||||
ssize_t remaining = sizeof(err_info->detail) - count;\
|
||||
if (remaining > 0) { \
|
||||
int written = snprintf(err_info->detail + count, remaining, "%u,", csi2->err_list[field].cnt); \
|
||||
if (written >= 0) { \
|
||||
count += written; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
APPEND_STAT(RK_CSI2_ERR_SOTSYN);
|
||||
APPEND_STAT(RK_CSI2_ERR_FS_FE_MIS);
|
||||
APPEND_STAT(RK_CSI2_ERR_FRM_SEQ_ERR);
|
||||
APPEND_STAT(RK_CSI2_ERR_CRC_ONCE);
|
||||
APPEND_STAT(RK_CSI2_ERR_CRC);
|
||||
APPEND_STAT(RK_CSI2_ERR_ECC2);
|
||||
APPEND_STAT(RK_CSI2_ERR_CTRL);
|
||||
APPEND_STAT(RK_CSI2_ERR_ULPM);
|
||||
APPEND_STAT(RK_CSI2_ERR_SOT);
|
||||
APPEND_STAT(RK_CSI2_ERR_ECC);
|
||||
APPEND_STAT(RK_CSI2_ERR_ID);
|
||||
APPEND_STAT(RK_CSI2_ERR_CODE);
|
||||
|
||||
err_info->err_code = csi2->err_list[RK_CSI2_ERR_ALL].cnt ? BIT(0) : 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long rkcif_csi2_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
{
|
||||
struct csi2_dev *csi2 = sd_to_dev(sd);
|
||||
struct v4l2_subdev *sensor = get_remote_sensor(sd);
|
||||
long ret = 0;
|
||||
int i = 0;
|
||||
struct rkmodule_error_info *err_info;
|
||||
|
||||
switch (cmd) {
|
||||
case RKCIF_CMD_SET_CSI_IDX:
|
||||
@@ -667,6 +706,10 @@ static long rkcif_csi2_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg
|
||||
else
|
||||
csi2_quick_stream_off(csi2);
|
||||
break;
|
||||
case RKMODULE_GET_ERROR_INFO:
|
||||
err_info = (struct rkmodule_error_info *)arg;
|
||||
ret = csi2_get_error_info(csi2, err_info);
|
||||
break;
|
||||
default:
|
||||
ret = -ENOIOCTLCMD;
|
||||
break;
|
||||
@@ -683,6 +726,7 @@ static long rkcif_csi2_compat_ioctl32(struct v4l2_subdev *sd,
|
||||
struct rkcif_csi_info csi_info;
|
||||
int sw_dbg = 0;
|
||||
long ret;
|
||||
struct rkmodule_error_info *err_info;
|
||||
|
||||
switch (cmd) {
|
||||
case RKCIF_CMD_SET_CSI_IDX:
|
||||
@@ -697,6 +741,22 @@ static long rkcif_csi2_compat_ioctl32(struct v4l2_subdev *sd,
|
||||
|
||||
ret = rkcif_csi2_ioctl(sd, cmd, &sw_dbg);
|
||||
break;
|
||||
case RKMODULE_GET_ERROR_INFO:
|
||||
err_info = kzalloc(sizeof(*err_info), GFP_KERNEL);
|
||||
if (!err_info) {
|
||||
ret = -ENOMEM;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = rkcif_csi2_ioctl(sd, cmd, err_info);
|
||||
if (!ret) {
|
||||
if (copy_to_user(up, err_info, sizeof(*err_info))) {
|
||||
kfree(err_info);
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
kfree(err_info);
|
||||
break;
|
||||
default:
|
||||
ret = -ENOIOCTLCMD;
|
||||
break;
|
||||
@@ -960,6 +1020,7 @@ static irqreturn_t rk_csirx_irq2_handler(int irq, void *ctx)
|
||||
char err_str[CSI_ERRSTR_LEN] = {0};
|
||||
char vc_info[CSI_VCINFO_LEN] = {0};
|
||||
u64 cur_timestamp = ktime_get_ns();
|
||||
struct csi2_err_stats *err_list = NULL;
|
||||
|
||||
if (!csi2_hw) {
|
||||
disable_irq_nosync(irq);
|
||||
@@ -975,26 +1036,36 @@ static irqreturn_t rk_csirx_irq2_handler(int irq, void *ctx)
|
||||
val = read_csihost_reg(csi2_hw->base, CSIHOST_ERR2);
|
||||
if (val) {
|
||||
if (val & CSIHOST_ERR2_PHYERR_ESC) {
|
||||
err_list = &csi2->err_list[RK_CSI2_ERR_ULPM];
|
||||
err_list->cnt++;
|
||||
csi2_find_err_vc(val & 0xf, vc_info);
|
||||
snprintf(cur_str, CSI_ERRSTR_LEN, "(ULPM,lane:%s) ", vc_info);
|
||||
csi2_err_strncat(err_str, cur_str);
|
||||
}
|
||||
if (val & CSIHOST_ERR2_PHYERR_SOTHS) {
|
||||
err_list = &csi2->err_list[RK_CSI2_ERR_SOT];
|
||||
err_list->cnt++;
|
||||
csi2_find_err_vc((val >> 4) & 0xf, vc_info);
|
||||
snprintf(cur_str, CSI_ERRSTR_LEN, "(sot,lane:%s) ", vc_info);
|
||||
csi2_err_strncat(err_str, cur_str);
|
||||
}
|
||||
if (val & CSIHOST_ERR2_ECC_CORRECTED) {
|
||||
err_list = &csi2->err_list[RK_CSI2_ERR_ECC];
|
||||
err_list->cnt++;
|
||||
csi2_find_err_vc((val >> 8) & 0xf, vc_info);
|
||||
snprintf(cur_str, CSI_ERRSTR_LEN, "(ecc,vc:%s) ", vc_info);
|
||||
csi2_err_strncat(err_str, cur_str);
|
||||
}
|
||||
if (val & CSIHOST_ERR2_ERR_ID) {
|
||||
err_list = &csi2->err_list[RK_CSI2_ERR_ID];
|
||||
err_list->cnt++;
|
||||
csi2_find_err_vc((val >> 12) & 0xf, vc_info);
|
||||
snprintf(cur_str, CSI_ERRSTR_LEN, "(err id,vc:%s) ", vc_info);
|
||||
csi2_err_strncat(err_str, cur_str);
|
||||
}
|
||||
if (val & CSIHOST_ERR2_PHYERR_CODEHS) {
|
||||
err_list = &csi2->err_list[RK_CSI2_ERR_CODE];
|
||||
err_list->cnt++;
|
||||
snprintf(cur_str, CSI_ERRSTR_LEN, "(err code) ");
|
||||
csi2_err_strncat(err_str, cur_str);
|
||||
}
|
||||
|
||||
@@ -115,6 +115,11 @@ enum csi2_err {
|
||||
RK_CSI2_ERR_CRC,
|
||||
RK_CSI2_ERR_ECC2,
|
||||
RK_CSI2_ERR_CTRL,
|
||||
RK_CSI2_ERR_ULPM,
|
||||
RK_CSI2_ERR_SOT,
|
||||
RK_CSI2_ERR_ECC,
|
||||
RK_CSI2_ERR_ID,
|
||||
RK_CSI2_ERR_CODE,
|
||||
RK_CSI2_ERR_ALL,
|
||||
RK_CSI2_ERR_MAX
|
||||
};
|
||||
|
||||
@@ -610,9 +610,6 @@ static int pcie_rkep_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
vm_flags_set(vma, VM_IO);
|
||||
vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP);
|
||||
|
||||
if (pcie_rkep->cur_mmap_res == PCIE_EP_MMAP_RESOURCE_BAR2 ||
|
||||
pcie_rkep->cur_mmap_res == PCIE_EP_MMAP_RESOURCE_USER_MEM)
|
||||
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
|
||||
|
||||
@@ -154,8 +154,8 @@ static int rk_pcie_local_dma_frombus_block(struct dma_trx_obj *obj, u32 chn,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rk_pcie_local_dma_tobus_block(struct dma_trx_obj *obj, u32 chn,
|
||||
u64 bus_paddr, u64 local_paddr, u32 size)
|
||||
static int rk_pcie_local_dma_tobus_block(struct dma_trx_obj *obj, u32 chn,
|
||||
u64 bus_paddr, u64 local_paddr, u32 size)
|
||||
{
|
||||
struct pcie_dw_dmatest_dev *dmatest_dev = (struct pcie_dw_dmatest_dev *)obj->priv;
|
||||
struct dma_table *table;
|
||||
|
||||
@@ -488,9 +488,6 @@ int rga_get_pixel_stride_from_format(uint32_t format)
|
||||
case RGA_FORMAT_YCrCb_422_SP_10B:
|
||||
pixel_stride = 10;
|
||||
break;
|
||||
case RGA_FORMAT_BPP1:
|
||||
case RGA_FORMAT_BPP2:
|
||||
case RGA_FORMAT_BPP4:
|
||||
case RGA_FORMAT_BPP8:
|
||||
case RGA_FORMAT_YCbCr_400:
|
||||
case RGA_FORMAT_A8:
|
||||
@@ -505,9 +502,16 @@ int rga_get_pixel_stride_from_format(uint32_t format)
|
||||
case RGA_FORMAT_Y8:
|
||||
pixel_stride = 8;
|
||||
break;
|
||||
case RGA_FORMAT_BPP4:
|
||||
case RGA_FORMAT_Y4:
|
||||
pixel_stride = 4;
|
||||
break;
|
||||
case RGA_FORMAT_BPP2:
|
||||
pixel_stride = 2;
|
||||
break;
|
||||
case RGA_FORMAT_BPP1:
|
||||
pixel_stride = 1;
|
||||
break;
|
||||
default:
|
||||
rga_err("unknown format [0x%x]\n", format);
|
||||
return -1;
|
||||
@@ -823,14 +827,22 @@ int rga_image_size_cal(int w, int h, int format,
|
||||
uv = (w * h) >> 2;
|
||||
v = uv;
|
||||
break;
|
||||
case RGA_FORMAT_BPP8:
|
||||
case RGA_FORMAT_YCbCr_400:
|
||||
case RGA_FORMAT_A8:
|
||||
case RGA_FORMAT_Y8:
|
||||
yrgb = w * h;
|
||||
break;
|
||||
case RGA_FORMAT_BPP4:
|
||||
case RGA_FORMAT_Y4:
|
||||
yrgb = (w * h) >> 1;
|
||||
break;
|
||||
case RGA_FORMAT_BPP2:
|
||||
yrgb = (w * h) >> 2;
|
||||
break;
|
||||
case RGA_FORMAT_BPP1:
|
||||
yrgb = (w * h) >> 3;
|
||||
break;
|
||||
default:
|
||||
rga_err("Unsuport format [0x%x]\n", format);
|
||||
return -EFAULT;
|
||||
|
||||
@@ -254,12 +254,14 @@ int rga_dma_memory_check(struct rga_dma_buffer *rga_dma_buffer, struct rga_img_i
|
||||
int rga_dma_map_phys_addr(phys_addr_t phys_addr, size_t size, struct rga_dma_buffer *buffer,
|
||||
enum dma_data_direction dir, struct device *map_dev)
|
||||
{
|
||||
int ret;
|
||||
dma_addr_t addr;
|
||||
|
||||
addr = dma_map_resource(map_dev, phys_addr, size, dir, 0);
|
||||
if (addr == DMA_MAPPING_ERROR) {
|
||||
rga_err("dma_map_resouce failed!\n");
|
||||
return -EINVAL;
|
||||
ret = dma_mapping_error(map_dev, addr);
|
||||
if (ret < 0) {
|
||||
rga_err("dma_map_resouce failed!, ret = %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
buffer->dma_addr = addr;
|
||||
|
||||
@@ -53,6 +53,8 @@ struct analogix_dp_plat_data {
|
||||
bool dual_connector_split;
|
||||
bool left_display;
|
||||
|
||||
bool disable_psr;
|
||||
|
||||
u8 max_bpc;
|
||||
|
||||
struct analogix_dp_device *left;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#define RKPM_SLP_PMU_DBG BIT(26)
|
||||
#define RKPM_SLP_LP_PR BIT(27)
|
||||
#define RKPM_SLP_ARCH_TIMER_RESET BIT(28)
|
||||
#define RKPM_SLP_LP_AOA BIT(29)
|
||||
|
||||
/* the wake up source */
|
||||
#define RKPM_CPU0_WKUP_EN BIT(0)
|
||||
|
||||
@@ -229,6 +229,9 @@
|
||||
#define RKMODULE_SET_CMPS_MODE \
|
||||
_IOW('V', BASE_VIDIOC_PRIVATE + 55, __u32)
|
||||
|
||||
#define RKMODULE_GET_ERROR_INFO \
|
||||
_IOR('V', BASE_VIDIOC_PRIVATE + 56, struct rkmodule_error_info)
|
||||
|
||||
struct rkmodule_i2cdev_info {
|
||||
__u8 slave_addr;
|
||||
} __attribute__ ((packed));
|
||||
@@ -987,4 +990,9 @@ enum rkmodule_cmps_mode {
|
||||
CMPS_HIGH_BIT_WIDTH_MODE,
|
||||
};
|
||||
|
||||
struct rkmodule_error_info {
|
||||
__u32 err_code;
|
||||
__u8 detail[256];
|
||||
};
|
||||
|
||||
#endif /* _UAPI_RKMODULE_CAMERA_H */
|
||||
|
||||
Reference in New Issue
Block a user