From patchwork Wed Jun 5 17:17:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuduo Sang X-Patchwork-Id: 249151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 56FB72C02A3 for ; Thu, 6 Jun 2013 03:18:03 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UkHLK-0003O2-Qk; Wed, 05 Jun 2013 17:17:50 +0000 Received: from mail-pb0-f50.google.com ([209.85.160.50]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UkHLF-0003Nv-An for kernel-team@lists.ubuntu.com; Wed, 05 Jun 2013 17:17:45 +0000 Received: by mail-pb0-f50.google.com with SMTP id wy17so2075916pbc.9 for ; Wed, 05 Jun 2013 10:17:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=rkFTNhXT6dlPr443KeU0MC4FJqHm54L+6VcCddjvtFk=; b=c1XLmS4kp33c8Co7InQYJv0DbhdupK7jPdl+Zi7/kKhnXXt5hUrmppmSki2AVLlf7n uGmEkODOWg3yxEOojhun8hqGlY1oMAUhhKUcMmtP/Kvdes/7wtDPvW2dCpGzciRTzSre WEUNDQHIeUpOoYd+ASBpSITmo1hOTRG7E44ba6AE9oW64oxXvwqqrnq2xCJLc+9P+YRc oYIIDUfELVz4Q8ZaQKaBVfxQ71u7fDGBTAJazCDLfyMn/97yO7EhkcFeKvTHjEJS9FgZ 9MJSo5FwxX5YxzRCH9h3MTYap93e05wI+ZKIWt7HnpwbvqE8KG+BVhrxEKwhh6jd0rQS PCtw== X-Received: by 10.66.254.131 with SMTP id ai3mr34851920pad.54.1370452664370; Wed, 05 Jun 2013 10:17:44 -0700 (PDT) Received: from [192.168.0.107] ([123.122.92.92]) by mx.google.com with ESMTPSA id rn7sm68920618pbc.12.2013.06.05.10.17.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Jun 2013 10:17:43 -0700 (PDT) Message-ID: <51AF72B4.8070105@canonical.com> Date: Thu, 06 Jun 2013 01:17:40 +0800 From: Shuduo Sang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: kernel-team@lists.ubuntu.com Subject: [Quantal][SRU] thinkpad-acpi: recognize latest V-Series using, DMI_BIOS_VENDOR X-Gm-Message-State: ALoCoQk2fJ262MlwMQEvjbKciGq9N4uvLFH26RKKBezBHItRVgfOzQNgTvjrFXBEBfNpFbp0t96F X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This patch was submitted to upstream in Aug 2012 by Monoj Iyer and merged into v3.6-rc3. Pls backport to Quantal 3.5 kernel. This patch fixes the issue thinkpad-acpi module not be loaded on some Lenovo laptops for example Zhaoyang series. Thanks, Shuduo From a4f46bb9fa84642e356898ee44b670989622f8bb Mon Sep 17 00:00:00 2001 From: Manoj Iyer Date: Mon, 6 Aug 2012 18:15:37 -0500 Subject: [PATCH] thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR In the latest V-series bios DMI_PRODUCT_VERSION does not contain the string Lenovo or Thinkpad, but is set to the model number, this causes the thinkpad_acpi module to fail to load. Recognize laptop as Lenovo using DMI_BIOS_VENDOR instead, which is set to Lenovo. Test on V490u s = dmi_get_system_info(DMI_PRODUCT_NAME); ============= == After the patch == [ 1350.295757] thinkpad_acpi: ThinkPad ACPI Extras v0.24 [ 1350.295760] thinkpad_acpi: http://ibm-acpi.sf.net/ [ 1350.295761] thinkpad_acpi: ThinkPad BIOS H7ET21WW (1.00 ), EC unknown [ 1350.295763] thinkpad_acpi: Lenovo LENOVO, model LV5DXXX [ 1350.296086] thinkpad_acpi: detected a 8-level brightness capable ThinkPad [ 1350.296694] thinkpad_acpi: radio switch found; radios are enabled [ 1350.296703] thinkpad_acpi: possible tablet mode switch found; ThinkPad in laptop mode [ 1350.306466] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked [ 1350.307082] Registered led device: tpacpi::thinklight [ 1350.307215] Registered led device: tpacpi::power [ 1350.307255] Registered led device: tpacpi::standby [ 1350.307294] Registered led device: tpacpi::thinkvantage [ 1350.308160] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one [ 1350.308333] thinkpad_acpi: Console audio control enabled, mode: monitor (read only) [ 1350.312287] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input14 == Before the patch == sudo modprobe thinkpad_acpi FATAL: Error inserting thinkpad_acpi (/lib/modules/3.2.0-27-generic/kernel/drivers/platform/x86/thinkpad_acpi.ko): No such device Test on B485 ============= This patch was also test in a B485 where the thinkpad_acpi module does not have any issues loading. But, I tested it to make sure this patch does not break on already functioning models of Lenovo products. [13486.746359] thinkpad_acpi: ThinkPad ACPI Extras v0.24 [13486.746364] thinkpad_acpi: http://ibm-acpi.sf.net/ [13486.746368] thinkpad_acpi: ThinkPad BIOS HJET15WW(1.01), EC unknown [13486.746373] thinkpad_acpi: Lenovo Lenovo LB485, model 814TR01 [13486.747300] thinkpad_acpi: detected a 8-level brightness capable ThinkPad [13486.752435] thinkpad_acpi: rfkill switch tpacpi_bluetooth_sw: radio is unblocked [13486.752883] Registered led device: tpacpi::thinklight [13486.752915] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one [13486.753216] thinkpad_acpi: Console audio control enabled, mode: monitor (read only) [13486.757147] input: ThinkPad Extra Buttons as /devices/platform/thinkpad_acpi/input/input15 Signed-off-by: Manoj Iyer Signed-off-by: Matthew Garrett Signed-off-by: Shuduo Sang --- drivers/platform/x86/thinkpad_acpi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index f28f36c..80e3779 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -8664,6 +8664,13 @@ static int __must_check __init get_thinkpad_model_data( tp->model_str = kstrdup(s, GFP_KERNEL); if (!tp->model_str) return -ENOMEM; + } else { + s = dmi_get_system_info(DMI_BIOS_VENDOR); + if (s && !(strnicmp(s, "Lenovo", 6))) { + tp->model_str = kstrdup(s, GFP_KERNEL); + if (!tp->model_str) + return -ENOMEM; + } }