From: Takashi Iwai Subject: Re: [PATCH 001/003] snd-powermac: enable headphone detection Date: Tue, 15 Apr 2008 14:28:13 +0200 Message-ID: References: <46e1c7760804141012s22f638a1v199ae9a4af112169@mail.gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mail.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 2C6E52470F for ; Tue, 15 Apr 2008 14:28:14 +0200 (CEST) In-Reply-To: <46e1c7760804141012s22f638a1v199ae9a4af112169@mail.gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Risto Suominen Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 14 Apr 2008 20:12:18 +0300, Risto Suominen wrote: > > From: Risto Suominen > > Enable port change interrupt while initialising AWACS, Screamer, and > Burgundy chipsets. > > Signed-off-by: Risto Suominen > --- > Kernel version 2.6.25-rc8 (probably any 2.6) > > --- sound/ppc/pmac.c.orig 2008-04-05 17:45:08.000000000 +0300 > +++ sound/ppc/pmac.c 2008-04-07 12:18:47.503077312 +0300 > @@ -214,7 +214,7 @@ static int snd_pmac_pcm_prepare(struct s > int rate_index; > long offset; > struct pmac_stream *astr; > - > + > rec->dma_size = snd_pcm_lib_buffer_bytes(subs); > rec->period_size = snd_pcm_lib_period_bytes(subs); > rec->nperiods = rec->dma_size / rec->period_size; > @@ -643,7 +643,7 @@ static int snd_pmac_pcm_close(struct snd > /* reset constraints */ > astr->cur_freqs = chip->freqs_ok; > astr->cur_formats = chip->formats_ok; > - > + > return 0; > } > Please split the patch, one to fix the initialization and one to fix coding styles. > @@ -1063,6 +1063,10 @@ static int __init snd_pmac_detect(struct > else { > struct pci_dev *pdev = NULL; > > +#ifndef for_each_pci_dev > +#define for_each_pci_dev(d) \ > + while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) > +#endif Why is this needed? thanks, Takashi > for_each_pci_dev(pdev) { > struct device_node *np = pci_device_to_OF_node(pdev); > if (np && np == macio->of_node) { > @@ -1300,9 +1304,9 @@ int __init snd_pmac_new(struct snd_card > > snd_pmac_sound_feature(chip, 1); > > - /* reset */ > - if (chip->model == PMAC_AWACS) > - out_le32(&chip->awacs->control, 0x11); > + /* reset & enable interrupts */ > + if (chip->model <= PMAC_BURGUNDY) > + out_le32(&chip->awacs->control, chip->control_mask); > > /* Powerbooks have odd ways of enabling inputs such as > an expansion-bay CD or sound from an internal modem >