From: Mark Brown <broonie@sirena.org.uk>
To: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: alsa-devel@alsa-project.org, pHilipp Zabel <philipp.zabel@gmail.com>
Subject: Re: asoc: s3c24xx+uda1380 - some questions
Date: Tue, 27 Jan 2009 20:00:52 +0000 [thread overview]
Message-ID: <20090127200051.GA6424@sirena.org.uk> (raw)
In-Reply-To: <200901271822.32537.anarsoul@gmail.com>
On Tue, Jan 27, 2009 at 06:22:25PM +0200, Vasily Khoruzhick wrote:
> Btw, on rx1950 there're 4 gpio pins involved:
> GPJ0 controls codec power
> GPA1 controls amplifier power
> GPG12 is jack sense pin, it's value depends whether headphone jack is inserted
You might want to have a look at the jack reporting API that was
recently added, it should save you a bit of code:
http://git.kernel.org/?p=linux/kernel/git/broonie/sound-2.6.git;a=commit;h=8a2cd6180f8fa00111843c2f4a4f4361995358e0
It'll need a little helper for GPIOs adding to the core but that should
be reusable.
> down(&rx1950_power_mutex);
> printk("%s: enable == %d\n", __func__, enable);
> if (enable) {
> if (s3c2410_gpio_getpin(S3C2440_GPJ0))
> goto done;
> //spin_lock(&cmpl_lock);
> //waiting_for_completion = 1;
> //spin_unlock(&cmpl_lock);
> s3c2410_gpio_setpin(S3C2410_GPD0, 0);
> s3c2410_gpio_setpin(S3C2440_GPJ0, 0);
> s3c2410_gpio_setpin(S3C2440_GPJ0, 1);
>
> /* Wait for EINT20 irq to ensure uda1380 is powered */
> //printk("%s: waiting for compeltion...\n", __func__);
> //wait_for_completion(&rx1950_sound_completion);
> //printk("%s: completed\n", __func__);
> //printk("%s: GPG12: %d\n", __func__,
> // s3c2410_gpio_getpin(S3C2410_GPG12));
> mdelay(50);
> s3c2410_gpio_setpin(S3C2410_GPD0, 1);
> s3c2410_gpio_setpin(S3C2410_GPD0, 0);
Hrm. The completion makes this look more like it could use a full blown
regulator - it's certainly a pattern that will get reused often enough.
> /* configure some gpios */
> s3c2410_gpio_cfgpin(S3C2410_GPD0, S3C2410_GPIO_OUTPUT);
> s3c2410_gpio_cfgpin(S3C2410_GPG12, S3C2410_GPIO_IRQ);
> s3c2410_gpio_cfgpin(S3C2440_GPJ0, S3C2410_GPIO_OUTPUT);
The S3C24xx now supports gpiolib so you should be able to use that - the
platform specific GPIO API will probably get killed at some point.
next prev parent reply other threads:[~2009-01-27 20:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-27 13:19 asoc: s3c24xx+uda1380 - some questions Vasily Khoruzhick
2009-01-27 15:00 ` Mark Brown
2009-01-27 15:19 ` Vasily Khoruzhick
2009-01-27 15:25 ` Mark Brown
2009-01-27 15:49 ` Vasily Khoruzhick
2009-01-27 16:06 ` pHilipp Zabel
2009-01-27 16:22 ` Vasily Khoruzhick
2009-01-27 19:49 ` pHilipp Zabel
2009-01-27 20:32 ` Vasily Khoruzhick
2009-02-02 23:46 ` Vasily Khoruzhick
2009-02-03 11:41 ` Mark Brown
2009-02-03 11:57 ` Vasily Khoruzhick
2009-02-03 12:05 ` Mark Brown
2009-02-03 13:52 ` Vasily Khoruzhick
2009-02-03 16:09 ` pHilipp Zabel
2009-02-03 17:21 ` Mark Brown
2009-01-27 20:00 ` Mark Brown [this message]
2009-01-27 20:14 ` Vasily Khoruzhick
2009-01-27 20:19 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090127200051.GA6424@sirena.org.uk \
--to=broonie@sirena.org.uk \
--cc=alsa-devel@alsa-project.org \
--cc=anarsoul@gmail.com \
--cc=philipp.zabel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.