From patchwork Thu Dec 29 14:25:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rudolf Marek X-Patchwork-Id: 9491247 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 35E8D60453 for ; Thu, 29 Dec 2016 14:32:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DDFC1FF1D for ; Thu, 29 Dec 2016 14:32:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E384D25250; Thu, 29 Dec 2016 14:32:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF6C01FF1D for ; Thu, 29 Dec 2016 14:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752734AbcL2OcJ (ORCPT ); Thu, 29 Dec 2016 09:32:09 -0500 Received: from ms.trustica.cz ([82.208.32.68]:39924 "EHLO ms.trustica.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752656AbcL2OcJ (ORCPT ); Thu, 29 Dec 2016 09:32:09 -0500 X-Greylist: delayed 391 seconds by postgrey-1.27 at vger.kernel.org; Thu, 29 Dec 2016 09:32:08 EST Received: from localhost (localhost [127.0.0.1]) by ms.trustica.cz (Postfix) with ESMTP id 273D69A77F for ; Thu, 29 Dec 2016 15:25:36 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ms.trustica.cz Received: from ms.trustica.cz ([127.0.0.1]) by localhost (ms.trustica.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xW6XmxcdpqOx for ; Thu, 29 Dec 2016 15:25:35 +0100 (CET) Received: from [192.168.88.62] (56.32.broadband3.iol.cz [85.70.32.56]) (Authenticated sender: r.marek@assembler.cz) by ms.trustica.cz (Postfix) with ESMTPSA id 943179A759 for ; Thu, 29 Dec 2016 15:25:35 +0100 (CET) To: linux-hwmon@vger.kernel.org From: Rudolf Marek Subject: [PATCH] sensors-detect: Add Exar Message-ID: <5a915597-c5d5-9e0e-b1f1-043e8ae48043@assembler.cz> Date: Thu, 29 Dec 2016 15:25:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, I stumbled across a new SuperIOs from Exar. They do not contain any hw sensors, but it could be useful to have them in sensors-detect Funny is that those have configurable key sequence, which can clash with existing devices. Perhaps this can be improved and check for vendor ID? In the attached patch, I added just a default key sequence 0x67, 0x67 The datasheets can be found: https://www.exar.com/products/interface/uarts/lpc-uarts https://www.exar.com/product/interface/uarts/lpc-uarts/xr28v384 https://www.exar.com/product/interface/uarts/lpc-uarts/xr28v382 The patch is completely untested, please check the datasheet for relevant information. Thanks Rudolf diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 057cd96..b47595e 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1582,7 +1582,7 @@ use vars qw(@i2c_adapter_names); # * FEAT_FAN # * FEAT_TEMP use vars qw(@superio_ids_natsemi @superio_ids_smsc @superio_ids_smsc_ns - @superio_ids_winbond @superio_ids_ite @superio_ids); + @superio_ids_winbond @superio_ids_exar @superio_ids_ite @superio_ids); use constant FEAT_IN => (1 << 0); use constant FEAT_FAN => (1 << 1); @@ -2022,6 +2022,18 @@ use constant FEAT_SMBUS => (1 << 7); } ); +@superio_ids_exar = ( + { + name => "Exar XR28V384", + driver => "not-a-sensor", + devid => 0x0384, + }, { + name => "Exar XR28V382", + driver => "not-a-sensor", + devid => 0x0382, + } +); + @superio_ids_winbond = ( { name => "VIA VT1211 Super IO Sensors", @@ -2483,6 +2495,14 @@ use constant FEAT_SMBUS => (1 << 7); ns_detect => \&smsc_ns_detect_superio, ns_chips => \@superio_ids_smsc_ns, }, { + family => "Exar", + enter => + { + 0x2e => [0x67, 0x67], #The non-default key can be 0x87 0x87, 0x77 0x77 or 0xa0, 0xa0 + 0x4e => [0x67, 0x67], + }, + chips => \@superio_ids_exar, + }, { family => "VIA/Winbond/Nuvoton/Fintek", guess => 0x290, enter => @@ -4081,7 +4101,7 @@ sub exit_superio { my ($addrreg, $datareg) = @_; - # Some chips (SMSC, Winbond) want this + # Some chips (SMSC, Winbond, Exar) want this outb($addrreg, 0xaa); # Return to "Wait For Key" state (PNP-ISA spec)