From patchwork Mon Aug 20 11:33:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 10801 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3539123E41 for ; Mon, 20 Aug 2012 11:33:19 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5DCCCA183C9 for ; Mon, 20 Aug 2012 11:33:13 +0000 (UTC) Received: by ghbg10 with SMTP id g10so5193969ghb.11 for ; Mon, 20 Aug 2012 04:33:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:message-id :date:from:user-agent:mime-version:to:cc:subject:references :in-reply-to:content-type:x-tm-as-mml:x-gm-message-state; bh=AegTUELdgR0SzdCaVjDv9jzg9SdlHKMkb6UknnJJOT8=; b=bs7xg6NwtwZE4g4Se0lHrWX5CNYdWbFqp7fbKXMIQRtVhSpGX1s+N7chq7nrQl4zIF ibeNoM3ZR2z40rntF77VYvYbtuTCRuwz7ALKdVMX093ZxmSt6ZxcKtezXBj/VafFMP3j Ytk0+5yJNm6EjjlR5t3qrvIxaqDSme7LdRd/IDTER0aLDZVUD5UhIClNZ4s9uolUCXjM YwXldVeY4gN755PHuzfHwoqo5BQiSfrj3SdgZiVWAmEHTXnIfPQG4nJ4Y3J9m/NoiyEA JK6kY872R492ky/H1NE20ctvBaLQniF6TQPq8DLd15FF3upEfUGkivMovb+JFBPawEie R1nQ== Received: by 10.50.187.138 with SMTP id fs10mr9332667igc.43.1345462397788; Mon, 20 Aug 2012 04:33:17 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp78658igc; Mon, 20 Aug 2012 04:33:17 -0700 (PDT) Received: by 10.68.229.2 with SMTP id sm2mr33445064pbc.57.1345462396374; Mon, 20 Aug 2012 04:33:16 -0700 (PDT) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com. [210.118.77.12]) by mx.google.com with ESMTP id ms7si26258570pbb.88.2012.08.20.04.33.15; Mon, 20 Aug 2012 04:33:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of s.nawrocki@samsung.com designates 210.118.77.12 as permitted sender) client-ip=210.118.77.12; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of s.nawrocki@samsung.com designates 210.118.77.12 as permitted sender) smtp.mail=s.nawrocki@samsung.com Received: from eusync1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M910039OXG30R60@mailout2.w1.samsung.com>; Mon, 20 Aug 2012 12:33:39 +0100 (BST) Received: from [106.116.147.32] by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0M91001WAXFDAB40@eusync1.samsung.com>; Mon, 20 Aug 2012 12:33:14 +0100 (BST) Message-id: <50322079.4080409@samsung.com> Date: Mon, 20 Aug 2012 13:33:13 +0200 From: Sylwester Nawrocki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-version: 1.0 To: Sangwook Lee Cc: Sylwester Nawrocki , linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, sakari.ailus@maxwell.research.nokia.com, suapapa@insignal.co.kr, quartz.jang@samsung.com, linaro-dev@lists.linaro.org, patches@linaro.org, usman.ahmad@linaro.org Subject: Re: [PATH v3 0/2] Add v4l2 subdev driver for S5K4ECGX sensor with embedded SoC ISP References: <1343914971-23007-1-git-send-email-sangwook.lee@linaro.org> <501ADEF6.1080901@gmail.com> <50315AC8.5060100@gmail.com> In-reply-to: Content-type: multipart/mixed; boundary=------------020201040601070303000803 X-TM-AS-MML: No X-Gm-Message-State: ALoCoQk5n1rFbmbaYEEfPW1fDLOOOzPZYXcYhqcWs44pLLWUHMtoByvvYL6i5HvHPFt7Zl1exsIg Hi Sangwook, On 08/20/2012 12:43 PM, Sangwook Lee wrote: > On 20 August 2012 09:12, Sangwook Lee wrote: >> On 19 August 2012 22:29, Sylwester Nawrocki >> wrote: >>> On 08/03/2012 04:24 PM, Sangwook Lee wrote: >>>> I was thinking about this, but this seems to be is a bit time-consuming because >>>> I have to do this just due to lack of s5k4ecgx hardware information. >>>> let me try it later once >>>> this patch is accepted. >>> >>> I've converted this driver to use function calls instead of the register >>> arrays. It can be pulled, along with a couple of minor fixes/improvements, >>> from following git tree: >>> >>> git://linuxtv.org/snawrocki/media.git s5k4ecgx >>> (gitweb: http://git.linuxtv.org/snawrocki/media.git/s5k4ecgx) >>> >>> I don't own any Origen board thus it's untested. Could you give it a try ? > > Sorry, It doesn't work. I will send pictures to you by another mail thread. > Previously, I tested preview array and found out that > + /* > + * FIXME: according to the datasheet, > + * 0x70000496~ 0x7000049c seems to be only for capture mode, > + * but without these value, it doesn't work with preview mode. > + */ > > Do we need to set those values ? Yes, after my changes it should be set too. But there is a bug in the registers definitions. Attached patch should correct this, sorry about this oversight. Let me know if there are still any issues. To make sure the I2C write sequences are correct it might be useful to log all calls to s5k4ecgx_write() and compare the logs with original tables. --- Regards, Sylwester >From b53f1279a32808d696676b905d167bcd33c6e2dc Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Mon, 20 Aug 2012 13:27:03 +0200 Subject: [PATCH] s5k4ecgx: fix register definitions --- drivers/media/video/s5k4ecgx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/video/s5k4ecgx.c b/drivers/media/video/s5k4ecgx.c index 8ad0fb1..836db2f 100644 --- a/drivers/media/video/s5k4ecgx.c +++ b/drivers/media/video/s5k4ecgx.c @@ -69,7 +69,7 @@ module_param(debug, int, 0644); #define REG_G_PREV_OPEN_AFTER_CH 0x7000026a /* Preview context register sets. n = 0...4. */ -#define PREG(n, x) ((n) * 0x26 + (x)) +#define PREG(n, x) ((n) * 0x30 + (x)) #define REG_P_OUT_WIDTH(n) PREG(n, 0x700002a6) #define REG_P_OUT_HEIGHT(n) PREG(n, 0x700002a8) #define REG_P_FMT(n) PREG(n, 0x700002aa) @@ -93,10 +93,10 @@ module_param(debug, int, 0644); #define REG_G_PREVZOOM_IN_HEIGHT 0x70000496 #define REG_G_PREVZOOM_IN_XOFFS 0x70000498 #define REG_G_PREVZOOM_IN_YOFFS 0x7000049a -#define REG_G_CAPZOOM_IN_WIDTH 0x70000494 -#define REG_G_CAPZOOM_IN_HEIGHT 0x70000496 -#define REG_G_CAPZOOM_IN_XOFFS 0x70000498 -#define REG_G_CAPZOOM_IN_YOFFS 0x7000049a +#define REG_G_CAPZOOM_IN_WIDTH 0x7000049c +#define REG_G_CAPZOOM_IN_HEIGHT 0x7000049e +#define REG_G_CAPZOOM_IN_XOFFS 0x700004a0 +#define REG_G_CAPZOOM_IN_YOFFS 0x700004a2 /* n = 0...4 */ #define REG_USER_SHARPNESS(n) (0x70000a28 + (n) * 0xb6) -- 1.7.11.3