Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Stefan Binding <sbinding@opensource.cirrus.com>,
	Mark Brown <broonie@kernel.org>
Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/8] ASoC: cs42l42: Add SOFT_RESET_REBOOT register
Date: Thu, 19 Jan 2023 13:33:02 +0000	[thread overview]
Message-ID: <c19f2890-3c0f-5f72-d9fb-b59fe67205e8@opensource.cirrus.com> (raw)
In-Reply-To: <eb9fe53e-013b-e477-1d14-8d0c1c7514fc@linux.intel.com>

On 18/1/23 16:41, Pierre-Louis Bossart wrote:
> 
> 
> On 1/18/23 10:04, Stefan Binding wrote:
>> From: Richard Fitzgerald <rf@opensource.cirrus.com>
>>
>> The SOFT_RESET_REBOOT register is needed to recover CS42L42 state after
>> a Soundwire bus reset.
> 
> Humm, you probably want to clarify the terminology, the 'soft reset' is

SOFT_RESET is what the register is called.

> defined in the SoundWire spec as the case where the peripheral device
> loses sync. Bus reset is a Severe Reset, but there's also a Hard Reset.
>
> does this 'SOFT_RESET_REBOOT' need to be accessed when there's a soft
> reset, or only after a Severe/Hard Reset?
> 

After a bus(severe)-reset or a forced(hard)-reset, but the code in
driver/soundwire doesn't issue FORCE_RESET so there's no need to handle
that. If there was some reason to have the core SoundWire code issue
FORCE_RESET it would also need to add a callback to all clients so they
can do any special handling.

 From the datasheet:

"After a FORCE_RESET, the master must issue a reboot command (set 
SFT_RST_REBOOT; see
p. 162) and wait for 2.5 ms.

After a bus reset, the master must issue a reboot command (set
SFT_RST_REBOOT; see p. 162) and wait for 2.5 ms."

SFT_RESET_REBOOT is in the SOFT_RESET_REBOOT register.

>>
>> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
>> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
>> ---
>>   include/sound/cs42l42.h    | 5 +++++
>>   sound/soc/codecs/cs42l42.c | 2 ++
>>   2 files changed, 7 insertions(+)
>>
>> diff --git a/include/sound/cs42l42.h b/include/sound/cs42l42.h
>> index 1d1c24fdd0cae..3994e933db195 100644
>> --- a/include/sound/cs42l42.h
>> +++ b/include/sound/cs42l42.h
>> @@ -34,6 +34,7 @@
>>   #define CS42L42_PAGE_24		0x2400
>>   #define CS42L42_PAGE_25		0x2500
>>   #define CS42L42_PAGE_26		0x2600
>> +#define CS42L42_PAGE_27		0x2700
>>   #define CS42L42_PAGE_28		0x2800
>>   #define CS42L42_PAGE_29		0x2900
>>   #define CS42L42_PAGE_2A		0x2A00
>> @@ -720,6 +721,10 @@
>>   
>>   #define CS42L42_SRC_SDOUT_FS		(CS42L42_PAGE_26 + 0x09)
>>   
>> +/* Page 0x27 DMA */
>> +#define CS42L42_SOFT_RESET_REBOOT	(CS42L42_PAGE_27 + 0x01)
>> +#define CS42L42_SFT_RST_REBOOT_MASK	BIT(1)
>> +
>>   /* Page 0x28 S/PDIF Registers */
>>   #define CS42L42_SPDIF_CTL1		(CS42L42_PAGE_28 + 0x01)
>>   #define CS42L42_SPDIF_CTL2		(CS42L42_PAGE_28 + 0x02)
>> diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
>> index 2fefbcf7bd130..82aa11d6937be 100644
>> --- a/sound/soc/codecs/cs42l42.c
>> +++ b/sound/soc/codecs/cs42l42.c
>> @@ -293,6 +293,7 @@ bool cs42l42_readable_register(struct device *dev, unsigned int reg)
>>   	case CS42L42_SPDIF_SW_CTL1:
>>   	case CS42L42_SRC_SDIN_FS:
>>   	case CS42L42_SRC_SDOUT_FS:
>> +	case CS42L42_SOFT_RESET_REBOOT:
>>   	case CS42L42_SPDIF_CTL1:
>>   	case CS42L42_SPDIF_CTL2:
>>   	case CS42L42_SPDIF_CTL3:
>> @@ -358,6 +359,7 @@ bool cs42l42_volatile_register(struct device *dev, unsigned int reg)
>>   	case CS42L42_LOAD_DET_DONE:
>>   	case CS42L42_DET_STATUS1:
>>   	case CS42L42_DET_STATUS2:
>> +	case CS42L42_SOFT_RESET_REBOOT:
>>   		return true;
>>   	default:
>>   		return false;

  reply	other threads:[~2023-01-19 13:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 16:04 [PATCH v2 0/8] ASoC: cs42l42: Add Soundwire support Stefan Binding
2023-01-18 16:04 ` [PATCH v2 1/8] soundwire: stream: Add specific prep/deprep commands to port_prep callback Stefan Binding
2023-01-18 16:37   ` Pierre-Louis Bossart
2023-01-18 16:04 ` [PATCH v2 2/8] ASoC: cs42l42: Add SOFT_RESET_REBOOT register Stefan Binding
2023-01-18 16:41   ` Pierre-Louis Bossart
2023-01-19 13:33     ` Richard Fitzgerald [this message]
2023-01-18 16:04 ` [PATCH v2 3/8] ASoC: cs42l42: Ensure MCLKint is a multiple of the sample rate Stefan Binding
2023-01-18 16:46   ` Pierre-Louis Bossart
2023-01-18 16:04 ` [PATCH v2 4/8] ASoC: cs42l42: Separate ASP config from PLL config Stefan Binding
2023-01-18 16:04 ` [PATCH v2 5/8] ASoC: cs42l42: Export some functions for Soundwire Stefan Binding
2023-01-18 16:04 ` [PATCH v2 6/8] ASoC: cs42l42: Add Soundwire support Stefan Binding
2023-01-18 17:41   ` Pierre-Louis Bossart
2023-01-19 13:58     ` Richard Fitzgerald
2023-01-19 14:48       ` Pierre-Louis Bossart
2023-01-19 15:35         ` Richard Fitzgerald
2023-01-19 16:27           ` Pierre-Louis Bossart
2023-01-20 12:31             ` Richard Fitzgerald
2023-01-20 19:55           ` Pierre-Louis Bossart
2023-01-23 15:51             ` Richard Fitzgerald
2023-01-23 16:05               ` Pierre-Louis Bossart
2023-01-23 16:14                 ` Richard Fitzgerald
2023-01-23 16:25                   ` Pierre-Louis Bossart
2023-01-18 16:04 ` [PATCH v2 7/8] ASoC: cs42l42: Don't set idle_bias_on Stefan Binding
2023-01-18 16:04 ` [PATCH v2 8/8] ASoC: cs42l42: Wait for debounce interval after resume Stefan Binding
2023-01-18 17:43 ` [PATCH v2 0/8] ASoC: cs42l42: Add Soundwire support Pierre-Louis Bossart

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=c19f2890-3c0f-5f72-d9fb-b59fe67205e8@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sbinding@opensource.cirrus.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