From patchwork Fri May 12 09:52:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 9723807 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B60F601E7 for ; Fri, 12 May 2017 09:52:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92A9E287E6 for ; Fri, 12 May 2017 09:52:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 862C3287EE; Fri, 12 May 2017 09:52:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7DA7287E6 for ; Fri, 12 May 2017 09:52:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756956AbdELJwy (ORCPT ); Fri, 12 May 2017 05:52:54 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:56025 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751323AbdELJwx (ORCPT ); Fri, 12 May 2017 05:52:53 -0400 Received: from w540.lan (unknown [IPv6:2001:b07:6442:1ac4:101:582b:9c58:7e82]) (Authenticated sender: jacopo@jmondi.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 37AD41720F0; Fri, 12 May 2017 11:52:50 +0200 (CEST) From: Jacopo Mondi 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 Message-Id: <1494582763-22385-1-git-send-email-jacopo@jmondi.org> X-Mailer: git-send-email 2.7.4 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Wolfram Sang Reviewed-by: Laurent Pinchart --- 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)