From patchwork Wed Jul 15 22:51:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Valdis_Kl=C4=93tnieks?= X-Patchwork-Id: 6800981 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E8616C05AC for ; Wed, 15 Jul 2015 23:01:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9AA1206CD for ; Wed, 15 Jul 2015 23:01:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00508206C7 for ; Wed, 15 Jul 2015 23:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753502AbbGOXBd (ORCPT ); Wed, 15 Jul 2015 19:01:33 -0400 Received: from outbound.smtp.vt.edu ([198.82.183.121]:35978 "EHLO omr1.cc.vt.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752722AbbGOXBc (ORCPT ); Wed, 15 Jul 2015 19:01:32 -0400 X-Greylist: delayed 567 seconds by postgrey-1.27 at vger.kernel.org; Wed, 15 Jul 2015 19:01:32 EDT Received: from mr2.cc.vt.edu (mr2.cc.ipv6.vt.edu [IPv6:2001:468:c80:2105:0:212:7ed0:359e]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id t6FMpxhJ019478; Wed, 15 Jul 2015 18:51:59 -0400 Received: from auth1.smtp.vt.edu (auth1.smtp.vt.edu [198.82.161.152] (may be forged)) by mr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id t6FMpsAZ031435; Wed, 15 Jul 2015 18:51:59 -0400 Received: from turing-police.cc.vt.edu ([IPv6:2001:468:c80:2103:5e3:f126:12d2:a6c8]) (authenticated bits=0) by auth1.smtp.vt.edu (8.14.4/8.14.4) with ESMTP id t6FMpr3v029525 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 15 Jul 2015 18:51:53 -0400 X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6+dev To: Hans de Goede , Mauro Carvalho Chehab cc: contact@demhlyr.de, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ov519.c - allow setting i2c_detect_tries From: Valdis Kletnieks Mime-Version: 1.0 Date: Wed, 15 Jul 2015 18:51:53 -0400 Message-ID: <43010.1437000713@turing-police.cc.vt.edu> X-Spam-Status: No, score=-8.3 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I encountered a user who was having troubles getting a PlayStation EyeToy (USB ID 054c:0155) working as a webcam. They reported that repeated attempts would often make it work. Looking at the code, there was support for repeated attempts at I2C transactions - but only if you rebuilt the module from source. Added module parameter support so that users running a distro kernel can tune it for recalcitrant devices. While we're at it, fix the comment to reflect the error message actually issued. Testing: [/usr/src/linux-next] insmod drivers/media/usb/gspca/gspca_ov519.ko [/usr/src/linux-next] cat /sys/module/gspca_ov519/parameters/i2c_detect_tries 10 [/usr/src/linux-next] rmmod gspca_ov519 [/usr/src/linux-next] insmod drivers/media/usb/gspca/gspca_ov519.ko i2c_detect_tries=50 [/usr/src/linux-next] cat /sys/module/gspca_ov519/parameters/i2c_detect_tries 50 [/usr/src/linux-next] modinfo drivers/media/usb/gspca/gspca_ov519.ko | grep parm parm: i2c_detect_tries:Number of times to try to init I2C (default 10) (int) parm: frame_rate:Frame rate (5, 10, 15, 20 or 30 fps) (int) Reported-By: Demhlyr Signed-Off-By: Valdis Kletnieks --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/media/usb/gspca/ov519.c 2014-10-21 10:06:09.359806243 -0400 +++ b/drivers/media/usb/gspca/ov519.c 2015-07-15 18:35:21.063790541 -0400 @@ -57,8 +57,10 @@ MODULE_LICENSE("GPL"); static int frame_rate; /* Number of times to retry a failed I2C transaction. Increase this if you - * are getting "Failed to read sensor ID..." */ + * are getting "Can't determine sensor slave IDs" */ static int i2c_detect_tries = 10; +module_param(i2c_detect_tries, int, 0644); +MODULE_PARM_DESC(i2c_detect_tries,"Number of times to try to init I2C (default 10)"); /* ov519 device descriptor */ struct sd {