From patchwork Wed Jul 29 22:57:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frans Pop X-Patchwork-Id: 38249 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6TMvq0E017959 for ; Wed, 29 Jul 2009 22:57:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753259AbZG2W5u (ORCPT ); Wed, 29 Jul 2009 18:57:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754918AbZG2W5u (ORCPT ); Wed, 29 Jul 2009 18:57:50 -0400 Received: from Cpsmtpm-eml106.kpnxchange.com ([195.121.3.10]:60242 "EHLO CPSMTPM-EML106.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753038AbZG2W5u (ORCPT ); Wed, 29 Jul 2009 18:57:50 -0400 Received: from aragorn.fjphome.nl ([84.85.147.182]) by CPSMTPM-EML106.kpnxchange.com with Microsoft SMTPSVC(7.0.6001.18000); Thu, 30 Jul 2009 00:57:49 +0200 From: Frans Pop To: cedric@belbone.be, linux-kernel@vger.kernel.org Subject: Re: [Bug 13865] Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted Date: Thu, 30 Jul 2009 00:57:47 +0200 User-Agent: KMail/1.9.9 Cc: bugzilla-daemon@bugzilla.kernel.org, ACPI Devel Maling List , pm list , Matthew Garrett References: <200907292257.41573.rjw@sisk.pl> <200907292331.34214.elendil@planet.nl> In-Reply-To: <200907292331.34214.elendil@planet.nl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907300057.48669.elendil@planet.nl> X-OriginalArrivalTime: 29 Jul 2009 22:57:49.0556 (UTC) FILETIME=[FEE22B40:01CA109F] Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Wednesday 29 July 2009, Frans Pop wrote: > The strange thing is that the resume function does not do anything > that's not also done in hp_wmi_input_setup(). The only thing I can > think of is that we might need to test for > wmi_has_guid(HPWMI_EVENT_GUID) because that model simply does not > support input events. If that is the problem, the following patch will hopefully fix it. This patch is against .31-rc4 but will need only minor changes to apply against .30. Subject: hp-wmi: check that an input device exists in resume handler Some systems may not support input events, or registering the input handler may have failed. So check that an input device exists before trying to set the docking and tablet mode state during resume. Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=13865 Reported-by: cedric@belbone.be Signed-off-by: Frans Pop Cc: Matthew Garrett --- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 369bd43..63c9214 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -540,11 +540,13 @@ static int hp_wmi_resume_handler(struct device *device) * the input layer will only actually pass it on if the state * changed. */ - - input_report_switch(hp_wmi_input_dev, SW_DOCK, hp_wmi_dock_state()); - input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, - hp_wmi_tablet_state()); - input_sync(hp_wmi_input_dev); + if (hp_wmi_input_dev) { + input_report_switch(hp_wmi_input_dev, SW_DOCK, + hp_wmi_dock_state()); + input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, + hp_wmi_tablet_state()); + input_sync(hp_wmi_input_dev); + } if (wifi_rfkill) rfkill_set_states(wifi_rfkill,