diff mbox series

[02/11] ucm: docs: Add JackType value

Message ID 20191107015808.26844-2-cujomalainey@chromium.org (mailing list archive)
State New, archived
Headers show
Series [01/11] ucm: docs: Add JackName value | expand

Commit Message

Curtis Malainey Nov. 7, 2019, 1:57 a.m. UTC
Identifies the type of jack and how it should be accessed

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
---
 include/use-case.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jaroslav Kysela Nov. 11, 2019, 1:39 p.m. UTC | #1
Dne 07. 11. 19 v 2:57 Curtis Malainey napsal(a):
> Identifies the type of jack and how it should be accessed
> 
> Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
> ---
>   include/use-case.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/include/use-case.h b/include/use-case.h
> index 2051bd40..3208cc30 100644
> --- a/include/use-case.h
> +++ b/include/use-case.h
> @@ -322,6 +322,9 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
>    *        configuration that doesn't belong to UCM configuration files.
>    *   - JackName
>    *      - Input name is the input device name for the jack
> + *   - JackType
> + *      - Specifies whether the jack is accessed via hctl or gpio and therefore
> + *        only carries the possible values of "gpio" or "hctl"
>    */
>   int snd_use_case_get(snd_use_case_mgr_t *uc_mgr,
>                        const char *identifier,
> 

What is meant with the "gpio" type? The standard input device interface? I 
believe it should be "inputdev" and "ctl" (hctl is just interface on top of 
ctl and the application can access the jack through snd_ctl functions, too.

					Jaroslav
Jaroslav Kysela Nov. 29, 2019, 4:01 p.m. UTC | #2
Dne 11. 11. 19 v 14:39 Jaroslav Kysela napsal(a):
> Dne 07. 11. 19 v 2:57 Curtis Malainey napsal(a):
>> Identifies the type of jack and how it should be accessed
>>
>> Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
>> ---
>>    include/use-case.h | 3 +++
>>    1 file changed, 3 insertions(+)
>>
>> diff --git a/include/use-case.h b/include/use-case.h
>> index 2051bd40..3208cc30 100644
>> --- a/include/use-case.h
>> +++ b/include/use-case.h
>> @@ -322,6 +322,9 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
>>     *        configuration that doesn't belong to UCM configuration files.
>>     *   - JackName
>>     *      - Input name is the input device name for the jack
>> + *   - JackType
>> + *      - Specifies whether the jack is accessed via hctl or gpio and therefore
>> + *        only carries the possible values of "gpio" or "hctl"
>>     */
>>    int snd_use_case_get(snd_use_case_mgr_t *uc_mgr,
>>                         const char *identifier,
>>
> 
> What is meant with the "gpio" type? The standard input device interface? I
> believe it should be "inputdev" and "ctl" (hctl is just interface on top of
> ctl and the application can access the jack through snd_ctl functions, too.

I see (when I was cleaning this extra Chrome stuff in the ucm profiles) that 
it's related to the gpio (general purpose i/o pin interface) in the linux 
kernel. The JackSwitch is probably also related and defines the pin number 
where the application should watch for the jack state. In this case, it would 
be probably more nice to follow the JackControl and JackDev and define the pin 
number through JackGPIO or something like that. We will cover all three 
posibilities: ALSA control interface, Input interface, GPIO interface .

					Jaroslav
Curtis Malainey Dec. 3, 2019, 3:22 a.m. UTC | #3
On Fri, Nov 29, 2019 at 8:01 AM Jaroslav Kysela <perex@perex.cz> wrote:
>
> Dne 11. 11. 19 v 14:39 Jaroslav Kysela napsal(a):
> > Dne 07. 11. 19 v 2:57 Curtis Malainey napsal(a):
> >> Identifies the type of jack and how it should be accessed
> >>
> >> Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
> >> ---
> >>    include/use-case.h | 3 +++
> >>    1 file changed, 3 insertions(+)
> >>
> >> diff --git a/include/use-case.h b/include/use-case.h
> >> index 2051bd40..3208cc30 100644
> >> --- a/include/use-case.h
> >> +++ b/include/use-case.h
> >> @@ -322,6 +322,9 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
> >>     *        configuration that doesn't belong to UCM configuration files.
> >>     *   - JackName
> >>     *      - Input name is the input device name for the jack
> >> + *   - JackType
> >> + *      - Specifies whether the jack is accessed via hctl or gpio and therefore
> >> + *        only carries the possible values of "gpio" or "hctl"
> >>     */
> >>    int snd_use_case_get(snd_use_case_mgr_t *uc_mgr,
> >>                         const char *identifier,
> >>
> >
> > What is meant with the "gpio" type? The standard input device interface? I
> > believe it should be "inputdev" and "ctl" (hctl is just interface on top of
> > ctl and the application can access the jack through snd_ctl functions, too.
>
> I see (when I was cleaning this extra Chrome stuff in the ucm profiles) that
> it's related to the gpio (general purpose i/o pin interface) in the linux
> kernel. The JackSwitch is probably also related and defines the pin number
> where the application should watch for the jack state. In this case, it would
> be probably more nice to follow the JackControl and JackDev and define the pin
> number through JackGPIO or something like that. We will cover all three
> posibilities: ALSA control interface, Input interface, GPIO interface .
>
>                                         Jaroslav
Initially that was our thoughts too but then we realized that in the
event of a new theoretical input subsystem "foo" that can be used for
jack detect then we would need to create another field for that as
well. This reduces the need for having a field for every theoretical
subsystem in the future and only then requires a new value.
>
> --
> Jaroslav Kysela <perex@perex.cz>
> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
Jaroslav Kysela Dec. 3, 2019, 8:39 a.m. UTC | #4
Dne 03. 12. 19 v 4:22 Curtis Malainey napsal(a):
> On Fri, Nov 29, 2019 at 8:01 AM Jaroslav Kysela <perex@perex.cz> wrote:
>>
>> Dne 11. 11. 19 v 14:39 Jaroslav Kysela napsal(a):
>>> Dne 07. 11. 19 v 2:57 Curtis Malainey napsal(a):
>>>> Identifies the type of jack and how it should be accessed
>>>>
>>>> Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
>>>> ---
>>>>     include/use-case.h | 3 +++
>>>>     1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/include/use-case.h b/include/use-case.h
>>>> index 2051bd40..3208cc30 100644
>>>> --- a/include/use-case.h
>>>> +++ b/include/use-case.h
>>>> @@ -322,6 +322,9 @@ int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
>>>>      *        configuration that doesn't belong to UCM configuration files.
>>>>      *   - JackName
>>>>      *      - Input name is the input device name for the jack
>>>> + *   - JackType
>>>> + *      - Specifies whether the jack is accessed via hctl or gpio and therefore
>>>> + *        only carries the possible values of "gpio" or "hctl"
>>>>      */
>>>>     int snd_use_case_get(snd_use_case_mgr_t *uc_mgr,
>>>>                          const char *identifier,
>>>>
>>>
>>> What is meant with the "gpio" type? The standard input device interface? I
>>> believe it should be "inputdev" and "ctl" (hctl is just interface on top of
>>> ctl and the application can access the jack through snd_ctl functions, too.
>>
>> I see (when I was cleaning this extra Chrome stuff in the ucm profiles) that
>> it's related to the gpio (general purpose i/o pin interface) in the linux
>> kernel. The JackSwitch is probably also related and defines the pin number
>> where the application should watch for the jack state. In this case, it would
>> be probably more nice to follow the JackControl and JackDev and define the pin
>> number through JackGPIO or something like that. We will cover all three
>> posibilities: ALSA control interface, Input interface, GPIO interface .
>>
>>                                          Jaroslav
> Initially that was our thoughts too but then we realized that in the
> event of a new theoretical input subsystem "foo" that can be used for
> jack detect then we would need to create another field for that as
> well. This reduces the need for having a field for every theoretical
> subsystem in the future and only then requires a new value.

The JackDev and JackControl was defined in 2015. If we decide to switch to:

JackType "(gpio|ctl|inputdev)"
JackSwitch "(gpio pin|ctl jack control name|input device name)"

.. then we need to adapt pulseaudio, too.

Anyway, JackDev/JackControl allows to use both definitions simultaneously, 
thus the application can choose the interface as preferred (and available).

The gpio looks like a hack for drivers which does not have this abstraction 
(input device or ALSA's jack) implemented. The gpio pin value can be passed 
using the device tree to the driver.

					Jaroslav
diff mbox series

Patch

diff --git a/include/use-case.h b/include/use-case.h
index 2051bd40..3208cc30 100644
--- a/include/use-case.h
+++ b/include/use-case.h
@@ -322,6 +322,9 @@  int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr,
  *        configuration that doesn't belong to UCM configuration files.
  *   - JackName
  *      - Input name is the input device name for the jack
+ *   - JackType
+ *      - Specifies whether the jack is accessed via hctl or gpio and therefore
+ *        only carries the possible values of "gpio" or "hctl"
  */
 int snd_use_case_get(snd_use_case_mgr_t *uc_mgr,
                      const char *identifier,