Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1287176pxb; Fri, 21 Jan 2022 14:24:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiB85R3ecCWYisght2NgkT4QGj2SSG8cz8BwwOaFyw5JCdOmX0BK9IHNKduYEWUHVrIyxP X-Received: by 2002:a05:6a00:2442:b0:4c5:75b4:d53e with SMTP id d2-20020a056a00244200b004c575b4d53emr5243243pfj.49.1642803894477; Fri, 21 Jan 2022 14:24:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642803894; cv=none; d=google.com; s=arc-20160816; b=aC9D3lkvcDs672LNuhh+8sFh/8ndjNHZCbkP92fih5H185z6c6AAZARUv8kxo59Akd Kb1oq+NUfHsR2DAbZrWzYoDN3J+w80z1TI4+lUwTvnsMQEC8bKYIo2OYnuZYZ5Mkfjj4 TDOA2Mma05THnFV4aRpw04TT/a1U09UuIflW3xJDG6Rm+WH4DYmIBElPs7GyXL9hFjqS ujwMlpGejXfO41UjFisxWgGSsoMGO1BeIDaHbROmHY50N/prHXUjZ/pyyROWrrV4aE6b CAFRFeztwcQHzzSYoSY5UhikJ+TFi76I3SOk3ycPXaB1MRCFNEmhGiR7ELJ+7Xen8syP FUaw== 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=Pvcuu4ZrwYY4UFf91/QaWfyFWkdNSJ5U0+8f2UXSj7E=; b=DOa0fr/AzSQYN+qD8C4Qj6pHOB5Stp5zCLCp1A1EfK14oyL7sInce2V7i/bwfokzuU N9o0Q/Dz9ccvzmrbq59Bj+42hlnBwOmU2jROc75UkadzGfuyPWcC0y/LMWulJiHHSvrr waw7zuPJPXVd+i9XPT8XJfNcLz/ueGSIBlh1VvDEliKvxfnPnbDTlmxgKrAWKx8jtP1H 6+Z3vu2j7qUKac4Wu9AIefHqGg0vpnUH03RpYXd60GxtTPHx3W3+UdwWH0TT3KQGlcXh FEsdjRGbs1/Mebi/DI7YDa98QxGLsOJLuik+4Yq5OaQEIY4dWvNZI7ab6yZx/odW+q7A 16yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=3OaUOJOe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j63si1894622pgd.80.2022.01.21.14.24.41; Fri, 21 Jan 2022 14:24:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@trvn.ru header.s=mail header.b=3OaUOJOe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376919AbiATQPF (ORCPT + 99 others); Thu, 20 Jan 2022 11:15:05 -0500 Received: from box.trvn.ru ([194.87.146.52]:52625 "EHLO box.trvn.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233059AbiATQPD (ORCPT ); Thu, 20 Jan 2022 11:15:03 -0500 Received: from authenticated-user (box.trvn.ru [194.87.146.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.trvn.ru (Postfix) with ESMTPSA id 53F3E40CA6; Thu, 20 Jan 2022 21:14:59 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1642695300; bh=dJkfCt/wf01BgFz4htQDsVYJD+1/n2Njx5/ps0xEzUs=; h=From:To:Cc:Subject:Date:From; b=3OaUOJOeeMsO3xquiajjO5zTAA8+537EFlk1zt1x4SJRhSl+g8IowMQZkCSA/aMql AaarPT65ZyC/U7wKAhbgLlycoxLT4Yv8FF3dRzJtkqVjKo7bY0dGzsmHcehpzgWvuj WiAkfCKRlRx8XNSjJf8MQLSZX2v7OXMtd3PF8SH73lrEQWhHq+JANM5QzewVJMXcQj zwv4wr/N0ZM2lippvBSAiSoPUmem7RmgmsIMI4+av3+oOsw9h4/wGeX24S1BtjRTWs hWK8EHUSHvPJ4Ssvo9n+E67ORCr1GLbPLpJExKpa7EaVjzYYvJb1tHN/sd22m7uyEM mLuGsGayp1s5w== From: Nikita Travkin To: thierry.reding@gmail.com, lee.jones@linaro.org Cc: u.kleine-koenig@pengutronix.de, robh+dt@kernel.org, sboyd@kernel.org, krzk@kernel.org, linus.walleij@linaro.org, masneyb@onstation.org, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin Subject: [PATCH v3 0/3] Clock based PWM output driver Date: Thu, 20 Jan 2022 21:14:39 +0500 Message-Id: <20220120161442.140800-1-nikita@trvn.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series introduces an "adapter" driver that allows PWM consumers to control clock outputs with duty-cycle control. Some platforms (e.g. some Qualcomm chipsets) have "General Purpose" clocks that can be muxed to GPIO outputs and used as PWM outputs. Those outputs may be connected to various peripherals such as leds in display backlight or haptic feedback motor driver. To avoid re-implementing every single PWM consumer driver with clk support (like in [1]) and don't put the burden of providing the PWM sources on the clock drivers (as was proposed in [2]), clk based pwm controller driver is introduced. There is an existing driver that provides the opposite function in drivers/clk/clk-pwm.c with a compatible "pwm-clock" so the new driver uses the opposite naming scheme: drivers/pwm/pwm-clk.c and compatible "clk-pwm". Changes in v2: - Fix filename in the DT schema. - Address Uwe's review comments. Changes in v3: - Fix node pattern in the core pwm schema. - Address Uwe's review comments. [1] https://lore.kernel.org/lkml/20191205002503.13088-1-masneyb@onstation.org/ [2] https://lore.kernel.org/lkml/CACRpkdZxu1LfK11OHEx5L_4kyjMZ7qERpvDzFj5u3Pk2kD1qRA@mail.gmail.com/ Nikita Travkin (3): dt-bindings: pwm: Fix node name pattern dt-bindings: pwm: Document clk based PWM controller pwm: Add clock based PWM output driver .../devicetree/bindings/pwm/clk-pwm.yaml | 45 ++++++ .../devicetree/bindings/pwm/pwm.yaml | 2 +- drivers/pwm/Kconfig | 10 ++ drivers/pwm/Makefile | 1 + drivers/pwm/pwm-clk.c | 139 ++++++++++++++++++ 5 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/pwm/clk-pwm.yaml create mode 100644 drivers/pwm/pwm-clk.c -- 2.30.2