lede/target/linux/bcm27xx/patches-6.12/950-0391-media-i2c-ov9282-Read-chip-ID-via-2-reads.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

39 lines
1.2 KiB
Diff

From fee10f9387c026572a7c3e541ff6c9560ade5b91 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Wed, 11 Oct 2023 11:12:41 +0100
Subject: [PATCH] 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>
---
drivers/media/i2c/ov9282.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -1069,12 +1069,16 @@ error_unlock:
static int ov9282_detect(struct ov9282 *ov9282)
{
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)
return ret;
+ val |= (msb << 8);
if (val != OV9282_ID) {
dev_err(ov9282->dev, "chip id mismatch: %x!=%x",
OV9282_ID, val);