From patchwork Thu Dec 27 21:50:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10744055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A2C013BF for ; Thu, 27 Dec 2018 21:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A55428A5C for ; Thu, 27 Dec 2018 21:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E84228AD5; Thu, 27 Dec 2018 21:51:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D64E328A5C for ; Thu, 27 Dec 2018 21:51:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730540AbeL0Vus (ORCPT ); Thu, 27 Dec 2018 16:50:48 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35209 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbeL0Vus (ORCPT ); Thu, 27 Dec 2018 16:50:48 -0500 Received: by mail-wm1-f67.google.com with SMTP id t200so6456231wmt.0; Thu, 27 Dec 2018 13:50:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hGl6wDcv18nbdMCsHxKqHa15xVmZTDDMiXxC8PDTofU=; b=MvR42ypGbUXKRDB3dpUyyzgsNMVVpHcnsUhotUvvXBaCiHtCtWt9sCiC2BBzgX/mVm B7+5sCbZ6FUNmwk8sl2wFaJbxVl/BHK0Ox9HcVmO9C8X3NMp71ci6l75kQvq/K+Onc0V CWadsSwcfq8V6mLnJjvyOMp0bsT1dVnvPt76D1oKc6ih+4T/PQ6kiJZ7bpj9WdnRBCAu bREm7m1svtljiMwUng1ejHpvxhojCQkmLXaQhNdmHxEk/MHJAAS52uufDfDqLXn5491e hU6L6Wwh1x0BLkbIOo20rQ391akgKRg08U6YDhOxGpg5TTvvE9xYWkTzP5qbZtBs4lWl 1yYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hGl6wDcv18nbdMCsHxKqHa15xVmZTDDMiXxC8PDTofU=; b=DpNLiH9trH9XduZun5QtfcRbJe8AWVV/hQUetNaXwrCImD5ETMp8Iqe4bx3CAmokWq 1k4kADGdy2S+Mrg70h4eJ9et181OlR57smzJfRJjubgZLQYL4IYqjufGeI3l5Tw50h+Q XMTmtbsrBMzq4wwjITSykvP53VObOQivCeUsEfQ35poMVE2WbBq0r4P/oV9UW7h011Q3 ZTEoUKb09FSwHTOE2UYRv5rH74Hw8xk2nlGQr1GCuzO5ndR3mv78WgwkAbA93JQED7z0 E9rEB++BljeA1hibLHdc7C4G2KR9FeD49TMizyr+8ASOdEdxD8y4UqwchUep817G5KiX VMRw== X-Gm-Message-State: AJcUukeF/sZtig2OdX5CudbVK11Q30snUvMhwnpAQgKr2IMwI2PJqimP P0xa7y+eZPFPeVAXPav7qs8= X-Google-Smtp-Source: ALg8bN6ieOhYIq1Kis9m7na7acyY2+nvXugjt1uuR7Dii8uadNTOEZZDjJAx2UYcFua+8zlMFsGBdA== X-Received: by 2002:a1c:8acd:: with SMTP id m196mr22837472wmd.120.1545947444131; Thu, 27 Dec 2018 13:50:44 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD711B00071582302E30AD474.dip0.t-ipconnect.de. [2003:dc:d711:b000:7158:2302:e30a:d474]) by smtp.googlemail.com with ESMTPSA id m4sm34538164wmi.3.2018.12.27.13.50.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 13:50:42 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, jic23@kernel.org, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, mark.rutland@arm.com Cc: balbes-150@yandex.ru, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH 0/2] meson-saradc: temperature sensor support for Meson8b/Meson8m2 Date: Thu, 27 Dec 2018 22:50:18 +0100 Message-Id: <20181227215020.9803-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds support for the temperature sensor on Meson8b and Meson8m2 (both are sharing the same logic). These SoCs can use most of the existing infrastructure that we already have for Meson8: - parsing the TSC (calibration data) from an nvmem-cell - the math to calculate millicelsius from the register values What this series adds on top of the existing infrastructure: - The TSC data is 5-bit wide instead of 4-bit. The upper-most bit has t be written into a register in the HHI area (which is outside the ADC register space). Thus this adds a new device tree property to pass the HHI syscon to the SAR ADC and we set up this register during SAR ADC driver initialization - the multiplier and divider values (to convert the raw register value to celsius / millicelsius) are different compared to Meson8 This was successfully tested on multiple boards: - Meson8b Odroid-C1 (me) - Meson8b EC-100 (me) - Meson8m2 M8S (not upstream yet, me) - Meson8m2 MXIII-Plus (an earlier version of this series, Oleg Ivanov) Martin Blumenstingl (2): dt-bindings: iio: adc: meson-saradc: update temperature sensor support iio: adc: meson-saradc: enable the temperature sensor two more SoCs .../bindings/iio/adc/amlogic,meson-saradc.txt | 4 +++ drivers/iio/adc/meson_saradc.c | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+)