Skip to contentSkip to conversation

snd-aoa: add snd-aoa

RFC In review Johannes Berg 5 participants 47 messages Jun 7, 2006 – Jul 7, 2006

Subsystems (3)
lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

cover snd-aoa: add snd-aoa

The following patches would add snd-aoa to the Linux source tree. I'm posting them here now for some last round of review before I finally post them with a Signed-Off-By and Changelog for inclusion. As you previously asked about this, I don't think it makes sense to commit these patches one by one, but the first one removing layout-id support from snd-powermac might be worth singling out.
Please let me know either way so that I provide either one or two changelog entries.

snd-aoa currently handles all Apple machines that have a layout-id property in the sound node in the device-tree and doesn't attempt to handle any others yet, a bunch of layout-ids are untested by users, support for those was added based on the Info.plist file OSX has.

The only thing that still needs to be done is getting it to work on the PowerMac7,2/7,3 where the device tree has a bug that apparently prevents the i2sbus module from working properly.

Also, the DRC feature of the tas3004 codec should be exposed like snd-powermac exposes it, so there'll probably be one more round of patches before I will finally ask for inclusion.

Other than that, it replaces snd-powermac for all layout-id machines, and handles many more already, so I have also added a patch to snd-powermac to this patchset that removes support for any machines with a layout-id it, allowing snd-aoa to take over for those machines even if both are compiled in. On affected machines, snd-powermac will also give the hint that snd-aoa should be used instead, but if snd-aoa is compiled as modules it will load automatically.

Thanks for previous review, I hope I have incorporated all suggestions. Over the previous version, the major change is adding the file core/snd-aoa-gpio-feature.c which contains GPIO access routines for those machine that don't have platform functions for it.

Any further comments are appreciated.

For the curious (like me :) ) here's a diffstat for the whole series:

 sound/Kconfig                                   |    2 
 sound/Makefile                                  |    2 
 sound/aoa/Kconfig                               |   17 
 sound/aoa/Makefile                              |    4 
 sound/aoa/aoa-gpio.h                            |   81 +
 sound/aoa/aoa.h                                 |  131 ++
 sound/aoa/codecs/Kconfig                        |   32 
 sound/aoa/codecs/Makefile                       |    3 
 sound/aoa/codecs/snd-aoa-codec-onyx.c           | 1113 ++++++++++++++++++++++++
 sound/aoa/codecs/snd-aoa-codec-onyx.h           |   76 +
 sound/aoa/codecs/snd-aoa-codec-tas-gain-table.h |  209 ++++
 sound/aoa/codecs/snd-aoa-codec-tas.c            |  653 ++++++++++++++
 sound/aoa/codecs/snd-aoa-codec-tas.h            |   47 +
 sound/aoa/codecs/snd-aoa-codec-toonie.c         |  140 +++
 sound/aoa/core/Makefile                         |    5 
 sound/aoa/core/snd-aoa-alsa.c                   |   98 ++
 sound/aoa/core/snd-aoa-alsa.h                   |   16 
 sound/aoa/core/snd-aoa-core.c                   |  156 +++
 sound/aoa/core/snd-aoa-gpio-feature.c           |  392 ++++++++
 sound/aoa/core/snd-aoa-gpio-pmf.c               |  246 +++++
 sound/aoa/fabrics/Kconfig                       |   12 
 sound/aoa/fabrics/Makefile                      |    1 
 sound/aoa/fabrics/snd-aoa-fabric-layout.c       | 1096 +++++++++++++++++++++++
 sound/aoa/soundbus/Kconfig                      |   14 
 sound/aoa/soundbus/Makefile                     |    3 
 sound/aoa/soundbus/core.c                       |  250 +++++
 sound/aoa/soundbus/i2sbus/Makefile              |    2 
 sound/aoa/soundbus/i2sbus/i2sbus-control.c      |  192 ++++
 sound/aoa/soundbus/i2sbus/i2sbus-control.h      |   37 
 sound/aoa/soundbus/i2sbus/i2sbus-core.c         |  387 ++++++++
 sound/aoa/soundbus/i2sbus/i2sbus-interface.h    |  187 ++++
 sound/aoa/soundbus/i2sbus/i2sbus-pcm.c          | 1017 +++++++++++++++++++++
 sound/aoa/soundbus/i2sbus/i2sbus.h              |  112 ++
 sound/aoa/soundbus/soundbus.h                   |  202 ++++
 sound/aoa/soundbus/sysfs.c                      |   43 
 sound/ppc/Makefile                              |    2 
 sound/ppc/pmac.c                                |   44 
 sound/ppc/pmac.h                                |    3 
 sound/ppc/powermac.c                            |    7 
 sound/ppc/toonie.c                              |  378 --------
 40 files changed, 6987 insertions(+), 425 deletions(-)

--

author maintainer
#1 lore raw

RFC 1/12 snd-powermac: no longer handle anything with a layout-id property

This patch removes from snd-powermac the code that check for the layout-id and instead adds code that makes it refuse loading when a layout-id property is present, nothing that snd-aoa should be used.
It also removes the 'toonie' codec from snd-powermac which was only ever used on the mac mini which has a layout-id property.

sound/ppc/Makefile +1 -1
@@ -3,7 +3,7 @@ # Makefile for ALSA
 # Copyright (c) 2001 by Jaroslav Kysela <[email protected]>
 #
 
-snd-powermac-objs := powermac.o pmac.o awacs.o burgundy.o daca.o tumbler.o toonie.o keywest.o beep.o
+snd-powermac-objs := powermac.o pmac.o awacs.o burgundy.o daca.o tumbler.o keywest.o beep.o
 
 # Toplevel Module Dependency
 obj-$(CONFIG_SND_POWERMAC) += snd-powermac.o
sound/ppc/pmac.c +8 -36

62 lines not on this page · raw message

sound/ppc/pmac.h +1 -2
@@ -85,7 +85,7 @@ struct pmac_stream {
 
 enum snd_pmac_model {
 	PMAC_AWACS, PMAC_SCREAMER, PMAC_BURGUNDY, PMAC_DACA, PMAC_TUMBLER,
-	PMAC_SNAPPER, PMAC_TOONIE
+	PMAC_SNAPPER
 };
 
 struct snd_pmac {
@@ -188,7 +188,6 @@ int snd_pmac_burgundy_init(struct snd_pm
 int snd_pmac_daca_init(struct snd_pmac *chip);
 int snd_pmac_tumbler_init(struct snd_pmac *chip);
 int snd_pmac_tumbler_post_init(void);
-int snd_pmac_toonie_init(struct snd_pmac *chip);
 
 /* i2c functions */
 struct pmac_keywest {
sound/ppc/powermac.c +0 -7
@@ -94,13 +94,6 @@ static int __init snd_pmac_probe(struct 
 		if ( snd_pmac_tumbler_init(chip) < 0 || snd_pmac_tumbler_post_init() < 0)
 			goto __error;
 		break;
-	case PMAC_TOONIE:
-		strcpy(card->driver, "PMac Toonie");
-		strcpy(card->shortname, "PowerMac Toonie");
-		strcpy(card->longname, card->shortname);
-		if ((err = snd_pmac_toonie_init(chip)) < 0)
-			goto __error;
-		break;
 	case PMAC_AWACS:
 	case PMAC_SCREAMER:
 		name_ext = chip->model == PMAC_SCREAMER ? "Screamer" : "AWACS";
sound/ppc/toonie.c deleted +0 -378

378 lines not on this page · raw message

--

#2 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 3 lines · Johannes Berg

This patch removes from snd-powermac the code that check for the layout-id and instead adds code that makes it refuse loading when a layout-id property is present, nothing that snd-aoa should be used.

Can we get snd-powermac back as long as snd-aoa is lacking all those features from snd-powermac?

Andreas.

Signature · 9 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
#3 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

At Mon, 26 Jun 2006 22:49:04 +0200,

Quoted 9 lines · Andreas Schwab
Quoted 3 lines · Johannes Berg

This patch removes from snd-powermac the code that check for the layout-id and instead adds code that makes it refuse loading when a layout-id property is present, nothing that snd-aoa should be used.

Can we get snd-powermac back as long as snd-aoa is lacking all those features from snd-powermac?

What functions are missing?

Takashi

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#4 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 5 lines · Takashi Iwai

At Mon, 26 Jun 2006 22:49:04 +0200,

Quoted 3 lines · Andreas Schwab

Johannes Berg <[email protected]> writes:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

This patch removes from snd-powermac the code that check for the layout-id and instead adds code that makes it refuse loading when a layout-id property is present, nothing that snd-aoa should be used.

Can we get snd-powermac back as long as snd-aoa is lacking all those features from snd-powermac?

What functions are missing?

Sound on PowerMac7,2, DRC on TAS, probably more.

Andreas.

Signature · 9 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
#5 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 11 lines · Andreas Schwab
Quoted 9 lines · Takashi Iwai

At Mon, 26 Jun 2006 22:49:04 +0200,

Quoted 7 lines · Andreas Schwab
Quoted 3 lines · Johannes Berg

This patch removes from snd-powermac the code that check for the layout-id and instead adds code that makes it refuse loading when a layout-id property is present, nothing that snd-aoa should be used.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Can we get snd-powermac back as long as snd-aoa is lacking all those features from snd-powermac?

What functions are missing?

Sound on PowerMac7,2, DRC on TAS, probably more.

Another problem is that the sound device can only be opened once.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#6 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 13 lines · Andreas Schwab
Quoted 11 lines · Andreas Schwab
Quoted 9 lines · Takashi Iwai

At Mon, 26 Jun 2006 22:49:04 +0200,

Quoted 7 lines · Andreas Schwab
Quoted 3 lines · Johannes Berg

This patch removes from snd-powermac the code that check for the layout-id and instead adds code that makes it refuse loading when a layout-id property is present, nothing that snd-aoa should be used.

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Can we get snd-powermac back as long as snd-aoa is lacking all those features from snd-powermac?

What functions are missing?

Sound on PowerMac7,2, DRC on TAS, probably more.

Another problem is that the sound device can only be opened once.

What is the content of /proc/asound/cards? The patches must have changed the card name and failed to create a matching config file in /usr/share/alsa/cards.

Lee

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#7 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 3 lines · Lee Revell

What is the content of /proc/asound/cards? The patches must have changed the card name and failed to create a matching config file in /usr/share/alsa/cards.

Thanks for the hint. I have added 'AppleOnbdAudio cards.PMac' to /usr/share/alsa/cards/aliases.conf, and it works again.

Andreas.

Signature · 9 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
#8 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

At Fri, 30 Jun 2006 01:16:18 +0200,

Quoted 9 lines · Andreas Schwab
Quoted 3 lines · Lee Revell

What is the content of /proc/asound/cards? The patches must have changed the card name and failed to create a matching config file in /usr/share/alsa/cards.

Thanks for the hint. I have added 'AppleOnbdAudio cards.PMac' to /usr/share/alsa/cards/aliases.conf, and it works again.

Good catch. I fixed on ALSA HG repo.

Takashi

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#9 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

In reply to Andreas Schwab
Quoted 8 lines · Andreas Schwab
Quoted 3 lines · Lee Revell

What is the content of /proc/asound/cards? The patches must have changed the card name and failed to create a matching config file in /usr/share/alsa/cards.

Thanks for the hint. I have added 'AppleOnbdAudio cards.PMac' to /usr/share/alsa/cards/aliases.conf, and it works again.

There is still an issue... wether to enable softvol or not... With snd-aoa, the card name is always the same but wether it has hardware volume control or not (Toonie doesn't) is not known... Alsa should have ways to add softvol automatically if no master volume control exist.

Ben.

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author maintainer
#10 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 4 lines · Benjamin Herrenschmidt

There is still an issue... wether to enable softvol or not... With snd-aoa, the card name is always the same but wether it has hardware volume control or not (Toonie doesn't) is not known... Alsa should have ways to add softvol automatically if no master volume control exist.

Hm, good point. I probably need to completely revamp the card handling and not create a card object before the codecs are registered. That way, I could influence the naming through the codecs.

johannes

#11 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 10 lines · Johannes Berg
Quoted 4 lines · Benjamin Herrenschmidt

There is still an issue... wether to enable softvol or not... With snd-aoa, the card name is always the same but wether it has hardware volume control or not (Toonie doesn't) is not known... Alsa should have ways to add softvol automatically if no master volume control exist.

Hm, good point. I probably need to completely revamp the card handling and not create a card object before the codecs are registered. That way, I could influence the naming through the codecs.

Maybe ... or not... I'd rather not bother. I think Alsa should be able to create softvol if there is no Master volume...

Ben.

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author maintainer
#12 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 2 lines · Benjamin Herrenschmidt

Maybe ... or not... I'd rather not bother. I think Alsa should be able to create softvol if there is no Master volume...

But how long should it wait for the master volume to become available? Thing is, as far as I understand this, the mixer is dynamic and you can add and remove things at any time essentially. No one does, but that's another story.

johannes

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#13 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 9 lines · Johannes Berg
Quoted 2 lines · Benjamin Herrenschmidt

Maybe ... or not... I'd rather not bother. I think Alsa should be able to create softvol if there is no Master volume...

But how long should it wait for the master volume to become available? Thing is, as far as I understand this, the mixer is dynamic and you can add and remove things at any time essentially. No one does, but that's another story.

Well, when the master volume shows up, softvol can "unplug" itself :)

Ben.

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author maintainer
#14 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 1 line · Benjamin Herrenschmidt

Well, when the master volume shows up, softvol can "unplug" itself :)

Hmm, not a bad idea, that way there's always a master volume. And when some cards have an unusable master volume then softvol could be forced to superimpose via the config file.

johannes

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#15 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

In reply to Benjamin Herrenschmidt

At Fri, 07 Jul 2006 15:38:40 +1000,

Quoted 8 lines · Benjamin Herrenschmidt
Quoted 6 lines · Andreas Schwab
Quoted 3 lines · Lee Revell

What is the content of /proc/asound/cards? The patches must have changed the card name and failed to create a matching config file in /usr/share/alsa/cards.

Quoted 7 lines
Quoted 2 lines

Thanks for the hint. I have added 'AppleOnbdAudio cards.PMac' to /usr/share/alsa/cards/aliases.conf, and it works again.

There is still an issue... wether to enable softvol or not... With snd-aoa, the card name is always the same but wether it has hardware volume control or not (Toonie doesn't) is not known... Alsa should have ways to add softvol automatically if no master volume control exist.

Currently, it's aliased to PMacToonie.conf, so that "PCM" volume is added automatically when no corresponding h/w volume eixsts.

Takashi

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author maintainer
#16 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

Quoted 2 lines · Takashi Iwai

Currently, it's aliased to PMacToonie.conf, so that "PCM" volume is added automatically when no corresponding h/w volume eixsts.

Will submit a patch to name it "PCM" then on tas instead of "PCM1"

johannes

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

author maintainer
#17 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

In reply to Takashi Iwai
Quoted 1 line · Takashi Iwai

What functions are missing?

I think Andreas is referring to the fact that the device-trees on PowerMac7,2 and 7,3 are broken and hence snd-aoa-i2sbus doesn't work properly.

johannes

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

author maintainer
#18 lore raw

Re: [RFC 01/12] snd-powermac: no longer handle anything with a layout-id property

In reply to Andreas Schwab
Quoted 2 lines · Andreas Schwab

Can we get snd-powermac back as long as snd-aoa is lacking all those features from snd-powermac?

I'll be fixing it next week after an exam on Friday, or if I don't go to Nuremburg next week (4h hacking on train :) ) then the week after.

Until then, you can just revert that patch locally.

johannes

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

author maintainer
#19 lore raw

RFC 2/12 snd-aoa: add aoa header files

In reply to Johannes Berg

This patch adds header files to use for communication between the various parts of aoa.

sound/aoa/aoa-gpio.h new file +81 -0
@@ -0,0 +1,81 @@
+/*
+ * Apple Onboard Audio GPIO definitions
+ *
+ * Copyright 2006 Johannes Berg <[email protected]>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+
+#ifndef __AOA_GPIO_H
+#define __AOA_GPIO_H
+#include <linux/workqueue.h>
+#include <linux/mutex.h>
+#include <asm/prom.h>
+
+typedef void (*notify_func_t)(void *data);
+
+enum notify_type {
+	AOA_NOTIFY_HEADPHONE,
+	AOA_NOTIFY_LINE_IN,
+	AOA_NOTIFY_LINE_OUT,
+};
+
+struct gpio_runtime;
+struct gpio_methods {
+	/* for initialisation/de-initialisation of the GPIO layer */
+	void (*init)(struct gpio_runtime *rt);
+	void (*exit)(struct gpio_runtime *rt);
+
+	/* turn off headphone, speakers, lineout */
+	void (*all_amps_off)(struct gpio_runtime *rt);
+	/* turn headphone, speakers, lineout back to previous setting */
+	void (*all_amps_restore)(struct gpio_runtime *rt);
+
+	void (*set_headphone)(struct gpio_runtime *rt, int on);
+	void (*set_speakers)(struct gpio_runtime *rt, int on);
+	void (*set_lineout)(struct gpio_runtime *rt, int on);
+
+	int (*get_headphone)(struct gpio_runtime *rt);
+	int (*get_speakers)(struct gpio_runtime *rt);
+	int (*get_lineout)(struct gpio_runtime *rt);
+
+	void (*set_hw_reset)(struct gpio_runtime *rt, int on);
+
+	/* use this to be notified of any events. The notification
+	 * function is passed the data, and is called in process
+	 * context by the use of schedule_work.
+	 * The interface for it is that setting a function to NULL
+	 * removes it, and they return 0 if the operation succeeded,
+	 * and -EBUSY if the notification is already assigned by
+	 * someone else. */
+	int (*set_notify)(struct gpio_runtime *rt,
+			  enum notify_type type,
+			  notify_func_t notify,
+			  void *data);
+	/* returns 0 if not plugged in, 1 if plugged in
+	 * or a negative error code */
+	int (*get_detect)(struct gpio_runtime *rt,
+			  enum notify_type type);
+};
+
+struct gpio_notification {
+	notify_func_t notify;
+	void *data;
+	void *gpio_private;
+	struct work_struct work;
+	struct mutex mutex;
+};
+
+struct gpio_runtime {
+	/* to be assigned by fabric */
+	struct device_node *node;
+	/* since everyone needs this pointer anyway... */
+	struct gpio_methods *methods;
+	/* to be used by the gpio implementation */
+	int implementation_private;
+	struct gpio_notification headphone_notify;
+	struct gpio_notification line_in_notify;
+	struct gpio_notification line_out_notify;
+};
+
+#endif /* __AOA_GPIO_H */
sound/aoa/aoa.h new file +131 -0

131 lines not on this page · raw message

--

author maintainer
#20 lore raw

RFC 3/12 snd-aoa: add aoa core

In reply to Johannes Berg

This patch adds the core of aoa, in itself pretty useless, but providing useful functions to other modules.

sound/aoa/core/Makefile new file +5 -0
@@ -0,0 +1,5 @@
+obj-$(CONFIG_SND_AOA) += snd-aoa.o
+snd-aoa-objs := snd-aoa-core.o \
+		snd-aoa-alsa.o \
+		snd-aoa-gpio-pmf.o \
+		snd-aoa-gpio-feature.o
sound/aoa/core/snd-aoa-core.c new file +156 -0

156 lines not on this page · raw message

sound/aoa/core/snd-aoa-gpio-pmf.c new file +246 -0

246 lines not on this page · raw message

sound/aoa/core/snd-aoa-gpio-feature.c new file +392 -0

392 lines not on this page · raw message

sound/aoa/core/snd-aoa-alsa.h new file +16 -0
@@ -0,0 +1,16 @@
+/*
+ * Apple Onboard Audio Alsa private helpers
+ *
+ * Copyright 2006 Johannes Berg <[email protected]>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+
+#ifndef __SND_AOA_ALSA_H
+#define __SND_AOA_ALSA_H
+#include "../aoa.h"
+
+extern int aoa_alsa_init(char *name, struct module *mod);
+extern void aoa_alsa_cleanup(void);
+
+#endif /* __SND_AOA_ALSA_H */
sound/aoa/core/snd-aoa-alsa.c new file +98 -0

98 lines not on this page · raw message

--

#21 lore raw

Re: [Alsa-devel] [RFC 03/12] snd-aoa: add aoa core

At Wed, 07 Jun 2006 15:09:12 +0200,

Quoted 3 lines · Johannes Berg
sound/aoa/core/snd-aoa-gpio-pmf.c new file +0 -0

(snip)

sound/aoa/core/snd-aoa-gpio-pmf.c

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-pmf.c new file +2 -0
+void pmf_handle_notify_irq(void *data)
+{

Missing static.

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +0 -0

(snip)

sound/aoa/core/snd-aoa-gpio-feature.c line 53

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +2 -0
+static struct device_node *get_gpio(
+	char *name, char *altname, int *gpioptr, int *gpioactiveptr)

Unconventional style.

sound/aoa/core/snd-aoa-gpio-feature.c

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +2 -0
+irqreturn_t ftr_handle_notify_irq(int xx, void *data, struct pt_regs *regs)
+{

Missing static.

Quoted 4 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +4 -0
+static int ftr_set_notify(struct gpio_runtime *rt,
+			  enum notify_type type,
+			  notify_func_t notify,
+			  void *data)

(snip)

sound/aoa/core/snd-aoa-gpio-feature.c line 334

Quoted 6 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +6 -0
+	if (old && !notify) {
+		free_irq(irq, notif);
+	}
+	if (!old && notify) {
+		request_irq(irq, ftr_handle_notify_irq, 0, name, notif);
+	}

Remove braces. Any error check from request_irq()?

Takashi

author maintainer
#22 lore raw

Re: [RFC 03/12] snd-aoa: add aoa core

Quoted 10 lines · Takashi Iwai

At Wed, 07 Jun 2006 15:09:12 +0200,

Quoted 3 lines · Johannes Berg
sound/aoa/core/snd-aoa-gpio-pmf.c new file +0 -0

(snip)

sound/aoa/core/snd-aoa-gpio-pmf.c

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-pmf.c new file +2 -0
+void pmf_handle_notify_irq(void *data)
+{

Missing static.

Added, thanks.

Quoted 7 lines
Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +0 -0

(snip)

sound/aoa/core/snd-aoa-gpio-feature.c line 53

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +2 -0
+static struct device_node *get_gpio(
+	char *name, char *altname, int *gpioptr, int *gpioactiveptr)

Unconventional style.

Heh ok, fixed.

Quoted 4 lines

sound/aoa/core/snd-aoa-gpio-feature.c

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +2 -0
+irqreturn_t ftr_handle_notify_irq(int xx, void *data, struct pt_regs *regs)
+{

Missing static.

Added.

Quoted 5 lines
Quoted 4 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +4 -0
+static int ftr_set_notify(struct gpio_runtime *rt,
+			  enum notify_type type,
+			  notify_func_t notify,
+			  void *data)

(snip)

Quoted 8 lines

sound/aoa/core/snd-aoa-gpio-feature.c line 334

Quoted 6 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +6 -0
+	if (old && !notify) {
+		free_irq(irq, notif);
+	}
+	if (!old && notify) {
+		request_irq(irq, ftr_handle_notify_irq, 0, name, notif);
+	}

Remove braces.

Right.

Quoted 1 line

Any error check from request_irq()?

Ah, I figured it didn't matter, but it indeed does. Fixed.

johannes

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

author maintainer
#23 lore raw

Re: [Alsa-devel] [RFC 03/12] snd-aoa: add aoa core

In reply to Takashi Iwai
Quoted 10 lines · Takashi Iwai

At Wed, 07 Jun 2006 15:09:12 +0200,

Quoted 3 lines · Johannes Berg
sound/aoa/core/snd-aoa-gpio-pmf.c new file +0 -0

(snip)

sound/aoa/core/snd-aoa-gpio-pmf.c

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-pmf.c new file +2 -0
+void pmf_handle_notify_irq(void *data)
+{

Missing static.

Added, thanks.

Quoted 7 lines
Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +0 -0

(snip)

sound/aoa/core/snd-aoa-gpio-feature.c line 53

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +2 -0
+static struct device_node *get_gpio(
+	char *name, char *altname, int *gpioptr, int *gpioactiveptr)

Unconventional style.

Heh ok, fixed.

Quoted 4 lines

sound/aoa/core/snd-aoa-gpio-feature.c

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +2 -0
+irqreturn_t ftr_handle_notify_irq(int xx, void *data, struct pt_regs *regs)
+{

Missing static.

Added.

Quoted 5 lines
Quoted 4 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +4 -0
+static int ftr_set_notify(struct gpio_runtime *rt,
+			  enum notify_type type,
+			  notify_func_t notify,
+			  void *data)

(snip)

Quoted 8 lines

sound/aoa/core/snd-aoa-gpio-feature.c line 334

Quoted 6 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +6 -0
+	if (old && !notify) {
+		free_irq(irq, notif);
+	}
+	if (!old && notify) {
+		request_irq(irq, ftr_handle_notify_irq, 0, name, notif);
+	}

Remove braces.

Right.

Quoted 1 line

Any error check from request_irq()?

Ah, I figured it didn't matter, but it indeed does. Fixed.

johannes

#24 lore raw

Re: [RFC 03/12] snd-aoa: add aoa core

In reply to Johannes Berg

At Wed, 07 Jun 2006 15:09:12 +0200,

Quoted 3 lines · Johannes Berg
sound/aoa/core/snd-aoa-gpio-pmf.c new file +0 -0

(snip)

sound/aoa/core/snd-aoa-gpio-pmf.c

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-pmf.c new file +2 -0
+void pmf_handle_notify_irq(void *data)
+{

Missing static.

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +0 -0

(snip)

sound/aoa/core/snd-aoa-gpio-feature.c line 53

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +2 -0
+static struct device_node *get_gpio(
+	char *name, char *altname, int *gpioptr, int *gpioactiveptr)

Unconventional style.

sound/aoa/core/snd-aoa-gpio-feature.c

Quoted 2 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +2 -0
+irqreturn_t ftr_handle_notify_irq(int xx, void *data, struct pt_regs *regs)
+{

Missing static.

Quoted 4 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +4 -0
+static int ftr_set_notify(struct gpio_runtime *rt,
+			  enum notify_type type,
+			  notify_func_t notify,
+			  void *data)

(snip)

sound/aoa/core/snd-aoa-gpio-feature.c line 334

Quoted 6 lines
sound/aoa/core/snd-aoa-gpio-feature.c new file +6 -0
+	if (old && !notify) {
+		free_irq(irq, notif);
+	}
+	if (!old && notify) {
+		request_irq(irq, ftr_handle_notify_irq, 0, name, notif);
+	}

Remove braces. Any error check from request_irq()?

Takashi

author maintainer
#25 lore raw

RFC 4/12 snd-aoa: add soundbus

In reply to Johannes Berg

This patch adds the mostly generic soundbus that will be used for all the sound busses Apple machines have and provides just the hooks for automatic driver loading etc.

sound/aoa/soundbus/Kconfig new file +14 -0
@@ -0,0 +1,14 @@
+config SND_AOA_SOUNDBUS
+	tristate "Apple Soundbus support"
+	depends on SOUND && SND_PCM && EXPERIMENTAL
+	---help---
+	This option enables the generic driver for the soundbus
+	support on Apple machines.
+	
+	It is required for the sound bus implementations.
+
+config SND_AOA_SOUNDBUS_I2S
+	tristate "I2S bus support"
+	depends on SND_AOA_SOUNDBUS && PCI
+	---help---
+	This option enables support for Apple I2S busses.
sound/aoa/soundbus/Makefile new file +3 -0
@@ -0,0 +1,3 @@
+obj-$(CONFIG_SND_AOA_SOUNDBUS) += snd-aoa-soundbus.o
+snd-aoa-soundbus-objs := core.o sysfs.o
+obj-$(CONFIG_SND_AOA_SOUNDBUS_I2S) += i2sbus/
sound/aoa/soundbus/soundbus.h new file +202 -0

202 lines not on this page · raw message

sound/aoa/soundbus/sysfs.c new file +43 -0

43 lines not on this page · raw message

sound/aoa/soundbus/core.c new file +250 -0

250 lines not on this page · raw message

--

author maintainer
#26 lore raw

RFC 5/12 snd-aoa: add i2sbus

In reply to Johannes Berg

This patch adds the required files for i2sbus (the Makefile hook and the Kconfig item were already added in the previous patch). i2sbus is the module that handles the i2s busses on newer Apple machines, currently only handling those machines that have all the required information in the device tree.

sound/aoa/soundbus/i2sbus/i2sbus-control.h new file +37 -0
@@ -0,0 +1,37 @@
+/*
+ * i2sbus driver -- bus register definitions
+ *
+ * Copyright 2006 Johannes Berg <[email protected]>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+#ifndef __I2SBUS_CONTROLREGS_H
+#define __I2SBUS_CONTROLREGS_H
+
+/* i2s control registers, at least what we know about them */
+
+#define __PAD(m,n) u8 __pad##m[n]
+#define _PAD(line, n) __PAD(line, n)
+#define PAD(n) _PAD(__LINE__, (n))
+struct i2s_control_regs {
+	PAD(0x38);
+	__le32 fcr0;		/* 0x38 (unknown) */
+	__le32 cell_control;	/* 0x3c (fcr1) */
+	__le32 fcr2;		/* 0x40 (unknown) */
+	__le32 fcr3;		/* 0x44 (fcr3) */
+	__le32 clock_control;	/* 0x48 (unknown) */
+	PAD(4);
+	/* total size: 0x50 bytes */
+}  __attribute__((__packed__));
+
+#define CTRL_CLOCK_CELL_0_ENABLE	(1<<10)
+#define CTRL_CLOCK_CLOCK_0_ENABLE	(1<<12)
+#define CTRL_CLOCK_SWRESET_0		(1<<11)
+#define CTRL_CLOCK_INTF_0_ENABLE	(1<<13)
+
+#define CTRL_CLOCK_CELL_1_ENABLE	(1<<17)
+#define CTRL_CLOCK_CLOCK_1_ENABLE	(1<<18)
+#define CTRL_CLOCK_SWRESET_1		(1<<19)
+#define CTRL_CLOCK_INTF_1_ENABLE	(1<<20)
+
+#endif /* __I2SBUS_CONTROLREGS_H */
sound/aoa/soundbus/i2sbus/i2sbus-pcm.c new file +1017 -0

1,017 lines not on this page · raw message

sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +387 -0

387 lines not on this page · raw message

sound/aoa/soundbus/i2sbus/i2sbus-interface.h new file +187 -0

187 lines not on this page · raw message

sound/aoa/soundbus/i2sbus/i2sbus.h new file +112 -0

112 lines not on this page · raw message

sound/aoa/soundbus/i2sbus/Makefile new file +2 -0
@@ -0,0 +1,2 @@
+obj-$(CONFIG_SND_AOA_SOUNDBUS_I2S) += snd-aoa-i2sbus.o
+snd-aoa-i2sbus-objs := i2sbus-core.o i2sbus-pcm.o i2sbus-control.o
sound/aoa/soundbus/i2sbus/i2sbus-control.c new file +192 -0

192 lines not on this page · raw message

--

#27 lore raw

Re: [RFC 05/12] snd-aoa: add i2sbus

At Wed, 07 Jun 2006 15:09:14 +0200,

Quoted 4 lines · Johannes Berg
sound/aoa/soundbus/i2sbus/i2sbus-pcm.c new file +1 -0
+static int clock_and_divisors(int mclk, int sclk, int rate, int *out)

sound/aoa/soundbus/i2sbus/i2sbus-pcm.c line 46

Quoted 10 lines
sound/aoa/soundbus/i2sbus/i2sbus-pcm.c new file +10 -0
+{
+	/* sclk must be derived from mclk! */
+	if (mclk % sclk)
+		return -1;
+	/* derive sclk register value */
+	if (i2s_sf_sclkdiv(mclk / sclk, out))
+		return -1;
+
+	if (I2S_CLOCK_SPEED_18MHz % (rate * mclk) == 0) {
+		if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_18MHz / rate / mclk, out)) {

I'd use "I2S_CLOCK_SPEED_18MHZ / (rate * mclk)"

Quoted 5 lines
sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +3 -0
+static void i2sbus_release_dev(struct device *dev)
+{
+	struct i2sbus_dev *i2sdev;

sound/aoa/soundbus/i2sbus/i2sbus-core.c line 78

Quoted 10 lines
sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +10 -0
+	int i;
+
+	i2sdev = container_of(dev, struct i2sbus_dev, sound.ofdev.dev);
+
+ 	if (i2sdev->intfregs) iounmap(i2sdev->intfregs);
+ 	if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma);
+ 	if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma);
+	for (i=0;i<3;i++)
+		if (i2sdev->allocated_resource[i])
+			release_resource(i2sdev->allocated_resource[i]);

release_resource() doesn't kfree the record returned from request_mem_region(). ALSA has a helper function release_and_free_resource() that also does NULL check and kfree:

	for (i = 0; i < 3; i++)
		release_and_free_resource(i2sdev->allocated_resource[i]);
Quoted 5 lines
sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +5 -0
+/* FIXME: look at device node refcounting */
+static int i2sbus_add_dev(struct macio_dev *macio,
+			  struct i2sbus_control *control,
+			  struct device_node *np)
+{

(snip)

sound/aoa/soundbus/i2sbus/i2sbus-core.c line 251

Quoted 3 lines
sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +3 -0
+	for (i=0;i<3;i++)
+		if (dev->allocated_resource[i])
+			release_resource(dev->allocated_resource[i]);

Ditto.

Takashi

#28 lore raw

Re: [Alsa-devel] [RFC 05/12] snd-aoa: add i2sbus

In reply to Johannes Berg

At Wed, 07 Jun 2006 15:09:14 +0200,

Quoted 4 lines · Johannes Berg
sound/aoa/soundbus/i2sbus/i2sbus-pcm.c new file +1 -0
+static int clock_and_divisors(int mclk, int sclk, int rate, int *out)

sound/aoa/soundbus/i2sbus/i2sbus-pcm.c line 46

Quoted 10 lines
sound/aoa/soundbus/i2sbus/i2sbus-pcm.c new file +10 -0
+{
+	/* sclk must be derived from mclk! */
+	if (mclk % sclk)
+		return -1;
+	/* derive sclk register value */
+	if (i2s_sf_sclkdiv(mclk / sclk, out))
+		return -1;
+
+	if (I2S_CLOCK_SPEED_18MHz % (rate * mclk) == 0) {
+		if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_18MHz / rate / mclk, out)) {

I'd use "I2S_CLOCK_SPEED_18MHZ / (rate * mclk)"

Quoted 5 lines
sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +3 -0
+static void i2sbus_release_dev(struct device *dev)
+{
+	struct i2sbus_dev *i2sdev;

sound/aoa/soundbus/i2sbus/i2sbus-core.c line 78

Quoted 10 lines
sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +10 -0
+	int i;
+
+	i2sdev = container_of(dev, struct i2sbus_dev, sound.ofdev.dev);
+
+ 	if (i2sdev->intfregs) iounmap(i2sdev->intfregs);
+ 	if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma);
+ 	if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma);
+	for (i=0;i<3;i++)
+		if (i2sdev->allocated_resource[i])
+			release_resource(i2sdev->allocated_resource[i]);

release_resource() doesn't kfree the record returned from request_mem_region(). ALSA has a helper function release_and_free_resource() that also does NULL check and kfree:

	for (i = 0; i < 3; i++)
		release_and_free_resource(i2sdev->allocated_resource[i]);
Quoted 5 lines
sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +5 -0
+/* FIXME: look at device node refcounting */
+static int i2sbus_add_dev(struct macio_dev *macio,
+			  struct i2sbus_control *control,
+			  struct device_node *np)
+{

(snip)

sound/aoa/soundbus/i2sbus/i2sbus-core.c line 251

Quoted 3 lines
sound/aoa/soundbus/i2sbus/i2sbus-core.c new file +3 -0
+	for (i=0;i<3;i++)
+		if (dev->allocated_resource[i])
+			release_resource(dev->allocated_resource[i]);

Ditto.

Takashi

author maintainer
#29 lore raw

Re: [RFC 05/12] snd-aoa: add i2sbus

Quoted 4 lines · Takashi Iwai

sound/aoa/soundbus/i2sbus/i2sbus-pcm.c line 46

Quoted 2 lines
sound/aoa/soundbus/i2sbus/i2sbus-pcm.c new file +2 -0
+	if (I2S_CLOCK_SPEED_18MHz % (rate * mclk) == 0) {
+		if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_18MHz / rate / mclk, out)) {

I'd use "I2S_CLOCK_SPEED_18MHZ / (rate * mclk)"

Yeah, I guess that's clearer then if the multiplication is there twice.

Quoted 2 lines

release_resource() doesn't kfree the record returned from request_mem_region().

Hah, ouch. I'll go through and fix them all.

Quoted 2 lines

ALSA has a helper function
release_and_free_resource() that also does NULL check and kfree:

Why's that helper in alsa of all things? :)

johannes

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

author maintainer
#30 lore raw

Re: [Alsa-devel] [RFC 05/12] snd-aoa: add i2sbus

In reply to Takashi Iwai
Quoted 4 lines · Takashi Iwai

sound/aoa/soundbus/i2sbus/i2sbus-pcm.c line 46

Quoted 2 lines
sound/aoa/soundbus/i2sbus/i2sbus-pcm.c new file +2 -0
+	if (I2S_CLOCK_SPEED_18MHz % (rate * mclk) == 0) {
+		if (!i2s_sf_mclkdiv(I2S_CLOCK_SPEED_18MHz / rate / mclk, out)) {

I'd use "I2S_CLOCK_SPEED_18MHZ / (rate * mclk)"

Yeah, I guess that's clearer then if the multiplication is there twice.

Quoted 2 lines

release_resource() doesn't kfree the record returned from request_mem_region().

Hah, ouch. I'll go through and fix them all.

Quoted 2 lines

ALSA has a helper function
release_and_free_resource() that also does NULL check and kfree:

Why's that helper in alsa of all things? :)

johannes

#31 lore raw

Re: [RFC 05/12] snd-aoa: add i2sbus

At Fri, 09 Jun 2006 14:13:49 +0200,

Quoted 5 lines · Johannes Berg
Quoted 3 lines

ALSA has a helper function
release_and_free_resource() that also does NULL check and kfree:

Why's that helper in alsa of all things? :)

Yeah it's worth for core stuff indeed.

Takashi

author maintainer
#32 lore raw

RFC 6/12 snd-aoa: add onyx codec

In reply to Johannes Berg

This patch adds the codec Apple uses in newer machines with digital audio, the Onyx (pcm3052).

sound/aoa/codecs/snd-aoa-codec-onyx.h new file +76 -0
@@ -0,0 +1,76 @@
+/*
+ * Apple Onboard Audio driver for Onyx codec (header)
+ *
+ * Copyright 2006 Johannes Berg <[email protected]>
+ *
+ * GPL v2, can be found in COPYING.
+ */
+#ifndef __SND_AOA_CODEC_ONYX_H
+#define __SND_AOA_CODEC_ONYX_H
+#include <stddef.h>
+#include <linux/i2c.h>
+#include <linux/i2c-dev.h>
+#include <asm/pmac_low_i2c.h>
+#include <asm/prom.h>
+
+/* PCM3052 register definitions */
+
+/* the attenuation registers take values from
+ * -1 (0dB) to -127 (-63.0 dB) or others (muted) */
+#define ONYX_REG_DAC_ATTEN_LEFT		65
+#define FIRSTREGISTER			ONYX_REG_DAC_ATTEN_LEFT
+#define ONYX_REG_DAC_ATTEN_RIGHT	66
+
+#define ONYX_REG_CONTROL		67
+#	define ONYX_MRST		(1<<7)
+#	define ONYX_SRST		(1<<6)
+#	define ONYX_ADPSV		(1<<5)
+#	define ONYX_DAPSV		(1<<4)
+#	define ONYX_SILICONVERSION	(1<<0)
+/* all others reserved */
+
+#define ONYX_REG_DAC_CONTROL		68
+#	define ONYX_OVR1		(1<<6)
+#	define ONYX_MUTE_RIGHT		(1<<1)
+#	define ONYX_MUTE_LEFT		(1<<0)
+
+#define ONYX_REG_DAC_DEEMPH		69
+#	define ONYX_DIGDEEMPH_SHIFT	5
+#	define ONYX_DIGDEEMPH_MASK	(3<<ONYX_DIGDEEMPH_SHIFT)
+#	define ONYX_DIGDEEMPH_CTRL	(1<<4)
+
+#define ONYX_REG_DAC_FILTER		70
+#	define ONYX_ROLLOFF_FAST	(1<<5)
+#	define ONYX_DAC_FILTER_ALWAYS	(1<<2)
+
+#define	ONYX_REG_DAC_OUTPHASE		71
+#	define ONYX_OUTPHASE_INVERTED	(1<<0)
+
+#define ONYX_REG_ADC_CONTROL		72
+#	define ONYX_ADC_INPUT_MIC	(1<<5)
+/* 8 + input gain in dB, valid range for input gain is -4 .. 20 dB */
+#	define ONYX_ADC_PGA_GAIN_MASK	0x1f
+
+#define ONYX_REG_ADC_HPF_BYPASS		75
+#	define ONYX_HPF_DISABLE		(1<<3)
+#	define ONYX_ADC_HPF_ALWAYS	(1<<2)
+
+#define ONYX_REG_DIG_INFO1		77
+#	define ONYX_MASK_DIN_TO_BPZ	(1<<7)
+/* bits 1-5 control channel bits 1-5 */
+#	define ONYX_DIGOUT_DISABLE	(1<<0)
+
+#define ONYX_REG_DIG_INFO2		78
+/* controls channel bits 8-15 */
+
+#define ONYX_REG_DIG_INFO3		79
+/* control channel bits 24-29, high 2 bits reserved */
+
+#define ONYX_REG_DIG_INFO4		80
+#	define ONYX_VALIDL		(1<<7)
+#	define ONYX_VALIDR		(1<<6)
+#	define ONYX_SPDIF_ENABLE	(1<<5)
+/* lower 4 bits control bits 32-35 of channel control and word length */
+#	define ONYX_WORDLEN_MASK	(0xF)
+
+#endif /* __SND_AOA_CODEC_ONYX_H */
sound/aoa/codecs/snd-aoa-codec-onyx.c new file +1113 -0

1,113 lines not on this page · raw message

--

author maintainer
#33 lore raw

RFC 7/12 snd-aoa: add tas codec

In reply to Johannes Berg

This patch adds support for the tas3004 codec Apple uses in most newer machines without digital audio, and in some with digital audio (those are tas/topaz machines).

sound/aoa/codecs/snd-aoa-codec-tas-gain-table.h new file +209 -0
@@ -0,0 +1,209 @@
+/*
+ This is the program used to generate below table.
+
+#include <stdio.h>
+#include <math.h>
+int main() {
+  int dB2;
+  printf("/" "* This file is only included exactly once!\n");
+  printf(" *\n");
+  printf(" * If they'd only tell us that generating this table was\n");
+  printf(" * as easy as calculating\n");
+  printf(" *      hwvalue = 1048576.0*exp(0.057564628*dB*2)\n");
+  printf(" * :) *" "/\n");
+  printf("static int tas_gaintable[] = {\n");
+  printf("	0x000000, /" "* -infinity dB *" "/\n");
+  for (dB2=-140;dB2<=36;dB2++)
+    printf("	0x%.6x, /" "* %-02.1f dB *" "/\n", (int)(1048576.0*exp(0.057564628*dB2)), dB2/2.0);
+  printf("};\n\n");
+}
+
+*/
+
+/* This file is only included exactly once!
+ *
+ * If they'd only tell us that generating this table was
+ * as easy as calculating
+ *      hwvalue = 1048576.0*exp(0.057564628*dB*2)
+ * :) */
+static int tas_gaintable[] = {
+	0x000000, /* -infinity dB */
+	0x00014b, /* -70.0 dB */
+	0x00015f, /* -69.5 dB */
+	0x000174, /* -69.0 dB */
+	0x00018a, /* -68.5 dB */
+	0x0001a1, /* -68.0 dB */
+	0x0001ba, /* -67.5 dB */
+	0x0001d4, /* -67.0 dB */
+	0x0001f0, /* -66.5 dB */
+	0x00020d, /* -66.0 dB */
+	0x00022c, /* -65.5 dB */
+	0x00024d, /* -65.0 dB */
+	0x000270, /* -64.5 dB */
+	0x000295, /* -64.0 dB */
+	0x0002bc, /* -63.5 dB */
+	0x0002e6, /* -63.0 dB */
+	0x000312, /* -62.5 dB */
+	0x000340, /* -62.0 dB */
+	0x000372, /* -61.5 dB */
+	0x0003a6, /* -61.0 dB */
+	0x0003dd, /* -60.5 dB */
+	0x000418, /* -60.0 dB */
+	0x000456, /* -59.5 dB */
+	0x000498, /* -59.0 dB */
+	0x0004de, /* -58.5 dB */
+	0x000528, /* -58.0 dB */
+	0x000576, /* -57.5 dB */
+	0x0005c9, /* -57.0 dB */
+	0x000620, /* -56.5 dB */
+	0x00067d, /* -56.0 dB */
+	0x0006e0, /* -55.5 dB */
+	0x000748, /* -55.0 dB */
+	0x0007b7, /* -54.5 dB */
+	0x00082c, /* -54.0 dB */
+	0x0008a8, /* -53.5 dB */
+	0x00092b, /* -53.0 dB */
+	0x0009b6, /* -52.5 dB */
+	0x000a49, /* -52.0 dB */
+	0x000ae5, /* -51.5 dB */
+	0x000b8b, /* -51.0 dB */
+	0x000c3a, /* -50.5 dB */
+	0x000cf3, /* -50.0 dB */
+	0x000db8, /* -49.5 dB */
+	0x000e88, /* -49.0 dB */
+	0x000f64, /* -48.5 dB */
+	0x00104e, /* -48.0 dB */
+	0x001145, /* -47.5 dB */
+	0x00124b, /* -47.0 dB */
+	0x001361, /* -46.5 dB */
+	0x001487, /* -46.0 dB */
+	0x0015be, /* -45.5 dB */
+	0x001708, /* -45.0 dB */
+	0x001865, /* -44.5 dB */
+	0x0019d8, /* -44.0 dB */
+	0x001b60, /* -43.5 dB */
+	0x001cff, /* -43.0 dB */
+	0x001eb7, /* -42.5 dB */
+	0x002089, /* -42.0 dB */
+	0x002276, /* -41.5 dB */
+	0x002481, /* -41.0 dB */
+	0x0026ab, /* -40.5 dB */
+	0x0028f5, /* -40.0 dB */
+	0x002b63, /* -39.5 dB */
+	0x002df5, /* -39.0 dB */
+	0x0030ae, /* -38.5 dB */
+	0x003390, /* -38.0 dB */
+	0x00369e, /* -37.5 dB */
+	0x0039db, /* -37.0 dB */
+	0x003d49, /* -36.5 dB */
+	0x0040ea, /* -36.0 dB */
+	0x0044c3, /* -35.5 dB */
+	0x0048d6, /* -35.0 dB */
+	0x004d27, /* -34.5 dB */
+	0x0051b9, /* -34.0 dB */
+	0x005691, /* -33.5 dB */
+	0x005bb2, /* -33.0 dB */
+	0x006121, /* -32.5 dB */
+	0x0066e3, /* -32.0 dB */
+	0x006cfb, /* -31.5 dB */
+	0x007370, /* -31.0 dB */
+	0x007a48, /* -30.5 dB */
+	0x008186, /* -30.0 dB */
+	0x008933, /* -29.5 dB */
+	0x009154, /* -29.0 dB */
+	0x0099f1, /* -28.5 dB */
+	0x00a310, /* -28.0 dB */
+	0x00acba, /* -27.5 dB */
+	0x00b6f6, /* -27.0 dB */
+	0x00c1cd, /* -26.5 dB */
+	0x00cd49, /* -26.0 dB */
+	0x00d973, /* -25.5 dB */
+	0x00e655, /* -25.0 dB */
+	0x00f3fb, /* -24.5 dB */
+	0x010270, /* -24.0 dB */
+	0x0111c0, /* -23.5 dB */
+	0x0121f9, /* -23.0 dB */
+	0x013328, /* -22.5 dB */
+	0x01455b, /* -22.0 dB */
+	0x0158a2, /* -21.5 dB */
+	0x016d0e, /* -21.0 dB */
+	0x0182af, /* -20.5 dB */
+	0x019999, /* -20.0 dB */
+	0x01b1de, /* -19.5 dB */
+	0x01cb94, /* -19.0 dB */
+	0x01e6cf, /* -18.5 dB */
+	0x0203a7, /* -18.0 dB */
+	0x022235, /* -17.5 dB */
+	0x024293, /* -17.0 dB */
+	0x0264db, /* -16.5 dB */
+	0x02892c, /* -16.0 dB */
+	0x02afa3, /* -15.5 dB */
+	0x02d862, /* -15.0 dB */
+	0x03038a, /* -14.5 dB */
+	0x033142, /* -14.0 dB */
+	0x0361af, /* -13.5 dB */
+	0x0394fa, /* -13.0 dB */
+	0x03cb50, /* -12.5 dB */
+	0x0404de, /* -12.0 dB */
+	0x0441d5, /* -11.5 dB */
+	0x048268, /* -11.0 dB */
+	0x04c6d0, /* -10.5 dB */
+	0x050f44, /* -10.0 dB */
+	0x055c04, /* -9.5 dB */
+	0x05ad50, /* -9.0 dB */
+	0x06036e, /* -8.5 dB */
+	0x065ea5, /* -8.0 dB */
+	0x06bf44, /* -7.5 dB */
+	0x07259d, /* -7.0 dB */
+	0x079207, /* -6.5 dB */
+	0x0804dc, /* -6.0 dB */
+	0x087e80, /* -5.5 dB */
+	0x08ff59, /* -5.0 dB */
+	0x0987d5, /* -4.5 dB */
+	0x0a1866, /* -4.0 dB */
+	0x0ab189, /* -3.5 dB */
+	0x0b53be, /* -3.0 dB */
+	0x0bff91, /* -2.5 dB */
+	0x0cb591, /* -2.0 dB */
+	0x0d765a, /* -1.5 dB */
+	0x0e4290, /* -1.0 dB */
+	0x0f1adf, /* -0.5 dB */
+	0x100000, /* 0.0 dB */
+	0x10f2b4, /* 0.5 dB */
+	0x11f3c9, /* 1.0 dB */
+	0x13041a, /* 1.5 dB */
+	0x14248e, /* 2.0 dB */
+	0x15561a, /* 2.5 dB */
+	0x1699c0, /* 3.0 dB */
+	0x17f094, /* 3.5 dB */
+	0x195bb8, /* 4.0 dB */
+	0x1adc61, /* 4.5 dB */
+	0x1c73d5, /* 5.0 dB */
+	0x1e236d, /* 5.5 dB */
+	0x1fec98, /* 6.0 dB */
+	0x21d0d9, /* 6.5 dB */
+	0x23d1cd, /* 7.0 dB */
+	0x25f125, /* 7.5 dB */
+	0x2830af, /* 8.0 dB */
+	0x2a9254, /* 8.5 dB */
+	0x2d1818, /* 9.0 dB */
+	0x2fc420, /* 9.5 dB */
+	0x3298b0, /* 10.0 dB */
+	0x35982f, /* 10.5 dB */
+	0x38c528, /* 11.0 dB */
+	0x3c224c, /* 11.5 dB */
+	0x3fb278, /* 12.0 dB */
+	0x4378b0, /* 12.5 dB */
+	0x477829, /* 13.0 dB */
+	0x4bb446, /* 13.5 dB */
+	0x5030a1, /* 14.0 dB */
+	0x54f106, /* 14.5 dB */
+	0x59f980, /* 15.0 dB */
+	0x5f4e52, /* 15.5 dB */
+	0x64f403, /* 16.0 dB */
+	0x6aef5e, /* 16.5 dB */
+	0x714575, /* 17.0 dB */
+	0x77fbaa, /* 17.5 dB */
+	0x7f17af, /* 18.0 dB */
+};
+
sound/aoa/codecs/snd-aoa-codec-tas.h new file +47 -0

47 lines not on this page · raw message

sound/aoa/codecs/snd-aoa-codec-tas.c new file +653 -0

653 lines not on this page · raw message

--

author maintainer
#34 lore raw

Re: [RFC 07/12] snd-aoa: add tas codec

sound/aoa/codecs/snd-aoa-codec-tas.c line 607

Quoted 13 lines
sound/aoa/codecs/snd-aoa-codec-tas.c new file +13 -0
+		/* older machines have no 'codec' node with a 'compatible'
+		 * property that says 'tas3004', they just have a 'deq'
+		 * node without any such property... */
+		if (strcmp(dev->name, "deq") == 0) {
+			u32 *addr;
+			printk(KERN_DEBUG PFX "found 'deq' node\n");
+			addr = (u32 *) get_property(dev, "i2c-address", NULL);
+			if (!addr)
+				continue;
+			/* now, if the address doesn't match any of the two
+			 * that a tas3004 can have, we cannot handle this.
+			 * I doubt it ever happens but hey. */
+			if (*addr != 0x34 && *addr != 0x35)

And I fixed the obvious bug here now.

johannes

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

author maintainer
#35 lore raw

RFC 8/12 snd-aoa: add toonie codec

In reply to Johannes Berg

This adds support for the 'toonie' codec which is just a codec without any mixer/volume control functionality and is used on the mac mini.

sound/aoa/codecs/snd-aoa-codec-toonie.c new file +140 -0
@@ -0,0 +1,140 @@
+/*
+ * Apple Onboard Audio driver for Toonie codec
+ *
+ * Copyright 2006 Johannes Berg <[email protected]>
+ *
+ * GPL v2, can be found in COPYING.
+ *
+ *
+ * This is a driver for the toonie codec chip. This chip is present
+ * on the Mac Mini and is nothing but a DAC.
+ */
+#include <linux/delay.h>
+#include <linux/module.h>
+MODULE_AUTHOR("Johannes Berg <[email protected]>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("toonie codec driver for snd-aoa");
+
+#include "../aoa.h"
+#include "../soundbus/soundbus.h"
+
+
+#define PFX "snd-aoa-codec-toonie: "
+
+struct toonie {
+	struct aoa_codec	codec;
+};
+#define codec_to_toonie(c) container_of(c, struct toonie, codec)
+
+static int toonie_dev_register(struct snd_device *dev)
+{
+	return 0;
+}
+
+static struct snd_device_ops ops = {
+	.dev_register = toonie_dev_register,
+};
+
+static struct transfer_info toonie_transfers[] = {
+	/* This thing *only* has analog output,
+	 * the rates are taken from Info.plist
+	 * from Darwin. */
+	{
+		.formats = SNDRV_PCM_FMTBIT_S16_BE |
+			   SNDRV_PCM_FMTBIT_S24_BE,
+		.rates = SNDRV_PCM_RATE_32000 |
+			 SNDRV_PCM_RATE_44100 |
+			 SNDRV_PCM_RATE_48000 |
+			 SNDRV_PCM_RATE_88200 |
+			 SNDRV_PCM_RATE_96000,
+	},
+	{}
+};
+
+#ifdef CONFIG_PM
+static int toonie_suspend(struct codec_info_item *cii, pm_message_t state)
+{
+	/* can we turn it off somehow? */
+	return 0;
+}
+
+static int toonie_resume(struct codec_info_item *cii)
+{
+	return 0;
+}
+#endif /* CONFIG_PM */
+
+static struct codec_info toonie_codec_info = {
+	.transfers = toonie_transfers,
+	.sysclock_factor = 256,
+	.bus_factor = 64,
+	.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+	.suspend = toonie_suspend,
+	.resume = toonie_resume,
+#endif
+};
+
+static int toonie_init_codec(struct aoa_codec *codec)
+{
+	struct toonie *toonie = codec_to_toonie(codec);
+
+	if (aoa_snd_device_new(SNDRV_DEV_LOWLEVEL, toonie, &ops)) {
+		printk(KERN_ERR PFX "failed to create toonie snd device!\n");
+		return -ENODEV;
+	}
+
+	/* nothing connected? what a joke! */
+	if (toonie->codec.connected != 1)
+		return -ENOTCONN;
+
+	if (toonie->codec.soundbus_dev->attach_codec(toonie->codec.soundbus_dev,
+						     aoa_get_card(),
+						     &toonie_codec_info, toonie)) {
+		printk(KERN_ERR PFX "error creating toonie pcm\n");
+		return -ENODEV;
+	}
+
+	return 0;
+}
+
+static void toonie_exit_codec(struct aoa_codec *codec)
+{
+	struct toonie *toonie = codec_to_toonie(codec);
+
+	if (!toonie->codec.soundbus_dev) {
+		printk(KERN_ERR PFX "toonie_exit_codec called without soundbus_dev!\n");
+		return;
+	}
+	toonie->codec.soundbus_dev->detach_codec(toonie->codec.soundbus_dev, toonie);
+}
+
+static struct toonie *toonie;
+
+static int __init toonie_init(void)
+{
+	toonie = kzalloc(sizeof(struct toonie), GFP_KERNEL);
+
+	if (!toonie)
+		return -ENOMEM;
+
+	strlcpy(toonie->codec.name, "toonie", sizeof(toonie->codec.name));
+	toonie->codec.owner = THIS_MODULE;
+	toonie->codec.init = toonie_init_codec;
+	toonie->codec.exit = toonie_exit_codec;
+                                        
+	if (aoa_codec_register(&toonie->codec)) {
+		kfree(toonie);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static void __exit toonie_exit(void)
+{
+	kfree(toonie);
+}
+
+module_init(toonie_init);
+module_exit(toonie_exit);

--

author maintainer
#36 lore raw

RFC 9/12 snd-aoa: add build files for codecs

In reply to Johannes Berg

This adds the Makefile and Kconfig file for the codecs that were added in the previous patches.

sound/aoa/codecs/Makefile new file +3 -0
@@ -0,0 +1,3 @@
+obj-$(CONFIG_SND_AOA_ONYX) += snd-aoa-codec-onyx.o
+obj-$(CONFIG_SND_AOA_TAS) += snd-aoa-codec-tas.o
+obj-$(CONFIG_SND_AOA_TOONIE) += snd-aoa-codec-toonie.o
sound/aoa/codecs/Kconfig new file +32 -0
@@ -0,0 +1,32 @@
+config SND_AOA_ONYX
+	tristate "support Onyx chip"
+	depends on SND_AOA
+	---help---
+	This option enables support for the Onyx (pcm3052)
+	codec chip found in the latest Apple machines
+	(most of those with digital audio output).
+
+#config SND_AOA_TOPAZ
+#	tristate "support Topaz chips"
+#	depends on SND_AOA
+#	---help---
+#	This option enables support for the Topaz (CS84xx)
+#	codec chips found in the latest Apple machines,
+#	these chips do the digital input and output on
+#	some PowerMacs.
+
+config SND_AOA_TAS
+	tristate "support TAS chips"
+	depends on SND_AOA
+	---help---
+	This option enables support for the tas chips
+	found in a lot of Apple Machines, especially
+	iBooks and PowerBooks without digital.
+
+config SND_AOA_TOONIE
+	tristate "support Toonie chip"
+	depends on SND_AOA
+	---help---
+	This option enables support for the toonie codec
+	found in the Mac Mini. If you have a Mac Mini and
+	want to hear sound, select this option.

--

author maintainer
#37 lore raw

RFC 10/12 snd-aoa: add layout-id fabric

In reply to Johannes Berg

The 'fabric' is the thing that pulls all of snd-aoa together, this patch adds the 'layout' or 'layout-id' fabric that keys off the 'layout-id' property in the device-tree to pull in the proper modules. It itself loads if an i2sbus is present with a layout-id (exported in modalias) that it can use.

sound/aoa/fabrics/Makefile new file +1 -0
@@ -0,0 +1 @@
+obj-$(CONFIG_SND_AOA_FABRIC_LAYOUT) += snd-aoa-fabric-layout.o
sound/aoa/fabrics/Kconfig new file +12 -0
@@ -0,0 +1,12 @@
+config SND_AOA_FABRIC_LAYOUT
+	tristate "layout-id fabric"
+	depends SND_AOA
+	select SND_AOA_SOUNDBUS
+	select SND_AOA_SOUNDBUS_I2S
+	---help---
+	This enables the layout-id fabric for the Apple Onboard
+	Audio driver, the module holding it all together
+	based on the device-tree's layout-id property.
+	
+	If you are unsure and have a later Apple machine,
+	compile it as a module.
sound/aoa/fabrics/snd-aoa-fabric-layout.c new file +1096 -0

1,096 lines not on this page · raw message

--

author maintainer
#38 lore raw

RFC 11/12 snd-aoa: add Kconfig and Makefile

In reply to Johannes Berg

This patch adds the simple Kconfig and Makefile files for aoa.

sound/aoa/Kconfig new file +17 -0
@@ -0,0 +1,17 @@
+menu "Apple Onboard Audio driver"
+	depends on SND != n && PPC
+
+config SND_AOA
+	tristate "Apple Onboard Audio driver"
+	depends on SOUND && SND_PCM && EXPERIMENTAL
+	---help---
+	This option enables the new driver for the various
+	Apple Onboard Audio components.
+
+source "sound/aoa/fabrics/Kconfig"
+
+source "sound/aoa/codecs/Kconfig"
+
+source "sound/aoa/soundbus/Kconfig"
+
+endmenu
sound/aoa/Makefile new file +4 -0
@@ -0,0 +1,4 @@
+obj-$(CONFIG_SND_AOA) += core/
+obj-$(CONFIG_SND_AOA) += codecs/
+obj-$(CONFIG_SND_AOA) += fabrics/
+obj-$(CONFIG_SND_AOA_SOUNDBUS) += soundbus/

--

#39 lore raw

Re: [RFC 11/12] snd-aoa: add Kconfig and Makefile

At Wed, 07 Jun 2006 15:09:20 +0200,

sound/aoa/Kconfig line 6

Quoted 12 lines · Johannes Berg

This patch adds the simple Kconfig and Makefile files for aoa.

sound/aoa/Kconfig new file +6 -0
@@ -0,0 +1,17 @@
+menu "Apple Onboard Audio driver"
+	depends on SND != n && PPC
+
+config SND_AOA
+	tristate "Apple Onboard Audio driver"
+	depends on SOUND && SND_PCM && EXPERIMENTAL

Let's remove EXPERIMENTAL. Or keep snd-powermac untouched.

Takashi

#40 lore raw

Re: [Alsa-devel] [RFC 11/12] snd-aoa: add Kconfig and Makefile

In reply to Johannes Berg

At Wed, 07 Jun 2006 15:09:20 +0200,

sound/aoa/Kconfig line 6

Quoted 12 lines · Johannes Berg

This patch adds the simple Kconfig and Makefile files for aoa.

sound/aoa/Kconfig new file +6 -0
@@ -0,0 +1,17 @@
+menu "Apple Onboard Audio driver"
+	depends on SND != n && PPC
+
+config SND_AOA
+	tristate "Apple Onboard Audio driver"
+	depends on SOUND && SND_PCM && EXPERIMENTAL

Let's remove EXPERIMENTAL. Or keep snd-powermac untouched.

Takashi

author maintainer
#41 lore raw

Re: [RFC 11/12] snd-aoa: add Kconfig and Makefile

Quoted 1 line · Takashi Iwai

Let's remove EXPERIMENTAL. Or keep snd-powermac untouched.

Good point. It's been working for lots of people and I'm almost done verifying that it works for all that snd-powermac handled, so I'll remove the EXPERIMENTAL.

johannes

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

author maintainer
#42 lore raw

RFC 12/12 snd-aoa: wire up aoa in sound/

In reply to Johannes Berg

This patch adds the necessary Kconfig and Makefile hooks to make aoa buildable inside the kernel tree.

sound/Kconfig +2 -0
@@ -58,6 +58,8 @@ source "sound/pci/Kconfig"
 
 source "sound/ppc/Kconfig"
 
+source "sound/aoa/Kconfig"
+
 source "sound/arm/Kconfig"
 
 source "sound/mips/Kconfig"
sound/Makefile +1 -1
@@ -4,7 +4,7 @@ #
 obj-$(CONFIG_SOUND) += soundcore.o
 obj-$(CONFIG_SOUND_PRIME) += oss/
 obj-$(CONFIG_DMASOUND) += oss/
-obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ synth/ usb/ sparc/ parisc/ pcmcia/ mips/
+obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ synth/ usb/ sparc/ parisc/ pcmcia/ mips/ aoa/
 
 ifeq ($(CONFIG_SND),y)
   obj-y += last.o

--

#43 lore raw
In reply to Johannes Berg

At Wed, 07 Jun 2006 15:09:09 +0200,

Quoted 7 lines · Johannes Berg

The following patches would add snd-aoa to the Linux source tree. I'm posting them here now for some last round of review before I finally post them with a Signed-Off-By and Changelog for inclusion. As you previously asked about this, I don't think it makes sense to commit these patches one by one, but the first one removing layout-id support from snd-powermac might be worth singling out.

Yes, I'll apply the patch to snd-powermac separately.

Quoted 2 lines

Please let me know either way so that I provide either one or two changelog entries.

Both for snd-aoa addition and for dropping layout-id support from snd-powermac, please.

thanks,

Takashi

#44 lore raw
In reply to Johannes Berg

At Wed, 07 Jun 2006 15:09:09 +0200,

Quoted 7 lines · Johannes Berg

The following patches would add snd-aoa to the Linux source tree. I'm posting them here now for some last round of review before I finally post them with a Signed-Off-By and Changelog for inclusion. As you previously asked about this, I don't think it makes sense to commit these patches one by one, but the first one removing layout-id support from snd-powermac might be worth singling out.

Yes, I'll apply the patch to snd-powermac separately.

Quoted 2 lines

Please let me know either way so that I provide either one or two changelog entries.

Both for snd-aoa addition and for dropping layout-id support from snd-powermac, please.

thanks,

Takashi

author maintainer
#45 lore raw
Quoted 1 line · Takashi Iwai

Yes, I'll apply the patch to snd-powermac separately.

Ok.

Quoted 2 lines

Both for snd-aoa addition and for dropping layout-id support from snd-powermac, please.

Will do. How do you want the code? Should I post the final version as mails again or just provide two download URLs with two patches and appropriate changelogs?

johannes

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

#46 lore raw

At Fri, 09 Jun 2006 14:22:29 +0200,

Quoted 8 lines · Johannes Berg
Quoted 1 line · Takashi Iwai

Yes, I'll apply the patch to snd-powermac separately.

Ok.

Quoted 6 lines
Quoted 2 lines

Both for snd-aoa addition and for dropping layout-id support from snd-powermac, please.

Will do. How do you want the code? Should I post the final version as mails again or just provide two download URLs with two patches and appropriate changelogs?

I don't mind both ways any more at this stage. It's up to you.

thanks,

Takashi