From: Chia-I Wu <olvaffe@gmail.com>
To: "Erik Andrén" <erik.andren@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
video4linux-list@redhat.com, noodles@earth.li,
qce-ga-devel@lists.sourceforge.net
Subject: Re: Please test the gspca-stv06xx branch
Date: Fri, 28 Nov 2008 00:00:05 +0800 [thread overview]
Message-ID: <20081127160005.GA4097@m500.domain> (raw)
In-Reply-To: <62e5edd40811270355id4e856g1a8fb53f73455a39@mail.gmail.com>
On Thu, Nov 27, 2008 at 12:55:21PM +0100, Erik Andrén wrote:
> 2008/11/27 Chia-I Wu <olvaffe@gmail.com>:
> > On Thu, Nov 27, 2008 at 11:40:06AM +0100, Hans de Goede wrote:
> >> Chia-I Wu, I'm afraid this might conflict with your HDCS work, as it is
> >> against Erik's latest hg tree, so without your patches. I noticed you
> >> were defining your own read/write register functions which really seems
> >> the wrong thing todo, hopefully with my new functions you can use those
> >> directly, or ?
> > IMO, it is almost always a good thing that each driver defines its own
> > wrapping reg read/write functions. It is less confusing and saves
> > typings. It makes the sub-driver loosely coupled with the main driver.
> > And, the compiler will do the right thing, and optimize them out if
> > appropriate.
> I agree with Hans on this matter. It convolutes the driver and gives
> no real gain.
> I've just been converting the gspca-m5602 to use one set of read /
> write functions instead of sensor specific ones and it removes a large
> amount of code.
> What the compiler does is one thing but when dealing with non
> performance critical code paths, code simplicity is more important.
It is the opposite. What compiler does good to us is that, instead of
macros, one could define functions.
Other than hdcs_reg_write_seq, you may think the others as simple as,
for example,
#define hdcs_reg_write(hdcs, reg, val) \
stv06xx_write_sensor_b(hdcs->sd, reg, val)
There should be no complication, and the significance here is that it
gives clear implication that there is no word write
(stv06xx_write_sensor_w) to this device, even though it is available in
the stv06xx.h.
IMO, there should be per-sensor I/O functions. And the implementations
should be as simple as wrappers (i.e., macros) to the generic ones
provided by the bridge. Sending exotic usb control messages is the job
of the bridge driver, not the sensor driver's.
The purpose for hdcs_reg_write_seq is a little bit trickier. According
to the datasheet, HDCS family uses a serial protocol, instead of i2c, to
communicate with STV06xx. When the first bit of HDCS_ICTRL is cleared,
it allows sequential writes: The beginning address is given once,
followed by a set of values. The address will be automatically
incremented. The prototype of hdcs_reg_write_seq models this hardware
characteristic, which might be something not shared by every sensor.
--
Regards,
olv
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
next prev parent reply other threads:[~2008-11-27 16:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 21:00 Please test the gspca-stv06xx branch Erik Andrén
2008-11-25 8:20 ` Chia-I Wu
2008-11-25 11:22 ` Erik Andrén
2008-11-25 11:39 ` Chia-I Wu
2008-11-25 12:02 ` Erik Andrén
[not found] ` <492E7906.905@redhat.com>
2008-11-27 10:59 ` Chia-I Wu
2008-11-27 11:55 ` Erik Andrén
2008-11-27 16:00 ` Chia-I Wu [this message]
[not found] ` <492EE597.7010100@redhat.com>
2008-11-28 4:26 ` Chia-I Wu
2008-11-27 11:51 ` Erik Andrén
2008-11-27 18:08 ` Hans de Goede
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=20081127160005.GA4097@m500.domain \
--to=olvaffe@gmail.com \
--cc=erik.andren@gmail.com \
--cc=hdegoede@redhat.com \
--cc=noodles@earth.li \
--cc=qce-ga-devel@lists.sourceforge.net \
--cc=video4linux-list@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox