Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Roman Volkov <v1ron@mail.ru>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH v3 09/16] ALSA: Oxygen: Modify initialization functions
Date: Sat, 18 Jan 2014 11:50:52 +0100	[thread overview]
Message-ID: <52DA5C8C.9050400@ladisch.de> (raw)
In-Reply-To: <1389971315-3215-9-git-send-email-v1ron@mail.ru>

Roman Volkov wrote:
> Changes in GPIO values and sequence at startup, CS4245
> initialization changed and simplified, according to
> datasheets and reverse-engineering information.
>
>  static void cs4245_init(struct oxygen *chip)
>  {
>  	struct dg *data = chip->model_data;
>
> -	data->cs4245_regs[CS4245_DAC_CTRL_1] =
> -		CS4245_DAC_FM_SINGLE | CS4245_DAC_DIF_LJUST;
> -	data->cs4245_regs[CS4245_ADC_CTRL] =
> -		CS4245_ADC_FM_SINGLE | CS4245_ADC_DIF_LJUST;
> -	data->cs4245_regs[CS4245_SIGNAL_SEL] =
> -		CS4245_A_OUT_SEL_HIZ | CS4245_ASYNCH;
> -	data->cs4245_regs[CS4245_PGA_B_CTRL] = 0;
> -	data->cs4245_regs[CS4245_PGA_A_CTRL] = 0;
> -	data->cs4245_regs[CS4245_ANALOG_IN] =
> -		CS4245_PGA_SOFT | CS4245_PGA_ZERO | CS4245_SEL_INPUT_4;
> -	data->cs4245_regs[CS4245_DAC_A_CTRL] = 0;
> -	data->cs4245_regs[CS4245_DAC_B_CTRL] = 0;
> -	cs4245_registers_init(chip);
> +	/* Save the initial state: codec version, registers */
> +	cs4245_shadow_control(chip, CS4245_SAVE_TO_SHADOW);
> +
> +	data->cs4245_shadow[CS4245_POWER_CTRL] = 0;
> +	data->cs4245_shadow[CS4245_SIGNAL_SEL] = CS4245_A_OUT_SEL_DAC |
> +		CS4245_ASYNCH;
> +	data->cs4245_shadow[CS4245_DAC_CTRL_1] = 0;
> +	data->cs4245_shadow[CS4245_DAC_CTRL_2] = CS4245_DAC_SOFT |
> +		CS4245_DAC_ZERO | CS4245_INVERT_DAC;
> +	data->cs4245_shadow[CS4245_ADC_CTRL] = 0;
> +	data->cs4245_shadow[CS4245_ANALOG_IN] = CS4245_PGA_SOFT |
> +		CS4245_PGA_ZERO;

Please don't remove symbols like "CS4245_DAC_FM_SINGLE | CS4245_DAC_DIF_LJUST";
this would imply that you don't care about these settings.

Why don't you initialize registers like PGA/DAC_A/B?

> +void dg_init(struct oxygen *chip)
>  {
> -	data->output_sel = 0;
> -	data->input_sel = 3;
> -	data->hp_vol_att = 2 * 16;

These initializations should not be removed until all the other code
that uses them is also removed.

> -	oxygen_clear_bits16(chip, OXYGEN_GPIO_DATA,
> -			    GPIO_INPUT_ROUTE | GPIO_HP_REAR);
> +	oxygen_write16(chip, OXYGEN_GPIO_DATA, GPIO_HP_REAR | GPIO_INPUT_ROUTE);

Why are these bits now initialized to the opposite value?


Regards,
Clemens

  reply	other threads:[~2014-01-18 10:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 15:08 [PATCH v3 01/16] ALSA: Oxygen: Add the separate SPI waiting function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 02/16] ALSA: Oxygen: Modify the SPI writing function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 03/16] ALSA: Oxygen: Add mute mask for the OXYGEN_PLAY_ROUTING register Roman Volkov
2014-01-17 15:08 ` [PATCH v3 04/16] ALSA: Oxygen: Add CS4245_SPI_READ constant Roman Volkov
2014-01-18 10:29   ` Clemens Ladisch
2014-01-17 15:08 ` [PATCH v3 05/16] ALSA: Oxygen: Export oxygen_update_dac_routing symbol Roman Volkov
2014-01-17 15:08 ` [PATCH v3 06/16] ALSA: Oxygen: Change description of the xonar_dg.c file Roman Volkov
2014-01-17 15:08 ` [PATCH v3 07/16] ALSA: Oxygen: Additional definitions for the Xonar DG/DGX card Roman Volkov
2014-01-17 15:08 ` [PATCH v3 08/16] ALSA: Oxygen: Add new CS4245 SPI functions Roman Volkov
2014-01-18 10:36   ` Clemens Ladisch
2014-01-17 15:08 ` [PATCH v3 09/16] ALSA: Oxygen: Modify initialization functions Roman Volkov
2014-01-18 10:50   ` Clemens Ladisch [this message]
2014-01-20 14:14     ` Roman Volkov
2014-01-17 15:08 ` [PATCH v3 10/16] ALSA: Oxygen: Modify DAC/ADC parameters function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 11/16] ALSA: Oxygen: Modify adjust_dg_dac_routing function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 12/16] ALSA: Oxygen: Modify CS4245 register dumping function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 13/16] ALSA: Oxygen: Modify suspend, resume, and cleanup functions Roman Volkov
2014-01-17 15:08 ` [PATCH v3 14/16] ALSA: Oxygen: Remove code from the xonar_dg.c file Roman Volkov
2014-01-18 11:08   ` Clemens Ladisch
2014-01-17 15:08 ` [PATCH v3 15/16] ALSA: Oxygen: Additional declarations for the new mixer implementation Roman Volkov
2014-01-17 15:08 ` [PATCH v3 16/16] ALSA: Oxygen: The " Roman Volkov
2014-01-18 10:26 ` [PATCH v3 01/16] ALSA: Oxygen: Add the separate SPI waiting function Clemens Ladisch
2014-01-19  8:10   ` Roman Volkov
2014-01-19  9:39     ` Clemens Ladisch

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=52DA5C8C.9050400@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=v1ron@mail.ru \
    /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