From nobody Thu Apr 2 22:18:36 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 574632DCF57; Thu, 2 Apr 2026 02:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775097618; cv=none; b=W5KMtvzFhSAV/JEP17XUuSDLKXggs2tY//e1OOuAd1sVkz+ff69cH3mBqSkqu/X+4QdW2bXdTSlybZWNNDpMQqMPAKW/qsu8Eoa/N6e7XUtr6dR+F9cOWUb6kRlCZL9QNHnFEVgvS01m7w3y1ccs+pozvHDkXSs53cOn3hvxz2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775097618; c=relaxed/simple; bh=zmdM0qo8CX3kHCzsu50etCsSTnTDcsKCliyCWlfpcmk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OIKY8yTGUghKVDxDKkGif1NkI/r3b06VUWl8yEHfxUcCYAzYq8d24xxekWGhMcBj4/EIXwMOxQhB5r4a0SUeXHlhqRqwkkRraI2PCpFJGpqTBc2yk7xGonYQxz3urU+jhV2iwyY01fwugYUQGljyCiHVhhNNzqge7bnsYQYCV6Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YAY7Vf9y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YAY7Vf9y" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2E37EC19423; Thu, 2 Apr 2026 02:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775097618; bh=zmdM0qo8CX3kHCzsu50etCsSTnTDcsKCliyCWlfpcmk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YAY7Vf9yOJ8K6DwWOBrTe8a7fXq7YwkKKXSlYyyiJXAdH6y/m+RjjAJnOHCN79+AY Wg8J02eHCFNZpcpsa3Y8DxyRttJM68aSXOV7JILTBdseKh4FtUo86vYZVqYTxj2Y2c XJ8d3XKFSWwyV+wmnH1oh0X+esh387cYIFsJDOrBXBq4CWJ89JqMq4eSL/yw5sJXEn D5zPdhFtj/T1hrLhhEX1Iq7wHQYEuP2ImrfgyYWO+fdjkn5tEItKrWuqn4q2cWSxgB OZwz4VhvjsvSoERP339nqsxlcJgO0st7iB+35oPGHCyBxZi76a1aXGB2PZ+hu4Y4pq px19SG/bekRGA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A5D51112259; Thu, 2 Apr 2026 02:40:18 +0000 (UTC) From: Xianwei Zhao via B4 Relay Date: Thu, 02 Apr 2026 02:40:15 +0000 Subject: [PATCH v2 1/2] dt-bindings: pwm: amlogic: Add new bindings for S6 S7 S7D Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-s6-s7-pwm-v2-1-657dce040956@amlogic.com> References: <20260402-s6-s7-pwm-v2-0-657dce040956@amlogic.com> In-Reply-To: <20260402-s6-s7-pwm-v2-0-657dce040956@amlogic.com> To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiner Kallweit , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Xianwei Zhao , Junyi Zhao , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1775097616; l=1811; i=xianwei.zhao@amlogic.com; s=20251216; h=from:subject:message-id; bh=jS//+H3tRKyNMEGVeMFEtfJwKQUz9wNI3mixje/H5hM=; b=tdms4fS6vPfUsXE80dPyDtDcpNiA+GSo14eeE7/bMZQEqHP9vo135gK1STjJTLRYttbPPVLwY rusXNJflPoTCbeY6PHczRtZANL0ck36hcRCUHSZlpfIMthZXex+EzFw X-Developer-Key: i=xianwei.zhao@amlogic.com; a=ed25519; pk=dWwxtWCxC6FHRurOmxEtr34SuBYU+WJowV/ZmRJ7H+k= X-Endpoint-Received: by B4 Relay for xianwei.zhao@amlogic.com/20251216 with auth_id=578 X-Original-From: Xianwei Zhao Reply-To: xianwei.zhao@amlogic.com From: Junyi Zhao Amlogic S7/S7D/S6 different from the previous SoCs, a controller includes one pwm, at the same time, the controller has only one input clock source. Signed-off-by: Junyi Zhao Reviewed-by: Krzysztof Kozlowski Reviewed-by: Martin Blumenstingl Signed-off-by: Xianwei Zhao --- .../devicetree/bindings/pwm/pwm-amlogic.yaml | 19 +++++++++++++++= ++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml b/Docum= entation/devicetree/bindings/pwm/pwm-amlogic.yaml index c337d85da40f..93fa97f4011b 100644 --- a/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml +++ b/Documentation/devicetree/bindings/pwm/pwm-amlogic.yaml @@ -37,6 +37,7 @@ properties: - enum: - amlogic,meson8-pwm-v2 - amlogic,meson-s4-pwm + - amlogic,s7-pwm - items: - enum: - amlogic,a4-pwm @@ -45,6 +46,11 @@ properties: - amlogic,t7-pwm - amlogic,meson-a1-pwm - const: amlogic,meson-s4-pwm + - items: + - enum: + - amlogic,s6-pwm + - amlogic,s7d-pwm + - const: amlogic,s7-pwm - items: - enum: - amlogic,meson8b-pwm-v2 @@ -146,6 +152,19 @@ allOf: clock-names: false required: - clocks + - if: + properties: + compatible: + contains: + enum: + - amlogic,s7-pwm + then: + properties: + clocks: + maxItems: 1 + clock-names: false + required: + - clocks =20 - if: properties: --=20 2.52.0 From nobody Thu Apr 2 22:18:36 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A78133DEF9; Thu, 2 Apr 2026 02:40:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775097618; cv=none; b=RJsxKp9xDjz0Ue6H9dRjd76Ep95y9Nsa1QgQQH/ITOlW8tnUY4QWYgBlvtdoL8rXwLGKan3CleTSQdKKjDzznmw8oIJHsxGZnVg1rBALggvzHwZLPlT2x2hYO5X2/+XaCBZTuQfiEkUhg9dFmJRUlc0cekVz+S/0AHa2RYW61Do= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775097618; c=relaxed/simple; bh=4SdS+lHyJtTa2/Ms9Wv2AX4lHTJvDixvSJNqF+OkoRQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aooT2j20kwcGT5CfFly9g8O5BnB9cXLgt1skaLsd7scoo/95U+n3LpaVgADD6gVLqkftswqMFXK984wxX79HwIiz5vwCKX7XsoLvmprbyXaW7UrtZe463WJt8jCNLpvlcaMuSh3aG3DrgtyKPraRXzx99DjocO4EEB7aDc2yjNs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gdDlLgTc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gdDlLgTc" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3CF59C19421; Thu, 2 Apr 2026 02:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775097618; bh=4SdS+lHyJtTa2/Ms9Wv2AX4lHTJvDixvSJNqF+OkoRQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gdDlLgTcIWHHBa0BBSkuXr7+5Mc71LCm3SKnt+e2bILq82u9TiWjX+JLLZOQZ74pj SASzrPRtLWsHMPmo3XrVSXJkLyMLkRKe070lV+/teMbXuGNwOt/E/DTk1kx+rLzxw0 gYXZI/hgkXW1ssoGbOH1EBSu+cVpVczd5TRrswsO0+f0cYleGVMVPnbwe6ocmcgCnd E9WgjV+ZvcWWRBVDsLrJKs0JnI4p3FL2O/1tKvewkAOTM1gGghWJtYaNheZ8gBV3rh U7wOhEtakGHf+o+9HsGeCxjihr1gKe08VLMKv7QF4GWY416qzCduQ2peEMRhzpDc4+ L64HvAA9c5DJQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CE4E1112279; Thu, 2 Apr 2026 02:40:18 +0000 (UTC) From: Xianwei Zhao via B4 Relay Date: Thu, 02 Apr 2026 02:40:16 +0000 Subject: [PATCH v2 2/2] pwm: meson: Add support for Amlogic S7 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-s6-s7-pwm-v2-2-657dce040956@amlogic.com> References: <20260402-s6-s7-pwm-v2-0-657dce040956@amlogic.com> In-Reply-To: <20260402-s6-s7-pwm-v2-0-657dce040956@amlogic.com> To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiner Kallweit , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Xianwei Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1775097616; l=2781; i=xianwei.zhao@amlogic.com; s=20251216; h=from:subject:message-id; bh=o49tWz26WxnJOme5RKrdAld7mCVrpPGE+v52KlxAPOc=; b=ZCG8B2cWMv72BgpxPUZFlE4mKV/iyUMBSOfTUhkafcR/E4XCYxDHR+ni2AbmTmY920F+TCJi4 pkcdl4Qr2F1DRXBjIoWyboQEN8XmeDGS2lf5Wly1Kb+9CasM+VeAdlH X-Developer-Key: i=xianwei.zhao@amlogic.com; a=ed25519; pk=dWwxtWCxC6FHRurOmxEtr34SuBYU+WJowV/ZmRJ7H+k= X-Endpoint-Received: by B4 Relay for xianwei.zhao@amlogic.com/20251216 with auth_id=578 X-Original-From: Xianwei Zhao Reply-To: xianwei.zhao@amlogic.com From: Xianwei Zhao Add support for Amlogic S7 PWM. Amlogic S7 different from the previous SoCs, a controller includes one pwm, at the same time, the controller has only one input clock source. Signed-off-by: Xianwei Zhao --- drivers/pwm/pwm-meson.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index 8c6bf3d49753..7a43c42ef3d6 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -113,6 +113,7 @@ struct meson_pwm_data { int (*channels_init)(struct pwm_chip *chip); bool has_constant; bool has_polarity; + bool single_pwm; }; =20 struct meson_pwm { @@ -503,6 +504,18 @@ static void meson_pwm_s4_put_clk(void *data) clk_put(clk); } =20 +static int meson_pwm_init_channels_s7(struct pwm_chip *chip) +{ + struct device *dev =3D pwmchip_parent(chip); + struct meson_pwm *meson =3D to_meson_pwm(chip); + + meson->channels[0].clk =3D devm_clk_get(dev, NULL); + if (IS_ERR(meson->channels[0].clk)) + return dev_err_probe(dev, PTR_ERR(meson->channels[0].clk), + "Failed to get clk\n"); + return 0; +} + static int meson_pwm_init_channels_s4(struct pwm_chip *chip) { struct device *dev =3D pwmchip_parent(chip); @@ -592,6 +605,13 @@ static const struct meson_pwm_data pwm_s4_data =3D { .has_polarity =3D true, }; =20 +static const struct meson_pwm_data pwm_s7_data =3D { + .channels_init =3D meson_pwm_init_channels_s7, + .has_constant =3D true, + .has_polarity =3D true, + .single_pwm =3D true, +}; + static const struct of_device_id meson_pwm_matches[] =3D { { .compatible =3D "amlogic,meson8-pwm-v2", @@ -642,6 +662,10 @@ static const struct of_device_id meson_pwm_matches[] = =3D { .compatible =3D "amlogic,meson-s4-pwm", .data =3D &pwm_s4_data }, + { + .compatible =3D "amlogic,s7-pwm", + .data =3D &pwm_s7_data + }, {}, }; MODULE_DEVICE_TABLE(of, meson_pwm_matches); @@ -650,9 +674,11 @@ static int meson_pwm_probe(struct platform_device *pde= v) { struct pwm_chip *chip; struct meson_pwm *meson; - int err; + const struct meson_pwm_data *pdata =3D of_device_get_match_data(&pdev->de= v); + int err, npwm; =20 - chip =3D devm_pwmchip_alloc(&pdev->dev, MESON_NUM_PWMS, sizeof(*meson)); + npwm =3D pdata->single_pwm ? 1 : MESON_NUM_PWMS; + chip =3D devm_pwmchip_alloc(&pdev->dev, npwm, sizeof(*meson)); if (IS_ERR(chip)) return PTR_ERR(chip); meson =3D to_meson_pwm(chip); @@ -664,7 +690,7 @@ static int meson_pwm_probe(struct platform_device *pdev) spin_lock_init(&meson->lock); chip->ops =3D &meson_pwm_ops; =20 - meson->data =3D of_device_get_match_data(&pdev->dev); + meson->data =3D pdata; =20 err =3D meson->data->channels_init(chip); if (err < 0) --=20 2.52.0