From 16753aed2c1ac1d898461c6a35fe89c719ad5dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Andr=C3=A9n?= Date: Thu, 29 Jan 2009 17:34:41 +0100 Subject: gspca - m5602-s5k4aa: Add experimental SXGA support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Erik Andrén Priority: normal Signed-off-by: Erik Andrén --- .../drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c') diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index 2c0940bff..b18d3237b 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c @@ -66,6 +66,17 @@ static }; static struct v4l2_pix_format s5k4aa_modes[] = { + { + 1280, + 1024, + V4L2_PIX_FMT_SBGGR8, + V4L2_FIELD_NONE, + .sizeimage = + 1280 * 1024, + .bytesperline = 1280, + .colorspace = V4L2_COLORSPACE_SRGB, + .priv = 0 + }, { 640, 480, @@ -259,6 +270,38 @@ int s5k4aa_start(struct sd *sd) struct cam *cam = &sd->gspca_dev.cam; switch (cam->cam_mode[sd->gspca_dev.curr_mode].width) { + case 1280: + PDEBUG(D_V4L2, "Configuring camera for SXGA mode"); + + for (i = 0; i < ARRAY_SIZE(SXGA_s5k4aa); i++) { + switch (SXGA_s5k4aa[i][0]) { + case BRIDGE: + err = m5602_write_bridge(sd, + SXGA_s5k4aa[i][1], + SXGA_s5k4aa[i][2]); + break; + + case SENSOR: + data[0] = SXGA_s5k4aa[i][2]; + err = m5602_write_sensor(sd, + SXGA_s5k4aa[i][1], + data, 1); + break; + + case SENSOR_LONG: + data[0] = SXGA_s5k4aa[i][2]; + data[1] = SXGA_s5k4aa[i][3]; + err = m5602_write_sensor(sd, + SXGA_s5k4aa[i][1], + data, 2); + break; + + default: + err("Invalid stream command, exiting init"); + return -EINVAL; + } + } + case 640: PDEBUG(D_V4L2, "Configuring camera for VGA mode"); -- cgit v1.2.3 From 1b9286232ad7149cdc2b744f376894f66f011289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Andr=C3=A9n?= Date: Mon, 2 Feb 2009 19:56:39 +0100 Subject: gspca - m5602-s5k4aa: Disable SXGA resolution for now. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Erik Andrén SXGA resolution needs more testing. Disable it for now Priority: normal Signed-off-by: Erik Andrén --- linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c') diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index b18d3237b..97c06c5d0 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c @@ -66,6 +66,7 @@ static }; static struct v4l2_pix_format s5k4aa_modes[] = { +#if 0 { 1280, 1024, @@ -77,6 +78,7 @@ static struct v4l2_pix_format s5k4aa_modes[] = { .colorspace = V4L2_COLORSPACE_SRGB, .priv = 0 }, +#endif { 640, 480, -- cgit v1.2.3 From 7ca03eac2d8ff90a5ffc56ee23935a4daf31aabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Andr=C3=A9n?= Date: Thu, 12 Feb 2009 07:32:52 +0100 Subject: gspca - m5602-s5k4aa: Fixup SXGA resolution. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Grégory Lardière The SXGA resolution doesn't work unless you first force the VGA resolution. More investigation is needed in order to fix this the "right" way. Priority: normal Signed-off-by: Grégory Lardière Signed-off-by: Erik Andrén --- .../drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c') diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index 97c06c5d0..48bf519c6 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c @@ -66,27 +66,25 @@ static }; static struct v4l2_pix_format s5k4aa_modes[] = { -#if 0 { - 1280, - 1024, + 640, + 480, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE, .sizeimage = - 1280 * 1024, - .bytesperline = 1280, + 640 * 480, + .bytesperline = 640, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 0 }, -#endif { - 640, - 480, + 1280, + 1024, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE, .sizeimage = - 640 * 480, - .bytesperline = 640, + 1280 * 1024, + .bytesperline = 1280, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 0 } @@ -303,6 +301,10 @@ int s5k4aa_start(struct sd *sd) return -EINVAL; } } + err = s5k4aa_set_noise(&sd->gspca_dev, 0); + if (err < 0) + return err; + break; case 640: PDEBUG(D_V4L2, "Configuring camera for VGA mode"); @@ -335,6 +337,10 @@ int s5k4aa_start(struct sd *sd) return -EINVAL; } } + err = s5k4aa_set_noise(&sd->gspca_dev, 1); + if (err < 0) + return err; + break; } return err; } @@ -389,10 +395,6 @@ int s5k4aa_init(struct sd *sd) if (err < 0) return err; - err = s5k4aa_set_noise(&sd->gspca_dev, sensor_settings[NOISE_SUPP_IDX]); - if (err < 0) - return err; - err = s5k4aa_set_vflip(&sd->gspca_dev, sensor_settings[VFLIP_IDX]); if (err < 0) return err; -- cgit v1.2.3 From dda6c8332ecb0d0a4fc7b43de4318a01439078f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Andr=C3=A9n?= Date: Thu, 12 Feb 2009 07:40:29 +0100 Subject: gspca - m5602-s5k4aa: Fixup the vflip/hflip. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Grégory Lardière Ensure that the hflip and vflip is consistent when the sensor needs to be vflip quirked or not. Priority: normal Signed-off-by: Grégory Lardière Signed-off-by: Erik Andrén --- .../drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 110 ++++++++------------- 1 file changed, 41 insertions(+), 69 deletions(-) (limited to 'linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c') diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index 48bf519c6..60dc77e2a 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c @@ -268,6 +268,7 @@ int s5k4aa_start(struct sd *sd) int i, err = 0; u8 data[2]; struct cam *cam = &sd->gspca_dev.cam; + s32 *sensor_settings = sd->sensor_priv; switch (cam->cam_mode[sd->gspca_dev.curr_mode].width) { case 1280: @@ -342,13 +343,37 @@ int s5k4aa_start(struct sd *sd) return err; break; } - return err; + if (err < 0) + return err; + + err = s5k4aa_set_exposure(&sd->gspca_dev, + sensor_settings[EXPOSURE_IDX]); + if (err < 0) + return err; + + err = s5k4aa_set_gain(&sd->gspca_dev, sensor_settings[GAIN_IDX]); + if (err < 0) + return err; + + err = s5k4aa_set_brightness(&sd->gspca_dev, + sensor_settings[BRIGHTNESS_IDX]); + if (err < 0) + return err; + + err = s5k4aa_set_noise(&sd->gspca_dev, sensor_settings[NOISE_SUPP_IDX]); + if (err < 0) + return err; + + err = s5k4aa_set_vflip(&sd->gspca_dev, sensor_settings[VFLIP_IDX]); + if (err < 0) + return err; + + return s5k4aa_set_hflip(&sd->gspca_dev, sensor_settings[HFLIP_IDX]); } int s5k4aa_init(struct sd *sd) { int i, err = 0; - s32 *sensor_settings = sd->sensor_priv; for (i = 0; i < ARRAY_SIZE(init_s5k4aa) && !err; i++) { u8 data[2] = {0x00, 0x00}; @@ -381,25 +406,7 @@ int s5k4aa_init(struct sd *sd) if (dump_sensor) s5k4aa_dump_registers(sd); - err = s5k4aa_set_exposure(&sd->gspca_dev, - sensor_settings[EXPOSURE_IDX]); - if (err < 0) - return err; - - err = s5k4aa_set_gain(&sd->gspca_dev, sensor_settings[GAIN_IDX]); - if (err < 0) - return err; - - err = s5k4aa_set_brightness(&sd->gspca_dev, - sensor_settings[BRIGHTNESS_IDX]); - if (err < 0) - return err; - - err = s5k4aa_set_vflip(&sd->gspca_dev, sensor_settings[VFLIP_IDX]); - if (err < 0) - return err; - - return s5k4aa_set_hflip(&sd->gspca_dev, sensor_settings[HFLIP_IDX]); + return err; } static int s5k4aa_get_exposure(struct gspca_dev *gspca_dev, __s32 *val) @@ -467,36 +474,19 @@ static int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val) if (err < 0) return err; - if (dmi_check_system(s5k4aa_vflip_dmi_table)) { + if (dmi_check_system(s5k4aa_vflip_dmi_table)) val = !val; - data = (data & 0x3f) | - (!sensor_settings[HFLIP_IDX] << 6) | - ((val & 0x01) << 7); - } else { - data = (data & 0x3f) | - (sensor_settings[HFLIP_IDX] << 6) | - ((val & 0x01) << 7); - } + data = ((data & ~S5K4AA_RM_V_FLIP) | ((val & 0x01) << 7)); err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1); if (err < 0) return err; - if (val) { - err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); - if (err < 0) - return err; - - data++; - err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); - } else { - err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); - if (err < 0) - return err; - - data--; - err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); - } + err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); + if (err < 0) + return err; + data = (data & 0xfe) | !val; + err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); return err; } @@ -532,37 +522,19 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val) if (err < 0) return err; - if (dmi_check_system(s5k4aa_vflip_dmi_table)) { + if (dmi_check_system(s5k4aa_vflip_dmi_table)) val = !val; - data = (data & 0x3f) | - (!sensor_settings[VFLIP_IDX] << 7) | - ((val & 0x01) << 6); - } else { - data = (data & 0x3f) | - (sensor_settings[VFLIP_IDX] << 7) | - ((val & 0x01) << 6); - } data = ((data & ~S5K4AA_RM_H_FLIP) | ((val & 0x01) << 6)); err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1); if (err < 0) return err; - if (val) { - err = m5602_read_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); - if (err < 0) - return err; - data++; - err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); - if (err < 0) - return err; - } else { - err = m5602_read_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); - if (err < 0) - return err; - data--; - err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); - } + err = m5602_read_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); + if (err < 0) + return err; + data = (data & 0xfe) | !val; + err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); return err; } -- cgit v1.2.3 From 42abf44d3269d94fac9261246b91a18e636b0632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Andr=C3=A9n?= Date: Thu, 12 Feb 2009 20:36:05 +0100 Subject: gspca - m5602-s5k4aa: Add vflip quirk for the MSI L735 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Erik Andrén Priority: normal Signed-off-by: Erik Andrén --- linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c') diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index 60dc77e2a..81f24d413 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c @@ -61,6 +61,12 @@ static DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), DMI_MATCH(DMI_PRODUCT_NAME, "GX700/GX705/EX700") } + }, { + .ident = "MSI L735", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), + DMI_MATCH(DMI_PRODUCT_NAME, "MS-1717X") + } }, { } }; -- cgit v1.2.3