mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
Merge commit 'a6950c52636737132b15e13ee172a2c42f594a4d'
* commit 'a6950c52636737132b15e13ee172a2c42f594a4d': phy: rockchip: usbdp: update phy parameters for SI test ASoC: rockchip-spi-codec: Silence no spi_device_id warning drm/panel: panel-simple: add panel_simple_spi_ids id_table spi: rockchip-test: Add spi_rockchip_test_spi_ids id_table arm64: dts: rockchip: rk3568: remove rockchip,max-volt for cpu0_opp_table media: i2c: dw9763: support set max logical pos ioctl media: i2c: ov13855: support get otp info drm/bridge: dw-hdmi-qp-hdcp: Fix timeout for ksv list ready arm64: dts: rockchip: rk3576: add rkvdec_sram support Change-Id: I4de1113b4c20febc037c04b116c6f07c7a4b7451
This commit is contained in:
@@ -128,7 +128,6 @@
|
||||
nvmem-cell-names = "leakage", "pvtm", "mbist-vmin", "opp-info",
|
||||
"specification_serial_number", "remark_spec_serial_number";
|
||||
rockchip,supported-hw;
|
||||
rockchip,max-volt = <1150000>;
|
||||
rockchip,pvtm-voltage-sel = <
|
||||
0 84000 0
|
||||
84001 87000 1
|
||||
|
||||
@@ -2534,6 +2534,9 @@
|
||||
rockchip,srv = <&mpp_srv>;
|
||||
rockchip,task-capacity = <8>;
|
||||
rockchip,taskqueue-node = <5>;
|
||||
rockchip,sram = <&rkvdec_sram>;
|
||||
rockchip,rcb-iova = <0x10000000 0x78000>;
|
||||
rockchip,rcb-min-width = <512>;
|
||||
power-domains = <&power RK3576_PD_VDEC>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -5268,6 +5271,20 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
sram: sram@3ff88000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x0 0x3ff88000 0x0 0x78000>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0x0 0x0 0x3ff88000 0x78000>;
|
||||
|
||||
/* start address and size should be 4k align */
|
||||
rkvdec_sram: rkvdec-sram@0 {
|
||||
reg = <0x0 0x78000>;
|
||||
};
|
||||
};
|
||||
|
||||
scmi_shmem: scmi-shmem@4010f000 {
|
||||
compatible = "arm,scmi-shmem";
|
||||
reg = <0x0 0x4010f000 0x0 0x100>;
|
||||
|
||||
@@ -563,10 +563,10 @@ static void dw_hdmi_qp_hdcp(struct work_struct *p_work)
|
||||
{
|
||||
struct dw_qp_hdcp *hdcp = container_of(p_work, struct dw_qp_hdcp, work);
|
||||
u32 val;
|
||||
int i = 500;
|
||||
int i = 700;
|
||||
|
||||
while (i--) {
|
||||
usleep_range(7000, 8000);
|
||||
usleep_range(7200, 8000);
|
||||
|
||||
mutex_lock(&hdcp->mutex);
|
||||
if (hdcp->status == DW_HDCP_DISABLED) {
|
||||
|
||||
@@ -5197,11 +5197,19 @@ static int panel_simple_spi_write(struct device *dev, const u8 *data, size_t len
|
||||
}
|
||||
|
||||
static const struct of_device_id panel_simple_spi_of_match[] = {
|
||||
{ .compatible = "panel-simple-spi", .data = NULL },
|
||||
{ .compatible = "simple-panel-spi", .data = NULL },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, panel_simple_spi_of_match);
|
||||
|
||||
static const struct spi_device_id panel_simple_spi_ids[] = {
|
||||
{ .name = "panel-simple-spi" },
|
||||
{ .name = "simple-panel-spi" },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, panel_simple_spi_ids);
|
||||
|
||||
static int panel_simple_spi_probe(struct spi_device *spi)
|
||||
{
|
||||
struct device *dev = &spi->dev;
|
||||
@@ -5264,6 +5272,7 @@ static struct spi_driver panel_simple_spi_driver = {
|
||||
.probe = panel_simple_spi_probe,
|
||||
.remove = panel_simple_spi_remove,
|
||||
.shutdown = panel_simple_spi_shutdown,
|
||||
.id_table = panel_simple_spi_ids,
|
||||
};
|
||||
|
||||
static int __init panel_simple_init(void)
|
||||
|
||||
@@ -50,6 +50,7 @@ MODULE_PARM_DESC(debug, "debug level (0-2)");
|
||||
/* dw9763 device structure */
|
||||
struct dw9763_device {
|
||||
struct v4l2_ctrl_handler ctrls_vcm;
|
||||
struct v4l2_ctrl *focus;
|
||||
struct i2c_client *client;
|
||||
struct v4l2_subdev sd;
|
||||
struct v4l2_device vdev;
|
||||
@@ -58,13 +59,14 @@ struct dw9763_device {
|
||||
struct gpio_desc *power_gpio;
|
||||
unsigned short current_related_pos;
|
||||
unsigned short current_lens_pos;
|
||||
unsigned int max_current;
|
||||
unsigned int start_current;
|
||||
unsigned int rated_current;
|
||||
unsigned int step;
|
||||
unsigned int step_mode;
|
||||
unsigned int vcm_movefull_t;
|
||||
unsigned int t_src;
|
||||
unsigned int t_div;
|
||||
unsigned int max_logicalpos;
|
||||
|
||||
struct __kernel_old_timeval start_move_tv;
|
||||
struct __kernel_old_timeval end_move_tv;
|
||||
@@ -73,7 +75,6 @@ struct dw9763_device {
|
||||
u32 module_index;
|
||||
const char *module_facing;
|
||||
struct rk_cam_vcm_cfg vcm_cfg;
|
||||
int max_ma;
|
||||
struct mutex lock;
|
||||
struct regulator *supply;
|
||||
bool power_on;
|
||||
@@ -277,22 +278,25 @@ static int dw9763_get_pos(struct dw9763_device *dev_vcm,
|
||||
unsigned int *cur_pos)
|
||||
{
|
||||
struct i2c_client *client = dev_vcm->client;
|
||||
unsigned int dac, position, range;
|
||||
int ret;
|
||||
unsigned int abs_step;
|
||||
|
||||
ret = dw9763_read_reg(client, 0x03, 2, &abs_step);
|
||||
range = dev_vcm->rated_current - dev_vcm->start_current;
|
||||
ret = dw9763_read_reg(client, 0x03, 2, &dac);
|
||||
if (ret != 0)
|
||||
goto err;
|
||||
|
||||
if (abs_step <= dev_vcm->start_current)
|
||||
abs_step = VCMDRV_MAX_LOG;
|
||||
else if ((abs_step > dev_vcm->start_current) &&
|
||||
(abs_step <= dev_vcm->rated_current))
|
||||
abs_step = (dev_vcm->rated_current - abs_step) / dev_vcm->step;
|
||||
else
|
||||
abs_step = 0;
|
||||
if (dac <= dev_vcm->start_current) {
|
||||
position = dev_vcm->max_logicalpos;
|
||||
} else if ((dac > dev_vcm->start_current) &&
|
||||
(dac <= dev_vcm->rated_current)) {
|
||||
position = (dac - dev_vcm->start_current) * dev_vcm->max_logicalpos / range;
|
||||
position = dev_vcm->max_logicalpos - position;
|
||||
} else {
|
||||
position = 0;
|
||||
}
|
||||
|
||||
*cur_pos = abs_step;
|
||||
*cur_pos = position;
|
||||
v4l2_dbg(1, debug, &dev_vcm->sd, "%s: get position %d\n", __func__, *cur_pos);
|
||||
return 0;
|
||||
|
||||
@@ -305,14 +309,16 @@ err:
|
||||
static int dw9763_set_pos(struct dw9763_device *dev_vcm,
|
||||
unsigned int dest_pos)
|
||||
{
|
||||
unsigned int position;
|
||||
unsigned int range;
|
||||
int ret;
|
||||
unsigned int position = 0;
|
||||
|
||||
if (dest_pos >= VCMDRV_MAX_LOG)
|
||||
range = dev_vcm->rated_current - dev_vcm->start_current;
|
||||
if (dest_pos >= dev_vcm->max_logicalpos)
|
||||
position = dev_vcm->start_current;
|
||||
else
|
||||
position = dev_vcm->start_current +
|
||||
(dev_vcm->step * (VCMDRV_MAX_LOG - dest_pos));
|
||||
(range * (dev_vcm->max_logicalpos - dest_pos) / dev_vcm->max_logicalpos);
|
||||
|
||||
if (position > DW9763_MAX_REG)
|
||||
position = DW9763_MAX_REG;
|
||||
@@ -350,10 +356,10 @@ static int dw9763_set_ctrl(struct v4l2_ctrl *ctrl)
|
||||
|
||||
if (ctrl->id == V4L2_CID_FOCUS_ABSOLUTE) {
|
||||
|
||||
if (dest_pos > VCMDRV_MAX_LOG) {
|
||||
if (dest_pos > dev_vcm->max_logicalpos) {
|
||||
dev_info(&client->dev,
|
||||
"%s dest_pos is error. %d > %d\n",
|
||||
__func__, dest_pos, VCMDRV_MAX_LOG);
|
||||
__func__, dest_pos, dev_vcm->max_logicalpos);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -489,28 +495,31 @@ static const struct v4l2_subdev_internal_ops dw9763_int_ops = {
|
||||
static void dw9763_update_vcm_cfg(struct dw9763_device *dev_vcm)
|
||||
{
|
||||
struct i2c_client *client = dev_vcm->client;
|
||||
int cur_dist;
|
||||
|
||||
if (dev_vcm->max_ma == 0) {
|
||||
if (dev_vcm->max_current == 0) {
|
||||
dev_err(&client->dev, "max current is zero");
|
||||
return;
|
||||
}
|
||||
|
||||
cur_dist = dev_vcm->vcm_cfg.rated_ma - dev_vcm->vcm_cfg.start_ma;
|
||||
cur_dist = cur_dist * DW9763_MAX_REG / dev_vcm->max_ma;
|
||||
dev_vcm->step = (cur_dist + (VCMDRV_MAX_LOG - 1)) / VCMDRV_MAX_LOG;
|
||||
if (dev_vcm->vcm_cfg.start_ma == dev_vcm->vcm_cfg.rated_ma) {
|
||||
dev_err(&client->dev,
|
||||
"start current %d can not equal to rated current %d",
|
||||
dev_vcm->vcm_cfg.start_ma, dev_vcm->vcm_cfg.rated_ma);
|
||||
return;
|
||||
}
|
||||
|
||||
dev_vcm->start_current = dev_vcm->vcm_cfg.start_ma *
|
||||
DW9763_MAX_REG / dev_vcm->max_ma;
|
||||
DW9763_MAX_REG / dev_vcm->max_current;
|
||||
dev_vcm->rated_current = dev_vcm->vcm_cfg.rated_ma *
|
||||
DW9763_MAX_REG / dev_vcm->max_ma;
|
||||
DW9763_MAX_REG / dev_vcm->max_current;
|
||||
dev_vcm->step_mode = dev_vcm->vcm_cfg.step_mode;
|
||||
|
||||
dev_info(&client->dev,
|
||||
"vcm_cfg: %d, %d, %d, max_ma %d\n",
|
||||
"vcm_cfg: %d, %d, %d, max_current %d\n",
|
||||
dev_vcm->vcm_cfg.start_ma,
|
||||
dev_vcm->vcm_cfg.rated_ma,
|
||||
dev_vcm->vcm_cfg.step_mode,
|
||||
dev_vcm->max_ma);
|
||||
dev_vcm->max_current);
|
||||
}
|
||||
|
||||
static long dw9763_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
@@ -519,6 +528,7 @@ static long dw9763_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
struct i2c_client *client = dev_vcm->client;
|
||||
struct rk_cam_vcm_tim *vcm_tim;
|
||||
struct rk_cam_vcm_cfg *vcm_cfg;
|
||||
unsigned int max_logicalpos;
|
||||
int ret = 0;
|
||||
|
||||
if (cmd == RK_VIDIOC_VCM_TIMEINFO) {
|
||||
@@ -554,6 +564,16 @@ static long dw9763_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
dev_vcm->vcm_cfg.rated_ma = vcm_cfg->rated_ma;
|
||||
dev_vcm->vcm_cfg.step_mode = vcm_cfg->step_mode;
|
||||
dw9763_update_vcm_cfg(dev_vcm);
|
||||
} else if (cmd == RK_VIDIOC_SET_VCM_MAX_LOGICALPOS) {
|
||||
max_logicalpos = *(unsigned int *)arg;
|
||||
|
||||
if (max_logicalpos > 0) {
|
||||
dev_vcm->max_logicalpos = max_logicalpos;
|
||||
__v4l2_ctrl_modify_range(dev_vcm->focus,
|
||||
0, dev_vcm->max_logicalpos, 1, dev_vcm->max_logicalpos);
|
||||
}
|
||||
dev_dbg(&client->dev,
|
||||
"max_logicalpos %d\n", max_logicalpos);
|
||||
} else {
|
||||
dev_err(&client->dev,
|
||||
"cmd 0x%x not supported\n", cmd);
|
||||
@@ -573,6 +593,7 @@ static long dw9763_compat_ioctl32(struct v4l2_subdev *sd,
|
||||
struct rk_cam_compat_vcm_tim compat_vcm_tim;
|
||||
struct rk_cam_vcm_tim vcm_tim;
|
||||
struct rk_cam_vcm_cfg vcm_cfg;
|
||||
unsigned int max_logicalpos;
|
||||
long ret;
|
||||
|
||||
if (cmd == RK_VIDIOC_COMPAT_VCM_TIMEINFO) {
|
||||
@@ -605,6 +626,12 @@ static long dw9763_compat_ioctl32(struct v4l2_subdev *sd,
|
||||
ret = dw9763_ioctl(sd, cmd, &vcm_cfg);
|
||||
else
|
||||
ret = -EFAULT;
|
||||
} else if (cmd == RK_VIDIOC_SET_VCM_MAX_LOGICALPOS) {
|
||||
ret = copy_from_user(&max_logicalpos, up, sizeof(max_logicalpos));
|
||||
if (!ret)
|
||||
ret = dw9763_ioctl(sd, cmd, &max_logicalpos);
|
||||
else
|
||||
ret = -EFAULT;
|
||||
} else {
|
||||
dev_err(&client->dev,
|
||||
"cmd 0x%x not supported\n", cmd);
|
||||
@@ -641,8 +668,8 @@ static int dw9763_init_controls(struct dw9763_device *dev_vcm)
|
||||
|
||||
v4l2_ctrl_handler_init(hdl, 1);
|
||||
|
||||
v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FOCUS_ABSOLUTE,
|
||||
0, VCMDRV_MAX_LOG, 1, 32);
|
||||
dev_vcm->focus = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FOCUS_ABSOLUTE,
|
||||
0, dev_vcm->max_logicalpos, 1, dev_vcm->max_logicalpos);
|
||||
|
||||
if (hdl->error)
|
||||
dev_err(dev_vcm->sd.dev, "%s fail error: 0x%x\n",
|
||||
@@ -793,7 +820,7 @@ static int dw9763_probe(struct i2c_client *client,
|
||||
{
|
||||
struct device_node *np = of_node_get(client->dev.of_node);
|
||||
struct dw9763_device *dw9763_dev;
|
||||
unsigned int max_ma, start_ma, rated_ma, step_mode;
|
||||
unsigned int max_current, start_ma, rated_ma, step_mode;
|
||||
unsigned int t_src, t_div;
|
||||
struct v4l2_subdev *sd;
|
||||
char facing[2];
|
||||
@@ -802,14 +829,14 @@ static int dw9763_probe(struct i2c_client *client,
|
||||
dev_info(&client->dev, "probing...\n");
|
||||
if (of_property_read_u32(np,
|
||||
OF_CAMERA_VCMDRV_MAX_CURRENT,
|
||||
(unsigned int *)&max_ma)) {
|
||||
max_ma = DW9763_MAX_CURRENT;
|
||||
(unsigned int *)&max_current)) {
|
||||
max_current = DW9763_MAX_CURRENT;
|
||||
dev_info(&client->dev,
|
||||
"could not get module %s from dts!\n",
|
||||
OF_CAMERA_VCMDRV_MAX_CURRENT);
|
||||
}
|
||||
if (max_ma == 0)
|
||||
max_ma = DW9763_MAX_CURRENT;
|
||||
if (max_current == 0)
|
||||
max_current = DW9763_MAX_CURRENT;
|
||||
|
||||
if (of_property_read_u32(np,
|
||||
OF_CAMERA_VCMDRV_START_CURRENT,
|
||||
@@ -886,6 +913,7 @@ static int dw9763_probe(struct i2c_client *client,
|
||||
dw9763_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
|
||||
dw9763_dev->sd.internal_ops = &dw9763_int_ops;
|
||||
|
||||
dw9763_dev->max_logicalpos = VCMDRV_MAX_LOG;
|
||||
ret = dw9763_init_controls(dw9763_dev);
|
||||
if (ret)
|
||||
goto err_cleanup;
|
||||
@@ -914,13 +942,13 @@ static int dw9763_probe(struct i2c_client *client,
|
||||
if (ret)
|
||||
dev_err(&client->dev, "v4l2 async register subdev failed\n");
|
||||
|
||||
dw9763_dev->max_ma = max_ma;
|
||||
dw9763_dev->max_current = max_current;
|
||||
dw9763_dev->vcm_cfg.start_ma = start_ma;
|
||||
dw9763_dev->vcm_cfg.rated_ma = rated_ma;
|
||||
dw9763_dev->vcm_cfg.step_mode = step_mode;
|
||||
dw9763_update_vcm_cfg(dw9763_dev);
|
||||
dw9763_dev->move_us = 0;
|
||||
dw9763_dev->current_related_pos = VCMDRV_MAX_LOG;
|
||||
dw9763_dev->current_related_pos = dw9763_dev->max_logicalpos;
|
||||
dw9763_dev->start_move_tv = ns_to_kernel_old_timeval(ktime_get_ns());
|
||||
dw9763_dev->end_move_tv = ns_to_kernel_old_timeval(ktime_get_ns());
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <media/v4l2-ctrls.h>
|
||||
#include <media/v4l2-subdev.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
#include "otp_eeprom.h"
|
||||
|
||||
#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04)
|
||||
|
||||
@@ -145,6 +146,8 @@ struct ov13855 {
|
||||
const char *module_facing;
|
||||
const char *module_name;
|
||||
const char *len_name;
|
||||
|
||||
struct otp_info *otp;
|
||||
};
|
||||
|
||||
#define to_ov13855(sd) container_of(sd, struct ov13855, subdev)
|
||||
@@ -1217,14 +1220,97 @@ static int ov13855_g_frame_interval(struct v4l2_subdev *sd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ov13855_get_otp(struct otp_info *otp,
|
||||
struct rkmodule_inf *inf)
|
||||
{
|
||||
u32 i, j;
|
||||
u32 w, h;
|
||||
|
||||
/* awb */
|
||||
if (otp->awb_data.flag) {
|
||||
inf->awb.flag = 1;
|
||||
inf->awb.r_value = otp->awb_data.r_ratio;
|
||||
inf->awb.b_value = otp->awb_data.b_ratio;
|
||||
inf->awb.gr_value = otp->awb_data.g_ratio;
|
||||
inf->awb.gb_value = 0x0;
|
||||
|
||||
inf->awb.golden_r_value = otp->awb_data.r_golden;
|
||||
inf->awb.golden_b_value = otp->awb_data.b_golden;
|
||||
inf->awb.golden_gr_value = otp->awb_data.g_golden;
|
||||
inf->awb.golden_gb_value = 0x0;
|
||||
}
|
||||
|
||||
/* lsc */
|
||||
if (otp->lsc_data.flag) {
|
||||
inf->lsc.flag = 1;
|
||||
inf->lsc.width = otp->basic_data.size.width;
|
||||
inf->lsc.height = otp->basic_data.size.height;
|
||||
inf->lsc.table_size = otp->lsc_data.table_size;
|
||||
|
||||
for (i = 0; i < 289; i++) {
|
||||
inf->lsc.lsc_r[i] = (otp->lsc_data.data[i * 2] << 8) |
|
||||
otp->lsc_data.data[i * 2 + 1];
|
||||
inf->lsc.lsc_gr[i] = (otp->lsc_data.data[i * 2 + 578] << 8) |
|
||||
otp->lsc_data.data[i * 2 + 579];
|
||||
inf->lsc.lsc_gb[i] = (otp->lsc_data.data[i * 2 + 1156] << 8) |
|
||||
otp->lsc_data.data[i * 2 + 1157];
|
||||
inf->lsc.lsc_b[i] = (otp->lsc_data.data[i * 2 + 1734] << 8) |
|
||||
otp->lsc_data.data[i * 2 + 1735];
|
||||
}
|
||||
}
|
||||
|
||||
/* pdaf */
|
||||
if (otp->pdaf_data.flag) {
|
||||
inf->pdaf.flag = 1;
|
||||
inf->pdaf.gainmap_width = otp->pdaf_data.gainmap_width;
|
||||
inf->pdaf.gainmap_height = otp->pdaf_data.gainmap_height;
|
||||
inf->pdaf.pd_offset = otp->pdaf_data.pd_offset;
|
||||
inf->pdaf.dcc_mode = otp->pdaf_data.dcc_mode;
|
||||
inf->pdaf.dcc_dir = otp->pdaf_data.dcc_dir;
|
||||
inf->pdaf.dccmap_width = otp->pdaf_data.dccmap_width;
|
||||
inf->pdaf.dccmap_height = otp->pdaf_data.dccmap_height;
|
||||
w = otp->pdaf_data.gainmap_width;
|
||||
h = otp->pdaf_data.gainmap_height;
|
||||
for (i = 0; i < h; i++) {
|
||||
for (j = 0; j < w; j++) {
|
||||
inf->pdaf.gainmap[i * w + j] =
|
||||
(otp->pdaf_data.gainmap[(i * w + j) * 2] << 8) |
|
||||
otp->pdaf_data.gainmap[(i * w + j) * 2 + 1];
|
||||
}
|
||||
}
|
||||
w = otp->pdaf_data.dccmap_width;
|
||||
h = otp->pdaf_data.dccmap_height;
|
||||
for (i = 0; i < h; i++) {
|
||||
for (j = 0; j < w; j++) {
|
||||
inf->pdaf.dccmap[i * w + j] =
|
||||
(otp->pdaf_data.dccmap[(i * w + j) * 2] << 8) |
|
||||
otp->pdaf_data.dccmap[(i * w + j) * 2 + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* af */
|
||||
if (otp->af_data.flag) {
|
||||
inf->af.flag = 1;
|
||||
inf->af.dir_cnt = 1;
|
||||
inf->af.af_otp[0].vcm_start = otp->af_data.af_inf;
|
||||
inf->af.af_otp[0].vcm_end = otp->af_data.af_macro;
|
||||
inf->af.af_otp[0].vcm_dir = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void ov13855_get_module_inf(struct ov13855 *ov13855,
|
||||
struct rkmodule_inf *inf)
|
||||
{
|
||||
struct otp_info *otp = ov13855->otp;
|
||||
|
||||
memset(inf, 0, sizeof(*inf));
|
||||
strscpy(inf->base.sensor, OV13855_NAME, sizeof(inf->base.sensor));
|
||||
strscpy(inf->base.module, ov13855->module_name,
|
||||
sizeof(inf->base.module));
|
||||
strscpy(inf->base.lens, ov13855->len_name, sizeof(inf->base.lens));
|
||||
if (otp)
|
||||
ov13855_get_otp(otp, inf);
|
||||
}
|
||||
|
||||
static long ov13855_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
|
||||
@@ -1819,6 +1905,10 @@ static int ov13855_probe(struct i2c_client *client,
|
||||
{
|
||||
struct device *dev = &client->dev;
|
||||
struct device_node *node = dev->of_node;
|
||||
struct i2c_client *eeprom_ctrl_client;
|
||||
struct device_node *eeprom_ctrl_node;
|
||||
struct v4l2_subdev *eeprom_ctrl;
|
||||
struct otp_info *otp_ptr;
|
||||
struct ov13855 *ov13855;
|
||||
struct v4l2_subdev *sd;
|
||||
char facing[2];
|
||||
@@ -1904,6 +1994,37 @@ static int ov13855_probe(struct i2c_client *client,
|
||||
if (ret)
|
||||
goto err_power_off;
|
||||
|
||||
eeprom_ctrl_node = of_parse_phandle(node, "eeprom-ctrl", 0);
|
||||
if (eeprom_ctrl_node) {
|
||||
eeprom_ctrl_client =
|
||||
of_find_i2c_device_by_node(eeprom_ctrl_node);
|
||||
of_node_put(eeprom_ctrl_node);
|
||||
if (IS_ERR_OR_NULL(eeprom_ctrl_client)) {
|
||||
dev_err(dev, "can not get node\n");
|
||||
goto continue_probe;
|
||||
}
|
||||
eeprom_ctrl = i2c_get_clientdata(eeprom_ctrl_client);
|
||||
if (IS_ERR_OR_NULL(eeprom_ctrl)) {
|
||||
dev_err(dev, "can not get eeprom i2c client\n");
|
||||
} else {
|
||||
otp_ptr = devm_kzalloc(dev, sizeof(*otp_ptr), GFP_KERNEL);
|
||||
if (!otp_ptr) {
|
||||
put_device(&eeprom_ctrl_client->dev);
|
||||
goto continue_probe;
|
||||
}
|
||||
ret = v4l2_subdev_call(eeprom_ctrl,
|
||||
core, ioctl, 0, otp_ptr);
|
||||
if (!ret) {
|
||||
ov13855->otp = otp_ptr;
|
||||
} else {
|
||||
ov13855->otp = NULL;
|
||||
devm_kfree(dev, otp_ptr);
|
||||
}
|
||||
}
|
||||
put_device(&eeprom_ctrl_client->dev);
|
||||
}
|
||||
|
||||
continue_probe:
|
||||
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
|
||||
sd->internal_ops = &ov13855_internal_ops;
|
||||
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
|
||||
|
||||
@@ -1629,8 +1629,8 @@ static const struct rockchip_udphy_cfg rk3576_udphy_cfgs = {
|
||||
},
|
||||
},
|
||||
.dp_tx_ctrl_cfg = {
|
||||
rk3588_dp_tx_drv_ctrl_rbr_hbr,
|
||||
rk3588_dp_tx_drv_ctrl_rbr_hbr,
|
||||
rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
|
||||
rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
|
||||
rk3588_dp_tx_drv_ctrl_hbr2,
|
||||
rk3588_dp_tx_drv_ctrl_hbr3,
|
||||
},
|
||||
|
||||
@@ -399,6 +399,21 @@ MODULE_DEVICE_TABLE(of, rockchip_spi_test_dt_match);
|
||||
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
static const struct spi_device_id spi_rockchip_test_spi_ids[] = {
|
||||
{ .name = "spi_test_bus0_cs0" },
|
||||
{ .name = "spi_test_bus0_cs1" },
|
||||
{ .name = "spi_test_bus1_cs0" },
|
||||
{ .name = "spi_test_bus1_cs1" },
|
||||
{ .name = "spi_test_bus2_cs0" },
|
||||
{ .name = "spi_test_bus2_cs1" },
|
||||
{ .name = "spi_test_bus3_cs0" },
|
||||
{ .name = "spi_test_bus3_cs1" },
|
||||
{ .name = "spi_test_bus4_cs0" },
|
||||
{ .name = "spi_test_bus4_cs1" },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, spi_rockchip_test_spi_ids);
|
||||
|
||||
static struct spi_driver spi_rockchip_test_driver = {
|
||||
.driver = {
|
||||
.name = "spi_test",
|
||||
@@ -407,6 +422,7 @@ static struct spi_driver spi_rockchip_test_driver = {
|
||||
},
|
||||
.probe = rockchip_spi_test_probe,
|
||||
.remove = rockchip_spi_test_remove,
|
||||
.id_table = spi_rockchip_test_spi_ids,
|
||||
};
|
||||
|
||||
static int __init spi_rockchip_test_init(void)
|
||||
|
||||
@@ -351,12 +351,19 @@ static const struct of_device_id spi_codec_device_id[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, spi_codec_device_id);
|
||||
|
||||
static const struct spi_device_id spi_codec_id[] = {
|
||||
{ "spi-codec" },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, spi_codec_id);
|
||||
|
||||
static struct spi_driver spi_codec_driver = {
|
||||
.driver = {
|
||||
.name = "spi_codec",
|
||||
.name = "spi-codec",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(spi_codec_device_id),
|
||||
},
|
||||
.id_table = spi_codec_id,
|
||||
.probe = spi_codec_probe,
|
||||
.remove = spi_codec_remove,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user