From patchwork Sat Nov 1 20:19:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schwarzott X-Patchwork-Id: 5208911 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C1EC3C11AC for ; Sat, 1 Nov 2014 20:19:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1EC7A2015A for ; Sat, 1 Nov 2014 20:19:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 523CF20149 for ; Sat, 1 Nov 2014 20:19:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758848AbaKAUTc (ORCPT ); Sat, 1 Nov 2014 16:19:32 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:50161 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758469AbaKAUTc (ORCPT ); Sat, 1 Nov 2014 16:19:32 -0400 Received: from gauss.fritz.box (unknown [185.17.204.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zzam) by smtp.gentoo.org (Postfix) with ESMTPSA id DD40A34047C; Sat, 1 Nov 2014 20:19:29 +0000 (UTC) From: Matthias Schwarzott To: mchehab@osg.samsung.com, linux-media@vger.kernel.org Cc: mchehab@infradead.org, crope@iki.fi, hans.verkuil@cisco.com, Matthias Schwarzott Subject: [PATCH] cx231xx: use 1 byte read for i2c scan Date: Sat, 1 Nov 2014 21:19:21 +0100 Message-Id: <1414873161-23668-1-git-send-email-zzam@gentoo.org> X-Mailer: git-send-email 2.1.3 In-Reply-To: <54550E71.9010006@gentoo.org> References: <54550E71.9010006@gentoo.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now cx231xx_i2c_check_for_device works like i2c_check_for_device of em28xx driver. For me this fixes scanning of all ports but port 2. Signed-off-by: Matthias Schwarzott --- drivers/media/usb/cx231xx/cx231xx-i2c.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c index d1003c7..fe17a13 100644 --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c @@ -350,14 +350,15 @@ static int cx231xx_i2c_check_for_device(struct i2c_adapter *i2c_adap, struct cx231xx *dev = bus->dev; struct cx231xx_i2c_xfer_data req_data; int status = 0; + u8 buf[1]; /* prepare xfer_data struct */ req_data.dev_addr = msg->addr; - req_data.direction = msg->flags; + req_data.direction = I2C_M_RD; req_data.saddr_len = 0; req_data.saddr_dat = 0; - req_data.buf_size = 0; - req_data.p_buffer = NULL; + req_data.buf_size = 1; + req_data.p_buffer = buf; /* usb send command */ status = dev->cx231xx_send_usb_command(bus, &req_data);