Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Volkov <v1ron@mail.ru>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH v3 09/16] ALSA: Oxygen: Modify initialization functions
Date: Mon, 20 Jan 2014 18:14:03 +0400	[thread overview]
Message-ID: <20140120181403.41028cd4@v1ron-desktop> (raw)
In-Reply-To: <52DA5C8C.9050400@ladisch.de>

В Sat, 18 Jan 2014 11:50:52 +0100
Clemens Ladisch <clemens@ladisch.de> пишет:

> 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.

Okay, will remain these settings. It is better to configure them
manually.

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

If you meant volume control, the mixer performs initialization of these
settings. Probably they can be initalized to 30% volume, 100% by
default.

> > -	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?
> 

As I can recall, if GPIOs 5,6 are cleared, the audio input will be
inactive and we can't record anything. HP_REAR switches CS4245 to the
rear jack. I tried any sequences to minimize clicks\pops. Will try to
don't touch the GPIO_HP_REAR, perhaps this reduce the number of relay
switches at startup.

> 
> Regards,
> Clemens
> 



-- 
Kind regards,
Roman Volkov,
v1ron@mail.ru
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2014-01-20 14:14 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
2014-01-20 14:14     ` Roman Volkov [this message]
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=20140120181403.41028cd4@v1ron-desktop \
    --to=v1ron@mail.ru \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    /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