From patchwork Mon Apr 20 15:37:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Champagne X-Patchwork-Id: 19023 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3KFbwQg002987 for ; Mon, 20 Apr 2009 15:37:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755575AbZDTPh5 (ORCPT ); Mon, 20 Apr 2009 11:37:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754989AbZDTPh5 (ORCPT ); Mon, 20 Apr 2009 11:37:57 -0400 Received: from yw-out-2324.google.com ([74.125.46.28]:21669 "EHLO yw-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755461AbZDTPh4 (ORCPT ); Mon, 20 Apr 2009 11:37:56 -0400 Received: by yw-out-2324.google.com with SMTP id 5so1335871ywb.1 for ; Mon, 20 Apr 2009 08:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=zW+kfHcLdRtFtcsCwd+oawZ191TurvfuSzg68RMsQbM=; b=aSVhFFbprKTKVbRJIVntNTuU2KcGkJZxbjwYZF5402Z2xfs+9S5EkO4mRJv49VyapY csTo7FD9RBSOXzkGg6I8EYp+kULtOpm/x2x2c3aDBcSc64y2cOrnyMsKec6tRS5l1yiW iOVtOKcAbuhAtDuoptv3PBDLdJCU60/vGEBEo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=V4qGw2ElC8D64l/ZZ0o1txZyh1rR7AroqDu4/9O61GIuyYYsTQk3yTYTjbplrcEEr+ sKAUNENNaI+zZcp3Uq+5PhOnxFD3mfTp/AdDSQxkGr5dkWP8YSL2MFvnzILfFSK8WYVt yHlgDgzbNbFPT1TPPVzgBPMHBfTEUpjzfZ0Wc= MIME-Version: 1.0 Received: by 10.151.41.21 with SMTP id t21mr8753190ybj.117.1240241875609; Mon, 20 Apr 2009 08:37:55 -0700 (PDT) In-Reply-To: <20090405193625.57c3b1fd@free.fr> References: <5ec8ebd50903271106n14f0e2b7m1495ef135be0cd90@mail.gmail.com> <49CD2868.9080502@kaiser-linux.li> <5ec8ebd50903311144h316c7e3bmd30ce2c3d5a268ee@mail.gmail.com> <49D4EAB2.4090206@control.lth.se> <49D66C83.6000700@control.lth.se> <49D67781.6030807@gmail.com> <49D74485.8000004@control.lth.se> <20090405193625.57c3b1fd@free.fr> Date: Mon, 20 Apr 2009 17:37:55 +0200 Message-ID: <1d4c7fd50904200837pe4c82bfx1f0638072efba919@mail.gmail.com> Subject: Re: topro 6800 driver From: Thomas Champagne To: Jean-Francois Moine , Anders Blomdell Cc: =?ISO-8859-1?Q?Erik_Andr=E9n?= , Andy Shevchenko , Thomas Kaiser , Linux Media , Richard Case Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hello Anders I found a small time for testing your code. But your code doesn't work with my webcam. :-( I think it doesn't have the same sensor. Can you add in the sd_init method the check of the sensor id ? You can adjust this patch with your sensor id : Please, tell me what is your sensor id. Thomas --- 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 diff -r 5a9a52f1277e linux/drivers/media/video/gspca/tp6800.c --- a/linux/drivers/media/video/gspca/tp6800.c Sat Apr 18 18:21:49 2009 +0200 +++ b/linux/drivers/media/video/gspca/tp6800.c Mon Apr 20 17:33:15 2009 +0200 @@ -1601,8 +1601,21 @@ /* this function is called at probe and resume time */ static int sd_init(struct gspca_dev *gspca_dev) { + int res = 0; + __u8 value; + /* check if the device responds */ + REG_W(gspca_dev, TP6800_SIF_TYPE, 0x01); + REG_W(gspca_dev, TP6800_SIF_CONTROL, 0x01); + REG_W(gspca_dev, TP6800_GPIO_IO, 0x9f); + REG_R(gspca_dev, TP6800_GPIO_DATA, &value); + if ((value & 7) != 0x00) { + PDEBUG(D_ERR, "init reg: 0x%02x. Unrecognized sensor.", value); + return -1; + } return 0; +out: + return res; } /* -- start the camera -- */