From: "Jon Arne Jørgensen" <jonarne@jonarne.no>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: "Jon Arne Jørgensen" <jonarne@jonarne.no>,
"Timo Teras" <timo.teras@iki.fi>,
"Andy Walls" <awalls@md.metrocast.net>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
hans.verkuil@cisco.com, prabhakar.csengg@gmail.com,
g.liakhovetski@gmx.de, ezequiel.garcia@free-electrons.com
Subject: Re: [RFC 1/3] saa7115: Set saa7113 init to values from datasheet
Date: Fri, 31 May 2013 16:14:20 +0200 [thread overview]
Message-ID: <20130531141420.GH2367@dell.arpanet.local> (raw)
In-Reply-To: <20130531100827.10710841@redhat.com>
On Fri, May 31, 2013 at 10:08:27AM -0300, Mauro Carvalho Chehab wrote:
> Em Thu, 30 May 2013 21:00:01 +0200
> Jon Arne Jørgensen <jonarne@jonarne.no> escreveu:
>
> > On Thu, May 30, 2013 at 08:33:32AM +0300, Timo Teras wrote:
> > > On Thu, 30 May 2013 07:21:36 +0200
> > > Jon Arne Jørgensen <jonarne@jonarne.no> wrote:
> > >
> > > > On Wed, May 29, 2013 at 10:19:49PM -0400, Andy Walls wrote:
> > > > > Mauro Carvalho Chehab <mchehab@redhat.com> wrote:
> > > > >
> > > > > >Em Wed, 29 May 2013 22:41:16 +0200
> > > > > >Jon Arne Jørgensen <jonarne@jonarne.no> escreveu:
> > > > > >
> > > > > >> Change all default values in the initial setup table to match the
> > > > > >table
> > > > > >> in the datasheet.
> > > > > >
> > > > > >This is not a good idea, as it can produce undesired side effects
> > > > > >on the existing drivers that depend on it, and can't be easily
> > > > > >tested.
> > > > > >
> > > > > >Please, don't change the current "default". It is, of course, OK
> > > > > >to change them if needed via the information provided inside the
> > > > > >platform data.
> > > > >
> > > > > I was going to make a comment along the same line as Mauro.
> > > > > Please leave the driver defaults alone. It is almost impossible to
> > > > > regression test all the different devices with a SAA7113 chip, to
> > > > > ensure the change doesn't cause someone's device to not work
> > > > > properly.
> > > > >
> > > >
> > > > You guys are totally right.
> > > >
> > > > What if I clone the original saa7113_init table into a new one, and
> > > > make the driver use the new one if the calling driver sets
> > > > platform_data.
> > > >
> > > > Something like this?
> > > >
> > > > switch (state->ident) {
> > > > case V4L2_IDENT_SAA7111:
> > > > case V4L2_IDENT_SAA7111A:
> > > > saa711x_writeregs(sd, saa7111_init);
> > > > break;
> > > > case V4L2_IDENT_GM7113C:
> > > > case V4L2_IDENT_SAA7113:
> > > > - saa711x_writeregs(sd, saa7113_init);
> > > > + if (client->dev.platform_data)
> > > > + saa711x_writeregs(sd, saa7113_new_init);
> > > > + else
> > > > + saa711x_writeregs(sd, saa7113_init);
> > >
> > > I would rather have the platform_data provide the new table. Or if you
> > > think bulk of the table will be the same for most users, then perhaps
> > > add there an enum saying which table to use - and name the tables
> > > according to the chip variant it applies to.
> > >
> >
> > I think the bulk of the table will be the same for all drivers.
> > It's one bit here and one bit there that needs changing.
> > As the driver didn't support platform data.
> > Changing to a new init table for the drivers that implement
> > platform_data shouldn't cause any regressions.
>
> There are several things that are very bad on passing a table via
> platform data:
>
> 1) you're adding saa711x-specific data at the bridge driver,
> so, the saa711x code is spread on several places at the
> long term;
>
> 2) some part of the saa711x code may override the data there,
> as it is not aware about what bits should be preserved from
> the new device;
>
> 3) due (2), latter changes on the code are more likely to
> cause regressions;
>
> 4) also due to (2), some hacks can be needed, in order to warn
> saa711x to handle some things differently.
>
> That's why it is a way better to add meaningful parameters telling what
> bits are needed for the driver to work with the bridge. That's also
> why we do this with all other drivers.
>
I agree with you here.
I never planned to pass the table via platform data.
I've just posted a new version of this patch set.
Please have a look.
Best regards
Jon Arne Jørgensen
> Regards,
> Mauro
next prev parent reply other threads:[~2013-05-31 14:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 20:41 [RFC 0/3] saa7115: Implement i2c_board_info.platform_data Jon Arne Jørgensen
2013-05-29 20:41 ` [RFC 1/3] saa7115: Set saa7113 init to values from datasheet Jon Arne Jørgensen
2013-05-30 0:35 ` Mauro Carvalho Chehab
2013-05-30 2:19 ` Andy Walls
2013-05-30 5:21 ` Jon Arne Jørgensen
2013-05-30 5:33 ` Timo Teras
2013-05-30 19:00 ` Jon Arne Jørgensen
2013-05-31 13:08 ` Mauro Carvalho Chehab
2013-05-31 14:08 ` Timo Teras
2013-05-31 14:14 ` Jon Arne Jørgensen [this message]
2013-05-29 20:41 ` [RFC 2/3] saa7115: Remove unneeded register change for gm7113c Jon Arne Jørgensen
2013-05-29 20:41 ` [RFC 3/3] saa7115: Implement i2c_board_info.platform data Jon Arne Jørgensen
2013-05-29 20:49 ` Jon Arne Jørgensen
2013-05-30 0:42 ` Mauro Carvalho Chehab
2013-05-29 20:48 ` [RFC 0/3] saa7115: Implement i2c_board_info.platform_data Jon Arne Jørgensen
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=20130531141420.GH2367@dell.arpanet.local \
--to=jonarne@jonarne.no \
--cc=awalls@md.metrocast.net \
--cc=ezequiel.garcia@free-electrons.com \
--cc=g.liakhovetski@gmx.de \
--cc=hans.verkuil@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=prabhakar.csengg@gmail.com \
--cc=timo.teras@iki.fi \
/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
all inboxes | Powered by JetHome®