2019-01-18 23:48:46

by Dmitry Torokhov

[permalink] [raw]
Subject: [PATCH 1/7] Input: document meanings of KEY_SCREEN and KEY_ZOOM

It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB
folks have used them to indicate switch to full screen mode. Later, they
converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN
to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).

Let's commit to these uses, and define:

- KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
- KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)

Signed-off-by: Dmitry Torokhov <[email protected]>
---

Please let me know how we want merge this. Some of patches can be applied
independently and I tried marking them as such, but some require new key
names from input.h

include/uapi/linux/input-event-codes.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index ae366b87426a..bc5054e51bef 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -439,10 +439,12 @@
#define KEY_TITLE 0x171
#define KEY_SUBTITLE 0x172
#define KEY_ANGLE 0x173
-#define KEY_ZOOM 0x174
+#define KEY_FULL_SCREEN 0x174 /* AC View Toggle */
+#define KEY_ZOOM KEY_FULL_SCREEN
#define KEY_MODE 0x175
#define KEY_KEYBOARD 0x176
-#define KEY_SCREEN 0x177
+#define KEY_ASPECT_RATIO 0x177 /* HUTRR37: Aspect */
+#define KEY_SCREEN KEY_ASPECT_RATIO
#define KEY_PC 0x178 /* Media Select Computer */
#define KEY_TV 0x179 /* Media Select TV */
#define KEY_TV2 0x17a /* Media Select Cable */
--
2.20.1.321.g9e740568ce-goog



2019-01-18 23:32:21

by Dmitry Torokhov

[permalink] [raw]
Subject: [PATCH 3/7] HID: input: fix mapping of aspect ratio key

According to HUTRR37 usage 0x6d from the consumer usage page corresponds
to action that selects the next available supported aspect ratio option
on a device which outputs or displays video. However KEY_ZOOM means
activate "Full Screen" mode, KEY_ASPECT_RATIO should be used instead.

Signed-off-by: Dmitry Torokhov <[email protected]>
---
drivers/hid/hid-input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index d6fab5798487..def58c6aa835 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -891,7 +891,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x06a: map_key_clear(KEY_GREEN); break;
case 0x06b: map_key_clear(KEY_BLUE); break;
case 0x06c: map_key_clear(KEY_YELLOW); break;
- case 0x06d: map_key_clear(KEY_ZOOM); break;
+ case 0x06d: map_key_clear(KEY_ASPECT_RATIO); break;

case 0x06f: map_key_clear(KEY_BRIGHTNESSUP); break;
case 0x070: map_key_clear(KEY_BRIGHTNESSDOWN); break;
--
2.20.1.321.g9e740568ce-goog


2019-01-18 23:32:26

by Dmitry Torokhov

[permalink] [raw]
Subject: [PATCH 7/7] HID: input: add mapping for "Toggle Display" key

According to HUT 1.12 usage 0xb5 from the generic desktop page is reserved
for switching between external and internal display, so let's add the
mapping.

Signed-off-by: Dmitry Torokhov <[email protected]>
---

This can be applied independently.

drivers/hid/hid-input.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index ecb1b6f26853..da76358cde06 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -677,6 +677,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
break;
}

+ if ((usage->hid & 0xf0) == 0xb0) { /* SC - Display */
+ switch (usage->hid & 0xf) {
+ case 0x05: map_key_clear(KEY_SWITCHVIDEOMODE); break;
+ default: goto ignore;
+ }
+ break;
+ }
+
/*
* Some lazy vendors declare 255 usages for System Control,
* leading to the creation of ABS_X|Y axis and too many others.
--
2.20.1.321.g9e740568ce-goog


2019-01-18 23:32:29

by Dmitry Torokhov

[permalink] [raw]
Subject: [PATCH 5/7] HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys

According to HUTRR73 usages 0x79, 0x7a and 0x7c from the consumer page
correspond to Brightness Up/Down/Toggle keys, so let's add the mappings.

Signed-off-by: Dmitry Torokhov <[email protected]>
---

This can be applied independently.

drivers/hid/hid-input.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 5f800e7b04f2..cebe8a8cce2e 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -900,6 +900,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x074: map_key_clear(KEY_BRIGHTNESS_MAX); break;
case 0x075: map_key_clear(KEY_BRIGHTNESS_AUTO); break;

+ case 0x079: map_key_clear(KEY_KBDILLUMUP); break;
+ case 0x07a: map_key_clear(KEY_KBDILLUMDOWN); break;
+ case 0x07c: map_key_clear(KEY_KBDILLUMTOGGLE); break;
+
case 0x082: map_key_clear(KEY_VIDEO_NEXT); break;
case 0x083: map_key_clear(KEY_LAST); break;
case 0x084: map_key_clear(KEY_ENTER); break;
--
2.20.1.321.g9e740568ce-goog


2019-01-18 23:33:04

by Dmitry Torokhov

[permalink] [raw]
Subject: [PATCH 4/7] HID: input: add mapping for Expose/Overview key

According to HUTRR77 usage 0x29f from the consumer page is reserved for
the Desktop application to present all running user’s application windows.
Linux defines KEY_SCALE to request Compiz Scale (Expose) mode, so let's
add the mapping.

Signed-off-by: Dmitry Torokhov <[email protected]>
---

This can be applied independently.

drivers/hid/hid-input.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index def58c6aa835..5f800e7b04f2 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1030,6 +1030,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x2cb: map_key_clear(KEY_KBDINPUTASSIST_ACCEPT); break;
case 0x2cc: map_key_clear(KEY_KBDINPUTASSIST_CANCEL); break;

+ case 0x29f: map_key_clear(KEY_SCALE); break;
+
default: map_key_clear(KEY_UNKNOWN);
}
break;
--
2.20.1.321.g9e740568ce-goog


2019-01-18 23:33:23

by Dmitry Torokhov

[permalink] [raw]
Subject: [PATCH 6/7] HID: input: add mapping for "Full Screen" key

According to HUT 1.12 usage 0x232 from the consumer page is reserved for
switching application between full screen and windowed mode, so let's add
the mapping.

Signed-off-by: Dmitry Torokhov <[email protected]>
---

This needs the new key definition.

drivers/hid/hid-input.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index cebe8a8cce2e..ecb1b6f26853 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1014,6 +1014,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x22d: map_key_clear(KEY_ZOOMIN); break;
case 0x22e: map_key_clear(KEY_ZOOMOUT); break;
case 0x22f: map_key_clear(KEY_ZOOMRESET); break;
+ case 0x232: map_key_clear(KEY_FULL_SCREEN); break;
case 0x233: map_key_clear(KEY_SCROLLUP); break;
case 0x234: map_key_clear(KEY_SCROLLDOWN); break;
case 0x238: map_rel(REL_HWHEEL); break;
--
2.20.1.321.g9e740568ce-goog


2019-01-18 23:34:49

by Dmitry Torokhov

[permalink] [raw]
Subject: [PATCH 2/7] [media] doc-rst: switch to new names for Full Screen/Aspect keys

We defined better names for keys to activate full screen mode or
change aspect ratio (while keeping the existing keycodes to avoid
breaking userspace), so let's use them in the document.

Signed-off-by: Dmitry Torokhov <[email protected]>
---
Documentation/media/uapi/rc/rc-tables.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/media/uapi/rc/rc-tables.rst b/Documentation/media/uapi/rc/rc-tables.rst
index c8ae9479f842..57797e56f45e 100644
--- a/Documentation/media/uapi/rc/rc-tables.rst
+++ b/Documentation/media/uapi/rc/rc-tables.rst
@@ -616,7 +616,7 @@ the remote via /dev/input/event devices.

- .. row 78

- - ``KEY_SCREEN``
+ - ``KEY_ASPECT_RATIO``

- Select screen aspect ratio

@@ -624,7 +624,7 @@ the remote via /dev/input/event devices.

- .. row 79

- - ``KEY_ZOOM``
+ - ``KEY_FULL_SCREEN``

- Put device into zoom/full screen mode

--
2.20.1.321.g9e740568ce-goog


2019-01-21 10:13:00

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH 1/7] Input: document meanings of KEY_SCREEN and KEY_ZOOM

On Fri, 18 Jan 2019, Dmitry Torokhov wrote:

> It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB
> folks have used them to indicate switch to full screen mode. Later, they
> converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN
> to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).
>
> Let's commit to these uses, and define:
>
> - KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
> - KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)
>
> Signed-off-by: Dmitry Torokhov <[email protected]>
> ---
>
> Please let me know how we want merge this. Some of patches can be applied
> independently and I tried marking them as such, but some require new key
> names from input.h

Acked-by: Jiri Kosina <[email protected]>

for the HID changes, and feel free to take it through your tree as a
whole, I don't expect any major conflicts rising up from this.

Thanks,

--
Jiri Kosina
SUSE Labs


2019-01-21 10:59:46

by Benjamin Tissoires

[permalink] [raw]
Subject: Re: [PATCH 1/7] Input: document meanings of KEY_SCREEN and KEY_ZOOM

On Mon, Jan 21, 2019 at 11:11 AM Jiri Kosina <[email protected]> wrote:
>
> On Fri, 18 Jan 2019, Dmitry Torokhov wrote:
>
> > It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB
> > folks have used them to indicate switch to full screen mode. Later, they
> > converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN
> > to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).
> >
> > Let's commit to these uses, and define:
> >
> > - KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
> > - KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)
> >
> > Signed-off-by: Dmitry Torokhov <[email protected]>
> > ---
> >
> > Please let me know how we want merge this. Some of patches can be applied
> > independently and I tried marking them as such, but some require new key
> > names from input.h
>
> Acked-by: Jiri Kosina <[email protected]>

Acked-by: Benjamin Tissoires <[email protected]>

>
> for the HID changes, and feel free to take it through your tree as a
> whole, I don't expect any major conflicts rising up from this.

Works for me too. My tests showed no issues, so that's OK from me.

Cheers,
Benjamin

>
> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs
>

2019-01-23 22:08:09

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 1/7] Input: document meanings of KEY_SCREEN and KEY_ZOOM

On Mon, Jan 21, 2019 at 11:41:32AM +0100, Benjamin Tissoires wrote:
> On Mon, Jan 21, 2019 at 11:11 AM Jiri Kosina <[email protected]> wrote:
> >
> > On Fri, 18 Jan 2019, Dmitry Torokhov wrote:
> >
> > > It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB
> > > folks have used them to indicate switch to full screen mode. Later, they
> > > converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN
> > > to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).
> > >
> > > Let's commit to these uses, and define:
> > >
> > > - KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
> > > - KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)
> > >
> > > Signed-off-by: Dmitry Torokhov <[email protected]>
> > > ---
> > >
> > > Please let me know how we want merge this. Some of patches can be applied
> > > independently and I tried marking them as such, but some require new key
> > > names from input.h
> >
> > Acked-by: Jiri Kosina <[email protected]>
>
> Acked-by: Benjamin Tissoires <[email protected]>

Mauro, any objections on pushing the media doc patch through my tree?

Thanks.

--
Dmitry

2019-02-18 07:26:32

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [PATCH 2/7] [media] doc-rst: switch to new names for Full Screen/Aspect keys

On Fri, Jan 18, 2019 at 03:30:32PM -0800, Dmitry Torokhov wrote:
> We defined better names for keys to activate full screen mode or
> change aspect ratio (while keeping the existing keycodes to avoid
> breaking userspace), so let's use them in the document.
>
> Signed-off-by: Dmitry Torokhov <[email protected]>
> ---
> Documentation/media/uapi/rc/rc-tables.rst | 4 ++--

Mauro, do you want to take this through your tree or I should pick it up
with the patch that does renames in uapi header?

Thanks!

> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/media/uapi/rc/rc-tables.rst b/Documentation/media/uapi/rc/rc-tables.rst
> index c8ae9479f842..57797e56f45e 100644
> --- a/Documentation/media/uapi/rc/rc-tables.rst
> +++ b/Documentation/media/uapi/rc/rc-tables.rst
> @@ -616,7 +616,7 @@ the remote via /dev/input/event devices.
>
> - .. row 78
>
> - - ``KEY_SCREEN``
> + - ``KEY_ASPECT_RATIO``
>
> - Select screen aspect ratio
>
> @@ -624,7 +624,7 @@ the remote via /dev/input/event devices.
>
> - .. row 79
>
> - - ``KEY_ZOOM``
> + - ``KEY_FULL_SCREEN``
>
> - Put device into zoom/full screen mode
>
> --
> 2.20.1.321.g9e740568ce-goog
>

--
Dmitry

2019-03-21 12:24:45

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH 2/7] [media] doc-rst: switch to new names for Full Screen/Aspect keys

Em Sun, 17 Feb 2019 23:26:06 -0800
Dmitry Torokhov <[email protected]> escreveu:

> On Fri, Jan 18, 2019 at 03:30:32PM -0800, Dmitry Torokhov wrote:
> > We defined better names for keys to activate full screen mode or
> > change aspect ratio (while keeping the existing keycodes to avoid
> > breaking userspace), so let's use them in the document.
> >
> > Signed-off-by: Dmitry Torokhov <[email protected]>
> > ---
> > Documentation/media/uapi/rc/rc-tables.rst | 4 ++--
>
> Mauro, do you want to take this through your tree or I should pick it up
> with the patch that does renames in uapi header?

Feel free to apply it via your tree. It probably makes sense to keep it
with the series that add the new codes.

Acked-by: Mauro Carvalho Chehab <[email protected]>
>
> Thanks!
>
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/media/uapi/rc/rc-tables.rst b/Documentation/media/uapi/rc/rc-tables.rst
> > index c8ae9479f842..57797e56f45e 100644
> > --- a/Documentation/media/uapi/rc/rc-tables.rst
> > +++ b/Documentation/media/uapi/rc/rc-tables.rst
> > @@ -616,7 +616,7 @@ the remote via /dev/input/event devices.
> >
> > - .. row 78
> >
> > - - ``KEY_SCREEN``
> > + - ``KEY_ASPECT_RATIO``
> >
> > - Select screen aspect ratio
> >
> > @@ -624,7 +624,7 @@ the remote via /dev/input/event devices.
> >
> > - .. row 79
> >
> > - - ``KEY_ZOOM``
> > + - ``KEY_FULL_SCREEN``
> >
> > - Put device into zoom/full screen mode
> >
> > --
> > 2.20.1.321.g9e740568ce-goog
> >
>



Thanks,
Mauro

2019-03-21 12:24:58

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH 1/7] Input: document meanings of KEY_SCREEN and KEY_ZOOM

Em Fri, 18 Jan 2019 15:30:31 -0800
Dmitry Torokhov <[email protected]> escreveu:

> It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB
> folks have used them to indicate switch to full screen mode. Later, they
> converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN
> to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).
>
> Let's commit to these uses, and define:
>
> - KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
> - KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)
>
> Signed-off-by: Dmitry Torokhov <[email protected]>

Feel free to apply via your tree.

Acked-by: Mauro Carvalho Chehab <[email protected]>

> ---
>
> Please let me know how we want merge this. Some of patches can be applied
> independently and I tried marking them as such, but some require new key
> names from input.h
>
> include/uapi/linux/input-event-codes.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> index ae366b87426a..bc5054e51bef 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -439,10 +439,12 @@
> #define KEY_TITLE 0x171
> #define KEY_SUBTITLE 0x172
> #define KEY_ANGLE 0x173
> -#define KEY_ZOOM 0x174
> +#define KEY_FULL_SCREEN 0x174 /* AC View Toggle */
> +#define KEY_ZOOM KEY_FULL_SCREEN
> #define KEY_MODE 0x175
> #define KEY_KEYBOARD 0x176
> -#define KEY_SCREEN 0x177
> +#define KEY_ASPECT_RATIO 0x177 /* HUTRR37: Aspect */
> +#define KEY_SCREEN KEY_ASPECT_RATIO
> #define KEY_PC 0x178 /* Media Select Computer */
> #define KEY_TV 0x179 /* Media Select TV */
> #define KEY_TV2 0x17a /* Media Select Cable */



Thanks,
Mauro