diff mbox series

support for ASUS ROG G14 (G401I) series asus-wmi.c/asus-nb-wmi.c

Message ID 4033154a9e166a37acb5c0491fa0b85f8b0fc032.camel@retarded.farm (mailing list archive)
State Not Applicable, archived
Headers show
Series support for ASUS ROG G14 (G401I) series asus-wmi.c/asus-nb-wmi.c | expand

Commit Message

Armas Spann June 17, 2020, 11:52 a.m. UTC
Support for the currently unsupported ASUS G14 Notebooks (GA401I series) to the asus(-nb)-wmi.c sources.
First change is the on the input buffer, the new devices are sending 5 DWORD instead of 3 as it was definded before. (might be already submitted upstream)

The second part of the patch adds the correct device dmi identificator.

Comments

Andy Shevchenko July 9, 2020, 7:18 p.m. UTC | #1
On Wed, Jun 17, 2020 at 3:02 PM Armas Spann <zappel@retarded.farm> wrote:
>
> Support for the currently unsupported ASUS G14 Notebooks (GA401I series) to the asus(-nb)-wmi.c sources.
> First change is the on the input buffer, the new devices are sending 5 DWORD instead of 3 as it was definded before. (might be already submitted upstream)
>
> The second part of the patch adds the correct device dmi identificator.

I can't take patch w/o Signed-off-by. See [1] for the details.

On top of that it doesn't apply. And it clashes with already applied
7b91f1565fbf ("platform/x86: asus_wmi: Reserve more space for struct bias_args")


>
>
>
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -116,6 +116,8 @@
>         u32 arg0;
>         u32 arg1;
>         u32 arg2; /* At least TUF Gaming series uses 3 dword input buffer. */
> +        u32 arg3; /* At least ROG Zephyrus G14 series uses 5 dword input buffer */
> +        u32 arg4;
>  } __packed;
>
>  /*
> --- a/drivers/platform/x86/asus-nb-wmi.c
> +++ b/drivers/platform/x86/asus-nb-wmi.c
> @@ -110,6 +110,12 @@
>         .wmi_force_als_set = true,
>  };
>
> +static struct quirk_entry quirk_asus_ga401i = {
> +       .wapf = 4, // not sure if that is correct
> +       .wmi_backlight_power = true,
> +       .wmi_backlight_set_devstate = true,
> +};
> +
>  static int dmi_matched(const struct dmi_system_id *dmi)
>  {
>         pr_info("Identified laptop model '%s'\n", dmi->ident);
> @@ -411,7 +417,25 @@
>                 },
>                 .driver_data = &quirk_asus_forceals,
>         },
> -       {},
> +       {
> +               .callback = dmi_matched,
> +               .ident = "ASUSTeK COMPUTER INC. GA401IV",
> +               .matches = {
> +                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +                       DMI_MATCH(DMI_PRODUCT_NAME, "GA401IV"),
> +               },
> +               .driver_data = &quirk_asus_ga401i,
> +       },
> +       {
> +               .callback = dmi_matched,
> +               .ident = "ASUSTeK COMPUTER INC. GA401IU",
> +               .matches = {
> +                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
> +                       DMI_MATCH(DMI_PRODUCT_NAME, "GA401IU"),
> +               },
> +               .driver_data = &quirk_asus_ga401i,
> +       },
> +       {},
>  };
>
>  static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
>
Andy Shevchenko July 9, 2020, 7:19 p.m. UTC | #2
On Thu, Jul 9, 2020 at 10:18 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Wed, Jun 17, 2020 at 3:02 PM Armas Spann <zappel@retarded.farm> wrote:
> >
> > Support for the currently unsupported ASUS G14 Notebooks (GA401I series) to the asus(-nb)-wmi.c sources.
> > First change is the on the input buffer, the new devices are sending 5 DWORD instead of 3 as it was definded before. (might be already submitted upstream)
> >
> > The second part of the patch adds the correct device dmi identificator.
>
> I can't take patch w/o Signed-off-by. See [1] for the details.
>
> On top of that it doesn't apply. And it clashes with already applied
> 7b91f1565fbf ("platform/x86: asus_wmi: Reserve more space for struct bias_args")

[1]: https://www.kernel.org/doc/html/latest/process/submitting-patches.html
Armas Spann July 10, 2020, 6:24 p.m. UTC | #3
Am Donnerstag, den 09.07.2020, 22:19 +0300 schrieb Andy Shevchenko:
> On Thu, Jul 9, 2020 at 10:18 PM Andy Shevchenko
> <
> andy.shevchenko@gmail.com
> > wrote:
> > On Wed, Jun 17, 2020 at 3:02 PM Armas Spann <
> > zappel@retarded.farm
> > > wrote:
> > > Support for the currently unsupported ASUS G14 Notebooks (GA401I series)
> > > to the asus(-nb)-wmi.c sources.
> > > First change is the on the input buffer, the new devices are sending 5
> > > DWORD instead of 3 as it was definded before. (might be already submitted
> > > upstream)
> > > 
> > > The second part of the patch adds the correct device dmi identificator.
> > 
> > I can't take patch w/o Signed-off-by. See [1] for the details.
> > 
> > On top of that it doesn't apply. And it clashes with already applied
> > 7b91f1565fbf ("platform/x86: asus_wmi: Reserve more space for struct
> > bias_args")
> 
> [1]: 
> https://www.kernel.org/doc/html/latest/process/submitting-patches.html
> 
> 
> 
> 
Many thanks for your feedback. 
I must excuse myself for not beeing guideline conform.

Now, I removed the already fixed input_buffer and added the ASUS Zephyrus ROG
G502I Series as well.

Corrected patch:


--- linux/drivers/platform/x86/asus-nb-wmi.c.orig	2020-07-10
19:31:02.288784987 +0200
+++ linux/drivers/platform/x86/asus-nb-wmi.c	2020-07-10 19:59:04.515645657
+0200
@@ -110,6 +110,16 @@ static struct quirk_entry quirk_asus_for
 	.wmi_force_als_set = true,
 };
 
+static struct quirk_entry quirk_asus_ga401i = {
+	.wmi_backlight_power = true,
+	.wmi_backlight_set_devstate = true,
+};
+
+static struct quirk_entry quirk_asus_ga502i = {
+	.wmi_backlight_power = true,
+	.wmi_backlight_set_devstate = true,
+};
+
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
 	pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -411,6 +421,78 @@ static const struct dmi_system_id asus_q
 		},
 		.driver_data = &quirk_asus_forceals,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. GA401IH",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "GA401IH"),
+		},
+		.driver_data = &quirk_asus_ga401i,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. GA401II",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "GA401II"),
+		},
+	   .driver_data = &quirk_asus_ga401i,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. GA401IU",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "GA401IU"),
+		},
+		.driver_data = &quirk_asus_ga401i,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. GA401IV",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "GA401IV"),
+		},
+		.driver_data = &quirk_asus_ga401i,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. GA401IVC",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "GA401IVC"),
+		},
+		.driver_data = &quirk_asus_ga401i,
+	},
+		{
+		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. GA502II",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "GA502II"),
+		},
+	   .driver_data = &quirk_asus_ga502i,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. GA502IU",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "GA502IU"),
+		},
+		.driver_data = &quirk_asus_ga502i,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "ASUSTeK COMPUTER INC. GA502IV",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "GA502IV"),
+		},
+		.driver_data = &quirk_asus_ga502i,
+	},
 	{},
 };
 

--
Signed-off-by: Armas Spann <zappel@retarded.farm>
Andy Shevchenko July 10, 2020, 8:46 p.m. UTC | #4
On Fri, Jul 10, 2020 at 9:24 PM Armas Spann <zappel@retarded.farm> wrote:
>
> Am Donnerstag, den 09.07.2020, 22:19 +0300 schrieb Andy Shevchenko:
> > On Thu, Jul 9, 2020 at 10:18 PM Andy Shevchenko
> > <
> > andy.shevchenko@gmail.com
> > > wrote:
> > > On Wed, Jun 17, 2020 at 3:02 PM Armas Spann <
> > > zappel@retarded.farm
> > > > wrote:
> > > > Support for the currently unsupported ASUS G14 Notebooks (GA401I series)
> > > > to the asus(-nb)-wmi.c sources.
> > > > First change is the on the input buffer, the new devices are sending 5
> > > > DWORD instead of 3 as it was definded before. (might be already submitted
> > > > upstream)
> > > >
> > > > The second part of the patch adds the correct device dmi identificator.
> > >
> > > I can't take patch w/o Signed-off-by. See [1] for the details.
> > >
> > > On top of that it doesn't apply. And it clashes with already applied
> > > 7b91f1565fbf ("platform/x86: asus_wmi: Reserve more space for struct
> > > bias_args")
> >
> > [1]:
> > https://www.kernel.org/doc/html/latest/process/submitting-patches.html
> >
> >
> >
> >
> Many thanks for your feedback.
> I must excuse myself for not beeing guideline conform.
>
> Now, I removed the already fixed input_buffer and added the ASUS Zephyrus ROG
> G502I Series as well.
>
> Corrected patch:

Good. Now you need to do it so:
- it has proper and clear commit message (and being committed locally)
- you commit change with `git commit -a -s` which adds correctly the
Signed-off-by tag
- with help of `git format-patch -v<N> -1 HEAD~0` you create a file
with patch, where `<N>` corresponds to the version of it, now I guess
it's something like 3 or 4
- you open that file in editor and add a changelog after cutter '---'
line, save it
- with help of `git send-email 0001-*` you can send that patch to the
mailing lists (don't forget to Cc maintainers as well)
Armas Spann July 10, 2020, 9:45 p.m. UTC | #5
Am Freitag, den 10.07.2020, 23:46 +0300 schrieb Andy Shevchenko:
> On Fri, Jul 10, 2020 at 9:24 PM Armas Spann <
> zappel@retarded.farm
> > wrote:
> > Am Donnerstag, den 09.07.2020, 22:19 +0300 schrieb Andy Shevchenko:
> > > On Thu, Jul 9, 2020 at 10:18 PM Andy Shevchenko
> > > <
> > > andy.shevchenko@gmail.com
> > > 
> > > > wrote:
> > > > On Wed, Jun 17, 2020 at 3:02 PM Armas Spann <
> > > > zappel@retarded.farm
> > > > 
> > > > > wrote:
> > > > > Support for the currently unsupported ASUS G14 Notebooks (GA401I
> > > > > series)
> > > > > to the asus(-nb)-wmi.c sources.
> > > > > First change is the on the input buffer, the new devices are sending 5
> > > > > DWORD instead of 3 as it was definded before. (might be already
> > > > > submitted
> > > > > upstream)
> > > > > 
> > > > > The second part of the patch adds the correct device dmi
> > > > > identificator.
> > > > 
> > > > I can't take patch w/o Signed-off-by. See [1] for the details.
> > > > 
> > > > On top of that it doesn't apply. And it clashes with already applied
> > > > 7b91f1565fbf ("platform/x86: asus_wmi: Reserve more space for struct
> > > > bias_args")
> > > 
> > > [1]:
> > > https://www.kernel.org/doc/html/latest/process/submitting-patches.html
> > > 
> > > 
> > > 
> > > 
> > > 
> > 
> > Many thanks for your feedback.
> > I must excuse myself for not beeing guideline conform.
> > 
> > Now, I removed the already fixed input_buffer and added the ASUS Zephyrus
> > ROG
> > G502I Series as well.
> > 
> > Corrected patch:
> 
> Good. Now you need to do it so:
> - it has proper and clear commit message (and being committed locally)
> - you commit change with `git commit -a -s` which adds correctly the
> Signed-off-by tag
> - with help of `git format-patch -v<N> -1 HEAD~0` you create a file
> with patch, where `<N>` corresponds to the version of it, now I guess
> it's something like 3 or 4
> - you open that file in editor and add a changelog after cutter '---'
> line, save it
> - with help of `git send-email 0001-*` you can send that patch to the
> mailing lists (don't forget to Cc maintainers as well)
> 
> 

Many thanks for this brief explanation. I hope that I did it now correct, so I'm
not wasting more of your time. (the email was just sent via git)


Best Regards,Armas Spann
diff mbox series

Patch

--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -116,6 +116,8 @@ 
 	u32 arg0;
 	u32 arg1;
 	u32 arg2; /* At least TUF Gaming series uses 3 dword input buffer. */
+        u32 arg3; /* At least ROG Zephyrus G14 series uses 5 dword input buffer */
+        u32 arg4;
 } __packed;
 
 /*
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -110,6 +110,12 @@ 
 	.wmi_force_als_set = true,
 };
 
+static struct quirk_entry quirk_asus_ga401i = {
+       .wapf = 4, // not sure if that is correct
+       .wmi_backlight_power = true,
+       .wmi_backlight_set_devstate = true,
+};
+
 static int dmi_matched(const struct dmi_system_id *dmi)
 {
 	pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -411,7 +417,25 @@ 
 		},
 		.driver_data = &quirk_asus_forceals,
 	},
-	{},
+	{
+               .callback = dmi_matched,
+               .ident = "ASUSTeK COMPUTER INC. GA401IV",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "GA401IV"),
+               },
+               .driver_data = &quirk_asus_ga401i,
+       },
+       {
+               .callback = dmi_matched,
+               .ident = "ASUSTeK COMPUTER INC. GA401IU",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "GA401IU"),
+               },
+               .driver_data = &quirk_asus_ga401i,
+       },
+       {},
 };
 
 static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)