From patchwork Thu Mar 7 09:43:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 2230821 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id DDB97DF223 for ; Thu, 7 Mar 2013 09:43:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755296Ab3CGJnq (ORCPT ); Thu, 7 Mar 2013 04:43:46 -0500 Received: from mail-wg0-f45.google.com ([74.125.82.45]:49737 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755107Ab3CGJnp (ORCPT ); Thu, 7 Mar 2013 04:43:45 -0500 Received: by mail-wg0-f45.google.com with SMTP id dq12so366899wgb.0 for ; Thu, 07 Mar 2013 01:43:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type:x-gm-message-state; bh=m9xYv829hT4r3M3veEOjBxEBNlPnklrPKrJurdteS3c=; b=REVbydgTM2Vmoz6ey6klx+78Gkw6jKk+O6cyggJqYgQuKIWN6bh6koMLU6arq3efCz MO2lW7rbkiVCcFrAXh4bJxEb0Qx+YjgGI2KBjZt4m1ttepblsiouUNkHRqurl4dGup86 uiSC/KT1efbBFZUP1g6DSVTOfCE9UwR/XRiEzsBS7/fpX8/rZFXoTmNfE+hI23M90w5j hFz1jGKDS81JgVKzvxg0Ywb8V+znDika/4umQbGT5FG8tftsBWjM5sTcSArQznGiQ3rs FNv6i5aGropeo8+OvoFiINKx2fM0/X4uey4DGQYJOaL1md3jnSJouFVmEL9v5TzD+KpO 3JBg== MIME-Version: 1.0 X-Received: by 10.180.109.82 with SMTP id hq18mr21770453wib.0.1362649422123; Thu, 07 Mar 2013 01:43:42 -0800 (PST) Received: by 10.194.166.99 with HTTP; Thu, 7 Mar 2013 01:43:42 -0800 (PST) Date: Thu, 7 Mar 2013 10:43:42 +0100 Message-ID: Subject: mt9m111/mt9m131: kernel 3.8 issues. From: javier Martin To: linux-media@vger.kernel.org Cc: Sascha Hauer , Guennadi Liakhovetski , benoit.thebaudeau@advansee.com X-Gm-Message-State: ALoCoQk8ixbHKN+jKBkphLVuz9SxYdYugVY8fj81Xq4+s2pWtTEalnm4+2Q5bPpvCsYVAM7XsVJE Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi, I am testing mt9m131 sensor (which is supported in mt9m111.c) in mainline kernel 3.8 with my Visstrim M10, which is an i.MX27 board. Since both mx2_camera.c and mt9m111.c are soc_camera drivers making it work was quite straightforward. However, I've found several issues regarding mt9m111.c: 1. mt9m111 probe is broken. It will give an oops since it tries to use a context before it's been assigned. 2. mt9m111 auto exposure control is broken too (see the patch below). 3. After I've fixed 1 and 2 the colours in the pictures I grab are dull and not vibrant, green is very dark and red seems like pink, blue and yellow look fine though. I have both auto exposure and auto white balance enabled. I can see in the list that you have tried this sensor before. Have you also noticed these problems (specially 3)? This patch is just to provide a quick fix for points 1 and 2 just in case you feel like testing this in kernel 3.8. If you consider these fix are valid I'll send a proper patch later: } @@ -916,6 +916,9 @@ static int mt9m111_video_probe(struct i2c_client *client) s32 data; int ret; + /* Assign context to avoid oops */ + mt9m111->ctx = &context_a; + ret = mt9m111_s_power(&mt9m111->subdev, 1); if (ret < 0) return ret; Regards. diff --git a/drivers/media/i2c/soc_camera/mt9m111.c b/drivers/media/i2c/soc_camera/mt9m111.c index 62fd94a..7d99655 100644 --- a/drivers/media/i2c/soc_camera/mt9m111.c +++ b/drivers/media/i2c/soc_camera/mt9m111.c @@ -704,7 +704,7 @@ static int mt9m111_set_autoexposure(struct mt9m111 *mt9m111, int on) { struct i2c_client *client = v4l2_get_subdevdata(&mt9m111->subdev); - if (on) + if (on == V4L2_EXPOSURE_AUTO) return reg_set(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN); return reg_clear(OPER_MODE_CTRL, MT9M111_OPMODE_AUTOEXPO_EN);