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: 12797083 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 877AF7E0 for ; Thu, 31 Mar 2022 12:58:23 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id n63-20020a1c2742000000b0038d0c31db6eso2002767wmn.1 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=bYA5XwLQeWZDFIdDdVeBu9zqF1YGkYy+Y7XhsuNqNi+uR70WAffhBN6G4he7N5XIE+ uACf2CCj8AhUTN47alPjP59G9CcdoDtCTAgDdt8PzkEtr+Ck5++s1F5OBMPTlcfhMfjF wizvUSTRSJq6v9XGxtPEt5xs9R41Qc4rihnHGdZmNmQGYNuhmqfXMAX4HOFwNyVaIb2x OagMd/lnu4Rgv9xxVfPqNGSjkpBPExE5OHGl/NYOkn7dvK+8DNfePqhsOVoVoKvzr5M7 miseHqlEDVtS4g/lQeQxwdAd8tWO2dSRH3YydgZOM4Zy1ld1ZecOGd/CGmBoT6UsnC62 W9Nw== X-Gm-Message-State: AOAM532OGSm32gDbR634atEMuMM562lrgEyVJ36pNXxAi1i6mMUzMWJW p/9IQzV2qhs4/jC4P0VPlQAa3g== 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 Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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