All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: linux-media@vger.kernel.org
Cc: robert.jarzmik@free.fr, g.liakhovetski@gmx.de, p.wiesner@phytec.de
Subject: [PATCH 01/20] mt9m111: Added indication that MT9M131 is supported by this driver
Date: Fri, 30 Jul 2010 16:53:19 +0200	[thread overview]
Message-ID: <1280501618-23634-2-git-send-email-m.grzeschik@pengutronix.de> (raw)
In-Reply-To: <1280501618-23634-1-git-send-email-m.grzeschik@pengutronix.de>

From: Philipp Wiesner <p.wiesner@phytec.de>

Added this info to Kconfig and mt9m111.c, some comment cleanup,
replaced 'mt9m11x'-statements by clarifications or driver name.
Driver is fully compatible to mt9m131 which has only additional functions
compared to mt9m111. Those aren't used anyway at the moment.

Signed-off-by: Philipp Wiesner <p.wiesner@phytec.de>
---
 drivers/media/video/Kconfig   |    5 +++--
 drivers/media/video/mt9m111.c |   37 +++++++++++++++++++++++--------------
 2 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index cdbbbe4..0e8cf24 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -871,10 +871,11 @@ config SOC_CAMERA_MT9M001
 	  and colour models.
 
 config SOC_CAMERA_MT9M111
-	tristate "mt9m111 and mt9m112 support"
+	tristate "mt9m111, mt9m112 and mt9m131 support"
 	depends on SOC_CAMERA && I2C
 	help
-	  This driver supports MT9M111 and MT9M112 cameras from Micron
+	  This driver supports MT9M111, MT9M112 and MT9M131 cameras from
+	  Micron/Aptina
 
 config SOC_CAMERA_MT9T031
 	tristate "mt9t031 support"
diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c
index d35f536..e934559 100644
--- a/drivers/media/video/mt9m111.c
+++ b/drivers/media/video/mt9m111.c
@@ -1,5 +1,5 @@
 /*
- * Driver for MT9M111/MT9M112 CMOS Image Sensor from Micron
+ * Driver for MT9M111/MT9M112/MT9M131 CMOS Image Sensor from Micron/Aptina
  *
  * Copyright (C) 2008, Robert Jarzmik <robert.jarzmik@free.fr>
  *
@@ -19,11 +19,14 @@
 #include <media/soc_camera.h>
 
 /*
- * mt9m111 and mt9m112 i2c address is 0x5d or 0x48 (depending on SAddr pin)
+ * MT9M111, MT9M112 and MT9M131:
+ * i2c address is 0x48 or 0x5d (depending on SADDR pin)
  * The platform has to define i2c_board_info and call i2c_register_board_info()
  */
 
-/* mt9m111: Sensor register addresses */
+/*
+ * Sensor core register addresses (0x000..0x0ff)
+ */
 #define MT9M111_CHIP_VERSION		0x000
 #define MT9M111_ROW_START		0x001
 #define MT9M111_COLUMN_START		0x002
@@ -72,8 +75,9 @@
 #define MT9M111_CTXT_CTRL_LED_FLASH_EN	(1 << 2)
 #define MT9M111_CTXT_CTRL_VBLANK_SEL_B	(1 << 1)
 #define MT9M111_CTXT_CTRL_HBLANK_SEL_B	(1 << 0)
+
 /*
- * mt9m111: Colorpipe register addresses (0x100..0x1ff)
+ * Colorpipe register addresses (0x100..0x1ff)
  */
 #define MT9M111_OPER_MODE_CTRL		0x106
 #define MT9M111_OUTPUT_FORMAT_CTRL	0x108
@@ -109,8 +113,9 @@
 #define MT9M111_OUTFMT_SWAP_YCbCr_C_Y	(1 << 1)
 #define MT9M111_OUTFMT_SWAP_RGB_EVEN	(1 << 1)
 #define MT9M111_OUTFMT_SWAP_YCbCr_Cb_Cr	(1 << 0)
+
 /*
- * mt9m111: Camera control register addresses (0x200..0x2ff not implemented)
+ * Camera control register addresses (0x200..0x2ff not implemented)
  */
 
 #define reg_read(reg) mt9m111_reg_read(client, MT9M111_##reg)
@@ -160,7 +165,8 @@ enum mt9m111_context {
 
 struct mt9m111 {
 	struct v4l2_subdev subdev;
-	int model;	/* V4L2_IDENT_MT9M11x* codes from v4l2-chip-ident.h */
+	int model;	/* V4L2_IDENT_MT9M111 or V4L2_IDENT_MT9M112 code */
+			/* from v4l2-chip-ident.h */
 	enum mt9m111_context context;
 	struct v4l2_rect rect;
 	const struct mt9m111_datafmt *fmt;
@@ -934,7 +940,7 @@ static int mt9m111_init(struct i2c_client *client)
 	if (!ret)
 		ret = mt9m111_set_autoexposure(client, mt9m111->autoexposure);
 	if (ret)
-		dev_err(&client->dev, "mt9m11x init failed: %d\n", ret);
+		dev_err(&client->dev, "mt9m111 init failed: %d\n", ret);
 	return ret;
 }
 
@@ -970,21 +976,24 @@ static int mt9m111_video_probe(struct soc_camera_device *icd,
 	data = reg_read(CHIP_VERSION);
 
 	switch (data) {
-	case 0x143a: /* MT9M111 */
+	case 0x143a: /* MT9M111 or MT9M131 */
 		mt9m111->model = V4L2_IDENT_MT9M111;
+		dev_info(&client->dev,
+			"Detected a MT9M111/MT9M131 chip ID %x\n", data);
 		break;
 	case 0x148c: /* MT9M112 */
 		mt9m111->model = V4L2_IDENT_MT9M112;
+		dev_info(&client->dev, "Detected a MT9M112 chip ID %x\n", data);
 		break;
 	default:
 		ret = -ENODEV;
 		dev_err(&client->dev,
-			"No MT9M11x chip detected, register read %x\n", data);
+			"No MT9M111/MT9M112/MT9M131 chip detected, "
+			"register read %x\n",
+			data);
 		goto ei2c;
 	}
 
-	dev_info(&client->dev, "Detected a MT9M11x chip ID %x\n", data);
-
 ei2c:
 	return ret;
 }
@@ -1034,13 +1043,13 @@ static int mt9m111_probe(struct i2c_client *client,
 	int ret;
 
 	if (!icd) {
-		dev_err(&client->dev, "MT9M11x: missing soc-camera data!\n");
+		dev_err(&client->dev, "mt9m111: soc-camera data missing!\n");
 		return -EINVAL;
 	}
 
 	icl = to_soc_camera_link(icd);
 	if (!icl) {
-		dev_err(&client->dev, "MT9M11x driver needs platform data\n");
+		dev_err(&client->dev, "mt9m111: driver needs platform data\n");
 		return -EINVAL;
 	}
 
@@ -1116,6 +1125,6 @@ static void __exit mt9m111_mod_exit(void)
 module_init(mt9m111_mod_init);
 module_exit(mt9m111_mod_exit);
 
-MODULE_DESCRIPTION("Micron MT9M111/MT9M112 Camera driver");
+MODULE_DESCRIPTION("Micron/Aptina MT9M111/MT9M112/MT9M131 Camera driver");
 MODULE_AUTHOR("Robert Jarzmik");
 MODULE_LICENSE("GPL");
-- 
1.7.1


  reply	other threads:[~2010-07-30 14:54 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-30 14:53 [PATCH 00/20] MT9M111/MT9M131 Michael Grzeschik
2010-07-30 14:53 ` Michael Grzeschik [this message]
2010-07-31 19:49   ` [PATCH 01/20] mt9m111: Added indication that MT9M131 is supported by this driver Guennadi Liakhovetski
2010-07-31 20:10   ` Robert Jarzmik
2010-07-31 20:16     ` Guennadi Liakhovetski
2010-07-31 20:28       ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 02/20] mt9m111: init chip after read CHIP_VERSION Michael Grzeschik
2010-07-31 20:09   ` Guennadi Liakhovetski
2010-07-31 20:36     ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 03/20] mt9m111: register cleanup hex to dec bitoffset Michael Grzeschik
2010-07-31 20:40   ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 04/20] mt9m111: added new bit offset defines Michael Grzeschik
2010-07-31 20:44   ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 05/20] mt9m111: added default row/col/width/height values Michael Grzeschik
2010-07-31 20:25   ` Guennadi Liakhovetski
2010-07-30 14:53 ` [PATCH 06/20] mt9m111: changed MAX_{HEIGHT,WIDTH} values to silicon pixelcount Michael Grzeschik
2010-07-31 20:51   ` Robert Jarzmik
2010-07-30 14:53 ` [PATCH 07/20] mt9m111: changed MIN_DARK_COLS to MT9M131 spec count Michael Grzeschik
2010-07-30 14:53 ` [PATCH 08/20] mt9m111: cropcap use defined default rect properties in defrect Michael Grzeschik
2010-07-30 14:53 ` [PATCH 09/20] mt9m111: cropcap check if type is CAPTURE Michael Grzeschik
2010-07-30 14:53 ` [PATCH 10/20] mt9m111: rewrite make_rect for positioning in debug Michael Grzeschik
2010-08-01  9:33   ` Guennadi Liakhovetski
2010-07-30 14:53 ` [PATCH 11/20] mt9m111: added mt9m111 format structure Michael Grzeschik
2010-08-01 16:48   ` Guennadi Liakhovetski
2010-07-30 14:53 ` [PATCH 12/20] mt9m111: s_crop add calculation of output size Michael Grzeschik
2010-08-01 19:38   ` Guennadi Liakhovetski
2010-07-30 14:53 ` [PATCH 13/20] mt9m111: s_crop check for VIDEO_CAPTURE type Michael Grzeschik
2010-07-30 14:53 ` [PATCH 14/20] mt9m111: added reg_mask function Michael Grzeschik
2010-07-30 14:53 ` [PATCH 15/20] mt9m111: rewrite setup_rect, added soft_crop for smooth panning Michael Grzeschik
2010-07-30 14:53 ` [PATCH 16/20] mt9m111: added more supported BE colour formats Michael Grzeschik
2010-07-30 14:53 ` [PATCH 17/20] mt9m111: rewrite set_pixfmt Michael Grzeschik
2010-07-30 14:53 ` [PATCH 18/20] mt9m111: make use of testpattern in debug mode Michael Grzeschik
2010-07-30 14:53 ` [PATCH 19/20] mt9m111: try_fmt rewrite to use preset values Michael Grzeschik
2010-07-30 14:53 ` [PATCH 20/20] mt9m111: s_fmt make use of try_fmt Michael Grzeschik
2010-07-30 15:38 ` [PATCH 00/20] MT9M111/MT9M131 Guennadi Liakhovetski
2010-07-31 10:33   ` Robert Jarzmik
2010-08-02 10:35   ` Michael Grzeschik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1280501618-23634-2-git-send-email-m.grzeschik@pengutronix.de \
    --to=m.grzeschik@pengutronix.de \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-media@vger.kernel.org \
    --cc=p.wiesner@phytec.de \
    --cc=robert.jarzmik@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.