From patchwork Thu Mar 31 12:58:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 555355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9DC5C433F5 for ; Thu, 31 Mar 2022 12:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236458AbiCaNAM (ORCPT ); Thu, 31 Mar 2022 09:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235275AbiCaNAL (ORCPT ); Thu, 31 Mar 2022 09:00:11 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5CCB3DDFE for ; Thu, 31 Mar 2022 05:58:23 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 123-20020a1c1981000000b0038b3616a71aso1995295wmz.4 for ; Thu, 31 Mar 2022 05:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s6IAiCErtoOnzY3QsYXRtTepvpiVgbrk3mBJAs+Q6vU=; b=bvNNA21ueIlJ6UIxIQIw6Q2a62ptN6bDTK06HUE1vsXd46k2UdcAw+hO3A0upoEgWw TQhZkRxWepuAwYNUMp13le4x9Znra1Dh//Xeljgx4ZKSwSfi8aMfHt4CBTppdp1WeEm0 nm8oT4URhjVyqGxfKuB2W4h9yzjB0sTabLFxI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s6IAiCErtoOnzY3QsYXRtTepvpiVgbrk3mBJAs+Q6vU=; b=k6WjtP08mLvB72VnPhIApsh/txs+CLEb1qDwNrySCBDT3nVbMa9wnvbxdlimdEuIU7 7DzYyL/wKft1piRzIPBd4W6MhTIpNYLoRQOIMmH++X1dLU7k6ds/aAxdIdyFcFdLcv/t 4sVBIwWabMd4Pr0VkWricuDyhzIsx3X6SgrYQlIilgTy9EjxaFZ1lo7gRfNhvDZswU+p GbrRLvY7MqlDUBQEpUQWVlzPT4tvILdIgxgHLH08NaoycMMaKLIpTSIg6PCglbD9/c2o WPfxXMqMYLGFwtDyLr8xtAHPDfozmUVruNMJ8h40teCfMyXX3mQzMqqXJF6G4gv/Zfrx 8fjA== X-Gm-Message-State: AOAM531KBGRAhYoLRHT6+El3zeEMN9D1OatDRUFOpRIAup+///g3RFVb YmvDIRtBse9gAr++H3hdw1cqMA== X-Google-Smtp-Source: ABdhPJzonrrVqK+Oc9T5eRd5302wWGc9jNLdlpnmStxZJpcaRUQhHL7NZubtbnHg8xWPm/0Nvq3LuA== X-Received: by 2002:a1c:f705:0:b0:37d:f2e5:d8ec with SMTP id v5-20020a1cf705000000b0037df2e5d8ecmr4780128wmh.21.1648731501845; Thu, 31 Mar 2022 05:58:21 -0700 (PDT) Received: from fabiobaltieri-linux.lan ([37.228.205.1]) by smtp.gmail.com with ESMTPSA id j16-20020a05600c191000b0038c9249ffdesm8230695wmq.9.2022.03.31.05.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 05:58:21 -0700 (PDT) From: Fabio Baltieri To: Benson Leung , Guenter Roeck Cc: Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Lee Jones , Rob Herring , chrome-platform@lists.linux.dev, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Fabio Baltieri Subject: [PATCH v2 0/4] Add channel type support to pwm-cros-ec Date: Thu, 31 Mar 2022 12:58:14 +0000 Message-Id: <20220331125818.3776912-1-fabiobaltieri@chromium.org> X-Mailer: git-send-email 2.35.1.1021.g381101b075-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi, The ChromiumOS EC PWM host command protocol supports specifying the requested PWM by type rather than channel. [1] This series adds support for specifying PWM by type rather than channel number in the pwm-cros-ec driver, which abstracts the node definitions from the actual hardware configuration from the kernel perspective, aligns the API with the one used by the bootloader, and allows removing some dtsi overrides. Tested on a sc7180-trogdor board, but on a version based on an older kernel, so this exact series is build only tested. Changes from v1: (https://patchwork.kernel.org/project/chrome-platform/list/?series=625182) - fixed the dt include file license - fixed the property name (s/_/-/) - rebased on current linus tree (few dts files changed from a soc tree pull, so patch 4 needs a recent base to apply correctly) [1] https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/common/pwm.c;l=24 [2] https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/depthcharge/src/drivers/ec/cros/ec.c;l=1271-1273 Fabio Baltieri (4): dt-bindings: add mfd/cros_ec definitions drivers: pwm: pwm-cros-ec: add channel type support dt-bindings: update google,cros-ec-pwm documentation arm64: dts: address cros-ec-pwm channels by type .../bindings/pwm/google,cros-ec-pwm.yaml | 6 ++ .../mt8183-kukui-jacuzzi-fennel-sku1.dts | 4 +- .../dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 3 +- .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + .../boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 4 - arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 8 +- .../qcom/sc7280-herobrine-herobrine-r0.dts | 6 +- .../arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 6 +- .../arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi | 3 +- arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 6 +- .../boot/dts/rockchip/rk3399-gru-bob.dts | 4 - .../dts/rockchip/rk3399-gru-chromebook.dtsi | 4 +- .../boot/dts/rockchip/rk3399-gru-kevin.dts | 4 - arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 1 + drivers/pwm/pwm-cros-ec.c | 80 +++++++++++++++---- include/dt-bindings/mfd/cros_ec.h | 18 +++++ 16 files changed, 117 insertions(+), 41 deletions(-) create mode 100644 include/dt-bindings/mfd/cros_ec.h