All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH 1/2] ASoC: uda134x: replace a macro with a value in platform struct.
Date: Thu, 24 Jun 2010 14:49:30 +0100	[thread overview]
Message-ID: <1277387370.3100.214.camel@odin> (raw)
In-Reply-To: <1277386731-31160-1-git-send-email-vzapolskiy@gmail.com>

On Thu, 2010-06-24 at 17:38 +0400, Vladimir Zapolskiy wrote:
> This change wipes out a hardcoded macro, which enables codec bias
> level control. Now is_powered_on_standby value shall be used instead.
> 
> Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
> ---
>  include/sound/uda134x.h    |   12 ++++++++++++
>  sound/soc/codecs/uda134x.c |   21 +++++----------------
>  2 files changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h
> index 509efb0..e475659 100644
> --- a/include/sound/uda134x.h
> +++ b/include/sound/uda134x.h
> @@ -18,6 +18,18 @@ struct uda134x_platform_data {
>  	struct l3_pins l3;
>  	void (*power) (int);
>  	int model;
> +	/*
> +	  ALSA SOC usually puts the device in standby mode when it's not used
> +	  for sometime. If you unset is_powered_on_standby the driver will
> +	  turn off the ADC/DAC when this callback is invoked and turn it back
> +	  on when needed. Unfortunately this will result in a very light bump
> +	  (it can be audible only with good earphones). If this bothers you
> +	  set is_powered_on_standby, you will have slightly higher power
> +	  consumption. Please note that sending the L3 command for ADC is
> +	  enough to make the bump, so it doesn't make difference if you
> +	  completely take off power from the codec.
> +	*/
> +	int is_powered_on_standby;
>  #define UDA134X_UDA1340 1
>  #define UDA134X_UDA1341 2
>  #define UDA134X_UDA1344 3
> diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c
> index e8066b6..5c7b054 100644
> --- a/sound/soc/codecs/uda134x.c
> +++ b/sound/soc/codecs/uda134x.c
> @@ -27,19 +27,6 @@
>  #include "uda134x.h"
>  
> 
> -#define POWER_OFF_ON_STANDBY 1
> -/*
> -  ALSA SOC usually puts the device in standby mode when it's not used
> -  for sometime. If you define POWER_OFF_ON_STANDBY the driver will
> -  turn off the ADC/DAC when this callback is invoked and turn it back
> -  on when needed. Unfortunately this will result in a very light bump
> -  (it can be audible only with good earphones). If this bothers you
> -  just comment this line, you will have slightly higher power
> -  consumption . Please note that sending the L3 command for ADC is
> -  enough to make the bump, so it doesn't make difference if you
> -  completely take off power from the codec.
> - */
> -
>  #define UDA134X_RATES SNDRV_PCM_RATE_8000_48000
>  #define UDA134X_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE | \
>  		SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S20_3LE)
> @@ -559,9 +546,11 @@ static int uda134x_soc_probe(struct platform_device *pdev)
>  	codec->num_dai = 1;
>  	codec->read = uda134x_read_reg_cache;
>  	codec->write = uda134x_write;
> -#ifdef POWER_OFF_ON_STANDBY
> -	codec->set_bias_level = uda134x_set_bias_level;
> -#endif
> +
> +	if (!pd->is_powered_on_standby) {
> +		codec->set_bias_level = uda134x_set_bias_level;

The codec ops pointers have moved in multi-component. Can you put this
check in your uda134x_set_bias_level() instead.

Thanks

Liam
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

  parent reply	other threads:[~2010-06-24 13:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 13:38 [PATCH 1/2] ASoC: uda134x: replace a macro with a value in platform struct Vladimir Zapolskiy
2010-06-24 13:38 ` [PATCH 2/2] ASoC: uda134x: fix bias level setup on initialization Vladimir Zapolskiy
2010-06-24 13:49 ` Liam Girdwood [this message]
2010-06-24 15:54   ` [PATCH 1/2] ASoC: uda134x: replace a macro with a value in platform struct Vladimir Zapolskiy
2010-06-24 16:05     ` Liam Girdwood
2010-06-24 16:21       ` Vladimir Zapolskiy
2010-06-24 16:39         ` Liam Girdwood
2010-06-25 11:29 ` 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=1277387370.3100.214.camel@odin \
    --to=lrg@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=vzapolskiy@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.