[PATCH 05/21] gspca pac7302/pac7311: separate init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Márton Németh <nm127@xxxxxxxxxxx>

Separate the init function. Remove the run-time decision for
PAC7302 and PAC7311 sensors.

Signed-off-by: Márton Németh <nm127@xxxxxxxxxxx>
Cc: Thomas Kaiser <thomas@xxxxxxxxxxxxxxx>
Cc: Theodore Kilgore <kilgota@xxxxxxxxxx>
Cc: Kyle Guinn <elyk03@xxxxxxxxx>
---
diff -uprN e/drivers/media/video/gspca/pac7311.c f/drivers/media/video/gspca/pac7311.c
--- e/drivers/media/video/gspca/pac7311.c	2009-10-30 17:27:57.000000000 +0100
+++ f/drivers/media/video/gspca/pac7311.c	2009-10-30 18:04:30.000000000 +0100
@@ -698,15 +698,18 @@ static void sethvflip(struct gspca_dev *
 	reg_w(gspca_dev, 0x11, 0x01);
 }

-/* this function is called at probe and resume time */
-static int sd_init(struct gspca_dev *gspca_dev)
+/* this function is called at probe and resume time for pac7302 */
+static int pac7302_sd_init(struct gspca_dev *gspca_dev)
 {
-	struct sd *sd = (struct sd *) gspca_dev;
+	reg_w_seq(gspca_dev, init_7302, sizeof init_7302);

-	if (sd->sensor == SENSOR_PAC7302)
-		reg_w_seq(gspca_dev, init_7302, sizeof init_7302);
-	else
-		reg_w_seq(gspca_dev, init_7311, sizeof init_7311);
+	return 0;
+}
+
+/* this function is called at probe and resume time for pac7311 */
+static int pac7311_sd_init(struct gspca_dev *gspca_dev)
+{
+	reg_w_seq(gspca_dev, init_7311, sizeof init_7311);

 	return 0;
 }
@@ -1156,7 +1159,7 @@ static struct sd_desc pac7302_sd_desc =
 	.ctrls = sd_ctrls,
 	.nctrls = ARRAY_SIZE(sd_ctrls),
 	.config = pac7302_sd_config,
-	.init = sd_init,
+	.init = pac7302_sd_init,
 	.start = sd_start,
 	.stopN = sd_stopN,
 	.stop0 = sd_stop0,
@@ -1170,7 +1173,7 @@ static struct sd_desc pac7311_sd_desc =
 	.ctrls = sd_ctrls,
 	.nctrls = ARRAY_SIZE(sd_ctrls),
 	.config = pac7311_sd_config,
-	.init = sd_init,
+	.init = pac7311_sd_init,
 	.start = sd_start,
 	.stopN = sd_stopN,
 	.stop0 = sd_stop0,
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux