From patchwork Mon Jan 18 14:51:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 365546 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp30537jap; Mon, 18 Jan 2021 06:54:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD3DscuPPupOwbZkQp1gGbHUdztfVpLESXJhmB8WmJ8rHQfWYWOGeNDH+xJPgniLA0kWnA X-Received: by 2002:a05:6402:139a:: with SMTP id b26mr19709721edv.47.1610981689288; Mon, 18 Jan 2021 06:54:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610981689; cv=none; d=google.com; s=arc-20160816; b=LCxO6kVmcQca+8aYv8JEb2FkoRLY5fSAQ6YLnxW9jpe7GcX8FcACRquzWdP1QJkFyF avoa/PRUNZJiHROs8u7gW/KUAmG43FaoAanRjk3C5UewlEyGN+h6gyTq50JNy3N5+seV a43wbYb53q/lQ5uvhPKxji4hYRCjylZQVQgOVpHF6ilSaPkwZ772a0OJJpWYlZWwviJs Pe5kn5EHWnltRkTzSynSDnZ/FPWb4qDgDw0apRsvxZ4BxbeqTwkIQUADC3jmZInNZWQg TJ+D0Djt40mv4XBt1v3x15wZsIhYcPUhI4N+H6A3xuoH57/OncivLvFNH9upOA93Qes8 36DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=q0TSPYDv5XLvkcKJyd9FXdxRdT8c1olJkUJTenoQBLk=; b=GyUCywynRMh4iEbf9MIEcBScSslgfFdlQhBmOsD4Bl36nwOl2StdyzJlgQzLw7mJc5 jDgPcD515NvRsfWr9ULWXA7a+45MI5V9eLUd1Uf5xKEAqGVCJhgkG2AYkxVeSS6hgOrw dej0Bz/CxIE81C+FZvbYGPbnSGeeOmY+U3LzM45c5tcCwEie0ocwq7knyVuokdf9TicZ 6OkuhsfOsN2K/rVj8U0VxbE1fAfbHQhKg7gq7/4tbzf4i2uto2eQLP4RpuGBHMc+W1KT xnF7TKc/artAcUr7KG7gNRpWPgudx4ZS/qO1yq5qmpQodtoWad+i7ItvfPiIR+1FKK9O AmYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xeZI2nV1; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si7754199ejl.311.2021.01.18.06.54.49; Mon, 18 Jan 2021 06:54:49 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xeZI2nV1; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405267AbhAROxO (ORCPT + 6 others); Mon, 18 Jan 2021 09:53:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405223AbhAROwp (ORCPT ); Mon, 18 Jan 2021 09:52:45 -0500 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD3DC061573 for ; Mon, 18 Jan 2021 06:52:05 -0800 (PST) Received: by mail-lj1-x22e.google.com with SMTP id m10so18491917lji.1 for ; Mon, 18 Jan 2021 06:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=q0TSPYDv5XLvkcKJyd9FXdxRdT8c1olJkUJTenoQBLk=; b=xeZI2nV1WpcEHH5v6RF37EzP2mXduc8p8BDdSRw5WBx4KviNLBnXcyIvsox8z5HCSt 7R4U+S22A2AxW4ZAuJRAbUS+eguhCE0MzJduDJzttcN2bhYuRQXOcgNszu8qOoe6eOEq qwZYsRx603Qb7VVcP5m0O3P7hGgcuYqf00dyG/8tJXLc9QLe5SaQCuzHrcC8qcsW8F9V C2sfpmkxidscoRZ1aiLkeXuAcuhRaMZzPMMLipKgfMi1V1XWqpVJp+OkSS3bLmNnR7DV 5N0vVXQ4FjMOTqiwAQe6mghFhcPnovdhnGziZ0d4g8eiT3Kbk05hYBN7slLfa/t3B9Xr 0oDQ== 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=q0TSPYDv5XLvkcKJyd9FXdxRdT8c1olJkUJTenoQBLk=; b=m9d5q/s5FBL4Ch4JXwIylW6CaMFdOVn4OUcmhVnH89fkvyas+SYvoqbkkIeLXjOhIa fCs7V951Cau97+/kY/pu2e1jOpktMqpfQ16snhE0aRahtK5bdNeINdeXsuAHuJPZzxI7 WQbuZNd4FHF3S6mk24roA7Jt6ieTtYUmcz5TH86taQQeTlQW7VwxYjBjkzCDIT0ZyrbN ZiUOBYzp3+eTshSX9KanCG1yPOEQwmez2f4raQheEu44Aloar144x8ptSb/X5cDhSGPn 21QYfth0X9g/HC0L9SCsihenKPgBXZET/Owdfi60CJRAuykDbhFrTaiZXRbar9Py/wkG UusA== X-Gm-Message-State: AOAM531q4oBh+YnGx8cxVL5mleNYICNl99aTcQCjKMiPwixefct3A44F +SuDxb2WlP8WK2kK2nAxcD0HkQ== X-Received: by 2002:a2e:8084:: with SMTP id i4mr19058ljg.291.1610981523647; Mon, 18 Jan 2021 06:52:03 -0800 (PST) Received: from eriador.lumag.spb.ru ([188.162.64.4]) by smtp.gmail.com with ESMTPSA id h13sm1969697lfj.110.2021.01.18.06.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 06:52:03 -0800 (PST) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Rob Herring , Zhang Rui , Daniel Lezcano , Amit Kucheria , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, Manivannan Sadhasivam , Jishnu Prakash Subject: [PATCH v11 0/5] qcom: pm8150: add support for thermal monitoring Date: Mon, 18 Jan 2021 17:51:55 +0300 Message-Id: <20210118145200.504951-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch serie adds support for thermal monitoring block on Qualcomm's PMIC5 chips. PM8150{,b,l}, qrb5165-rb5 board and sm8250-mtp board device trees are extended to support thermal zones provided by this thermal monitoring block. Unlike the rest of PMIC thermal senses, these thermal zones describe particular thermistors, which differ between from board to board. Dependencies: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/log/?h=ib-iio-thermal-5.11-rc1 Changes since v10: - Rebased on top of ib-iio-thermal-5.11-rc1 immutable branch, with IIO-related patches picked up by Jonathan. - Changed thermal zone device tree nodes to use -thermal suffix following the schema. - Reordered device tree nodes to keep the alphanumeric sorting order. Changes since v9: - In patch 12 add comments to the code as requested by Daniel Lezcano. - Change copyright comment in qcom-spmi-adc-tm5.c to clearly note driver history. Changes since v8: - Simplified qcom_vadc_map_voltage_temp() code by removing ascending tables support - Simplified qcom-vadc-common volt/temp mapping code - Implement suggestions by Matthias Kaehlcke: message formatting, rewrite comments, remove unused variable initialization. Changes since v7: - Move qcom-vadc-common.h header to include/linux/iio/adc/ dir. - Use explicit sizeof(var) instead of hand-coding 1 when accessing adc-tm registers. - Remove buffer read from adc_tm5_init(). - Remove extra on-stack var from adc_tm5_get_temp(). - Minor formatting changes as suggested Daniel. Changes since v6: - Added include as noted by Jishnu Prakash. Changes since v5: - Reworked DT bindings: * Removed qcom,adc-channel, instead it is parsed from io-channels * Renamed qcom,hw-settle-time to include -us suffix - Re-added monitor enabling which got lost during refactored. Noted by Jishnu Prakash. - Use threaded IRQ handler as susggested by Jishnu. Changes since v4: - Added kernel-doc comments to ADC-TM structures - Used several sizeof(buf) instead of hand-conding register size Changes since v3: - Fix DT description to spell "thermal monitoring" instead of just TM - Fix warnings in DT example - Add EXPORT_SYMBOL_GPL(of_iio_channel_get_by_name) - Fixed whitespace chanes in qcom-vadc-common.c - Removed error message if IIO chanel get returns -EPROBE_DEFER Changes since v2: - IIO: export of_iio_channel_get_by_name() function - dt-bindings: move individual io-channels to each thermal monitoring channel rather than listing them all in device node - added fallback defaults to of_device_get_match_data calls in qcom-spmi-adc5 and qcom-spmi-adc-tm5 drivers - minor typo fixes Changes since v1: - Introduce fixp_linear_interpolate() by Craig Tatlor - Lots of syntax/whitespace changes - Cleaned up register definitions per Jonathan's suggestion - Implemented most of the suggestions from Bjorn's and Jonathan's review