Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bdd00b9 authored by Theodore Kilgore's avatar Theodore Kilgore Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (13992): gspca_sn9c2028: New gspca subdriver



New gspca subdriver adding support for SN9C2028 dual-mode cameras.

Signed-off-by: default avatarTheodore Kilgore <kilgota@banach.math.auburn.edu>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 70136081
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -141,6 +141,16 @@ config USB_GSPCA_PAC7311
	  To compile this driver as a module, choose M here: the
	  module will be called gspca_pac7311.

config USB_GSPCA_SN9C2028
	tristate "SONIX Dual-Mode USB Camera Driver"
	depends on VIDEO_V4L2 && USB_GSPCA
	help
	  Say Y here if you want streaming support for Sonix SN9C2028 cameras.
	  These are supported as stillcams in libgphoto2/camlibs/sonix.

	  To compile this driver as a module, choose M here: the
	  module will be called gspca_sn9c2028.

config USB_GSPCA_SN9C20X
	tristate "SN9C20X USB Camera Driver"
	depends on VIDEO_V4L2 && USB_GSPCA
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ obj-$(CONFIG_USB_GSPCA_OV534_9) += gspca_ov534_9.o
obj-$(CONFIG_USB_GSPCA_PAC207)   += gspca_pac207.o
obj-$(CONFIG_USB_GSPCA_PAC7302)  += gspca_pac7302.o
obj-$(CONFIG_USB_GSPCA_PAC7311)  += gspca_pac7311.o
obj-$(CONFIG_USB_GSPCA_SN9C2028) += gspca_sn9c2028.o
obj-$(CONFIG_USB_GSPCA_SN9C20X)  += gspca_sn9c20x.o
obj-$(CONFIG_USB_GSPCA_SONIXB)   += gspca_sonixb.o
obj-$(CONFIG_USB_GSPCA_SONIXJ)   += gspca_sonixj.o
@@ -45,6 +46,7 @@ gspca_ov534_9-objs := ov534_9.o
gspca_pac207-objs   := pac207.o
gspca_pac7302-objs  := pac7302.o
gspca_pac7311-objs  := pac7311.o
gspca_sn9c2028-objs := sn9c2028.o
gspca_sn9c20x-objs  := sn9c20x.o
gspca_sonixb-objs   := sonixb.o
gspca_sonixj-objs   := sonixj.o
+757 −0

File added.

Preview size limit exceeded, changes collapsed.

+51 −0
Original line number Diff line number Diff line
/*
 * SN9C2028 common functions
 *
 * Copyright (C) 2009 Theodore Kilgore <kilgota@auburn,edu>
 *
 * Based closely upon the file gspca/pac_common.h
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

static const unsigned char sn9c2028_sof_marker[5] =
	{ 0xff, 0xff, 0x00, 0xc4, 0xc4 };

static unsigned char *sn9c2028_find_sof(struct gspca_dev *gspca_dev,
					unsigned char *m, int len)
{
	struct sd *sd = (struct sd *) gspca_dev;
	int i;

	/* Search for the SOF marker (fixed part) in the header */
	for (i = 0; i < len; i++) {
		if (m[i] == sn9c2028_sof_marker[sd->sof_read]) {
			sd->sof_read++;
			if (sd->sof_read == sizeof(sn9c2028_sof_marker)) {
				PDEBUG(D_FRAM,
					"SOF found, bytes to analyze: %u."
					" Frame starts at byte #%u",
					len, i + 1);
				sd->sof_read = 0;
				return m + i + 1;
			}
		} else {
			sd->sof_read = 0;
		}
	}

	return NULL;
}
+1 −0
Original line number Diff line number Diff line
@@ -362,6 +362,7 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_SPCA561  v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
#define V4L2_PIX_FMT_PAC207   v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
#define V4L2_PIX_FMT_SQ905C   v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
#define V4L2_PIX_FMT_PJPG     v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
#define V4L2_PIX_FMT_OV511    v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */