Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Bard Liao <bardliao@realtek.com>
Cc: oder_chiou@realtek.com, alsa-devel@alsa-project.org,
	lars@metafoo.de, zhengxing@rock-chips.com, yang.a.fang@intel.com,
	lgirdwood@gmail.com, john.lin@realtek.com,
	koro.chen@mediatek.com, flove@realtek.com
Subject: Re: [PATCH 1/2] ASoC: rt5645: Adds push button support for rt5650
Date: Mon, 20 Apr 2015 21:41:14 +0100	[thread overview]
Message-ID: <20150420204114.GI14892@sirena.org.uk> (raw)
In-Reply-To: <1429497442-13021-1-git-send-email-bardliao@realtek.com>


[-- Attachment #1.1: Type: text/plain, Size: 818 bytes --]

On Mon, Apr 20, 2015 at 10:37:21AM +0800, Bard Liao wrote:

> --- a/sound/soc/codecs/rt5645.c
> +++ b/sound/soc/codecs/rt5645.c
> @@ -198,7 +198,6 @@ static const struct reg_default rt5645_reg[] = {
>  	{ 0xda, 0x0000 },
>  	{ 0xdb, 0x0003 },
>  	{ 0xdc, 0x0049 },
> -	{ 0xdd, 0x001b },
>  	{ 0xdf, 0x0008 },
>  	{ 0xe0, 0x4000 },
>  	{ 0xe6, 0x8000 },

That's a bit weird, why is this in here?

> +	if (rt5645->btn_jack && rt5645->codec_type == CODEC_TYPE_RT5650) {

Can we have a switch statement for the device type so it's easier to add
other devices if there's new derivatives please?

> +			btn_type = rt5645_button_detect(rt5645->codec);
> +			switch (btn_type) {
> +			case 0x8000:
> +			case 0x4000:
> +			case 0x2000:
> +				report |= SND_JACK_BTN_0;
> +				break;

Why do we mash all these values together?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2015-04-20 20:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20  2:37 [PATCH 1/2] ASoC: rt5645: Adds push button support for rt5650 Bard Liao
2015-04-20  2:37 ` [PATCH 2/2] ASoC: Intel: rt5645_set_jack_detect is changed Bard Liao
2015-04-20 20:57   ` Mark Brown
2015-04-20 20:41 ` Mark Brown [this message]
2015-04-21  2:08   ` [PATCH 1/2] ASoC: rt5645: Adds push button support for rt5650 Bard Liao
2015-04-21 10:48     ` Mark Brown
2015-04-21 11:41       ` Bard Liao
2015-04-22 11:04         ` 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=20150420204114.GI14892@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=flove@realtek.com \
    --cc=john.lin@realtek.com \
    --cc=koro.chen@mediatek.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=yang.a.fang@intel.com \
    --cc=zhengxing@rock-chips.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