linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Martin <consume.noise@gmail.com>
To: Lyude <lyude@redhat.com>
Cc: ibm-acpi-devel@lists.sourceforge.net,
	Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>,
	Darren Hart <dvhart@infradead.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] thinkpad_acpi: Move tablet detection into separate function
Date: Wed, 9 Nov 2016 12:10:20 +0100	[thread overview]
Message-ID: <CADscph3VdmG4UQF+6=2jDR3DtStR+f=zsaOURSXH_U4RMp0ntQ@mail.gmail.com> (raw)
In-Reply-To: <1478538633-11450-1-git-send-email-lyude@redhat.com>

Sorry, I didn't had the time to look at the patches earlier.

Now, I did and was wondering why hotkey_tablet_mode doesn't show up in
sysfs anymore ...

On 7 November 2016 at 18:10, Lyude <lyude@redhat.com> wrote:
> @@ -3464,17 +3495,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
>                 res = add_to_attr_set(hotkey_dev_attributes,
>                                 &dev_attr_hotkey_radio_sw.attr);
>
> -       /* For X41t, X60t, X61t Tablets... */
> -       if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
> -               tp_features.hotkey_tablet = 1;
> -               tabletsw_state = !!(status & TP_HOTKEY_TABLET_MASK);
> -               pr_info("possible tablet mode switch found; "
> -                       "ThinkPad in %s mode\n",
> -                       (tabletsw_state) ? "tablet" : "laptop");
> -               res = add_to_attr_set(hotkey_dev_attributes,
> -                               &dev_attr_hotkey_tablet_mode.attr);
> -       }
> -
>         if (!res)
>                 res = register_attr_set_with_sysfs(
>                                 hotkey_dev_attributes,
> @@ -3482,6 +3502,12 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
>         if (res)
>                 goto err_exit;
>
> +       res = hotkey_init_tablet_mode();
> +       if (res < 0)
> +               goto err_exit;
> +
> +       tabletsw_state = res;
> +
>         /* Set up key map */
>         hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE,
>                                         GFP_KERNEL);
> --
> 2.7.4
>

This block has to be before register_attr_set_with_sysfs().

With that fixed and a small patch (will be sent soon) on top it works
on my Yoga 260, so:
Tested-by: Daniel Martin <consume.noise@gmail.com>

      parent reply	other threads:[~2016-11-09 11:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 17:10 [PATCH v3 1/3] thinkpad_acpi: Move tablet detection into separate function Lyude
2016-11-07 17:10 ` [PATCH 2/3] thinkpad_acpi: Don't repeat ourselves in hotkey_init_tablet_mode() Lyude
2016-11-08 11:08   ` Henrique de Moraes Holschuh
2016-11-07 17:10 ` [PATCH v4 3/3] thinkpad_acpi: Add support for X1 Yoga (2016) Tablet Mode Lyude
2016-11-08 11:01   ` Henrique de Moraes Holschuh
2016-11-08 10:50 ` [PATCH v3 1/3] thinkpad_acpi: Move tablet detection into separate function Henrique de Moraes Holschuh
2016-11-09 11:10 ` Daniel Martin [this message]

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='CADscph3VdmG4UQF+6=2jDR3DtStR+f=zsaOURSXH_U4RMp0ntQ@mail.gmail.com' \
    --to=consume.noise@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=ibm-acpi@hmh.eng.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).