From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934088AbcKILK3 (ORCPT ); Wed, 9 Nov 2016 06:10:29 -0500 Received: from mail-ua0-f193.google.com ([209.85.217.193]:34687 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933204AbcKILKW (ORCPT ); Wed, 9 Nov 2016 06:10:22 -0500 MIME-Version: 1.0 In-Reply-To: <1478538633-11450-1-git-send-email-lyude@redhat.com> References: <1478538633-11450-1-git-send-email-lyude@redhat.com> From: Daniel Martin Date: Wed, 9 Nov 2016 12:10:20 +0100 Message-ID: Subject: Re: [PATCH v3 1/3] thinkpad_acpi: Move tablet detection into separate function To: Lyude Cc: ibm-acpi-devel@lists.sourceforge.net, Henrique de Moraes Holschuh , Darren Hart , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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