From: Takashi Iwai Subject: Re: [PATCH asoc-dev (take #2)] ASoC: Convert N810 machine driver to use gpiolib Date: Thu, 15 May 2008 11:05:54 +0200 Message-ID: References: <1210831463-14704-1-git-send-email-jarkko.nikula@nokia.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 mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 9038C103843 for ; Thu, 15 May 2008 11:05:54 +0200 (CEST) In-Reply-To: <1210831463-14704-1-git-send-email-jarkko.nikula@nokia.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: Jarkko Nikula Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 15 May 2008 09:04:23 +0300, Jarkko Nikula wrote: > > Use gpiolib since it is now available for OMAPs. Change also references to > HW version RX44 to product name N810. > > Signed-off-by: Jarkko Nikula Thanks, applied to ALSA tree now. Takashi > --- > sound/soc/omap/n810.c | 25 ++++++++++++++----------- > 1 files changed, 14 insertions(+), 11 deletions(-) > > diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c > index c2afffb..c32487b 100644 > --- a/sound/soc/omap/n810.c > +++ b/sound/soc/omap/n810.c > @@ -30,15 +30,15 @@ > > #include > #include > -#include > +#include > #include > > #include "omap-mcbsp.h" > #include "omap-pcm.h" > #include "../codecs/tlv320aic3x.h" > > -#define RX44_HEADSET_AMP_GPIO 10 > -#define RX44_SPEAKER_AMP_GPIO 101 > +#define N810_HEADSET_AMP_GPIO 10 > +#define N810_SPEAKER_AMP_GPIO 101 > > static struct clk *sys_clkout2; > static struct clk *sys_clkout2_src; > @@ -154,9 +154,9 @@ static int n810_spk_event(struct snd_soc_dapm_widget *w, > struct snd_kcontrol *k, int event) > { > if (SND_SOC_DAPM_EVENT_ON(event)) > - omap_set_gpio_dataout(RX44_SPEAKER_AMP_GPIO, 1); > + gpio_set_value(N810_SPEAKER_AMP_GPIO, 1); > else > - omap_set_gpio_dataout(RX44_SPEAKER_AMP_GPIO, 0); > + gpio_set_value(N810_SPEAKER_AMP_GPIO, 0); > > return 0; > } > @@ -165,9 +165,9 @@ static int n810_jack_event(struct snd_soc_dapm_widget *w, > struct snd_kcontrol *k, int event) > { > if (SND_SOC_DAPM_EVENT_ON(event)) > - omap_set_gpio_dataout(RX44_HEADSET_AMP_GPIO, 1); > + gpio_set_value(N810_HEADSET_AMP_GPIO, 1); > else > - omap_set_gpio_dataout(RX44_HEADSET_AMP_GPIO, 0); > + gpio_set_value(N810_HEADSET_AMP_GPIO, 0); > > return 0; > } > @@ -303,12 +303,12 @@ static int __init n810_soc_init(void) > clk_set_parent(sys_clkout2_src, func96m_clk); > clk_set_rate(sys_clkout2, 12000000); > > - if (omap_request_gpio(RX44_HEADSET_AMP_GPIO) < 0) > + if (gpio_request(N810_HEADSET_AMP_GPIO, "hs_amp") < 0) > BUG(); > - if (omap_request_gpio(RX44_SPEAKER_AMP_GPIO) < 0) > + if (gpio_request(N810_SPEAKER_AMP_GPIO, "spk_amp") < 0) > BUG(); > - omap_set_gpio_direction(RX44_HEADSET_AMP_GPIO, 0); > - omap_set_gpio_direction(RX44_SPEAKER_AMP_GPIO, 0); > + gpio_direction_output(N810_HEADSET_AMP_GPIO, 0); > + gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0); > > return 0; > err2: > @@ -323,6 +323,9 @@ err1: > > static void __exit n810_soc_exit(void) > { > + gpio_free(N810_SPEAKER_AMP_GPIO); > + gpio_free(N810_HEADSET_AMP_GPIO); > + > platform_device_unregister(n810_snd_device); > } > > -- > 1.5.5.1 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >