* [PATCH] Splitting CONFIG_SND_POWERMAC
@ 2004-03-15 4:59 Pavel Roskin
2004-03-15 10:50 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Roskin @ 2004-03-15 4:59 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1135 bytes --]
Hello!
I was compiling Linux 2.6.x for PowerPC and got compile errors:
sound/built-in.o(.text+0x28828): In function `daca_init_client':
: undefined reference to `i2c_smbus_write_byte_data'
sound/built-in.o(.text+0x28840): In function `daca_init_client':
: undefined reference to `i2c_smbus_write_byte_data'
sound/built-in.o(.text+0x2885c): In function `daca_init_client':
: undefined reference to `i2c_smbus_write_block_data'
and so on. It turns out CONFIG_SND_POWERMAC should not be enabled without
CONFIG_I2C. My first idea was to add a dependency.
However, the kernel finds Burgundy sound chip on my PowerPC. The code for
Burgundy doesn't use I2C. I have to enable CONFIG_I2C (without any
drivers) just to satisfy the linker.
I think ideally the driver should be split into the base powermac driver
and 3 specific drivers - AWACS, Burgundy and Keywest, the later being
dependent on I2C.
The attached patch implements an interim solution - there is still one
module, but the user can select what hardware the module supports. Only
Keywest devices require I2C.
The patch is against Linux 2.6.4.
--
Regards,
Pavel Roskin
[-- Attachment #2: Type: TEXT/plain, Size: 3486 bytes --]
--- linux.orig/sound/ppc/Kconfig
+++ linux/sound/ppc/Kconfig
@@ -4,8 +4,30 @@
depends on SND!=n && PPC
config SND_POWERMAC
- tristate "PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)"
+ tristate "PowerMac sound support"
depends on SND
+ ---help---
+ Answer Y or M to include support for intergrated sound devices on
+ PowerMac. You also need to select one of the drivers below.
+
+config SND_AWACS
+ bool "AWACS, Screamer sound support"
+ depends on SND_POWERMAC
+ ---help---
+ Answer Y to include support for AWACS and Screamer sound on PowerMac.
+
+config SND_BURGUNDY
+ bool "Burgundy sound support"
+ depends on SND_POWERMAC
+ ---help---
+ Answer Y to include support for Burgundy sound on PowerMac.
+
+config SND_KEYWEST
+ bool "Keywest (DACA, Tumbler, Snapper) sound support"
+ depends on SND_POWERMAC && I2C
+ ---help---
+ Answer Y to include support for PowerMac Keywest sound devices, such
+ as DACA, Tumbler and Snapper.
endmenu
--- linux.orig/sound/ppc/Makefile
+++ linux/sound/ppc/Makefile
@@ -3,7 +3,16 @@
# Copyright (c) 2001 by Jaroslav Kysela <perex@suse.cz>
#
-snd-powermac-objs := powermac.o pmac.o awacs.o burgundy.o daca.o tumbler.o keywest.o
+snd-powermac-objs := powermac.o pmac.o
+ifeq ($(CONFIG_SND_AWACS),y)
+snd-powermac-objs += awacs.o
+endif
+ifeq ($(CONFIG_SND_BURGUNDY),y)
+snd-powermac-objs += burgundy.o
+endif
+ifeq ($(CONFIG_SND_KEYWEST),y)
+snd-powermac-objs += daca.o tumbler.o keywest.o
+endif
# Toplevel Module Dependency
obj-$(CONFIG_SND_POWERMAC) += snd-powermac.o
--- linux.orig/sound/ppc/powermac.c
+++ linux/sound/ppc/powermac.c
@@ -70,7 +70,6 @@ static int __init snd_pmac_probe(void)
{
snd_card_t *card;
pmac_t *chip;
- char *name_ext;
int err;
card = snd_card_new(index, id, THIS_MODULE, 0);
@@ -81,6 +80,7 @@ static int __init snd_pmac_probe(void)
goto __error;
switch (chip->model) {
+#ifdef CONFIG_SND_BURGUNDY
case PMAC_BURGUNDY:
strcpy(card->driver, "PMac Burgundy");
strcpy(card->shortname, "PowerMac Burgundy");
@@ -89,6 +89,8 @@ static int __init snd_pmac_probe(void)
if ((err = snd_pmac_burgundy_init(chip)) < 0)
goto __error;
break;
+#endif
+#ifdef CONFIG_SND_KEYWEST
case PMAC_DACA:
strcpy(card->driver, "PMac DACA");
strcpy(card->shortname, "PowerMac DACA");
@@ -98,8 +100,8 @@ static int __init snd_pmac_probe(void)
goto __error;
break;
case PMAC_TUMBLER:
- case PMAC_SNAPPER:
- name_ext = chip->model == PMAC_TUMBLER ? "Tumbler" : "Snapper";
+ case PMAC_SNAPPER: {
+ char *name_ext = (chip->model == PMAC_TUMBLER) ? "Tumbler" : "Snapper";
sprintf(card->driver, "PMac %s", name_ext);
sprintf(card->shortname, "PowerMac %s", name_ext);
sprintf(card->longname, "%s (Dev %d) Sub-frame %d",
@@ -107,9 +109,12 @@ static int __init snd_pmac_probe(void)
if ((err = snd_pmac_tumbler_init(chip)) < 0)
goto __error;
break;
+ }
+#endif
+#ifdef CONFIG_SND_AWACS
case PMAC_AWACS:
- case PMAC_SCREAMER:
- name_ext = chip->model == PMAC_SCREAMER ? "Screamer" : "AWACS";
+ case PMAC_SCREAMER: {
+ char *name_ext = (chip->model == PMAC_SCREAMER) ? "Screamer" : "AWACS";
sprintf(card->driver, "PMac %s", name_ext);
sprintf(card->shortname, "PowerMac %s", name_ext);
if (chip->is_pbook_3400)
@@ -123,6 +128,8 @@ static int __init snd_pmac_probe(void)
if ((err = snd_pmac_awacs_init(chip)) < 0)
goto __error;
break;
+ }
+#endif
default:
snd_printk("unsupported hardware %d\n", chip->model);
err = -EINVAL;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Splitting CONFIG_SND_POWERMAC
2004-03-15 4:59 [PATCH] Splitting CONFIG_SND_POWERMAC Pavel Roskin
@ 2004-03-15 10:50 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2004-03-15 10:50 UTC (permalink / raw)
To: Pavel Roskin; +Cc: alsa-devel
At Sun, 14 Mar 2004 23:59:51 -0500 (EST),
Pavel Roskin wrote:
>
> [1 <text/plain; US-ASCII (7bit)>]
> Hello!
>
> I was compiling Linux 2.6.x for PowerPC and got compile errors:
>
> sound/built-in.o(.text+0x28828): In function `daca_init_client':
> : undefined reference to `i2c_smbus_write_byte_data'
> sound/built-in.o(.text+0x28840): In function `daca_init_client':
> : undefined reference to `i2c_smbus_write_byte_data'
> sound/built-in.o(.text+0x2885c): In function `daca_init_client':
> : undefined reference to `i2c_smbus_write_block_data'
>
> and so on. It turns out CONFIG_SND_POWERMAC should not be enabled without
> CONFIG_I2C. My first idea was to add a dependency.
>
> However, the kernel finds Burgundy sound chip on my PowerPC. The code for
> Burgundy doesn't use I2C. I have to enable CONFIG_I2C (without any
> drivers) just to satisfy the linker.
>
> I think ideally the driver should be split into the base powermac driver
> and 3 specific drivers - AWACS, Burgundy and Keywest, the later being
> dependent on I2C.
>
> The attached patch implements an interim solution - there is still one
> module, but the user can select what hardware the module supports. Only
> Keywest devices require I2C.
thanks for the patch.
in fact, i've also thought of splitting this stuff (as you can see it
in the code). the major drawback by split is that you have to detect
what chip is used on your machine. and on powermac, it's not easy to
guess like PCI soundcards...
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-15 10:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-15 4:59 [PATCH] Splitting CONFIG_SND_POWERMAC Pavel Roskin
2004-03-15 10:50 ` Takashi Iwai
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.