All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <j.w.r.degoede@hhs.nl>
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: Thu, 27 Nov 2008 19:08:08 +0100	[thread overview]
Message-ID: <492EE208.7010903@hhs.nl> (raw)
In-Reply-To: <62e5edd40811270351o7ae92605ra2e46ec5e9ee94fa@mail.gmail.com>

Erik Andrén wrote:
> 2008/11/27 Hans de Goede <hdegoede@redhat.com>:

<snip>

>> I've solved this be creating 2 separate stv06xx_write_sensor functions:
>> typedef u8 u8_pair[2];
>> typedef u16 u16_pair[2];
>>
>> int stv06xx_write_sensor_bytes(struct sd *sd, const u8_pair *data, int len);
>> int stv06xx_write_sensor_words(struct sd *sd, const u16_pair *data, int
>> len);
>>
>> These functions get passed one or more u8 / u16  pairs where pair[0] is an
>> register-address and pair[1] is the value to write to that register, note
>> that for stv06xx_write_sensor_words() the addresses are in reality still 8
>> bits, they are gettings stored in an u16 for easier coding.
> 
> This is an alternate way of solving the same problem. I think this
> approach is more convoluted without any real gain.
> First you must multiplex the data and addresses by putting them
> together and then demultiplex them in the function.
> Not ideal but also not a big deal.
> 


The gain here is that it is easy to define a single table with address, value 
pairs to init the sensor. Like you've done in stv06xx_vv6410.h, my patch now 
uses that table directly and unmodifed. Imagine what this table would look like 
if you had 2 separate tables for addresses and values, then the resulting table 
declaration_S_ in stv06xx_vv6410.h would make it very hard to see which value 
gets written to which register, so IMHO there is a real and big gain here.

<snip>

Regards,

Hans

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

      reply	other threads:[~2008-11-27 18:02 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
     [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 [this message]

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=492EE208.7010903@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --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 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.