All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
       [not found] <CGME20200330073548epcas2p3045be9d3c8b76115c76ce27679840b6f@epcas2p3.samsung.com>
@ 2020-03-30  7:35 ` 이경택
  2020-03-30 17:05   ` Mark Brown
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: 이경택 @ 2020-03-30  7:35 UTC (permalink / raw)
  To: lgirdwood, broonie, tiwai; +Cc: alsa-devel

Since a virtual mixer has no backing registers
to decide which path to connect,
it will try to match with initial value 0.
This is to ensure that the default mixer choice will be
correctly powered up during initialization.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
---
 sound/soc/soc-dapm.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 9fb54e6fe254..fc55a0534252 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -802,7 +802,16 @@ static void dapm_set_mixer_path_status(struct
snd_soc_dapm_path *p, int i,
 			val = max - val;
 		p->connect = !!val;
 	} else {
-		p->connect = 0;
+		/* since a virtual mixer has no backing registers to
+		 * decide which path to connect, it will try to match
+		 * with initial value 0.  This is to ensure
+		 * that the default mixer choice will be
+		 * correctly powered up during initialization.
+		 */
+		val = 0;
+		if (invert)
+			val = max - val;
+		p->connect = !!val;
 	}
 }
 
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
  2020-03-30  7:35 ` [PATCH 1/3] ASoC: dapm: connect virtual mux with default value 이경택
@ 2020-03-30 17:05   ` Mark Brown
  2020-03-31  5:42   ` 이경택
  2020-03-31  6:50   ` 이경택
  2 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2020-03-30 17:05 UTC (permalink / raw)
  To: 이경택; +Cc: alsa-devel, lgirdwood, tiwai

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

On Mon, Mar 30, 2020 at 04:35:47PM +0900, 이경택 wrote:

> +++ b/sound/soc/soc-dapm.c
> @@ -802,7 +802,16 @@ static void dapm_set_mixer_path_status(struct
> snd_soc_dapm_path *p, int i,

It looks like your client corrupted this by at least word wrapping it,
can you resend please?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
  2020-03-30  7:35 ` [PATCH 1/3] ASoC: dapm: connect virtual mux with default value 이경택
  2020-03-30 17:05   ` Mark Brown
@ 2020-03-31  5:42   ` 이경택
  2020-03-31  5:55     ` Lars-Peter Clausen
  2020-03-31  6:50   ` 이경택
  2 siblings, 1 reply; 8+ messages in thread
From: 이경택 @ 2020-03-31  5:42 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, lgirdwood, tiwai, hmseo, tkjung, pilsun.jang

Since a virtual mixer has no backing registers to decide which path to
connect, it will try to match with initial value 0.
This is to ensure that the default mixer choice will be correctly powered
up during initialization.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
---
 sound/soc/soc-dapm.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index
9fb54e6fe254..fc55a0534252 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -802,7 +802,16 @@ static void dapm_set_mixer_path_status(struct
snd_soc_dapm_path *p, int i,
 			val = max - val;
 		p->connect = !!val;
 	} else {
-		p->connect = 0;
+		/* since a virtual mixer has no backing registers to
+		 * decide which path to connect, it will try to match
+		 * with initial value 0.  This is to ensure
+		 * that the default mixer choice will be
+		 * correctly powered up during initialization.
+		 */
+		val = 0;
+		if (invert)
+			val = max - val;
+		p->connect = !!val;
 	}
 }
 
--
2.21.0




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
  2020-03-31  5:42   ` 이경택
@ 2020-03-31  5:55     ` Lars-Peter Clausen
  2020-03-31  6:35       ` 이경택
  0 siblings, 1 reply; 8+ messages in thread
From: Lars-Peter Clausen @ 2020-03-31  5:55 UTC (permalink / raw)
  To: 이경택, broonie
  Cc: alsa-devel, lgirdwood, tiwai, hmseo, tkjung, pilsun.jang

On 3/31/20 7:42 AM, 이경택 wrote:
> Since a virtual mixer has no backing registers to decide which path to
> connect, it will try to match with initial value 0.
> This is to ensure that the default mixer choice will be correctly powered
> up during initialization.
>
> Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
> ---
>   sound/soc/soc-dapm.c | 11 ++++++++++-
>   1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index
> 9fb54e6fe254..fc55a0534252 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -802,7 +802,16 @@ static void dapm_set_mixer_path_status(struct
> snd_soc_dapm_path *p, int i,
>   			val = max - val;
>   		p->connect = !!val;
>   	} else {
> -		p->connect = 0;
> +		/* since a virtual mixer has no backing registers to
> +		 * decide which path to connect, it will try to match
> +		 * with initial value 0.  This is to ensure
> +		 * that the default mixer choice will be
> +		 * correctly powered up during initialization.
> +		 */
> +		val = 0;
> +		if (invert)
> +			val = max - val;
> +		p->connect = !!val;
Do you have virtual mixers that have the inverted flag set and if yes 
why? Cause otherwise this is exactly the same as before.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
  2020-03-31  5:55     ` Lars-Peter Clausen
@ 2020-03-31  6:35       ` 이경택
  2020-03-31  7:10         ` Lars-Peter Clausen
  0 siblings, 1 reply; 8+ messages in thread
From: 이경택 @ 2020-03-31  6:35 UTC (permalink / raw)
  To: 'Lars-Peter Clausen', broonie
  Cc: alsa-devel, lgirdwood, tiwai, hmseo, tkjung, pilsun.jang

On 3/31/20 7:55 AM, Lars-Peter Clausen wrote:
>On 3/31/20 7:42 AM, 이경택 wrote:
>> Since a virtual mixer has no backing registers to decide which path to 
>> connect, it will try to match with initial value 0.
>> This is to ensure that the default mixer choice will be correctly 
>> powered up during initialization.
>>
>> Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
>> ---
>>   sound/soc/soc-dapm.c | 11 ++++++++++-
>>   1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index
>> 9fb54e6fe254..fc55a0534252 100644
>> --- a/sound/soc/soc-dapm.c
>> +++ b/sound/soc/soc-dapm.c
>> @@ -802,7 +802,16 @@ static void dapm_set_mixer_path_status(struct 
>> snd_soc_dapm_path *p, int i,
>>   			val = max - val;
>>   		p->connect = !!val;
>>   	} else {
>> -		p->connect = 0;
>> +		/* since a virtual mixer has no backing registers to
>> +		 * decide which path to connect, it will try to match
>> +		 * with initial value 0.  This is to ensure
>> +		 * that the default mixer choice will be
>> +		 * correctly powered up during initialization.
>> +		 */
>> +		val = 0;
>> +		if (invert)
>> +			val = max - val;
>> +		p->connect = !!val;
>Do you have virtual mixers that have the inverted flag set and if yes why? Cause otherwise this is exactly the same as before.
Yes, I have virtual mixers with inverted flag.
It is used to create a switch which is connected by default and can be disconnected when user application needs it.
Actually hardware can't be disconnected by virtual switch.
So, connected was better for default value for virtual mixers in my experience.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
  2020-03-30  7:35 ` [PATCH 1/3] ASoC: dapm: connect virtual mux with default value 이경택
  2020-03-30 17:05   ` Mark Brown
  2020-03-31  5:42   ` 이경택
@ 2020-03-31  6:50   ` 이경택
  2 siblings, 0 replies; 8+ messages in thread
From: 이경택 @ 2020-03-31  6:50 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, lgirdwood, tiwai, hmseo, tkjung, pilsun.jang

Since a virtual mixer has no backing registers to decide which path to connect, it will try to match with initial value 0.
This is to ensure that the default mixer choice will be correctly powered up during initialization.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
---
 sound/soc/soc-dapm.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 9fb54e6fe254..fc55a0534252 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -802,7 +802,16 @@ static void dapm_set_mixer_path_status(struct snd_soc_dapm_path *p, int i,
 			val = max - val;
 		p->connect = !!val;
 	} else {
-		p->connect = 0;
+		/* since a virtual mixer has no backing registers to
+		 * decide which path to connect, it will try to match
+		 * with initial value 0.  This is to ensure
+		 * that the default mixer choice will be
+		 * correctly powered up during initialization.
+		 */
+		val = 0;
+		if (invert)
+			val = max - val;
+		p->connect = !!val;
 	}
 }
 
--
2.21.0




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
  2020-03-31  6:35       ` 이경택
@ 2020-03-31  7:10         ` Lars-Peter Clausen
  2020-03-31  7:31           ` 이경택
  0 siblings, 1 reply; 8+ messages in thread
From: Lars-Peter Clausen @ 2020-03-31  7:10 UTC (permalink / raw)
  To: 이경택, broonie
  Cc: alsa-devel, lgirdwood, tiwai, hmseo, tkjung, pilsun.jang

On 3/31/20 8:35 AM, 이경택 wrote:
> On 3/31/20 7:55 AM, Lars-Peter Clausen wrote:
>> On 3/31/20 7:42 AM, 이경택 wrote:
>>> Since a virtual mixer has no backing registers to decide which path to
>>> connect, it will try to match with initial value 0.
>>> This is to ensure that the default mixer choice will be correctly
>>> powered up during initialization.
>>>
>>> Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
>>> ---
>>>    sound/soc/soc-dapm.c | 11 ++++++++++-
>>>    1 file changed, 10 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index
>>> 9fb54e6fe254..fc55a0534252 100644
>>> --- a/sound/soc/soc-dapm.c
>>> +++ b/sound/soc/soc-dapm.c
>>> @@ -802,7 +802,16 @@ static void dapm_set_mixer_path_status(struct
>>> snd_soc_dapm_path *p, int i,
>>>    			val = max - val;
>>>    		p->connect = !!val;
>>>    	} else {
>>> -		p->connect = 0;
>>> +		/* since a virtual mixer has no backing registers to
>>> +		 * decide which path to connect, it will try to match
>>> +		 * with initial value 0.  This is to ensure
>>> +		 * that the default mixer choice will be
>>> +		 * correctly powered up during initialization.
>>> +		 */
>>> +		val = 0;
>>> +		if (invert)
>>> +			val = max - val;
>>> +		p->connect = !!val;
>> Do you have virtual mixers that have the inverted flag set and if yes why? Cause otherwise this is exactly the same as before.
> Yes, I have virtual mixers with inverted flag.
> It is used to create a switch which is connected by default and can be disconnected when user application needs it.
> Actually hardware can't be disconnected by virtual switch.
> So, connected was better for default value for virtual mixers in my experience.

It would be good to mention this in the commit message, that the purpose 
of the patch is to allow virtual mixers with a default state of on.

I think you can also simplify the expression to just `p->connect = invert;`


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/3] ASoC: dapm: connect virtual mux with default value
  2020-03-31  7:10         ` Lars-Peter Clausen
@ 2020-03-31  7:31           ` 이경택
  0 siblings, 0 replies; 8+ messages in thread
From: 이경택 @ 2020-03-31  7:31 UTC (permalink / raw)
  To: 'Lars-Peter Clausen', broonie
  Cc: alsa-devel, lgirdwood, tiwai, hmseo, tkjung, pilsun.jang

On 3/31/20 9:10 AM, Lars-Peter Clausen wrote:
>On 3/31/20 8:35 AM, 이경택 wrote:
>> On 3/31/20 7:55 AM, Lars-Peter Clausen wrote:
>>> On 3/31/20 7:42 AM, 이경택 wrote:
>>>> Since a virtual mixer has no backing registers to decide which path to
>>>> connect, it will try to match with initial value 0.
>>>> This is to ensure that the default mixer choice will be correctly
>>>> powered up during initialization.
>>>>
>>>> Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
>>>> ---
>>>>    sound/soc/soc-dapm.c | 11 ++++++++++-
>>>>    1 file changed, 10 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index
>>>> 9fb54e6fe254..fc55a0534252 100644
>>>> --- a/sound/soc/soc-dapm.c
>>>> +++ b/sound/soc/soc-dapm.c
>>>> @@ -802,7 +802,16 @@ static void dapm_set_mixer_path_status(struct
>>>> snd_soc_dapm_path *p, int i,
>>>>    			val = max - val;
>>>>    		p->connect = !!val;
>>>>    	} else {
>>>> -		p->connect = 0;
>>>> +		/* since a virtual mixer has no backing registers to
>>>> +		 * decide which path to connect, it will try to match
>>>> +		 * with initial value 0.  This is to ensure
>>>> +		 * that the default mixer choice will be
>>>> +		 * correctly powered up during initialization.
>>>> +		 */
>>>> +		val = 0;
>>>> +		if (invert)
>>>> +			val = max - val;
>>>> +		p->connect = !!val;
>>> Do you have virtual mixers that have the inverted flag set and if yes why? Cause otherwise this is exactly the same as before.
>> Yes, I have virtual mixers with inverted flag.
>> It is used to create a switch which is connected by default and can be disconnected when user application needs it.
>> Actually hardware can't be disconnected by virtual switch.
>> So, connected was better for default value for virtual mixers in my experience.
>
>It would be good to mention this in the commit message, that the purpose 
>of the patch is to allow virtual mixers with a default state of on.
>
>I think you can also simplify the expression to just `p->connect = invert;`
>
Ok. I'll resend this patch with the purpose in commit message, and simplified code.
Thank you for your quick response!



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-31  7:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200330073548epcas2p3045be9d3c8b76115c76ce27679840b6f@epcas2p3.samsung.com>
2020-03-30  7:35 ` [PATCH 1/3] ASoC: dapm: connect virtual mux with default value 이경택
2020-03-30 17:05   ` Mark Brown
2020-03-31  5:42   ` 이경택
2020-03-31  5:55     ` Lars-Peter Clausen
2020-03-31  6:35       ` 이경택
2020-03-31  7:10         ` Lars-Peter Clausen
2020-03-31  7:31           ` 이경택
2020-03-31  6:50   ` 이경택

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.