From patchwork Sun Jan 22 17:45:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 46982 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1244446wrn; Sun, 22 Jan 2023 09:48:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXs2GkTHaJEIzb1mzXR4KAFnQI5mRAgT59KFluEzMXSsfA6luB7/hYfM1LoplFKZqzCHQbWR X-Received: by 2002:a05:6a00:3315:b0:582:294d:f465 with SMTP id cq21-20020a056a00331500b00582294df465mr23589324pfb.13.1674409694338; Sun, 22 Jan 2023 09:48:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674409694; cv=none; d=google.com; s=arc-20160816; b=ao0niHV9HwzNRirkqIaG89pTUCDXZExf2fdYBlFgaKJGQqGQvBvQ7iqqMGRkFrdUJw PYgrcM84mSyLgEPO4t0Kis6eLwRBQHsAs8yhIAIzrOB/6wh/vmPBO54Sea/yqJt7UlDj W7A7ylhJf1IwPm6Guks2urH6j80KJbTxVoHg6A/wfymq1n2zQt3HumCn6DWh9ByakVr4 aseDapqWy/4WkfIxnj2oN8kShKJRFYqUg4nDApaWhr8mvFMpSEAtR4l1oFWn5aPBzf7+ ZjoKC3X/bxSiSpBX4/MdfFVtagrnFbrm8PO4iY3yoby1/KDJ0OyzZTMjN6o2d2UghoBT PHPg== 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=C1pTKo3OWmmnFLZF4o1FXmS9+0egk/fNiq0vh7NwwbU=; b=prI4o0Apz38ChIcNhKq8O4UKXI8ZEPZhNFThGi5FXfLNc/3oIWlvyWXeFnttJZbIjg YJNOYcQPBCLA4yqG+TB44VZFu8E2aN/Lp9swnDNPLm8nKFnAD8vaDsblNOwwvaHkshp1 G0gHVqYXGL79C3YS1YMPj0hMBzqnTesyNcqtTpU53bDgrP3PVdrx0ri0xNCQHEBhZdwO jft25x2eYzyGo+wzEv3VNxQpPaudW62fFQinyCC4Kma0t2ck1W7eVaWUi1ltplI6Ie06 2eMw0ARMsK3UHyzQp5UULz3P6LT2SIkK4vsJUJNGqgDcZHwIsZeA6Z0zvimc44txZC02 iuUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aRl4d32i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a056a0021c500b005803c45cc2dsi50927478pfj.48.2023.01.22.09.48.02; Sun, 22 Jan 2023 09:48:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aRl4d32i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230492AbjAVRp6 (ORCPT + 99 others); Sun, 22 Jan 2023 12:45:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbjAVRp5 (ORCPT ); Sun, 22 Jan 2023 12:45:57 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A427BC163; Sun, 22 Jan 2023 09:45:54 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id c10-20020a05600c0a4a00b003db0636ff84so7034723wmq.0; Sun, 22 Jan 2023 09:45:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=C1pTKo3OWmmnFLZF4o1FXmS9+0egk/fNiq0vh7NwwbU=; b=aRl4d32ipmSDJVbkB5xcYtx/AEwBlze3zNYXP97tiaBBpEkJWi9Ocm3s2RSA6dbWAT WiKfLjPLWOZZtJTA2bF0t8Ps4md2g3wtDHIq+Y9rZLqri54rsQhr1YSYASz/4hz2klL8 pNclQ14iwKUYBdN/Skrr9eBveH+M3sULQMipbSi7KoTkWfZt/ccuvFL67f0liZeAMFSg JHAs8yHxUK9T7Rt/3udUUNESxkzTJhLpBWzknac5PU0aMWT5FYH4EhSDsxP6ICU2N3rB TcViA1D/7jyYCFWyy8lMD/hZnLUGElS8KlzNSV4dCL/LePhKt6UQyiashgwN14Llv6rk dZdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=C1pTKo3OWmmnFLZF4o1FXmS9+0egk/fNiq0vh7NwwbU=; b=NqofxZnzJMXcn5kjP7Lfs6woqlwCV+Jr1qlrMldHQI2UXG9fNQL0MRPge9r0d4GxdO MUiFblh1IeWZfZs9nUq1LQwr8igGq6zltsi+L5ctYHnpoCQKUupHwBaLnBvfIhYK6Sh3 G41EG0HzV3lctreRZ2ojlBPvXdknMfnW2/gFDuqQC099BWOuteKMmc74QsqF8YB4SUL+ 0G7O1AUDyrRoEK6blD90W+5Ni9LdiruXgoLtoYW9cEcmvH146uBP3KRkvnze+LFlugME nD5lfjde81CUfA4tv35Zt0YdCLBmryKHOt1Q3x/E0x709g0qlID90cf8IwfpZ86dM1CG CZJA== X-Gm-Message-State: AFqh2koN3zpIvAXAI6DuzP289rA9UQXo+mAKJ5omXqUVTMSEGNGAg2qK TxYTTnxMnGiHvpH6C6ewHtWA3lpL16w= X-Received: by 2002:a05:600c:16c9:b0:3db:222:3e0c with SMTP id l9-20020a05600c16c900b003db02223e0cmr21130173wmn.33.1674409553042; Sun, 22 Jan 2023 09:45:53 -0800 (PST) Received: from localhost.localdomain (93-34-89-61.ip49.fastwebnet.it. [93.34.89.61]) by smtp.googlemail.com with ESMTPSA id m2-20020a05600c4f4200b003db0ad636d1sm9202257wmq.28.2023.01.22.09.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 09:45:52 -0800 (PST) From: Christian Marangi To: Ilia Lin , Andy Gross , Bjorn Andersson , Konrad Dybcio , "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Krzysztof Kozlowski , Nishanth Menon , Stephen Boyd , Yassine Oudjana , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [PATCH v2 1/2] dt-bindings: cpufreq: qcom-cpufreq-nvmem: make cpr bindings optional Date: Sun, 22 Jan 2023 18:45:47 +0100 Message-Id: <20230122174548.13758-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755745819685433157?= X-GMAIL-MSGID: =?utf-8?q?1755745819685433157?= The qcom-cpufreq-nvmem driver supports 2 kind of devices: - pre-cpr that doesn't have power-domains and base everything on nvmem cells and multiple named microvolt bindings - cpr-based that require power-domain in the cpu nodes and use various source to decide the correct voltage and freq When the schema was introduced, it was wrongly set to always require these binding but this is not the case for pre-cpr devices. Make the power-domain optional and set them required only for qcs404 based devices. While at it also make more clear what the opp-table supports by adding ref to the opp-v2-kryo-cpu and opp-v2-qcom-level schema. Fixes: ec24d1d55469 ("dt-bindings: opp: Convert qcom-nvmem-cpufreq to DT schema") Signed-off-by: Christian Marangi --- .../bindings/cpufreq/qcom-cpufreq-nvmem.yaml | 81 +++++++++++++------ 1 file changed, 56 insertions(+), 25 deletions(-) diff --git a/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml index 9c086eac6ca7..6f5e7904181f 100644 --- a/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml +++ b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml @@ -17,6 +17,9 @@ description: | on the CPU OPP in use. The CPUFreq driver sets the CPR power domain level according to the required OPPs defined in the CPU OPP tables. + For old implementation efuses are parsed to select the correct opp table and + voltage and CPR is not supported/used. + select: properties: compatible: @@ -33,37 +36,65 @@ select: required: - compatible -properties: - cpus: - type: object - - patternProperties: - '^cpu@[0-9a-f]+$': - type: object - - properties: - power-domains: - maxItems: 1 - - power-domain-names: - items: - - const: cpr - - required: - - power-domains - - power-domain-names - patternProperties: '^opp-table(-[a-z0-9]+)?$': - if: + allOf: + - if: + properties: + compatible: + const: operating-points-v2-kryo-cpu + then: + $ref: /schemas/opp/opp-v2-kryo-cpu.yaml# + + - if: + properties: + compatible: + const: operating-points-v2-qcom-level + then: + $ref: /schemas/opp/opp-v2-qcom-level.yaml# + + unevaluatedProperties: false + +allOf: + - if: properties: compatible: - const: operating-points-v2-kryo-cpu + contains: + enum: + - qcom,qcs404 + then: + properties: + cpus: + type: object + + patternProperties: + '^cpu@[0-9a-f]+$': + type: object + + properties: + power-domains: + maxItems: 1 + + power-domain-names: + items: + - const: cpr + + required: + - power-domains + - power-domain-names + patternProperties: - '^opp-?[0-9]+$': - required: - - required-opps + '^opp-table(-[a-z0-9]+)?$': + if: + properties: + compatible: + const: operating-points-v2-kryo-cpu + then: + patternProperties: + '^opp-?[0-9]+$': + required: + - required-opps additionalProperties: true