From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/3] ARM: mx28evk: add platform data for saif
Date: Thu, 10 Nov 2011 11:26:08 +0100 [thread overview]
Message-ID: <20111110102608.GY16886@pengutronix.de> (raw)
In-Reply-To: <65EE16ACC360FA4D99C96DC085B3F7722CB9F2@039-SN1MPN1-002.039d.mgd.msft.net>
On Thu, Nov 10, 2011 at 09:23:18AM +0000, Dong Aisheng-B29396 wrote:
> > > +
> > > +static const struct mxs_saif_platform_data
> > > + mx28evk_mxs_saif_pdata __initconst = {
> > > + .init = mx28evk_mxs_saif_pinit,
> > > + .get_master_id = mxs_get_saif_clk_master_id,
> >
> > This looks *very* suspicious. .init sets the mux register
> > and .get_master_id reads the very same information back. Why not simply
> > put a bool is_master into platform data?
>
> Originally it's used to avoid introduce a global variable to save clkmux
> Since we can directly read it from register.
>
> If put a bool is_master into pdata, we are assuming there are only two saif
> Instances. As I was suggested by Wolfram before that how about if there are
> more than two saifs in the future SoCs?
I don't understand. A is_master variable in platform_data does not make
any assumption about the number of interfaces in the system.
> So the original saif driver design is following this rule that it only needs
> to know its master id.
If that's the design then put the master id into platform_data. This
information is purely static and the board knows it. No need to put a
function in platform_data. Something like this:
struct saif_pdata {
bool master_mode; /* if true use master mode */
int master_id; /* id of the master if in slave mode */
};
> If we decide to change here, I may also have a lot to change in saif driver.
Some lines in the probe code, not more.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2011-11-10 10:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 6:42 [PATCH v4 0/3] ARM: mxs: add recording support for saif Dong Aisheng
2011-11-10 6:42 ` [PATCH v4 1/3] ARM: mxs: add saif clkmux functions Dong Aisheng
2011-11-11 7:14 ` Shawn Guo
2011-11-11 7:19 ` Dong Aisheng-B29396
2011-11-11 7:41 ` Shawn Guo
2011-11-10 6:42 ` [PATCH v4 2/3] ARM: mx28evk: add platform data for saif Dong Aisheng
2011-11-10 8:38 ` Sascha Hauer
2011-11-10 9:23 ` Dong Aisheng-B29396
2011-11-10 10:26 ` Sascha Hauer [this message]
2011-11-10 11:05 ` [alsa-devel] " Dong Aisheng-B29396
2011-11-11 6:06 ` Shawn Guo
2011-11-10 6:42 ` [PATCH v4 3/3] ARM: mx28evk: set a initial clock rate " Dong Aisheng
2011-11-10 6:46 ` [PATCH v4 0/3] ARM: mxs: add recording support " Dong Aisheng-B29396
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=20111110102608.GY16886@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).