public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH, RFC] mt9m111: allow data to be received on pixelclock falling edge?
@ 2008-11-07 11:59 Antonio Ospite
  2008-11-07 18:03 ` Robert Jarzmik
  0 siblings, 1 reply; 10+ messages in thread
From: Antonio Ospite @ 2008-11-07 11:59 UTC (permalink / raw)
  To: video4linux-list

Hi,

with the attached patch I can work around a problem I had adding camera
support to the Motorola A780 phone, but I again don't know if it is a
proper fix. Could you help me to find out, please?

Using the same pxa-camera working setup I have for A910 (the other
phone which I am working on) I got incorrect data, see[1]. It turned
out to be because pxa CIF was getting data on pixelclock rising edge
but the sensor hardware on A780 wanted otherwise. So I tried to set
PXA_CAMERA_PCP in pxacamera_platform_data flags, but the sensor bus
config prevented pxa-camera to honour this setting. With the attached
patch I can set PCP high in pxa-camera and get the right data[2] out of
CIF, using this platform config:

struct pxacamera_platform_data a780_pxacamera_platform_data = {
	.init	= a780_pxacamera_init,
	.flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
		PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN |
		PXA_CAMERA_PCP,
	.mclk_10khz = 1000,
};

Now I have many questions:

* Can the same sensor model have different default hardwired values?
  I am referring to IO/Timings differences between mt9m111 on A910
  and A780
* Should I change the sensor setup instead of changing its advertised
  capabilities? Maybe modifying mt9m111 so it can use platform data?
* Is the pxa-camera code dealing with PXA_CAMERA_PCP too conservative?
  Shouldn't PXA_CAMERA_PCP be independent from the specific sensor
  capabilities? it is a valid pxa-camera setting even if it produces
  wrong results with the specific sensor.

Note that the two phones set up a different set of GPIOs as data
lines between mt9m111 and pxa.

Please let me know if you need more details.

Thanks,
   Antonio Ospite

[1] http://people.openezx.org/ao2/a780-not-yet.jpg
[2] http://people.openezx.org/ao2/a780-finally-works.jpg


Pixeldata can be sent on pixelclock falling edge, allow this option in
mt9m111 so pxa-camera can honour PXA_CAMERA_PCP platform data flag.

See pxa-camera.c, pxa_camera_set_bus_param():

	if ((common_flags & SOCAM_PCLK_SAMPLE_RISING) &&
	    (common_flags & SOCAM_PCLK_SAMPLE_FALLING)) {
		if (pcdev->platform_flags & PXA_CAMERA_PCP)
			common_flags &= ~SOCAM_PCLK_SAMPLE_RISING;
		else
			common_flags &= ~SOCAM_PCLK_SAMPLE_FALLING;
	}

...

	if (common_flags & SOCAM_PCLK_SAMPLE_FALLING)
		cicr4 |= CICR4_PCP;


I needed this patch to make camera work properly on Motorola A780 phone.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>

diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c
index 76fb0cb..69e103c 100644
--- a/drivers/media/video/mt9m111.c
+++ b/drivers/media/video/mt9m111.c
@@ -410,7 +410,8 @@ static int mt9m111_stop_capture(struct soc_camera_device *icd)

 static unsigned long mt9m111_query_bus_param(struct soc_camera_device *icd)
 {
- return SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |
+ return SOCAM_MASTER |
+   SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING |
    SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_HIGH |
    SOCAM_DATAWIDTH_8;
 }

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-02-17 10:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 11:59 [PATCH, RFC] mt9m111: allow data to be received on pixelclock falling edge? Antonio Ospite
2008-11-07 18:03 ` Robert Jarzmik
2008-11-08 20:36   ` Guennadi Liakhovetski
2008-11-09 22:59     ` Antonio Ospite
2008-11-10 18:55       ` Guennadi Liakhovetski
2008-11-10 19:06         ` Robert Jarzmik
2008-11-12 18:27           ` Antonio Ospite
2008-12-01 20:54             ` Guennadi Liakhovetski
2008-12-03 18:51               ` Antonio Ospite
2009-02-17 10:28               ` Antonio Ospite

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox