Merge commit '6de3d51dcdf7e19c1484ac967943387e0621b4a5'

* commit '6de3d51dcdf7e19c1484ac967943387e0621b4a5':
  soc: rockchip: debug: don't enable Serror when panic
  pstore/ram: don't register boot_log to minidump when it is off
  power: supply: rk816/rk817/rk818 battery: avoid division by zero
  video: rockchip: rga3: fix iommu device sync cache causing crash
  video: rockchip: rga3: fix the error report of Coverity
  soc: rockchip: rockchip_system_monitor: simplify include
  media: uvcvideo: set system status to performance when stream on
  ARM: configs: rv1106-wakeup.config: fix some sleep to slow down the process
  clk: rockchip: rk3562: Fix clk_uart3_frac parent clk
  media: i2c: maxim4c: driver version v2.05.00
  media: i2c: sc230ai support master&slaver mode
  media: rockchip: isp: add isp dgain for tb mem head
  media: rockchip: isp: support for param run double

Change-Id: Ic11982e6ac7486b309860f7d7c4c746c9edfc76e
This commit is contained in:
Tao Huang
2023-11-21 14:39:36 +08:00
32 changed files with 217 additions and 46 deletions

View File

@@ -1,4 +1,5 @@
# CONFIG_ETHERNET is not set
CONFIG_HIGH_RES_TIMERS=y
CONFIG_INPUT=y
# CONFIG_MDIO_DEVICE is not set
# CONFIG_PHYLIB is not set
@@ -121,9 +122,11 @@ CONFIG_KEYBOARD_GPIO=y
# CONFIG_RC_CORE is not set
# CONFIG_RMI4_CORE is not set
# CONFIG_ROCKCHIP_REMOTECTL is not set
CONFIG_SCHED_HRTICK=y
# CONFIG_SENSORS_LIS3_I2C is not set
# CONFIG_SENSORS_LIS3_SPI is not set
# CONFIG_SENSOR_DEVICE is not set
# CONFIG_SND_HRTIMER is not set
CONFIG_SND_JACK_INPUT_DEV=y
# CONFIG_SND_SOC_CS42L52 is not set
# CONFIG_SND_SOC_CS42L56 is not set

View File

@@ -624,7 +624,7 @@ static struct rockchip_clk_branch rk3562_clk_branches[] __initdata = {
COMPOSITE(CLK_UART3_SRC, "clk_uart3_src", gpll_cpll_p, 0,
RK3562_PERI_CLKSEL_CON(25), 8, 1, MFLAGS, 0, 7, DFLAGS,
RK3562_PERI_CLKGATE_CON(7), 15, GFLAGS),
COMPOSITE_FRACMUX(CLK_UART3_FRAC, "clk_uart3_frac", "clk_uart3", CLK_SET_RATE_PARENT,
COMPOSITE_FRACMUX(CLK_UART3_FRAC, "clk_uart3_frac", "clk_uart3_src", CLK_SET_RATE_PARENT,
RK3562_PERI_CLKSEL_CON(26), 0,
RK3562_PERI_CLKGATE_CON(8), 0, GFLAGS,
&rk3562_clk_uart3_fracmux),

View File

@@ -7,7 +7,6 @@
*/
#include <dt-bindings/clock/rockchip-ddr.h>
#include <dt-bindings/soc/rockchip-system-status.h>
#include <drm/drm_modeset_lock.h>
#include <linux/arm-smccc.h>
#include <linux/clk.h>

View File

@@ -42,7 +42,6 @@
#ifdef CONFIG_DRM_ANALOGIX_DP
#include <drm/bridge/analogix_dp.h>
#endif
#include <dt-bindings/soc/rockchip-system-status.h>
#include <soc/rockchip/rockchip_dmc.h>
#include <soc/rockchip/rockchip-system-status.h>

View File

@@ -21,7 +21,6 @@
#ifdef CONFIG_DRM_ANALOGIX_DP
#include <drm/bridge/analogix_dp.h>
#endif
#include <dt-bindings/soc/rockchip-system-status.h>
#include <linux/debugfs.h>
#include <linux/fixp-arith.h>

View File

@@ -90,7 +90,9 @@ int maxim4c_remote_device_register(maxim4c_t *maxim4c,
int maxim4c_v4l2_subdev_init(maxim4c_t *maxim4c);
void maxim4c_v4l2_subdev_deinit(maxim4c_t *maxim4c);
/* maxim4c driver api */
int maxim4c_module_hw_init(maxim4c_t *maxim4c);
int maxim4c_hot_plug_detect_work_start(maxim4c_t *maxim4c);
/* maxim4c pattern api */
int maxim4c_pattern_hw_init(maxim4c_t *maxim4c);

View File

@@ -37,6 +37,11 @@
* 5. Fix unbalanced disabling for PoC regulator
* 6. MIPI VC count does not affected by data lane count
*
* V2.05.00
* 1. local device power on add some delay for i2c normal access.
* 2. enable hot plug detect for partial links are locked.
* 3. remote device hot plug init disable lock irq.
*
*/
#include <linux/clk.h>
#include <linux/i2c.h>
@@ -66,7 +71,7 @@
#include "maxim4c_api.h"
#define DRIVER_VERSION KERNEL_VERSION(2, 0x04, 0x04)
#define DRIVER_VERSION KERNEL_VERSION(2, 0x05, 0x00)
#define MAXIM4C_XVCLK_FREQ 25000000
@@ -103,8 +108,8 @@ static int maxim4c_check_local_chipid(maxim4c_t *maxim4c)
return 0;
}
} else {
// if chipid is unexpected, retry
dev_err(dev, "Unexpected maxim chipid = %02x\n", chipid);
return -ENODEV;
}
}
}
@@ -135,7 +140,7 @@ static irqreturn_t maxim4c_hot_plug_detect_irq_handler(int irq, void *dev_id)
queue_delayed_work(maxim4c->hot_plug_work.state_check_wq,
&maxim4c->hot_plug_work.state_d_work,
msecs_to_jiffies(50));
msecs_to_jiffies(100));
}
mutex_unlock(&maxim4c->mutex);
@@ -209,8 +214,14 @@ static void maxim4c_hot_plug_state_check_work(struct work_struct *work)
if (curr_lock_state & MAXIM4C_LINK_MASK_A) {
dev_info(dev, "Link A plug in\n");
if (maxim4c->hot_plug_irq > 0)
disable_irq(maxim4c->hot_plug_irq);
maxim4c_remote_devices_init(maxim4c, MAXIM4C_LINK_MASK_A);
if (maxim4c->hot_plug_irq > 0)
enable_irq(maxim4c->hot_plug_irq);
maxim4c_video_pipe_linkid_enable(maxim4c, link_id, true);
} else {
dev_info(dev, "Link A plug out\n");
@@ -225,8 +236,14 @@ static void maxim4c_hot_plug_state_check_work(struct work_struct *work)
if (curr_lock_state & MAXIM4C_LINK_MASK_B) {
dev_info(dev, "Link B plug in\n");
if (maxim4c->hot_plug_irq > 0)
disable_irq(maxim4c->hot_plug_irq);
maxim4c_remote_devices_init(maxim4c, MAXIM4C_LINK_MASK_B);
if (maxim4c->hot_plug_irq > 0)
enable_irq(maxim4c->hot_plug_irq);
maxim4c_video_pipe_linkid_enable(maxim4c, link_id, true);
} else {
dev_info(dev, "Link B plug out\n");
@@ -241,8 +258,14 @@ static void maxim4c_hot_plug_state_check_work(struct work_struct *work)
if (curr_lock_state & MAXIM4C_LINK_MASK_C) {
dev_info(dev, "Link C plug in\n");
if (maxim4c->hot_plug_irq > 0)
disable_irq(maxim4c->hot_plug_irq);
maxim4c_remote_devices_init(maxim4c, MAXIM4C_LINK_MASK_C);
if (maxim4c->hot_plug_irq > 0)
enable_irq(maxim4c->hot_plug_irq);
maxim4c_video_pipe_linkid_enable(maxim4c, link_id, true);
} else {
dev_info(dev, "Link C plug out\n");
@@ -257,8 +280,14 @@ static void maxim4c_hot_plug_state_check_work(struct work_struct *work)
if (curr_lock_state & MAXIM4C_LINK_MASK_D) {
dev_info(dev, "Link D plug in\n");
if (maxim4c->hot_plug_irq > 0)
disable_irq(maxim4c->hot_plug_irq);
maxim4c_remote_devices_init(maxim4c, MAXIM4C_LINK_MASK_D);
if (maxim4c->hot_plug_irq > 0)
enable_irq(maxim4c->hot_plug_irq);
maxim4c_video_pipe_linkid_enable(maxim4c, link_id, true);
} else {
dev_info(dev, "Link D plug out\n");
@@ -273,12 +302,34 @@ static void maxim4c_hot_plug_state_check_work(struct work_struct *work)
} else {
queue_delayed_work(maxim4c->hot_plug_work.state_check_wq,
&maxim4c->hot_plug_work.state_d_work,
msecs_to_jiffies(100));
msecs_to_jiffies(200));
}
mutex_unlock(&maxim4c->mutex);
}
int maxim4c_hot_plug_detect_work_start(maxim4c_t *maxim4c)
{
struct device *dev = &maxim4c->client->dev;
u8 link_lock_state = 0, link_enable_mask = 0;
link_lock_state = maxim4c->link_lock_state;
link_enable_mask = maxim4c->gmsl_link.link_enable_mask;
if (link_lock_state != link_enable_mask) {
dev_info(dev, "%s: link_lock = 0x%02x, link_mask = 0x%02x\n",
__func__, link_lock_state, link_enable_mask);
maxim4c->hot_plug_state = MAXIM4C_HOT_PLUG_OUT;
queue_delayed_work(maxim4c->hot_plug_work.state_check_wq,
&maxim4c->hot_plug_work.state_d_work,
msecs_to_jiffies(200));
}
return 0;
}
static int maxim4c_lock_state_work_init(maxim4c_t *maxim4c)
{
struct device *dev = &maxim4c->client->dev;
@@ -328,7 +379,7 @@ static int maxim4c_local_device_power_on(maxim4c_t *maxim4c)
gpiod_set_value_cansleep(maxim4c->pwdn_gpio, 1);
usleep_range(5000, 10000);
usleep_range(10000, 11000);
}
return 0;
@@ -646,6 +697,8 @@ static int maxim4c_probe(struct i2c_client *client,
maxim4c->pwdn_gpio = devm_gpiod_get(dev, "pwdn", GPIOD_OUT_LOW);
if (IS_ERR(maxim4c->pwdn_gpio))
dev_warn(dev, "Failed to get pwdn-gpios, maybe no use\n");
else
usleep_range(1000, 1100);
maxim4c->lock_gpio = devm_gpiod_get(dev, "lock", GPIOD_IN);
if (IS_ERR(maxim4c->lock_gpio))

View File

@@ -463,7 +463,17 @@ int maxim4c_link_select_remote_enable(struct maxim4c *maxim4c, u8 link_mask)
0x0006, MAXIM4C_I2C_REG_ADDR_16BITS,
link_enable, link_enable);
ret |= maxim4c_link_wait_linklock(maxim4c, link_mask);
if (ret) {
dev_err(dev, "%s: link oneshot reset or enable error, link mask = 0x%x\n",
__func__, link_mask);
return ret;
}
maxim4c_link_wait_linklock(maxim4c, link_mask);
dev_info(dev, "link_mask = 0x%02x, link_lock = 0x%02x\n",
link_mask, maxim4c->link_lock_state);
return 0;
}
return ret;

View File

@@ -532,6 +532,11 @@ static int __maxim4c_start_stream(struct maxim4c *maxim4c)
if (maxim4c->hot_plug_irq > 0)
enable_irq(maxim4c->hot_plug_irq);
if (maxim4c->link_lock_state != maxim4c->gmsl_link.link_enable_mask) {
dev_info(dev, "partial links are locked, start hot plug detect work.\n");
maxim4c_hot_plug_detect_work_start(maxim4c);
}
return 0;
}

View File

@@ -190,7 +190,6 @@ static int max96715_module_init(maxim4c_remote_t *max96715)
{
struct device *dev = max96715->dev;
struct i2c_client *client = max96715->client;
struct maxim4c *maxim4c = max96715->local;
int ret = 0;
ret = maxim4c_remote_i2c_addr_select(max96715, MAXIM4C_I2C_SER_DEF);
@@ -206,16 +205,9 @@ static int max96715_module_init(maxim4c_remote_t *max96715)
return ret;
#if MAX96715_MODE_SWITCH
if (maxim4c->hot_plug_irq > 0)
disable_irq(maxim4c->hot_plug_irq);
ret = max96715_link_mode_select(max96715, LINK_MODE_CONFIG);
if (ret) {
if (maxim4c->hot_plug_irq > 0)
enable_irq(maxim4c->hot_plug_irq);
if (ret)
return ret;
}
#endif
ret = maxim4c_i2c_run_init_seq(client,
@@ -225,16 +217,11 @@ static int max96715_module_init(maxim4c_remote_t *max96715)
dev_err(dev, "remote id = %d init sequence error\n",
max96715->remote_id);
if (maxim4c->hot_plug_irq > 0)
enable_irq(maxim4c->hot_plug_irq);
return ret;
}
#if MAX96715_MODE_SWITCH
ret = max96715_link_mode_select(max96715, LINK_MODE_VIDEO);
if (maxim4c->hot_plug_irq > 0)
enable_irq(maxim4c->hot_plug_irq);
if (ret)
return ret;
#endif

View File

@@ -173,6 +173,7 @@ struct sc230ai {
const char *module_facing;
const char *module_name;
const char *len_name;
enum rkmodule_sync_mode sync_mode;
u32 cur_vts;
bool has_init_exp;
bool is_thunderboot;
@@ -534,6 +535,28 @@ static const struct regval sc230ai_linear_10_1920x1080_regs[] = {
{REG_NULL, 0x00},
};
static __maybe_unused const struct regval sc230ai_interal_sync_master_start_regs[] = {
{0x300a, 0x24}, //sync as output PAD
{0x3032, 0xa0},
{0x3222, 0x00}, //master mode
{REG_NULL, 0x00},
};
static __maybe_unused const struct regval sc230ai_interal_sync_master_stop_regs[] = {
{REG_NULL, 0x00},
};
static __maybe_unused const struct regval sc230ai_interal_sync_slaver_start_regs[] = {
{0x300a, 0x20}, //sync as input PAD
{0x3222, 0x01}, //slave mode
{0x3224, 0x92}, //fsync trigger
{0x3614, 0x01},
{REG_NULL, 0x00},
};
static __maybe_unused const struct regval sc230ai_interal_sync_slaver_stop_regs[] = {
{REG_NULL, 0x00},
};
static const struct sc230ai_mode supported_modes[] = {
{
@@ -919,6 +942,7 @@ static long sc230ai_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
u32 i, h, w;
long ret = 0;
u32 stream = 0;
u32 *sync_mode = NULL;
switch (cmd) {
case RKMODULE_GET_MODULE_INFO:
@@ -969,6 +993,14 @@ static long sc230ai_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
ret = sc230ai_write_reg(sc230ai->client, SC230AI_REG_CTRL_MODE,
SC230AI_REG_VALUE_08BIT, SC230AI_MODE_SW_STANDBY);
break;
case RKMODULE_GET_SYNC_MODE:
sync_mode = (u32 *)arg;
*sync_mode = sc230ai->sync_mode;
break;
case RKMODULE_SET_SYNC_MODE:
sync_mode = (u32 *)arg;
sc230ai->sync_mode = *sync_mode;
break;
default:
ret = -ENOIOCTLCMD;
break;
@@ -987,6 +1019,7 @@ static long sc230ai_compat_ioctl32(struct v4l2_subdev *sd,
struct preisp_hdrae_exp_s *hdrae;
long ret;
u32 stream = 0;
u32 sync_mode;
switch (cmd) {
case RKMODULE_GET_MODULE_INFO:
@@ -1055,6 +1088,21 @@ static long sc230ai_compat_ioctl32(struct v4l2_subdev *sd,
ret = sc230ai_ioctl(sd, cmd, &stream);
break;
case RKMODULE_GET_SYNC_MODE:
ret = sc230ai_ioctl(sd, cmd, &sync_mode);
if (!ret) {
ret = copy_to_user(up, &sync_mode, sizeof(u32));
if (ret)
ret = -EFAULT;
}
break;
case RKMODULE_SET_SYNC_MODE:
ret = copy_from_user(&sync_mode, up, sizeof(u32));
if (!ret)
ret = sc230ai_ioctl(sd, cmd, &sync_mode);
else
ret = -EFAULT;
break;
default:
ret = -ENOIOCTLCMD;
break;
@@ -1066,7 +1114,7 @@ static long sc230ai_compat_ioctl32(struct v4l2_subdev *sd,
static int __sc230ai_start_stream(struct sc230ai *sc230ai)
{
int ret;
int ret = 0;
if (!sc230ai->is_thunderboot) {
ret = sc230ai_write_array(sc230ai->client, sc230ai->cur_mode->reg_list);
@@ -1085,20 +1133,36 @@ static int __sc230ai_start_stream(struct sc230ai *sc230ai)
return ret;
}
}
if (sc230ai->sync_mode == INTERNAL_MASTER_MODE)
ret |= sc230ai_write_array(sc230ai->client,
sc230ai_interal_sync_master_start_regs);
else if (sc230ai->sync_mode == SLAVE_MODE)
ret |= sc230ai_write_array(sc230ai->client,
sc230ai_interal_sync_slaver_start_regs);
}
return sc230ai_write_reg(sc230ai->client, SC230AI_REG_CTRL_MODE,
ret |= sc230ai_write_reg(sc230ai->client, SC230AI_REG_CTRL_MODE,
SC230AI_REG_VALUE_08BIT, SC230AI_MODE_STREAMING);
return ret;
}
static int __sc230ai_stop_stream(struct sc230ai *sc230ai)
{
int ret = 0;
sc230ai->has_init_exp = false;
if (sc230ai->is_thunderboot) {
sc230ai->is_first_streamoff = true;
pm_runtime_put(&sc230ai->client->dev);
} else {
if (sc230ai->sync_mode == INTERNAL_MASTER_MODE)
ret |= sc230ai_write_array(sc230ai->client,
sc230ai_interal_sync_master_stop_regs);
else if (sc230ai->sync_mode == SLAVE_MODE)
ret |= sc230ai_write_array(sc230ai->client,
sc230ai_interal_sync_slaver_stop_regs);
}
return sc230ai_write_reg(sc230ai->client, SC230AI_REG_CTRL_MODE,
ret |= sc230ai_write_reg(sc230ai->client, SC230AI_REG_CTRL_MODE,
SC230AI_REG_VALUE_08BIT, SC230AI_MODE_SW_STANDBY);
return ret;
}
static int __sc230ai_power_on(struct sc230ai *sc230ai);
@@ -1614,6 +1678,7 @@ static int sc230ai_probe(struct i2c_client *client,
char facing[2];
int ret;
u32 i, hdr_mode = 0;
const char *sync_mode_name = NULL;
dev_info(dev, "driver version: %02x.%02x.%02x",
DRIVER_VERSION >> 16,
@@ -1637,6 +1702,25 @@ static int sc230ai_probe(struct i2c_client *client,
dev_err(dev, "could not get module information!\n");
return -EINVAL;
}
ret = of_property_read_string(node, RKMODULE_CAMERA_SYNC_MODE,
&sync_mode_name);
if (ret) {
sc230ai->sync_mode = NO_SYNC_MODE;
dev_err(dev, "could not get sync mode!\n");
} else {
if (strcmp(sync_mode_name, RKMODULE_EXTERNAL_MASTER_MODE) == 0) {
sc230ai->sync_mode = EXTERNAL_MASTER_MODE;
dev_info(dev, "external master mode\n");
} else if (strcmp(sync_mode_name, RKMODULE_INTERNAL_MASTER_MODE) == 0) {
sc230ai->sync_mode = INTERNAL_MASTER_MODE;
dev_info(dev, "internal master mode\n");
} else if (strcmp(sync_mode_name, RKMODULE_SLAVE_MODE) == 0) {
sc230ai->sync_mode = SLAVE_MODE;
dev_info(dev, "slave mode\n");
}
}
sc230ai->is_thunderboot = IS_ENABLED(CONFIG_VIDEO_ROCKCHIP_THUNDER_BOOT_ISP);
sc230ai->client = client;
for (i = 0; i < ARRAY_SIZE(supported_modes); i++) {

View File

@@ -18,7 +18,6 @@
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-dma-sg.h>
#include <soc/rockchip/rockchip-system-status.h>
#include <dt-bindings/soc/rockchip-system-status.h>
#include <soc/rockchip/rockchip_iommu.h>
#include <linux/rk-isp32-config.h>

View File

@@ -20,7 +20,6 @@
#include <media/videobuf2-dma-contig.h>
#include <media/v4l2-fwnode.h>
#include <linux/iommu.h>
#include <dt-bindings/soc/rockchip-system-status.h>
#include <soc/rockchip/rockchip-system-status.h>
#include <linux/io.h>
#include <linux/mfd/syscon.h>

View File

@@ -23,7 +23,6 @@
#include <media/videobuf2-dma-sg.h>
#include <media/v4l2-fwnode.h>
#include <linux/iommu.h>
#include <dt-bindings/soc/rockchip-system-status.h>
#include <soc/rockchip/rockchip-system-status.h>
#include <linux/io.h>
#include <linux/mfd/syscon.h>

View File

@@ -5,7 +5,6 @@
* Author: Dingxian Wen <shawn.wen@rock-chips.com>
*/
#include <dt-bindings/soc/rockchip-system-status.h>
#include <linux/clk.h>
#include <linux/cpufreq.h>
#include <linux/debugfs.h>

View File

@@ -45,7 +45,6 @@
#include <linux/pm_runtime.h>
#include <linux/pinctrl/consumer.h>
#include <linux/regmap.h>
#include <dt-bindings/soc/rockchip-system-status.h>
#include <soc/rockchip/rockchip-system-status.h>
#include "common.h"
#include "isp_ispp.h"

View File

@@ -130,6 +130,11 @@ static int rkisp_params_vb2_queue_setup(struct vb2_queue *vq,
INIT_LIST_HEAD(&params_vdev->params);
if (params_vdev->first_cfg_params) {
params_vdev->first_cfg_params = false;
return 0;
}
params_vdev->first_params = true;
return 0;
@@ -228,6 +233,10 @@ static void rkisp_params_vb2_stop_streaming(struct vb2_queue *vq)
}
spin_unlock_irqrestore(&params_vdev->config_lock, flags);
if (dev->is_pre_on) {
params_vdev->first_cfg_params = true;
return;
}
rkisp_params_disable_isp(params_vdev);
/* clean module params */
params_vdev->ops->clear_first_param(params_vdev);
@@ -456,6 +465,7 @@ void rkisp_params_stream_stop(struct rkisp_isp_params_vdev *params_vdev)
params_vdev->ops->stream_stop(params_vdev);
if (params_vdev->ops->fop_release)
params_vdev->ops->fop_release(params_vdev);
params_vdev->first_cfg_params = false;
}
bool rkisp_params_check_bigmode(struct rkisp_isp_params_vdev *params_vdev)

View File

@@ -45,7 +45,6 @@
#include <linux/pinctrl/consumer.h>
#include <linux/regmap.h>
#include <media/videobuf2-dma-contig.h>
#include <dt-bindings/soc/rockchip-system-status.h>
#include <soc/rockchip/rockchip-system-status.h>
#include "regs.h"
#include "rkisp1.h"

View File

@@ -23,6 +23,7 @@
#include <media/v4l2-common.h>
#include "uvcvideo.h"
#include <soc/rockchip/rockchip-system-status.h>
/* ------------------------------------------------------------------------
* UVC Controls
@@ -2210,6 +2211,8 @@ int uvc_video_start_streaming(struct uvc_streaming *stream)
if (ret < 0)
goto error_commit;
rockchip_set_system_status(SYS_STATUS_PERFORMANCE);
ret = uvc_video_start_transfer(stream, GFP_KERNEL);
if (ret < 0)
goto error_video;
@@ -2217,6 +2220,7 @@ int uvc_video_start_streaming(struct uvc_streaming *stream)
return 0;
error_video:
rockchip_clear_system_status(SYS_STATUS_PERFORMANCE);
usb_set_interface(stream->dev->udev, stream->intfnum, 0);
error_commit:
uvc_video_clock_cleanup(stream);
@@ -2248,4 +2252,5 @@ void uvc_video_stop_streaming(struct uvc_streaming *stream)
}
uvc_video_clock_cleanup(stream);
rockchip_clear_system_status(SYS_STATUS_PERFORMANCE);
}

View File

@@ -328,6 +328,9 @@ static u32 interpolate(int value, u32 *table, int size)
u8 i;
u16 d;
if (size < 2)
return 0;
for (i = 0; i < size; i++) {
if (value < table[i])
break;
@@ -2965,6 +2968,8 @@ static void rk816_bat_finish_algorithm(struct rk816_battery *di)
FINISH_CHRG_CUR2 : FINISH_CHRG_CUR1;
finish_sec = base2sec(di->chrg_finish_base);
soc_sec = di->fcc * 3600 / 100 / DIV(finish_current);
if (soc_sec == 0)
soc_sec = 1;
plus_soc = finish_sec / DIV(soc_sec);
if (finish_sec > soc_sec) {
rest = finish_sec % soc_sec;
@@ -4671,7 +4676,7 @@ static int rk816_bat_parse_dt(struct rk816_battery *di)
}
pdata->ocv_size = length / sizeof(u32);
if (pdata->ocv_size <= 0) {
if (pdata->ocv_size < 2) {
dev_err(dev, "invalid ocv table\n");
return -EINVAL;
}

View File

@@ -651,6 +651,9 @@ static u32 interpolate(int value, u32 *table, int size)
u8 i;
u16 d;
if (size < 2)
return 0;
for (i = 0; i < size; i++) {
if (value < table[i])
break;
@@ -1599,6 +1602,9 @@ static void rk817_bat_first_pwron(struct rk817_battery_device *battery)
battery->pwron_voltage) * 1000;/* uAH */
battery->dsoc = battery->rsoc;
battery->fcc = battery->pdata->design_capacity;
if (battery->fcc < MIN_FCC)
battery->fcc = MIN_FCC;
battery->nac = rk817_bat_vol_to_cap(battery, battery->pwron_voltage);
rk817_bat_update_qmax(battery, battery->qmax);
@@ -1801,7 +1807,7 @@ static int rk817_bat_parse_dt(struct rk817_battery_device *battery)
}
pdata->ocv_size = length / sizeof(u32);
if (pdata->ocv_size <= 0) {
if (pdata->ocv_size < 2) {
dev_err(dev, "invalid ocv table\n");
return -EINVAL;
}
@@ -2773,6 +2779,8 @@ static void rk817_bat_finish_algorithm(struct rk817_battery_device *battery)
finish_sec = base2sec(battery->finish_base);
soc_sec = battery->fcc * 3600 / 100 / DIV(finish_current);
if (soc_sec == 0)
soc_sec = 1;
plus_soc = finish_sec / DIV(soc_sec);
if (finish_sec > soc_sec) {
rest = finish_sec % soc_sec;

View File

@@ -287,6 +287,9 @@ static u32 interpolate(int value, u32 *table, int size)
u8 i;
u16 d;
if (size < 2)
return 0;
for (i = 0; i < size; i++) {
if (value < table[i])
break;
@@ -2101,6 +2104,8 @@ static void rk818_bat_finish_algorithm(struct rk818_battery *di)
FINISH_CHRG_CUR2 : FINISH_CHRG_CUR1;
finish_sec = base2sec(di->finish_base);
soc_sec = di->fcc * 3600 / 100 / DIV(finish_current);
if (soc_sec == 0)
soc_sec = 1;
plus_soc = finish_sec / DIV(soc_sec);
if (finish_sec > soc_sec) {
rest = finish_sec % soc_sec;
@@ -3240,7 +3245,7 @@ static int rk818_bat_parse_dt(struct rk818_battery *di)
}
pdata->ocv_size = length / sizeof(u32);
if (pdata->ocv_size <= 0) {
if (pdata->ocv_size < 2) {
dev_err(dev, "invalid ocv table\n");
return -EINVAL;
}

View File

@@ -332,7 +332,6 @@ static int rockchip_panic_notify_edpcsr(struct notifier_block *nb,
printed = 0;
}
rockchip_debug_serror_enable();
return NOTIFY_OK;
}
@@ -406,7 +405,7 @@ static int rockchip_panic_notify_pmpcsr(struct notifier_block *nb,
prev_pc = NULL;
printed = 0;
}
rockchip_debug_serror_enable();
return NOTIFY_OK;
}
#else

View File

@@ -4,7 +4,6 @@
* Author: Finley Xiao <finley.xiao@rock-chips.com>
*/
#include <dt-bindings/soc/rockchip-system-status.h>
#include <linux/clk-provider.h>
#include <linux/cpu.h>
#include <linux/cpufreq.h>

View File

@@ -87,7 +87,7 @@
#define DRIVER_MAJOR_VERISON 1
#define DRIVER_MINOR_VERSION 3
#define DRIVER_REVISION_VERSION 0
#define DRIVER_REVISION_VERSION 1
#define DRIVER_PATCH_VERSION
#define DRIVER_VERSION (STR(DRIVER_MAJOR_VERISON) "." STR(DRIVER_MINOR_VERSION) \
@@ -97,7 +97,7 @@
#define RGA_JOB_TIMEOUT_DELAY HZ
#define RGA_RESET_TIMEOUT 1000
#define RGA_MAX_SCHEDULER 3
#define RGA_MAX_SCHEDULER RGA_HW_SIZE
#define RGA_MAX_BUS_CLK 10
#define RGA_BUFFER_POOL_MAX_SIZE 64

View File

@@ -1319,7 +1319,8 @@ static int rga_mm_sync_dma_sg_for_device(struct rga_internal_buffer *buffer,
return -EFAULT;
}
if (buffer->mm_flag & RGA_MEM_PHYSICAL_CONTIGUOUS) {
if (buffer->mm_flag & RGA_MEM_PHYSICAL_CONTIGUOUS &&
scheduler->data->mmu != RGA_IOMMU) {
dma_sync_single_for_device(scheduler->dev, buffer->phys_addr, buffer->size, dir);
} else {
sgt = rga_mm_lookup_sgt(buffer);
@@ -1349,7 +1350,8 @@ static int rga_mm_sync_dma_sg_for_cpu(struct rga_internal_buffer *buffer,
return -EFAULT;
}
if (buffer->mm_flag & RGA_MEM_PHYSICAL_CONTIGUOUS) {
if (buffer->mm_flag & RGA_MEM_PHYSICAL_CONTIGUOUS &&
scheduler->data->mmu != RGA_IOMMU) {
dma_sync_single_for_cpu(scheduler->dev, buffer->phys_addr, buffer->size, dir);
} else {
sgt = rga_mm_lookup_sgt(buffer);

View File

@@ -15,7 +15,7 @@
#define GET_GCD(n1, n2) \
({ \
int i; \
int gcd = 0; \
int gcd = 1; \
for (i = 1; i <= (n1) && i <= (n2); i++) { \
if ((n1) % i == 0 && (n2) % i == 0) \
gcd = i; \

View File

@@ -37,7 +37,6 @@
#include <media/v4l2-mediabus.h>
#include <linux/delay.h>
#include <linux/pm_runtime.h>
#include <dt-bindings/soc/rockchip-system-status.h>
#include <soc/rockchip/rockchip-system-status.h>
#include <linux/phy/phy.h>
#include <linux/uaccess.h>

View File

@@ -790,10 +790,12 @@ static void ramoops_register_ram_zone_info_to_minidump(struct ramoops_context *c
int i = 0;
struct persistent_ram_zone *prz = NULL;
#ifdef CONFIG_PSTORE_BOOT_LOG
for (i = 0; i < cxt->max_boot_log_cnt; i++) {
prz = cxt->boot_przs[i];
_ramoops_register_ram_zone_info_to_minidump(prz);
}
#endif
for (i = 0; i < cxt->max_dump_cnt; i++) {
prz = cxt->dprzs[i];

View File

@@ -6,6 +6,8 @@
#ifndef __SOC_ROCKCHIP_SYSTEM_STATUS_H
#define __SOC_ROCKCHIP_SYSTEM_STATUS_H
#include <dt-bindings/soc/rockchip-system-status.h>
#if IS_REACHABLE(CONFIG_ROCKCHIP_SYSTEM_MONITOR)
int rockchip_register_system_status_notifier(struct notifier_block *nb);
int rockchip_unregister_system_status_notifier(struct notifier_block *nb);

View File

@@ -1993,6 +1993,7 @@ struct rkisp_thunderboot_resmem_head {
__u32 exp_gain[3];
__u32 exp_time_reg[3];
__u32 exp_gain_reg[3];
__u32 exp_isp_dgain[3];
} __attribute__ ((packed));
/**

View File

@@ -5,7 +5,6 @@
* Copyright (c) 2023 Rockchip Electronics Co. Ltd.
*/
#include <dt-bindings/soc/rockchip-system-status.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <soc/rockchip/rockchip_dmc.h>