All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: OV7670: getting it working with soc-camera.
Date: Thu, 18 Jun 2009 10:20:20 +0000	[thread overview]
Message-ID: <4A3A14E4.2000301@cam.ac.uk> (raw)
In-Reply-To: <Pine.LNX.4.64.0906172022570.4218@axis700.grange>

Guennadi Liakhovetski wrote:
> On Wed, 17 Jun 2009, Jonathan Cameron wrote:
> 
>> This is purely for info of anyone else wanting to use the ov7670
>> with Guennadi's recent work on converted soc-camera to v4l2-subdevs.
>>
>> It may not be completely minimal, but it's letting me take pictures ;)
> 
> Cool, I like it! Not the pictures, but the fact that the required patch 
> turned out to be so small. Of course, you understand this is not what 
> we'll eventually commit, but, I think, this is a good start. In principle, 
> if a device has all parameters fixed, there's no merit in trying to set 
> them.
Yup, my intention is to slowly remove elements as they become unnecessary
(and push any that actually make sense to the mailing list).

> 
>> Couple of minor queries:
>>
>> Currently it is assumed that there is a means of telling the chip to
>> use particular bus params.  In the case of this one it doesn't support
>> anything other than 8 bit. Stuff may get added down the line, but
>> in meantime does anyone mind if we make icd->ops->set_bus_param
>> optional in soc-camera?
> 
> struct soc_camera_ops will disappear completely anyway, and we don't know 
> yet what the v4l2-subdev counterpart will look like.
> 
Sure, I'll wait and see whether this question is relevant down the line.

...

>> Or for that matter why the address is right shifted by
>> 1 in:
>>
>> v4l_info(client, "chip found @ 0x%02x (%s)\n",
>> 	 client->addr << 1, client->adapter->name);
>>
>> Admittedly the data sheet uses an 'unusual' convention for the
>> address (separate write and read address which correspond to
>> a single address of 0x21 with the relevant write bit set as
>> appropriate).
> 
> That's exactly the reason, I think. Many (or most?) datasheets specify i2c 
> addresses which are a double of Linux i2c address. IIRC this is just a 
> Linux convention to use the shifted address.

Um. I'm not sure I agree with this.  The convention when specifying the
address in registration is to use correct one (without the write bit)
and based on a lot of non video chips I've come across is about 50 / 50
on how they document it (with many using a delightful and random mix of the two)
If you are going to have a registration scheme that requires the board code
to specify the address as 0x21 then to my mind having the driver declare
it as being on 0x42 seems rather odd and misleading.

This is particularly true here where the driver is using smbus calls as
that specification is very clear indeed on the fact that addresses are 7 bit.
Admittedly this chip uses the sccb bus protocol that just 'happens'
to bare a startling resemblance to smbus / i2c.

Still this isn't exactly a crucial element of the driver!
 
>> As ever any comments welcome. Thanks to Guennadi Liakhovetski
>> for his soc-camera work and Hans Verkuil for conversion of the
>> ov7670 to soc-dev.
>>
>> Tested against a merge of todays v4l-next tree and Linus' current
>> with the minor pxa-camera bug I posted earlier fixed and Guennadi's
>> extensive patch set applied (this requires a few hand merges, but
>> nothing too nasty).
> 
> Good to know.
> 
> A couple of comments:
> 

...
>> +#endif
> 
> ...and this switching. All this should be done in struct soc_camera_link 
> .power() and .reset() methods in your platform code.
Ah, I'd missed those methods, thanks!

You are quite right about the i2c_device_table as well, not sure what
got into me there.

Thanks,

Jonathan

  reply	other threads:[~2009-06-18 10:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17 17:56 OV7670: getting it working with soc-camera Jonathan Cameron
2009-06-17 18:38 ` Guennadi Liakhovetski
2009-06-18 10:20   ` Jonathan Cameron [this message]
2009-06-18 11:59     ` Jonathan Cameron
2009-06-19 17:46       ` Jonathan Cameron

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=4A3A14E4.2000301@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=g.liakhovetski@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /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.