Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: "ext Candelaria Villareal, Jorge" <x0107209@ti.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"broonie@opensource.wolfsonmicro.com"
	<broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] ASoC: SDP3430: Add support for EXTMUTE using TWL GPIO6
Date: Tue, 4 Aug 2009 09:58:15 +0300	[thread overview]
Message-ID: <200908040958.15673.peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <2256F256009DAA4CBE661E9F41EAC84B533409F1@dlee01.ent.ti.com>

On Wednesday 15 July 2009 04:04:08 ext Candelaria Villareal, Jorge wrote:
> Board sdp3430 has hardware support for EXTMUTE using TWL4030 GPIO6
> line, controlled by register INTBR_PMBR1. Machine driver takes care
> of enabling gpio line through i2c and codec driver manipulates the
> line during headset ramp up/down sequence.
>
> +#define TWL4030_INTBR_PMBR1	0x0D
> +#define EXTMUTE(value)		(value << 2)

This is confusing, should it be something like this?:
#define GPIO6_PWM0_MUX(value)		(value << 2)

> +	/* Set TWL4030 GPIO6 as EXTMUTE signal */
> +	twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, EXTMUTE(0x02),
> +							TWL4030_MODULE_INTBR);

I think you meant this:
twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, EXTMUTE(0x02),
							TWL4030_INTBR_PMBR1);

Furthermore, since you are modifying pin muxing register, I think it is safer 
to do something like this here to avoid changing other pin's function:

u8 pin_mux;

twl4030_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux,
							TWL4030_INTBR_PMBR1);
pin_mux &= ~GPIO6_PWM0_MUX(0x3);
pin_mux |= GPIO6_PWM0_MUX(0x2);
twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux,
							TWL4030_INTBR_PMBR1);


-- 
Péter

  parent reply	other threads:[~2009-08-04  6:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15  1:04 [PATCH] ASoC: SDP3430: Add support for EXTMUTE using TWL GPIO6 Candelaria Villareal, Jorge
2009-07-17  9:11 ` Mark Brown
2009-08-04  6:58 ` Peter Ujfalusi [this message]
2009-08-06 15:20   ` Candelaria Villareal, Jorge
2009-08-06 17:23     ` Mark Brown
2009-08-07  5:52   ` Peter Ujfalusi
2009-08-07 15:33     ` Candelaria Villareal, Jorge

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=200908040958.15673.peter.ujfalusi@nokia.com \
    --to=peter.ujfalusi@nokia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=x0107209@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox