From patchwork Fri Mar 10 13:58:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viktor Krasnov X-Patchwork-Id: 737425 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vfqF72cR2z9s7m for ; Sat, 11 Mar 2017 01:21:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=dev.rtsoft.ru header.i=@dev.rtsoft.ru header.b="P8dt616M"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933842AbdCJOVN (ORCPT ); Fri, 10 Mar 2017 09:21:13 -0500 Received: from mail.dev.rtsoft.ru ([213.79.90.226]:44542 "EHLO mail.dev.rtsoft.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933355AbdCJOVK (ORCPT ); Fri, 10 Mar 2017 09:21:10 -0500 X-Greylist: delayed 1295 seconds by postgrey-1.27 at vger.kernel.org; Fri, 10 Mar 2017 09:21:10 EST Received: from vkrasnov.dev.rtsoft.ru (vkrasnov.dev.rtsoft.ru [192.168.14.23]) by mail.dev.rtsoft.ru (Postfix) with ESMTP id D221D41ADC; Fri, 10 Mar 2017 16:59:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.dev.rtsoft.ru D221D41ADC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev.rtsoft.ru; s=mail; t=1489154371; bh=2ZngpqIQG/gk3erDmEvobMQjOEx4/XF5d6X0EeoXih0=; h=From:To:Cc:Subject:Date:From; b=P8dt616MuP93eT1MH1bWOwEokw4CIu438z2AxwlKs+6aqCa6nhRHqBTuyKgsHzpu2 QnULrUPYsFg1f6OrANrmUAvNAij/SXsfmTDUXw/T5vFiov8w6LDMCU+zOjeetegSve n+CkhJfbYxujiczewOgQOaKfNIj/17f88E5jThLo= From: Viktor Krasnov To: jdelvare@suse.com, wsa@the-dreams.de Cc: linux-i2c@vger.kernel.org, Viktor Krasnov , Edgar Cherkasov , Michael Brunner Subject: [PATCH] i2c: i2c-scmi: add a MS HID Date: Fri, 10 Mar 2017 16:58:35 +0300 Message-Id: <1489154315-26499-1-git-send-email-vkrasnov@dev.rtsoft.ru> X-Mailer: git-send-email 1.9.3 MIME-Version: 1.0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Edgar Cherkasov Description of the problem: - i2c-scmi driver contains only two identifiers "SMBUS01" and "SMBUSIBM"; - the fist HID (SMBUS01) is clearly defined in "SMBus Control Method Interface Specification, version 1.0": "Each device must specify 'SMBUS01' as its _HID and use a unique _UID value"; - unfortunately, BIOS vendors (like AMI) seem to ignore this requirement and implement "SMB0001" HID instead of "SMBUS01"; - I speculate that they do this because only "SMB0001" is hard coded in Windows SMBus driver produced by Microsoft. This leads to following situation: - SMBus works out of box in Windows but not in Linux; - board vendors are forced to add correct "SMBUS01" HID to BIOS to make SMBus work in Linux. Moreover the same board vendors complain that tools (3-rd party ASL compiler) do not like the "SMBUS01" identifier and produce errors. So they need to constantly patch the compiler for each new version of BIOS. As it is very unlikely that BIOS vendors implement a correct HID in future, I would propose to consider whether it is possible to work around the problem by adding MS HID to the Linux i2c-scmi driver. Signed-off-by: Edgar Cherkasov Signed-off-by: Michael Brunner Acked-by: Viktor Krasnov Reviewed-by: Jean Delvare --- drivers/i2c/busses/i2c-scmi.c | 1 + include/acpi/acpi_drivers.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/i2c/busses/i2c-scmi.c b/drivers/i2c/busses/i2c-scmi.c index dfc98df..fb9aee0 100644 --- a/drivers/i2c/busses/i2c-scmi.c +++ b/drivers/i2c/busses/i2c-scmi.c @@ -51,6 +51,7 @@ struct acpi_smbus_cmi { static const struct acpi_device_id acpi_smbus_cmi_ids[] = { {"SMBUS01", (kernel_ulong_t)&smbus_methods}, {ACPI_SMBUS_IBM_HID, (kernel_ulong_t)&ibm_smbus_methods}, + {ACPI_SMBUS_MS_HID, (kernel_ulong_t)&smbus_methods}, {"", 0} }; MODULE_DEVICE_TABLE(acpi, acpi_smbus_cmi_ids); diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 29c6912..d34538b 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -60,6 +60,8 @@ #define ACPI_DOCK_HID "LNXDOCK" /* Quirk for broken IBM BIOSes */ #define ACPI_SMBUS_IBM_HID "SMBUSIBM" +/* SMBUS HID definition as supported by Microsoft Windows */ +#define ACPI_SMBUS_MS_HID "SMB0001" /* * For fixed hardware buttons, we fabricate acpi_devices with HID