From patchwork Sat Oct 31 23:16:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TsODwqltZXRoIE3Dg8KhcnRvbg==?= X-Patchwork-Id: 56814 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 n9VNGbl5029787 for ; Sat, 31 Oct 2009 23:16:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933386AbZJaXQl (ORCPT ); Sat, 31 Oct 2009 19:16:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933385AbZJaXQl (ORCPT ); Sat, 31 Oct 2009 19:16:41 -0400 Received: from mail01a.mail.t-online.hu ([84.2.40.6]:52818 "EHLO mail01a.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933383AbZJaXQl (ORCPT ); Sat, 31 Oct 2009 19:16:41 -0400 X-Authuid: nmarci Received: from [192.168.1.64] (dsl5402C4D0.pool.t-online.hu [84.2.196.208]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail01a.mail.t-online.hu (Postfix) with ESMTPSA id 93E6D797A51; Sun, 1 Nov 2009 00:16:33 +0100 (CET) Message-ID: <4AECC558.2090909@freemail.hu> Date: Sun, 01 Nov 2009 00:16:40 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Jean-Francois Moine , Hans de Goede , V4L Mailing List CC: Thomas Kaiser , Theodore Kilgore , Kyle Guinn Subject: [PATCH 18/21] gspca pac7302/pac7311: generalize reg_w_var X-DCC-mail.t-online.hu-Metrics: mail01a.mail.t-online.hu 32721; Body=6 Fuz1=6 Fuz2=6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff -uprN r/drivers/media/video/gspca/pac7311.c s/drivers/media/video/gspca/pac7311.c --- r/drivers/media/video/gspca/pac7311.c 2009-10-31 09:07:56.000000000 +0100 +++ s/drivers/media/video/gspca/pac7311.c 2009-10-31 10:21:55.000000000 +0100 @@ -602,7 +602,9 @@ static void reg_w_page(struct gspca_dev /* output a variable sequence */ static void reg_w_var(struct gspca_dev *gspca_dev, - const __u8 *seq) + const __u8 *seq, + const __u8 *page3, unsigned int page3_len, + const __u8 *page4, unsigned int page4_len) { int index, len; @@ -613,10 +615,10 @@ static void reg_w_var(struct gspca_dev * case END_OF_SEQUENCE: return; case LOAD_PAGE4: - reg_w_page(gspca_dev, page4_7311, sizeof page4_7311); + reg_w_page(gspca_dev, page4, page4_len); break; case LOAD_PAGE3: - reg_w_page(gspca_dev, page3_7302, sizeof page3_7302); + reg_w_page(gspca_dev, page3, page3_len); break; default: if (len > USB_BUF_SZ) { @@ -874,7 +876,9 @@ static int pac7302_sd_start(struct gspca sd->sof_read = 0; - reg_w_var(gspca_dev, start_7302); + reg_w_var(gspca_dev, start_7302, + page3_7302, sizeof(page3_7302), + NULL, 0); pac7302_setbrightcont(gspca_dev); pac7302_setcolors(gspca_dev); pac7302_setgain(gspca_dev); @@ -900,7 +904,9 @@ static int pac7311_sd_start(struct gspca sd->sof_read = 0; - reg_w_var(gspca_dev, start_7311); + reg_w_var(gspca_dev, start_7311, + NULL, 0, + page4_7311, sizeof(page4_7311)); pac7311_setcontrast(gspca_dev); pac7311_setgain(gspca_dev); pac7311_setexposure(gspca_dev);