From patchwork Sun May 10 10:32:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 11539153 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E19115AB for ; Sun, 10 May 2020 10:32:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2986D214DB for ; Sun, 10 May 2020 10:32:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726913AbgEJKcx (ORCPT ); Sun, 10 May 2020 06:32:53 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:46388 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726630AbgEJKcx (ORCPT ); Sun, 10 May 2020 06:32:53 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 0BBDD8030875; Sun, 10 May 2020 10:32:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GiZSJdxToDOn; Sun, 10 May 2020 13:32:49 +0300 (MSK) From: Serge Semin To: Jean Delvare , Guenter Roeck CC: Serge Semin , Serge Semin , Maxim Kaurkin , Maxim Kaurkin , Alexey Malahov , Pavel Parkhomenko , Ramil Zaripov , Ekaterina Skachko , Vadim Vlasov , Alexey Kolotnikov , Thomas Bogendoerfer , Paul Burton , Ralf Baechle , Arnd Bergmann , Jonathan Corbet , Rob Herring , , , , Subject: [PATCH v2 0/2] hwmon: Add Baikal-T1 SoC Process, Voltage and Temp sensor support Date: Sun, 10 May 2020 13:32:09 +0300 Message-ID: <20200510103211.27905-1-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20200306132611.103408030701@mail.baikalelectronics.ru> References: <20200306132611.103408030701@mail.baikalelectronics.ru> MIME-Version: 1.0 X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org In order to keep track of Baikal-T1 SoC power consumption and make sure the chip heating is within the normal temperature limits, there is a dedicated hardware monitor sensor embedded into the SoC. It is based on the Analog Bits PVT sensor but equipped with a vendor-specific control wrapper, which ease an access to the sensors functionality. Fist of all it provides an accessed to the sampled Temperature, Voltage and Low/Standard/High Voltage thresholds. In addition the wrapper generates an interrupt in case if one enabled for alarm thresholds or data ready event. All of these functionality is implemented in the Baikal-T1 PVT driver submitted within this patchset. Naturally there is also a patch, which creates a corresponding yaml-based dt-binding file for the sensor. This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: base-commit: 0e698dfa2822 ("Linux 5.7-rc4") tag: v5.7-rc4 Note new vendor prefix for Baikal-T1 PVT device will be added in the framework of the next patchset: https://lkml.org/lkml/2020/5/6/1047 Changelog v2: - Don't use a multi-arg clock phandle reference in the examples dt-bindings property. Thus reundant include pre-processor statement can be removed. - Rearrange the SoBs with adding Maxim' co-development tag. - Lowercase the node-name in the dt-schema example. - Add dual license header to the dt-bindings file. - Replace "additionalProperties: false" property with "unevaluatedProperties: false". - Discard label definition from the binding example. - Discard handwritten IO-access wrappers. Use normal readl/writel instead. - Use generic FIELD_{GET,PREP} macros instead of handwritten ones. - Since the driver depends on the OF config we can remove of_match_ptr() macro utilization. - Don't print error-message if no platform IRQ found. Just return an error. - Remove probe-status info string printout. - Our corporate email server doesn't change Message-Id anymore, so the patchset is resubmitted being in the cover-letter-threaded format. Co-developed-by: Maxim Kaurkin Signed-off-by: Maxim Kaurkin Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Pavel Parkhomenko Cc: Ramil Zaripov Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Alexey Kolotnikov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Arnd Bergmann Cc: Jonathan Corbet Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: linux-hwmon@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Serge Semin (2): dt-bindings: hwmon: Add Baikal-T1 PVT sensor binding hwmon: Add Baikal-T1 PVT sensor driver .../bindings/hwmon/baikal,bt1-pvt.yaml | 95 ++ Documentation/hwmon/bt1-pvt.rst | 113 ++ drivers/hwmon/Kconfig | 29 + drivers/hwmon/Makefile | 1 + drivers/hwmon/bt1-pvt.c | 1154 +++++++++++++++++ drivers/hwmon/bt1-pvt.h | 237 ++++ 6 files changed, 1629 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/baikal,bt1-pvt.yaml create mode 100644 Documentation/hwmon/bt1-pvt.rst create mode 100644 drivers/hwmon/bt1-pvt.c create mode 100644 drivers/hwmon/bt1-pvt.h