All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo@jmondi.org>
To: laurent.pinchart@ideasonboard.com, mchehab@kernel.org,
	hans.verkuil@cisco.com, sakari.ailus@linux.intel.com,
	sre@kernel.org, magnus.damm@gmail.com,
	wsa+renesas@sang-engineering.com
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: [PATCH] media: i2c: ov772x: Force use of SCCB protocol
Date: Fri, 12 May 2017 11:52:43 +0200	[thread overview]
Message-ID: <1494582763-22385-1-git-send-email-jacopo@jmondi.org> (raw)

Force use of Omnivision's SCCB protocol and make sure the I2c adapter
supports protocol mangling during probe.

Testing done on SH4 Migo-R board.
As commit:
[e789029761503f0cce03e8767a56ae099b88e1bd]
"i2c: sh_mobile: don't send a stop condition by default inside transfers"
makes the i2c adapter emit a stop bit between messages in a single
transfer only when explicitly required, the ov772x driver fails to
probe due to i2c transfer timeout without SCCB flag set.

i2c-sh_mobile i2c-sh_mobile.0: Transfer request timed out
ov772x 0-0021: Product ID error 92:92

With this patch applied:

soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
ov772x 0-0021: ov7725 Product ID 77:21 Manufacturer ID 7f:a2

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/i2c/soc_camera/ov772x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/soc_camera/ov772x.c b/drivers/media/i2c/soc_camera/ov772x.c
index 985a367..8a4b29e 100644
--- a/drivers/media/i2c/soc_camera/ov772x.c
+++ b/drivers/media/i2c/soc_camera/ov772x.c
@@ -1067,6 +1067,7 @@ static int ov772x_probe(struct i2c_client *client,
 			"I2C-Adapter doesn't support I2C_FUNC_SMBUS_BYTE_DATA\n");
 		return -EIO;
 	}
+	client->flags |= I2C_CLIENT_SCCB;
 
 	priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
-- 
2.7.4

             reply	other threads:[~2017-05-12  9:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12  9:52 Jacopo Mondi [this message]
2017-05-12  9:58 ` [PATCH] media: i2c: ov772x: Force use of SCCB protocol Wolfram Sang
2017-05-12 10:10 ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494582763-22385-1-git-send-email-jacopo@jmondi.org \
    --to=jacopo@jmondi.org \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sre@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.