mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
media: i2c: ov9282: Read chip ID via 2 reads
Vision Components have made an OV9281 module which blocks reading back the majority of registers to comply with NDAs, and in doing so doesn't allow auto-increment register reading as used when reading the chip ID. Use two reads and manually combine the results. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
1e09fc031c
commit
1f89a855fa
@@ -1069,12 +1069,16 @@ error_unlock:
|
|||||||
static int ov9282_detect(struct ov9282 *ov9282)
|
static int ov9282_detect(struct ov9282 *ov9282)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u32 val;
|
u32 val, msb;
|
||||||
|
|
||||||
ret = ov9282_read_reg(ov9282, OV9282_REG_ID, 2, &val);
|
ret = ov9282_read_reg(ov9282, OV9282_REG_ID + 1, 1, &val);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
ret = ov9282_read_reg(ov9282, OV9282_REG_ID, 1, &msb);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
val |= (msb << 8);
|
||||||
if (val != OV9282_ID) {
|
if (val != OV9282_ID) {
|
||||||
dev_err(ov9282->dev, "chip id mismatch: %x!=%x",
|
dev_err(ov9282->dev, "chip id mismatch: %x!=%x",
|
||||||
OV9282_ID, val);
|
OV9282_ID, val);
|
||||||
|
|||||||
Reference in New Issue
Block a user