Skip to content

Commit b2203e2

Browse files
committed
addded override_reg to fg dts
1 parent a3a3207 commit b2203e2

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

hardware/realsense/tegra194-camera-d4xx-fg12-16ch-dual.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@
238238
status = "ok";
239239
def-addr = <0x10>;
240240
reg = <0x1b>;
241+
override_reg = <0x1a>;
241242
compatible = "intel,d4xx";
242243
vcc-supply = <&p2822_vdd_1v8_cvb>;
243244
cam-type = "RGB";
@@ -284,6 +285,7 @@
284285
status = "ok";
285286
def-addr = <0x10>;
286287
reg = <0x1c>;
288+
override_reg = <0x1a>;
287289
compatible = "intel,d4xx";
288290
vcc-supply = <&p2822_vdd_1v8_cvb>;
289291
cam-type = "Y8";
@@ -331,6 +333,7 @@
331333
status = "ok";
332334
def-addr = <0x10>;
333335
reg = <0x1d>;
336+
override_reg = <0x1a>;
334337
compatible = "intel,d4xx";
335338
vcc-supply = <&p2822_vdd_1v8_cvb>;
336339
cam-type = "IMU";
@@ -444,6 +447,7 @@
444447
status = "ok";
445448
def-addr = <0x10>;
446449
reg = <0x1b>;
450+
override_reg = <0x1a>;
447451
compatible = "intel,d4xx";
448452
vcc-supply = <&p2822_vdd_1v8_cvb>;
449453
cam-type = "RGB";
@@ -490,6 +494,7 @@
490494
status = "ok";
491495
def-addr = <0x10>;
492496
reg = <0x1c>;
497+
override_reg = <0x1a>;
493498
compatible = "intel,d4xx";
494499
vcc-supply = <&p2822_vdd_1v8_cvb>;
495500
cam-type = "Y8";
@@ -537,6 +542,7 @@
537542
status = "ok";
538543
def-addr = <0x10>;
539544
reg = <0x1d>;
545+
override_reg = <0x1a>;
540546
compatible = "intel,d4xx";
541547
vcc-supply = <&p2822_vdd_1v8_cvb>;
542548
cam-type = "IMU";

hardware/realsense/tegra194-camera-d4xx-fg12-16ch.dtsi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
status = "ok";
170170
def-addr = <0x10>;
171171
reg = <0x1b>;
172+
override_reg = <0x1a>;
172173
compatible = "intel,d4xx";
173174
vcc-supply = <&p2822_vdd_1v8_cvb>;
174175
cam-type = "RGB";
@@ -215,6 +216,7 @@
215216
status = "ok";
216217
def-addr = <0x10>;
217218
reg = <0x1c>;
219+
override_reg = <0x1a>;
218220
compatible = "intel,d4xx";
219221
vcc-supply = <&p2822_vdd_1v8_cvb>;
220222
cam-type = "Y8";
@@ -262,6 +264,7 @@
262264
status = "ok";
263265
def-addr = <0x10>;
264266
reg = <0x1d>;
267+
override_reg = <0x1a>;
265268
compatible = "intel,d4xx";
266269
vcc-supply = <&p2822_vdd_1v8_cvb>;
267270
cam-type = "IMU";

kernel/realsense/d4xx_max96712.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5085,6 +5085,7 @@ static int ds5_probe(struct i2c_client *c, const struct i2c_device_id *id)
50855085
int ret, retry, err = 0;
50865086
#ifdef CONFIG_OF
50875087
const char *str;
5088+
uint32_t override_addr = 0;
50885089
#endif
50895090
if (!state)
50905091
return -ENOMEM;
@@ -5093,9 +5094,14 @@ static int ds5_probe(struct i2c_client *c, const struct i2c_device_id *id)
50935094

50945095
state->client = c;
50955096
dev_warn(&c->dev, "Probing driver for D4xx\n");
5096-
// Alias all addresses to 0x1a
5097-
c->addr = DS5_FIXED_REG_ADDR;
5098-
5097+
#ifdef CONFIG_OF
5098+
ret = of_property_read_u32(c->dev.of_node, "override_reg", &override_addr);
5099+
if (!ret) {
5100+
// Override probed address
5101+
dev_dbg(&c->dev, "Using override addr %u\n", override_addr);
5102+
c->addr = override_addr;
5103+
}
5104+
#endif
50995105
state->variant = ds5_variants + id->driver_data;
51005106
#ifdef CONFIG_OF
51015107
state->vcc = devm_regulator_get(&c->dev, "vcc");

0 commit comments

Comments
 (0)