Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2277898pxp; Mon, 21 Mar 2022 15:41:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2yPYW0mZY4BKntog2htWkNz1HhGU+my1ieaKGcoo20UQAygkTHWH/cO7Vsue+TTjKXPXM X-Received: by 2002:a63:d34c:0:b0:381:b709:4e21 with SMTP id u12-20020a63d34c000000b00381b7094e21mr19581741pgi.267.1647902493308; Mon, 21 Mar 2022 15:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647902493; cv=none; d=google.com; s=arc-20160816; b=W6uaaBCK8RHcohdA4UvKsEORresLcB0wSX0N7OgmtsCXtL1MuwfY14zCygoNAEjCET o8K3dtgGuBKK+WicZyh5NnQ72WbfBhPwCewGPnv4uNMN6Ez3XpZgEVzO382Y4My5EnJ6 fL9/me2dkQ82nJJvhNlR/AbV+59ocXNl6K0mU/iSj97KnJXrUnHGi63jFYRfQlZ3nyNE tUXd0wETTbIEPVa3LkWYK3H1cGJ6gLkvQ52XAJvtIYJrN0ctC2ZvdgHOWUmedTgSzfvC N/8oQMuN3lGYBjS9sDOVxE3CMjUZ+3mRvDooPNoX+DCERiBI2p6fXOzPOr6rpiqx+pAq GcqQ== 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=Rz2kPyhob/Zn4b4eynOw/6UOyfstxjJm01L/htyIYCc=; b=mP++PCEU1Px4+kV5bP7/J4MJ+OaiVY6Ehzf5R5RFu9aXQ7M/6TrNGwmdyTD5Uk+6nN IGGYC4O2JWTA/kI9gaJMOygEsB6cH3ZB1clq/OdiA/ezGDZAMC+euyQiaMfpOYBHKNzX axRHFyykRAoHWM5jffCIW2++qBw/MqNjsWHTTwHssgZT97euMC/KZr2DOS7+NuKyaIXz R1YmzE+odKMlAfrcDMtGQJIC1DrJsgZU8pMJVFtsUTIq0+uW/D2hkI7Vz4HWjEu1CO60 xRxGWv6n1sw7yGJ4HLoZhGtAnY3iZyblZnsS3ziqWHzpvC6ilqQ6x+rcw0nD+eB+8Ntl Al+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=J9iqLc21; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d8-20020a170902728800b00153bd156232si11395373pll.622.2022.03.21.15.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=J9iqLc21; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BF2625DE5A; Mon, 21 Mar 2022 14:52:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349258AbiCUOeW (ORCPT + 99 others); Mon, 21 Mar 2022 10:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350098AbiCUOd6 (ORCPT ); Mon, 21 Mar 2022 10:33:58 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4240A5D1A9 for ; Mon, 21 Mar 2022 07:32:32 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id b19so20939658wrh.11 for ; Mon, 21 Mar 2022 07:32:32 -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=Rz2kPyhob/Zn4b4eynOw/6UOyfstxjJm01L/htyIYCc=; b=J9iqLc21143U4IqrHGZbl43PU2GcDIexyXwwfNg978gKFJ++vuXmJOnT4lv/HRd0dA KhTJ0wFqyMYnKGSo+Arx6XL89qwnqi9YDs2QkCF+5rUz9Zcj2NNdqny+c19uCLiJ12S/ BBYe8FQDOdmnbZHKvEmOoX2I+hnhW61pr2jZ4= 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=Rz2kPyhob/Zn4b4eynOw/6UOyfstxjJm01L/htyIYCc=; b=6hXIrUFOft9A2PZwIgNuz/ZPGr5hjsBUNFoC8nk1DGRU3Ap0A+Gpz2tdb7G6n8MNKM 4OYxBo9KV+PWpT3iNRlgpHSLrTQb2Q0lkKNwWCWXjS14JWtphiM3PBXWKQk7OV+nDTNC w9QVpDL3Mvlj/cziuXXrPDyZZ8W9I/Es6Pz78vpU+YYGaVVfb2avTTdtu20KLPzsbZoA obcaRW8IasqYY8G6Mbcv6pQcuu+ago1gDM7I20acdPag7sxzClwdI83RXJ1xBtSZJ+yX FeqYthAP/B/3eXNDKj5pb8JdeX0KiSXAURXc5ea0joKodIOYDYAgkksTZZCsEaHS6kIC QTOA== X-Gm-Message-State: AOAM532nPcoI81bsWnzhvtdDrs06+SZ0oWqlWT0lcps3mvsMOTjE7F+J GJSXPhvz2azHmURG+xoWZSRmYw== X-Received: by 2002:adf:f281:0:b0:203:e3a2:de5d with SMTP id k1-20020adff281000000b00203e3a2de5dmr18548830wro.598.1647873150811; Mon, 21 Mar 2022 07:32:30 -0700 (PDT) Received: from fabiobaltieri-linux.lan ([37.228.205.1]) by smtp.gmail.com with ESMTPSA id u11-20020a05600c19cb00b00389efe9c512sm19092793wmq.23.2022.03.21.07.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 07:32:30 -0700 (PDT) From: Fabio Baltieri To: Benson Leung , Guenter Roeck Cc: Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , 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 0/4] Add channel type support to pwm-cros-ec Date: Mon, 21 Mar 2022 14:32:18 +0000 Message-Id: <20220321143222.2523373-1-fabiobaltieri@chromium.org> X-Mailer: git-send-email 2.35.1.894.gb6a874cedc-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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. [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 +- .../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 +++++ 15 files changed, 113 insertions(+), 39 deletions(-) create mode 100644 include/dt-bindings/mfd/cros_ec.h -- 2.35.1.894.gb6a874cedc-goog