From: Timur Tabi <timur@freescale.com>
To: Trent Piepho <xyzzy@speakeasy.org>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: [PATCH v3] ASoC CS4270 codec device driver
Date: Tue, 31 Jul 2007 13:53:16 -0500 [thread overview]
Message-ID: <46AF851C.5090700@freescale.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0707311122470.15067@shell2.speakeasy.net>
Trent Piepho wrote:
> If config FOO is compiled in (i.e. it's "y"), CONFIG_FOO will be defined.
> If it's a module, CONFIG_FOO_MODULE will be defined. It's one or the
> other, not both.
Learn something new every day. I should have known that already, though.
> If you want your code to comple differently if it has i2c available, you should
> do this:
>
> #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
> /* code that needs i2c goes here, i2c_transfer(), etc. */
> #endif
>
> Note that just checking defined(CONFIG_I2C_MODULE) isn't correct. If your
> code is compiled in and i2c is a module, you can't call i2c functions or
> the kernel won't link.
Which is a problem because ASoC currently requires all modules to be linked together. The
machine driver has hard-coded references to structures in the other drivers.
I think Liam was trying to fix that with the PowerPC branch, but it doesn't look like he's
finished.
> Of course, if you need i2c to work in any reasonble way, you should just
> have your driver depend on i2c in Kconfig.
Well, that's the odd thing about the CS4270 - it's not required. The CS4270 can work with
or without I2C. I tried writing the driver to be intelligent about that - if I2C is
enabled, but the device can't be found on the I2C bus, it falls back to "stand-alone" mode.
It looks like I'm not really going to be able to support stand-alone mode yet, anyway. So
I'll just try to make it compile when I2C is disabled.
--
Timur Tabi
Linux Kernel Developer @ Freescale
prev parent reply other threads:[~2007-07-31 18:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 15:46 [PATCH v3] ASoC CS4270 codec device driver Timur Tabi
2007-07-31 16:00 ` Takashi Iwai
2007-07-31 16:12 ` Timur Tabi
2007-07-31 16:17 ` Takashi Iwai
2007-07-31 16:31 ` Takashi Iwai
2007-07-31 16:41 ` Timur Tabi
2007-07-31 18:34 ` Trent Piepho
2007-07-31 18:53 ` Timur Tabi [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=46AF851C.5090700@freescale.com \
--to=timur@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
--cc=xyzzy@speakeasy.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.