From patchwork Sun Oct 28 12:26:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10658535 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 2005F174F for ; Sun, 28 Oct 2018 12:26:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D30A299C6 for ; Sun, 28 Oct 2018 12:26:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01533299CB; Sun, 28 Oct 2018 12:26:43 +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 9A97C299C6 for ; Sun, 28 Oct 2018 12:26:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727534AbeJ1VLM (ORCPT ); Sun, 28 Oct 2018 17:11:12 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33312 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbeJ1VLM (ORCPT ); Sun, 28 Oct 2018 17:11:12 -0400 Received: by mail-wr1-f67.google.com with SMTP id u1-v6so5737701wrn.0; Sun, 28 Oct 2018 05:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vvv+KuPLiYxURsZKRAMGzXA8rSzxo3zO5Xwq2sPYqgU=; b=fLhmaSeBSVP8Kwlao2VoCgQ2yJwO3Iy44cOOa+zgWWOOH90GyOGOl+RwpXen3sPmBO xWCsnPgYfKKwgfW2TQ0j9F/ifx8ltxRlDtEmNnKC9gUY6TzGeZdED15A9wOfCLwxv9Ya 7CmjbIs0PGIJIxlPYq548miOLIHz5KfIkzpgIgsutq4j3adNpe6okzZC3GAzPh2GwWcP dJDJ2mIlrCaeDZTvdy/bDo4fT8gv5IZ4SHd6KqLRgYRJjx4+T/wxh16SNU8T19paTE0u fhjsHuxf8h5mKnlUJK2SEfnRItjg2TZOLdGp3qNSRWvXZtcNNkIt0CTUzkoKqwd21le8 9tTw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=vvv+KuPLiYxURsZKRAMGzXA8rSzxo3zO5Xwq2sPYqgU=; b=D9Vq3e8ICBGwgS3GI3Tuetub7KEQYYoYJSz9c8EfxqnKYNdeR2J9oG7hGhrhf1Z9UJ JJLIqqWsOlM+FtswDMc7zml7UN0nTz96kMXTsIJ7HSI8HicjIvsOQWM1U1DjS8oOJ5Oq 7pTmqttaWjNNfeg2hDCx4hl6sgzLjq99RKr8wdMXH0huqzhhcFvrThOBzadEg4wX8plg wO+4588uIhgQ3ilH8ag4eW5AbKuwH2+S1wJ6EPtwKm6fbJ/YijWqqA7e4mQVC7xBu+sh g0H3PaNSk2tK/N1ZFTY2cXXNhZvaGp/Uk7RpDj9HxawSj40icdWxo4zv8hE6x9swe8mP gBJQ== X-Gm-Message-State: AGRZ1gKrVTewarUjoDfC/m0kBzNCxXpkdy2g7puoaNDVD8vkJEgYtNqD YDQ6A/poTTC0TIUk2j2Umk4= X-Google-Smtp-Source: AJdET5dDjxnke8hVkI6DvAAEmwH0ErFxhBrtEVoRtMK+9JmGHkDq0+YMrOM+FdjVn6B8vNbbYSMTuA== X-Received: by 2002:a5d:46ce:: with SMTP id g14-v6mr11170041wrs.263.1540729600579; Sun, 28 Oct 2018 05:26:40 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD7072200691979D1FB980407.dip0.t-ipconnect.de. [2003:dc:d707:2200:6919:79d1:fb98:407]) by smtp.googlemail.com with ESMTPSA id z185-v6sm19334091wmz.47.2018.10.28.05.26.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 05:26:39 -0700 (PDT) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, robh+dt@kernel.org, pmeerw@pmeerw.net, lars@metafoo.de, knaack.h@gmx.de, jic23@kernel.org Cc: khilman@baylibre.com, carlo@caione.org, Martin Blumenstingl Subject: [PATCH 1/7] dt-bindings: iio: adc: meson-saradc: add temperature sensor support Date: Sun, 28 Oct 2018 13:26:23 +0100 Message-Id: <20181028122629.10144-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181028122629.10144-1-martin.blumenstingl@googlemail.com> References: <20181028122629.10144-1-martin.blumenstingl@googlemail.com> 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 The 32-bit Meson SoCs Meson8, Meson8b and Meson8m2 can use the SAR ADC to read the chip temperature. This requires a few new, optional properties: - nvmem-cells and nvmem-cell-names are needed because the temperature sensor requires calibration to work correctly. The calibration data is stored in the eFuse. - amlogic,hhi-sysctrl is needed on Meson8b and Meson8m2 because the 5th bit of the TSC (temperature sensor calibration coefficient) is stored in the HHI register region (in the scratch register HHI_DPLL_TOP_0 at offset 0x318). Signed-off-by: Martin Blumenstingl --- .../bindings/iio/adc/amlogic,meson-saradc.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.txt b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.txt index 54b823f3a453..75c775954102 100644 --- a/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.txt +++ b/Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.txt @@ -22,6 +22,16 @@ Required properties: - vref-supply: the regulator supply for the ADC reference voltage - #io-channel-cells: must be 1, see ../iio-bindings.txt +Optional properties: +- amlogic,hhi-sysctrl: phandle to the syscon which contains the 5th bit + of the TSC (temperature sensor coefficient) on + Meson8b and Meson8m2 (which used to calibrate the + temperature sensor) +- nvmem-cells: phandle to the temperature_calib eFuse cells +- nvmem-cell-names: if present (to enable the temperature sensor + calibration) this must contain "temperature_calib" + + Example: saradc: adc@8680 { compatible = "amlogic,meson-gxl-saradc", "amlogic,meson-saradc";