aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-07-03 07:36:01 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-03 07:36:01 -0400
commit0ebfff1491ef85d41ddf9c633834838be144f69f (patch)
tree5b469a6d61a9fcfbf94e7b6d411e544dbdec8dec /sound/ppc
parentf63e115fb50db39706b955b81e3375ef6bab2268 (diff)
[POWERPC] Add new interrupt mapping core and change platforms to use it
This adds the new irq remapper core and removes the old one. Because there are some fundamental conflicts with the old code, like the value of NO_IRQ which I'm now setting to 0 (as per discussions with Linus), etc..., this commit also changes the relevant platform and driver code over to use the new remapper (so as not to cause difficulties later in bisecting). This patch removes the old pre-parsing of the open firmware interrupt tree along with all the bogus assumptions it made to try to renumber interrupts according to the platform. This is all to be handled by the new code now. For the pSeries XICS interrupt controller, a single remapper host is created for the whole machine regardless of how many interrupt presentation and source controllers are found, and it's set to match any device node that isn't a 8259. That works fine on pSeries and avoids having to deal with some of the complexities of split source controllers vs. presentation controllers in the pSeries device trees. The powerpc i8259 PIC driver now always requests the legacy interrupt range. It also has the feature of being able to match any device node (including NULL) if passed no device node as an input. That will help porting over platforms with broken device-trees like Pegasos who don't have a proper interrupt tree. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'sound/ppc')
-rw-r--r--sound/ppc/pmac.c33
-rw-r--r--sound/ppc/tumbler.c8
2 files changed, 18 insertions, 23 deletions
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 90db9a1d1e0a..641430631505 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -1120,6 +1120,7 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
1120 struct snd_pmac *chip; 1120 struct snd_pmac *chip;
1121 struct device_node *np; 1121 struct device_node *np;
1122 int i, err; 1122 int i, err;
1123 unsigned int irq;
1123 unsigned long ctrl_addr, txdma_addr, rxdma_addr; 1124 unsigned long ctrl_addr, txdma_addr, rxdma_addr;
1124 static struct snd_device_ops ops = { 1125 static struct snd_device_ops ops = {
1125 .dev_free = snd_pmac_dev_free, 1126 .dev_free = snd_pmac_dev_free,
@@ -1153,10 +1154,6 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
1153 if (chip->is_k2) { 1154 if (chip->is_k2) {
1154 static char *rnames[] = { 1155 static char *rnames[] = {
1155 "Sound Control", "Sound DMA" }; 1156 "Sound Control", "Sound DMA" };
1156 if (np->n_intrs < 3) {
1157 err = -ENODEV;
1158 goto __error;
1159 }
1160 for (i = 0; i < 2; i ++) { 1157 for (i = 0; i < 2; i ++) {
1161 if (of_address_to_resource(np->parent, i, 1158 if (of_address_to_resource(np->parent, i,
1162 &chip->rsrc[i])) { 1159 &chip->rsrc[i])) {
@@ -1185,10 +1182,6 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
1185 } else { 1182 } else {
1186 static char *rnames[] = { 1183 static char *rnames[] = {
1187 "Sound Control", "Sound Tx DMA", "Sound Rx DMA" }; 1184 "Sound Control", "Sound Tx DMA", "Sound Rx DMA" };
1188 if (np->n_intrs < 3) {
1189 err = -ENODEV;
1190 goto __error;
1191 }
1192 for (i = 0; i < 3; i ++) { 1185 for (i = 0; i < 3; i ++) {
1193 if (of_address_to_resource(np, i, 1186 if (of_address_to_resource(np, i,
1194 &chip->rsrc[i])) { 1187 &chip->rsrc[i])) {
@@ -1220,28 +1213,30 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return)
1220 chip->playback.dma = ioremap(txdma_addr, 0x100); 1213 chip->playback.dma = ioremap(txdma_addr, 0x100);
1221 chip->capture.dma = ioremap(rxdma_addr, 0x100); 1214 chip->capture.dma = ioremap(rxdma_addr, 0x100);
1222 if (chip->model <= PMAC_BURGUNDY) { 1215 if (chip->model <= PMAC_BURGUNDY) {
1223 if (request_irq(np->intrs[0].line, snd_pmac_ctrl_intr, 0, 1216 irq = irq_of_parse_and_map(np, 0);
1217 if (request_irq(irq, snd_pmac_ctrl_intr, 0,
1224 "PMac", (void*)chip)) { 1218 "PMac", (void*)chip)) {
1225 snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[0].line); 1219 snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n",
1220 irq);
1226 err = -EBUSY; 1221 err = -EBUSY;
1227 goto __error; 1222 goto __error;
1228 } 1223 }
1229 chip->irq = np->intrs[0].line; 1224 chip->irq = irq;
1230 } 1225 }
1231 if (request_irq(np->intrs[1].line, snd_pmac_tx_intr, 0, 1226 irq = irq_of_parse_and_map(np, 1);
1232 "PMac Output", (void*)chip)) { 1227 if (request_irq(irq, snd_pmac_tx_intr, 0, "PMac Output", (void*)chip)){
1233 snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[1].line); 1228 snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq);
1234 err = -EBUSY; 1229 err = -EBUSY;
1235 goto __error; 1230 goto __error;
1236 } 1231 }
1237 chip->tx_irq = np->intrs[1].line; 1232 chip->tx_irq = irq;
1238 if (request_irq(np->intrs[2].line, snd_pmac_rx_intr, 0, 1233 irq = irq_of_parse_and_map(np, 2);
1239 "PMac Input", (void*)chip)) { 1234 if (request_irq(irq, snd_pmac_rx_intr, 0, "PMac Input", (void*)chip)) {
1240 snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[2].line); 1235 snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq);
1241 err = -EBUSY; 1236 err = -EBUSY;
1242 goto __error; 1237 goto __error;
1243 } 1238 }
1244 chip->rx_irq = np->intrs[2].line; 1239 chip->rx_irq = irq;
1245 1240
1246 snd_pmac_sound_feature(chip, 1); 1241 snd_pmac_sound_feature(chip, 1);
1247 1242
diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c
index 70e4ebc70260..692c61177678 100644
--- a/sound/ppc/tumbler.c
+++ b/sound/ppc/tumbler.c
@@ -1121,7 +1121,7 @@ static long tumbler_find_device(const char *device, const char *platform,
1121 DBG("(I) GPIO device %s found, offset: %x, active state: %d !\n", 1121 DBG("(I) GPIO device %s found, offset: %x, active state: %d !\n",
1122 device, gp->addr, gp->active_state); 1122 device, gp->addr, gp->active_state);
1123 1123
1124 return (node->n_intrs > 0) ? node->intrs[0].line : 0; 1124 return irq_of_parse_and_map(node, 0);
1125} 1125}
1126 1126
1127/* reset audio */ 1127/* reset audio */
@@ -1264,16 +1264,16 @@ static int __init tumbler_init(struct snd_pmac *chip)
1264 &mix->line_mute, 1); 1264 &mix->line_mute, 1);
1265 irq = tumbler_find_device("headphone-detect", 1265 irq = tumbler_find_device("headphone-detect",
1266 NULL, &mix->hp_detect, 0); 1266 NULL, &mix->hp_detect, 0);
1267 if (irq < 0) 1267 if (irq <= NO_IRQ)
1268 irq = tumbler_find_device("headphone-detect", 1268 irq = tumbler_find_device("headphone-detect",
1269 NULL, &mix->hp_detect, 1); 1269 NULL, &mix->hp_detect, 1);
1270 if (irq < 0) 1270 if (irq <= NO_IRQ)
1271 irq = tumbler_find_device("keywest-gpio15", 1271 irq = tumbler_find_device("keywest-gpio15",
1272 NULL, &mix->hp_detect, 1); 1272 NULL, &mix->hp_detect, 1);
1273 mix->headphone_irq = irq; 1273 mix->headphone_irq = irq;
1274 irq = tumbler_find_device("line-output-detect", 1274 irq = tumbler_find_device("line-output-detect",
1275 NULL, &mix->line_detect, 0); 1275 NULL, &mix->line_detect, 0);
1276 if (irq < 0) 1276 if (irq <= NO_IRQ)
1277 irq = tumbler_find_device("line-output-detect", 1277 irq = tumbler_find_device("line-output-detect",
1278 NULL, &mix->line_detect, 1); 1278 NULL, &mix->line_detect, 1);
1279 mix->lineout_irq = irq; 1279 mix->lineout_irq = irq;