Merge commit 'ac8bace64e6d3fb931b7c5dce51decb190e5be15'

* commit 'ac8bace64e6d3fb931b7c5dce51decb190e5be15':
  drm/rockchip: drv: include debugfs.h in rockchip_drm_drv.h
  dma-buf: rk_heaps: rename heap module targets to rk-dma-heap-{cma,system}
  arm64: dts: rockchip: rk3588-vehicle-evb-v23: Modify the master of i2c-7 and the lock pin of max96756
  arm64: configs: rk3588_vehicle.config: add CONFIG_VIDEO_MAX96756=y
  arm64: dts: rockchip: rv1126b-evb: enable both acodec_pmu and acodec for 4ch capture by default
  media: i2c: max96756: Compatible with kernel-6.1 version
  video: rockchip: rga3: Explicitly include vmalloc.h
  mfd: display-serdes: Fix system crash caused by serdes_init_seq being a null pointer
  media: i2c: 0x03c10: Make generate_byte_stream() static
  mmc: sdhci-of-dwcmshc: optimize the random write performance when CMDQ is enabled

Change-Id: I88d66920660d39e89a0c97653b70e7d09d668afd
This commit is contained in:
Tao Huang
2025-09-11 14:17:54 +08:00
16 changed files with 190 additions and 22 deletions

View File

@@ -667,7 +667,14 @@
};
&i2c7 {
status = "disabled";
status = "okay";
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c7m0_xfer>;
};
&max96756 {
lock-gpios = <&gpio1 RK_PB1 GPIO_ACTIVE_HIGH>;
};
&pinctrl {
@@ -699,6 +706,12 @@
};
};
max96756-dphy0 {
max96756_dphy0_lock: max96756-dphy0-lock {
rockchip,pins = <1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none_smt>;
};
};
adsp {
adsp_bootroom_l: adsp-bootroom-l {
rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_output_low_pull_down>;

View File

@@ -20,7 +20,7 @@
rockchip,format = "i2s";
rockchip,mclk-fs-mapping = <256 1024>;
rockchip,cpu = <&sai2>;
rockchip,codec = <&audio_codec>, <&acdcdig_dsm>;
rockchip,codec = <&audio_codec_pmu>, <&audio_codec>, <&acdcdig_dsm>;
};
adc-keys {

View File

@@ -132,6 +132,10 @@
status = "okay";
};
&audio_codec_pmu {
status = "okay";
};
&audio_codec {
status = "okay";
};

View File

@@ -244,6 +244,10 @@
status = "okay";
};
&audio_codec_pmu {
status = "okay";
};
&audio_codec {
status = "okay";
};

View File

@@ -140,6 +140,10 @@
status = "okay";
};
&audio_codec_pmu {
status = "okay";
};
&audio_codec {
status = "okay";
};

View File

@@ -106,6 +106,7 @@ CONFIG_VEHICLE_GPIO_MCU_EXPANDER=y
# CONFIG_VIDEO_GC4C33 is not set
# CONFIG_VIDEO_GC8034 is not set
# CONFIG_VIDEO_IMX415 is not set
CONFIG_VIDEO_MAX96756=y
CONFIG_VIDEO_MAXIM_SERDES=y
# CONFIG_VIDEO_OV02B10 is not set
# CONFIG_VIDEO_OV13850 is not set

View File

@@ -1,7 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
rk-cma-heap-objs := rk-dma-cma.o rk-cma-heap.o
rk-dma-heap-cma-objs := rk-dma-cma.o rk-cma-heap.o
rk-dma-heap-system-objs := rk-system-heap.o
obj-$(CONFIG_DMABUF_HEAPS_ROCKCHIP) += rk-dma-heap.o
obj-$(CONFIG_DMABUF_HEAPS_ROCKCHIP_CMA_HEAP) += rk-cma-heap.o
obj-$(CONFIG_DMABUF_HEAPS_ROCKCHIP_SYSTEM_HEAP) += rk-system-heap.o
obj-$(CONFIG_DMABUF_HEAPS_ROCKCHIP_CMA_HEAP) += rk-dma-heap-cma.o
obj-$(CONFIG_DMABUF_HEAPS_ROCKCHIP_SYSTEM_HEAP) += rk-dma-heap-system.o

View File

@@ -21,6 +21,7 @@
#include <linux/media-bus-format.h>
#include <linux/module.h>
#include <linux/component.h>
#include <linux/debugfs.h>
#include <soc/rockchip/rockchip_dmc.h>

View File

@@ -6,7 +6,6 @@
#include <linux/clk.h>
#include <linux/component.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
#include <linux/fixp-arith.h>
#include <linux/iopoll.h>

View File

@@ -22,7 +22,6 @@
#endif
#include <dt-bindings/display/rockchip_vop.h>
#include <linux/debugfs.h>
#include <linux/fixp-arith.h>
#include <linux/jiffies.h>
#include <linux/iopoll.h>

View File

@@ -8,6 +8,9 @@
*
* V0.0X01.0X01
* - Support V4L2 DV class features
*
* V0.0X01.0X02
* - Compatible with kernel-6.1 version
*/
#define DEBUG
@@ -33,9 +36,11 @@
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
#include <linux/pinctrl/consumer.h>
#include <linux/of_graph.h>
#include <linux/bitfield.h>
#include "max96756.h"
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x01)
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x02)
static int debug;
module_param(debug, int, 0644);
@@ -304,6 +309,8 @@ static int max96756_write_array(struct i2c_client *client,
client->addr = regs[i].i2c_addr;
ret = max96756_write_reg(client, regs[i].addr,
MAX96756_REG_VALUE_08BIT, regs[i].val);
if (ret != 0)
dev_warn(&client->dev, "%x err i2c write!\n", client->addr);
if (regs[i].delay > 0)
msleep(regs[i].delay);
}
@@ -372,9 +379,15 @@ max96756_find_best_fit(struct v4l2_subdev_format *fmt)
return &supported_modes[cur_best_fit];
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int max96756_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
#else
static int max96756_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
#endif
{
struct max96756 *max96756 = to_max96756(sd);
const struct max96756_mode *mode;
@@ -388,7 +401,11 @@ static int max96756_set_fmt(struct v4l2_subdev *sd,
fmt->format.field = V4L2_FIELD_NONE;
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
*v4l2_subdev_get_try_format(sd, sd_state, fmt->pad) = fmt->format;
#else
*v4l2_subdev_get_try_format(sd, cfg, fmt->pad) = fmt->format;
#endif
#else
mutex_unlock(&max96756->mutex);
return -ENOTTY;
@@ -405,9 +422,15 @@ static int max96756_set_fmt(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int max96756_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
#else
static int max96756_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_format *fmt)
#endif
{
struct max96756 *max96756 = to_max96756(sd);
const struct max96756_mode *mode = max96756->cur_mode;
@@ -415,7 +438,11 @@ static int max96756_get_fmt(struct v4l2_subdev *sd,
mutex_lock(&max96756->mutex);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
fmt->format = *v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
#else
fmt->format = *v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
#endif
#else
mutex_unlock(&max96756->mutex);
return -ENOTTY;
@@ -431,9 +458,15 @@ static int max96756_get_fmt(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int max96756_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
#else
static int max96756_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_mbus_code_enum *code)
#endif
{
if (code->index != 0)
return -EINVAL;
@@ -443,9 +476,15 @@ static int max96756_enum_mbus_code(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int max96756_enum_frame_sizes(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_size_enum *fse)
#else
static int max96756_enum_frame_sizes(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse)
#endif
{
if (fse->index >= ARRAY_SIZE(supported_modes))
return -EINVAL;
@@ -548,6 +587,7 @@ static long max96756_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
dphy_param = (struct rkmodule_csi_dphy_param *)arg;
*dphy_param = rk3588_dcphy_param;
dev_dbg(&max96756->client->dev, "sensor get dphy param\n");
break;
default:
ret = -ENOIOCTLCMD;
break;
@@ -810,6 +850,7 @@ static int max96756_s_dv_timings(struct v4l2_subdev *sd,
return 0;
}
static int max96756_g_dv_timings(struct v4l2_subdev *sd,
struct v4l2_dv_timings *timings)
{
@@ -996,8 +1037,13 @@ static int max96756_runtime_suspend(struct device *dev)
static int max96756_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{
struct max96756 *max96756 = to_max96756(sd);
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->state, 0);
#else
struct v4l2_mbus_framefmt *try_fmt =
v4l2_subdev_get_try_format(sd, fh->pad, 0);
#endif
const struct max96756_mode *def_mode = &supported_modes[0];
mutex_lock(&max96756->mutex);
@@ -1014,10 +1060,15 @@ static int max96756_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
}
#endif
static int
max96756_enum_frame_interval(struct v4l2_subdev *sd,
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int max96756_enum_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_frame_interval_enum *fie)
#else
static int max96756_enum_frame_interval(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_interval_enum *fie)
#endif
{
if (fie->index >= ARRAY_SIZE(supported_modes))
return -EINVAL;
@@ -1031,6 +1082,39 @@ max96756_enum_frame_interval(struct v4l2_subdev *sd,
return 0;
}
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int max96756_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config)
{
struct max96756 *max96756 = to_max96756(sd);
config->type = V4L2_MBUS_CSI2_DPHY;
config->bus.mipi_csi2 = max96756->bus_cfg.bus.mipi_csi2;
return 0;
}
#elif KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static int max96756_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config)
{
struct max96756 *max96756 = to_max96756(sd);
u32 val = 0;
const struct max96756_mode *mode = max96756->cur_mode;
u8 data_lanes = max96756->bus_cfg.bus.mipi_csi2.num_data_lanes;
int i = 0;
val |= V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;
val |= (1 << (data_lanes - 1));
for (i = 0; i < PAD_MAX; i++)
val |= (mode->vc[i] & V4L2_MBUS_CSI2_CHANNELS);
config->type = V4L2_MBUS_CSI2_DPHY;
config->flags = val;
return 0;
}
#else
static int max96756_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
struct v4l2_mbus_config *config)
{
@@ -1040,10 +1124,17 @@ static int max96756_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
return 0;
}
#endif
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
static int max96756_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
#else
static int max96756_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_selection *sel)
#endif
{
struct max96756 *max96756 = to_max96756(sd);
@@ -1204,6 +1295,30 @@ static int max96756_configure_regulators(struct max96756 *max96756)
max96756->supplies);
}
static int max96756_mipi_data_lanes_parse(struct max96756 *max96756)
{
struct device *dev = &max96756->client->dev;
struct device_node *endpoint;
int ret = 0;
u8 mipi_data_line;
endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
if (!endpoint) {
dev_err(dev, "Failed to get endpoint\n");
return -EINVAL;
}
ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint), &max96756->bus_cfg);
if (ret) {
dev_err(dev, "Failed to get bus config\n");
return -EINVAL;
}
mipi_data_line = max96756->bus_cfg.bus.mipi_csi2.num_data_lanes;
dev_info(dev, "mipi csi2 phy data lanes = %d\n", mipi_data_line);
return 0;
}
static int max96756_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
@@ -1280,7 +1395,10 @@ static int max96756_probe(struct i2c_client *client)
mutex_init(&max96756->mutex);
max96756_mipi_data_lanes_parse(max96756);
sd = &max96756->subdev;
v4l2_i2c_subdev_init(sd, client, &max96756_subdev_ops);
ret = max96756_initialize_controls(max96756);
if (ret)
@@ -1318,7 +1436,11 @@ static int max96756_probe(struct i2c_client *client)
snprintf(sd->name, sizeof(sd->name), "m%02d_%s_%s %s",
max96756->module_index, facing, MAX96756_NAME,
dev_name(sd->dev));
#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE
ret = v4l2_async_register_subdev_sensor(sd);
#else
ret = v4l2_async_register_subdev_sensor_common(sd);
#endif
if (ret) {
dev_err(dev, "v4l2 async register subdev failed\n");
goto err_clean_entity;
@@ -1344,7 +1466,11 @@ err_destroy_mutex:
return ret;
}
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
static int max96756_remove(struct i2c_client *client)
#else
static void max96756_remove(struct i2c_client *client)
#endif
{
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct max96756 *max96756 = to_max96756(sd);
@@ -1362,8 +1488,9 @@ static int max96756_remove(struct i2c_client *client)
if (!pm_runtime_status_suspended(&client->dev))
__max96756_power_off(max96756);
pm_runtime_set_suspended(&client->dev);
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
return 0;
#endif
}
#if IS_ENABLED(CONFIG_OF)

View File

@@ -6035,7 +6035,7 @@ static int ox03c10_configure_regulators(struct ox03c10 *ox03c10)
//#define OX03C10_SETTING_CRC_CHECK
#ifdef OX03C10_SETTING_CRC_CHECK
u8 *generate_byte_stream(const struct regval *regs, size_t *stream_len)
static u8 *generate_byte_stream(const struct regval *regs, size_t *stream_len)
{
size_t count = 0;
const struct regval *p = regs;

View File

@@ -17,6 +17,9 @@ int serdes_i2c_set_sequence(struct serdes *serdes)
int i, num = 0, ret = 0;
unsigned int def = 0;
if (!serdes->serdes_init_seq)
return 0;
for (i = 0; i < serdes->serdes_init_seq->reg_seq_cnt; i++) {
if (serdes->serdes_init_seq->reg_sequence[i].reg == 0xffff) {
SERDES_DBG_MFD("%s: delay 0x%04x us\n", __func__,
@@ -195,10 +198,13 @@ static void serdes_reg_check_work(struct kthread_work *work)
}
serdes_i2c_check_register(serdes, &flag);
if (flag) {
if (serdes->chip_data->chip_init)
serdes->chip_data->chip_init(serdes);
serdes_i2c_set_sequence_backup(serdes);
msleep(500);
SERDES_DBG_MFD("%s %s\n", __func__, serdes->chip_data->name);
}
@@ -208,6 +214,9 @@ static void serdes_reg_check_work(struct kthread_work *work)
static int serdes_reg_check_work_setup(struct serdes *serdes)
{
if (!serdes->serdes_backup_seq || !serdes->serdes_backup_seq->reg_seq_cnt)
return 0;
kthread_init_delayed_work(&serdes->reg_check_work,
serdes_reg_check_work);
@@ -220,6 +229,8 @@ static int serdes_reg_check_work_setup(struct serdes *serdes)
kthread_queue_delayed_work(serdes->kworker, &serdes->reg_check_work,
msecs_to_jiffies(20000));
SERDES_DBG_MFD("serdes %s use_reg_check_work\n", serdes->chip_data->name);
return 0;
}
@@ -285,7 +296,7 @@ static int serdes_get_init_seq(struct serdes *serdes)
data = of_get_property(np, "serdes-init-sequence", &len);
if (!data) {
dev_err(dev, "failed to get serdes-init-sequence\n");
return -EINVAL;
return 0;
}
serdes->serdes_init_seq = devm_kzalloc(dev, sizeof(*serdes->serdes_init_seq),
@@ -310,8 +321,6 @@ static int serdes_get_init_seq(struct serdes *serdes)
return err;
}
serdes->dual_link = of_property_read_bool(dev->of_node, "dual-link");
/* init ser register(not des register) more early if uboot logo disabled */
serdes->route_enable = of_property_read_bool(dev->of_node, "route-enable");
if ((!serdes->route_enable) && (serdes->chip_data->serdes_type == TYPE_SER)) {
@@ -374,6 +383,8 @@ static int serdes_i2c_probe(struct i2c_client *client,
}
}
serdes->dual_link = of_property_read_bool(dev->of_node, "dual-link");
serdes->extcon = devm_extcon_dev_allocate(dev, serdes_cable);
if (IS_ERR(serdes->extcon))
return dev_err_probe(dev, PTR_ERR(serdes->extcon),
@@ -442,12 +453,9 @@ static int serdes_i2c_probe(struct i2c_client *client,
}
serdes->use_reg_check_work = of_property_read_bool(dev->of_node, "use-reg-check-work");
if (serdes->use_reg_check_work) {
if (serdes->use_reg_check_work)
serdes_reg_check_work_setup(serdes);
SERDES_DBG_MFD("%s: use_reg_check_work=%d\n", __func__, serdes->use_reg_check_work);
}
serdes_create_debugfs(serdes);
dev_info(dev, "serdes %s serdes_i2c_probe successful version %s\n",
@@ -469,7 +477,7 @@ static void serdes_i2c_remove(struct i2c_client *client)
struct device *dev = &client->dev;
struct serdes *serdes = dev_get_drvdata(dev);
if (serdes->use_reg_check_work)
if (!IS_ERR_OR_NULL(serdes->kworker))
serdes_reg_check_work_free(serdes);
if (serdes->use_delay_work) {

View File

@@ -90,6 +90,7 @@
/* send status config 1 */
#define CQHCI_SSC1 0x40
#define CQHCI_SSC1_CBC_MASK GENMASK(19, 16)
#define CQHCI_SSC1_CIT_MASK GENMASK(15, 0)
/* send status config 2 */
#define CQHCI_SSC2 0x44

View File

@@ -309,6 +309,11 @@ static void rk35xx_sdhci_cqe_enable(struct mmc_host *mmc)
struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
u32 reg;
/* Set Send Status Command Idle Timer to 10.66us (256 * 1 / 24) */
reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_SSC1);
reg = (reg & ~CQHCI_SSC1_CIT_MASK) | 0x0100;
sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_SSC1);
reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_CFG);
reg |= CQHCI_ENABLE;
sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_CFG);

View File

@@ -40,6 +40,7 @@
#include <linux/timer.h>
#include <linux/uaccess.h>
#include <linux/version.h>
#include <linux/vmalloc.h>
#include <linux/wait.h>
#include <linux/pm_runtime.h>
#include <linux/sched/mm.h>