From nobody Sat Oct 4 15:59:01 2025 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 9CF11319865; Thu, 14 Aug 2025 18:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196883; cv=none; b=F864kZh6SeuHkfviBQYvrL6WMV0eUVr5J5wjVKO+0GEApclne1cT91Qc0kOQKlk63U9yGFLRO0K1H6klQQusY9aEcwmO0/JB+VlsyqV3HnScW+uxjmwxxmNX8VnXb32SQuavDSYjbzYG1xipA9XBVGTPOhc7jGjsCwlng2unDYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196883; c=relaxed/simple; bh=E5DXNSbzapUKppWgx9yarWp9EL2Cugoyg6JuA+LJ6SQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QU81OvoYu6omW2RdP8uU4aw8cIGsB/NKdhRBgx47C7DDQ6CG2iJ3FHWmItebJoRukRTEIJ+NI0yvUzwInYX0rHAeeIrvTgX1IYmfD55rgMsxQMfM/vzFHZsHJQKP5YUk4TaskI2ZDr4fu5XUHGGCAVuNE7eVaYeUL2pdoVCWKRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NtUlGFTp; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NtUlGFTp" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-3b9e415a68eso708293f8f.2; Thu, 14 Aug 2025 11:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755196879; x=1755801679; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2ykD7n53ivDyU/GviBTKiHTwMYber4UFsbL7XDVUan0=; b=NtUlGFTpNMM8CSZmkwHnw4svtCR0oDvwKYx2Tsx3wh0bThTK38Ej8hHSHxxbs8CJS7 /+gwH/LFgoIT8o6LoqfJOe8WNV7HXoITHST2QfR+PdCBY4PbVMK6FVk2LeNNlyKpUkZN iQtH3NKXXlsxHy08Xg16ZW7g/UQ9XZmZjFx8vZQPTJDafCjOX5UmoypUiTKJkCMoH99o Eo0vYlR48dZT3jn3c4UFmx7iWDmYWTP6SxT/iAZ+SKZvFOVQ4VwbO4jy/PQEIsozpHh9 ym3kKQPpqHRfEj+SFZN5INwQ6e3b1Ws3zfB4TO3+qbdKV258SSp9FJpgeGivqkW2ujkv rh+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755196879; x=1755801679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2ykD7n53ivDyU/GviBTKiHTwMYber4UFsbL7XDVUan0=; b=VWu1dituxBDpwV6FY/ucquuWfNiJ+K5mIWteblUjUwaXGYb7UMuaRG5hI3wVfByGPb Zig2ENDgfmq3VrLerg0rhj2j347I8QfUVk3WcVb5DPKSf+45Zr4WbqYRzsNa+Ka72d0R 6HOoWHT9NK18WNLOeSCg7Q9+A/BDuFy7VT5Tl0CQ9zpvBR6Cc9NW/EMCUn5zwvIkTtIX 74PntlmIik0GUv7AqZkUqxw+kWNVj9r+k6ibDKpEn14DzXXEV55lezRcIa95AZz/reAN CQJSlKXLbJKas3lZyvPzgn6jZS3H1bdnrBpwl3FECnpdj/lfJfz1Bxl750sEqaeJvICp 1xgA== X-Forwarded-Encrypted: i=1; AJvYcCUFByFaqgNnXMU6UXCrx5zvsOJmi6ZNqeQCJ5uhRGCxRxyrn7H2LXZSaHvSKlvj1v5hCCal+o8EQehzqr9G@vger.kernel.org, AJvYcCVXfDcBnbi7wxVHtiwIG1UKc9X4hrE/Sz38biaNryVtzCjyvAWX+p34tnFLL9hfd5cDfJ+tETS+Erin@vger.kernel.org, AJvYcCX2GV4qlYluFd/wr5TJ2wgyTs0z2HAJGI4YmCqPrNOVjgucHXjogA07Z3kciP7f4kM/ocEgKkUuQt9D@vger.kernel.org, AJvYcCXwJa1o9xjQfE07HDV64pHbSyfyITfh+HipdosX9d9X8etgl3tOzR7QFoC9lwxpq5ob9ZDwDEDZ6P2lPiQ0TnbKLPY=@vger.kernel.org X-Gm-Message-State: AOJu0YwRUjfzru4ge4Nhm8hDZxaUIoWqtkquobDXJtyBHXgULgm8F+va zJ2t1BnqxPLuLezVf/dUR/gf5Uy/TgKFys8JmZJpJNfteIvsHFiD0ztBk6vY0gZ7qk8= X-Gm-Gg: ASbGncvLbM+FAf+yrbuFMtWStV47+xpg4QEG3SbKD4Yl3vJNOXyP1Os1KdwNh4sJdoq 1XlknWMZitC0Tn0h54l2Qxz6ZFa8+s+HadK9i/hND/z3JQSPONxmSKVYnShz/DuiJcjtWDciDCZ lmCeVBDVByzoStlTlhrQOeBLIJnKWSCvEAvaR71yrMqNWXvGTqI/SN7AE26n/Lfq5OeBgWgwBoJ 1I7YSCpb8yM7gR9IbUw8AiYrb4+2JEJIWFMIRo6TTgQqwxZZpbrsfJpe1+Rx1cM4cWvFQDjq5S+ +ct63FMiQIffa18zXhxrsAWXqhe/1cmUADCsJw+8hxAGKHFQhQZ6rS4mMAelC/1gqqf/9xs8QRY ClBr68lp+xN626yo9ltxkgbFm5vkboSTgCpfOTahJIOiNWq4amVi2bvEqsUMgHOcgqFSj+HKTGA == X-Google-Smtp-Source: AGHT+IGbjXbLTfGvDbBXosr9Qz6QMoggC/Cx2R2yTiVCS48fHaW9RG27CU1bk0CYXblJtqTiNkH1jg== X-Received: by 2002:a05:6000:230b:b0:3a5:8934:493a with SMTP id ffacd0b85a97d-3b9edf5a275mr3734740f8f.44.1755196878503; Thu, 14 Aug 2025 11:41:18 -0700 (PDT) Received: from biju.lan (host31-53-6-191.range31-53.btcentralplus.com. [31.53.6.191]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453aeasm53744383f8f.40.2025.08.14.11.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 11:41:18 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 1/7] dt-bindings: pwm: renesas,rzg2l-gpt: Document RZ/G3E support Date: Thu, 14 Aug 2025 19:41:05 +0100 Message-ID: <20250814184115.192930-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> References: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Document support for the GPT found on the Renesas RZ/G3E (R9A09G047) SoC. The GPT IP on these parts is similar to that on RZ/G2L but supports only 8 interrupts per channel and has multiple clocks and resets. Introduce a new compatible string `renesas,r9a09g047-gpt` for RZ/G3E. Signed-off-by: Biju Das Reviewed-by: Tommaso Merciai --- .../bindings/pwm/renesas,rzg2l-gpt.yaml | 525 ++++++++++++------ 1 file changed, 356 insertions(+), 169 deletions(-) diff --git a/Documentation/devicetree/bindings/pwm/renesas,rzg2l-gpt.yaml b= /Documentation/devicetree/bindings/pwm/renesas,rzg2l-gpt.yaml index 13b807765a30..6250dbb200e7 100644 --- a/Documentation/devicetree/bindings/pwm/renesas,rzg2l-gpt.yaml +++ b/Documentation/devicetree/bindings/pwm/renesas,rzg2l-gpt.yaml @@ -58,11 +58,14 @@ description: | =20 properties: compatible: - items: - - enum: - - renesas,r9a07g044-gpt # RZ/G2{L,LC} - - renesas,r9a07g054-gpt # RZ/V2L - - const: renesas,rzg2l-gpt + oneOf: + - items: + - enum: + - renesas,r9a07g044-gpt # RZ/G2{L,LC} + - renesas,r9a07g054-gpt # RZ/V2L + - const: renesas,rzg2l-gpt + + - const: renesas,r9a09g047-gpt # RZ/G3E =20 reg: maxItems: 1 @@ -71,179 +74,327 @@ properties: const: 3 =20 interrupts: - items: - - description: GPT32E0.GTCCRA input capture/compare match - - description: GPT32E0.GTCCRB input capture/compare - - description: GPT32E0.GTCCRC compare match - - description: GPT32E0.GTCCRD compare match - - description: GPT32E0.GTCCRE compare match - - description: GPT32E0.GTCCRF compare match - - description: GPT32E0.GTADTRA compare match - - description: GPT32E0.GTADTRB compare match - - description: GPT32E0.GTCNT overflow/GTPR compare match - - description: GPT32E0.GTCNT underflow - - description: GPT32E1.GTCCRA input capture/compare match - - description: GPT32E1.GTCCRB input capture/compare - - description: GPT32E1.GTCCRC compare match - - description: GPT32E1.GTCCRD compare match - - description: GPT32E1.GTCCRE compare match - - description: GPT32E1.GTCCRF compare match - - description: GPT32E1.GTADTRA compare match - - description: GPT32E1.GTADTRB compare match - - description: GPT32E1.GTCNT overflow/GTPR compare match - - description: GPT32E1.GTCNT underflow - - description: GPT32E2.GTCCRA input capture/compare match - - description: GPT32E2.GTCCRB input capture/compare - - description: GPT32E2.GTCCRC compare match - - description: GPT32E2.GTCCRD compare match - - description: GPT32E2.GTCCRE compare match - - description: GPT32E2.GTCCRF compare match - - description: GPT32E2.GTADTRA compare match - - description: GPT32E2.GTADTRB compare match - - description: GPT32E2.GTCNT overflow/GTPR compare match - - description: GPT32E2.GTCNT underflow - - description: GPT32E3.GTCCRA input capture/compare match - - description: GPT32E3.GTCCRB input capture/compare - - description: GPT32E3.GTCCRC compare match - - description: GPT32E3.GTCCRD compare match - - description: GPT32E3.GTCCRE compare match - - description: GPT32E3.GTCCRF compare match - - description: GPT32E3.GTADTRA compare match - - description: GPT32E3.GTADTRB compare match - - description: GPT32E3.GTCNT overflow/GTPR compare match - - description: GPT32E3.GTCNT underflow - - description: GPT32E4.GTCCRA input capture/compare match - - description: GPT32E4.GTCCRB input capture/compare - - description: GPT32E4.GTCCRC compare match - - description: GPT32E4.GTCCRD compare match - - description: GPT32E4.GTCCRE compare match - - description: GPT32E4.GTCCRF compare match - - description: GPT32E4.GTADTRA compare match - - description: GPT32E4.GTADTRB compare match - - description: GPT32E4.GTCNT overflow/GTPR compare match - - description: GPT32E4.GTCNT underflow - - description: GPT32E5.GTCCRA input capture/compare match - - description: GPT32E5.GTCCRB input capture/compare - - description: GPT32E5.GTCCRC compare match - - description: GPT32E5.GTCCRD compare match - - description: GPT32E5.GTCCRE compare match - - description: GPT32E5.GTCCRF compare match - - description: GPT32E5.GTADTRA compare match - - description: GPT32E5.GTADTRB compare match - - description: GPT32E5.GTCNT overflow/GTPR compare match - - description: GPT32E5.GTCNT underflow - - description: GPT32E6.GTCCRA input capture/compare match - - description: GPT32E6.GTCCRB input capture/compare - - description: GPT32E6.GTCCRC compare match - - description: GPT32E6.GTCCRD compare match - - description: GPT32E6.GTCCRE compare match - - description: GPT32E6.GTCCRF compare match - - description: GPT32E6.GTADTRA compare match - - description: GPT32E6.GTADTRB compare match - - description: GPT32E6.GTCNT overflow/GTPR compare match - - description: GPT32E6.GTCNT underflow - - description: GPT32E7.GTCCRA input capture/compare match - - description: GPT32E7.GTCCRB input capture/compare - - description: GPT32E7.GTCCRC compare match - - description: GPT32E7.GTCCRD compare match - - description: GPT32E7.GTCCRE compare match - - description: GPT32E7.GTCCRF compare match - - description: GPT32E7.GTADTRA compare match - - description: GPT32E7.GTADTRB compare match - - description: GPT32E7.GTCNT overflow/GTPR compare match - - description: GPT32E7.GTCNT underflow + oneOf: + - items: + - description: GPT32E0.GTCCRA input capture/compare match + - description: GPT32E0.GTCCRB input capture/compare + - description: GPT32E0.GTCCRC compare match + - description: GPT32E0.GTCCRD compare match + - description: GPT32E0.GTCCRE compare match + - description: GPT32E0.GTCCRF compare match + - description: GPT32E0.GTADTRA compare match + - description: GPT32E0.GTADTRB compare match + - description: GPT32E0.GTCNT overflow/GTPR compare match + - description: GPT32E0.GTCNT underflow + - description: GPT32E1.GTCCRA input capture/compare match + - description: GPT32E1.GTCCRB input capture/compare + - description: GPT32E1.GTCCRC compare match + - description: GPT32E1.GTCCRD compare match + - description: GPT32E1.GTCCRE compare match + - description: GPT32E1.GTCCRF compare match + - description: GPT32E1.GTADTRA compare match + - description: GPT32E1.GTADTRB compare match + - description: GPT32E1.GTCNT overflow/GTPR compare match + - description: GPT32E1.GTCNT underflow + - description: GPT32E2.GTCCRA input capture/compare match + - description: GPT32E2.GTCCRB input capture/compare + - description: GPT32E2.GTCCRC compare match + - description: GPT32E2.GTCCRD compare match + - description: GPT32E2.GTCCRE compare match + - description: GPT32E2.GTCCRF compare match + - description: GPT32E2.GTADTRA compare match + - description: GPT32E2.GTADTRB compare match + - description: GPT32E2.GTCNT overflow/GTPR compare match + - description: GPT32E2.GTCNT underflow + - description: GPT32E3.GTCCRA input capture/compare match + - description: GPT32E3.GTCCRB input capture/compare + - description: GPT32E3.GTCCRC compare match + - description: GPT32E3.GTCCRD compare match + - description: GPT32E3.GTCCRE compare match + - description: GPT32E3.GTCCRF compare match + - description: GPT32E3.GTADTRA compare match + - description: GPT32E3.GTADTRB compare match + - description: GPT32E3.GTCNT overflow/GTPR compare match + - description: GPT32E3.GTCNT underflow + - description: GPT32E4.GTCCRA input capture/compare match + - description: GPT32E4.GTCCRB input capture/compare + - description: GPT32E4.GTCCRC compare match + - description: GPT32E4.GTCCRD compare match + - description: GPT32E4.GTCCRE compare match + - description: GPT32E4.GTCCRF compare match + - description: GPT32E4.GTADTRA compare match + - description: GPT32E4.GTADTRB compare match + - description: GPT32E4.GTCNT overflow/GTPR compare match + - description: GPT32E4.GTCNT underflow + - description: GPT32E5.GTCCRA input capture/compare match + - description: GPT32E5.GTCCRB input capture/compare + - description: GPT32E5.GTCCRC compare match + - description: GPT32E5.GTCCRD compare match + - description: GPT32E5.GTCCRE compare match + - description: GPT32E5.GTCCRF compare match + - description: GPT32E5.GTADTRA compare match + - description: GPT32E5.GTADTRB compare match + - description: GPT32E5.GTCNT overflow/GTPR compare match + - description: GPT32E5.GTCNT underflow + - description: GPT32E6.GTCCRA input capture/compare match + - description: GPT32E6.GTCCRB input capture/compare + - description: GPT32E6.GTCCRC compare match + - description: GPT32E6.GTCCRD compare match + - description: GPT32E6.GTCCRE compare match + - description: GPT32E6.GTCCRF compare match + - description: GPT32E6.GTADTRA compare match + - description: GPT32E6.GTADTRB compare match + - description: GPT32E6.GTCNT overflow/GTPR compare match + - description: GPT32E6.GTCNT underflow + - description: GPT32E7.GTCCRA input capture/compare match + - description: GPT32E7.GTCCRB input capture/compare + - description: GPT32E7.GTCCRC compare match + - description: GPT32E7.GTCCRD compare match + - description: GPT32E7.GTCCRE compare match + - description: GPT32E7.GTCCRF compare match + - description: GPT32E7.GTADTRA compare match + - description: GPT32E7.GTADTRB compare match + - description: GPT32E7.GTCNT overflow/GTPR compare match + - description: GPT32E7.GTCNT underflow + - items: + - description: Input capture/compare match of the GTCCRA for cha= nnel 0 and 8 + - description: Input capture/compare match of the GTCCRB for cha= nnel 0 and 8 + - description: Compare match with the GTCCRC for channel 0 and 8 + - description: Compare match with the GTCCRD for channel 0 and 8 + - description: Compare match with the GTCCRE for channel 0 and 8 + - description: Compare match with the GTCCRF for channel 0 and 8 + - description: A and B both high interrupt for channel 0 and 8 + - description: A and B both low interrupt for channel 0 and 8 + - description: Input capture/compare match of the GTCCRA for cha= nnel 1 and 9 + - description: Input capture/compare match of the GTCCRB for cha= nnel 1 and 9 + - description: Compare match with the GTCCRC for channel 1 and 9 + - description: Compare match with the GTCCRD for channel 1 and 9 + - description: Compare match with the GTCCRE for channel 1 and 9 + - description: Compare match with the GTCCRF for channel 1 and 9 + - description: A and B both high interrupt for channel 1 and 9 + - description: A and B both low interrupt for channel 1 and 9 + - description: Input capture/compare match of the GTCCRA for cha= nnel 2 and 10 + - description: Input capture/compare match of the GTCCRB for cha= nnel 2 and 10 + - description: Compare match with the GTCCRC for channel 2 and 10 + - description: Compare match with the GTCCRD for channel 2 and 10 + - description: Compare match with the GTCCRE for channel 2 and 10 + - description: Compare match with the GTCCRF for channel 2 and 10 + - description: A and B both high interrupt for channel 2 and 10 + - description: A and B both low interrupt for channel 2 and 10 + - description: Input capture/compare match of the GTCCRA for cha= nnel 3 and 11 + - description: Input capture/compare match of the GTCCRB for cha= nnel 3 and 11 + - description: Compare match with the GTCCRC for channel 3 and 11 + - description: Compare match with the GTCCRD for channel 3 and 11 + - description: Compare match with the GTCCRE for channel 3 and 11 + - description: Compare match with the GTCCRF for channel 3 and 11 + - description: A and B both high interrupt for channel 3 and 11 + - description: A and B both low interrupt for channel 3 and 11 + - description: Input capture/compare match of the GTCCRA for cha= nnel 4 and 12 + - description: Input capture/compare match of the GTCCRB for cha= nnel 4 and 12 + - description: Compare match with the GTCCRC for channel 4 and 12 + - description: Compare match with the GTCCRD for channel 4 and 12 + - description: Compare match with the GTCCRE for channel 4 and 12 + - description: Compare match with the GTCCRF for channel 4 and 12 + - description: A and B both high interrupt for channel 4 and 12 + - description: A and B both low interrupt for channel 4 and 12 + - description: Input capture/compare match of the GTCCRA for cha= nnel 5 and 13 + - description: Input capture/compare match of the GTCCRB for cha= nnel 5 and 13 + - description: Compare match with the GTCCRC for channel 5 and 13 + - description: Compare match with the GTCCRD for channel 5 and 13 + - description: Compare match with the GTCCRE for channel 5 and 13 + - description: Compare match with the GTCCRF for channel 5 and 13 + - description: A and B both high interrupt for channel 5 and 13 + - description: A and B both low interrupt for channel 5 and 13 + - description: Input capture/compare match of the GTCCRA for cha= nnel 6 and 14 + - description: Input capture/compare match of the GTCCRB for cha= nnel 6 and 14 + - description: Compare match with the GTCCRC for channel 6 and 14 + - description: Compare match with the GTCCRD for channel 6 and 14 + - description: Compare match with the GTCCRE for channel 6 and 14 + - description: Compare match with the GTCCRF for channel 6 and 14 + - description: A and B both high interrupt for channel 6 and 14 + - description: A and B both low interrupt for channel 6 and 14 + - description: Input capture/compare match of the GTCCRA for cha= nnel 7 and 15 + - description: Input capture/compare match of the GTCCRB for cha= nnel 7 and 15 + - description: Compare match with the GTCCRC for channel 7 and 15 + - description: Compare match with the GTCCRD for channel 7 and 15 + - description: Compare match with the GTCCRE for channel 7 and 15 + - description: Compare match with the GTCCRF for channel 7 and 15 + - description: A and B both high interrupt for channel 7 and 15 + - description: A and B both low interrupt for channel 7 and 15 =20 interrupt-names: - items: - - const: ccmpa0 - - const: ccmpb0 - - const: cmpc0 - - const: cmpd0 - - const: cmpe0 - - const: cmpf0 - - const: adtrga0 - - const: adtrgb0 - - const: ovf0 - - const: unf0 - - const: ccmpa1 - - const: ccmpb1 - - const: cmpc1 - - const: cmpd1 - - const: cmpe1 - - const: cmpf1 - - const: adtrga1 - - const: adtrgb1 - - const: ovf1 - - const: unf1 - - const: ccmpa2 - - const: ccmpb2 - - const: cmpc2 - - const: cmpd2 - - const: cmpe2 - - const: cmpf2 - - const: adtrga2 - - const: adtrgb2 - - const: ovf2 - - const: unf2 - - const: ccmpa3 - - const: ccmpb3 - - const: cmpc3 - - const: cmpd3 - - const: cmpe3 - - const: cmpf3 - - const: adtrga3 - - const: adtrgb3 - - const: ovf3 - - const: unf3 - - const: ccmpa4 - - const: ccmpb4 - - const: cmpc4 - - const: cmpd4 - - const: cmpe4 - - const: cmpf4 - - const: adtrga4 - - const: adtrgb4 - - const: ovf4 - - const: unf4 - - const: ccmpa5 - - const: ccmpb5 - - const: cmpc5 - - const: cmpd5 - - const: cmpe5 - - const: cmpf5 - - const: adtrga5 - - const: adtrgb5 - - const: ovf5 - - const: unf5 - - const: ccmpa6 - - const: ccmpb6 - - const: cmpc6 - - const: cmpd6 - - const: cmpe6 - - const: cmpf6 - - const: adtrga6 - - const: adtrgb6 - - const: ovf6 - - const: unf6 - - const: ccmpa7 - - const: ccmpb7 - - const: cmpc7 - - const: cmpd7 - - const: cmpe7 - - const: cmpf7 - - const: adtrga7 - - const: adtrgb7 - - const: ovf7 - - const: unf7 + oneOf: + - items: + - const: ccmpa0 + - const: ccmpb0 + - const: cmpc0 + - const: cmpd0 + - const: cmpe0 + - const: cmpf0 + - const: adtrga0 + - const: adtrgb0 + - const: ovf0 + - const: unf0 + - const: ccmpa1 + - const: ccmpb1 + - const: cmpc1 + - const: cmpd1 + - const: cmpe1 + - const: cmpf1 + - const: adtrga1 + - const: adtrgb1 + - const: ovf1 + - const: unf1 + - const: ccmpa2 + - const: ccmpb2 + - const: cmpc2 + - const: cmpd2 + - const: cmpe2 + - const: cmpf2 + - const: adtrga2 + - const: adtrgb2 + - const: ovf2 + - const: unf2 + - const: ccmpa3 + - const: ccmpb3 + - const: cmpc3 + - const: cmpd3 + - const: cmpe3 + - const: cmpf3 + - const: adtrga3 + - const: adtrgb3 + - const: ovf3 + - const: unf3 + - const: ccmpa4 + - const: ccmpb4 + - const: cmpc4 + - const: cmpd4 + - const: cmpe4 + - const: cmpf4 + - const: adtrga4 + - const: adtrgb4 + - const: ovf4 + - const: unf4 + - const: ccmpa5 + - const: ccmpb5 + - const: cmpc5 + - const: cmpd5 + - const: cmpe5 + - const: cmpf5 + - const: adtrga5 + - const: adtrgb5 + - const: ovf5 + - const: unf5 + - const: ccmpa6 + - const: ccmpb6 + - const: cmpc6 + - const: cmpd6 + - const: cmpe6 + - const: cmpf6 + - const: adtrga6 + - const: adtrgb6 + - const: ovf6 + - const: unf6 + - const: ccmpa7 + - const: ccmpb7 + - const: cmpc7 + - const: cmpd7 + - const: cmpe7 + - const: cmpf7 + - const: adtrga7 + - const: adtrgb7 + - const: ovf7 + - const: unf7 + - items: + - const: gtcia0 + - const: gtcib0 + - const: gtcic0 + - const: gtcid0 + - const: gtcie0 + - const: gtcif0 + - const: gtcih0 + - const: gtcil0 + - const: gtcia1 + - const: gtcib1 + - const: gtcic1 + - const: gtcid1 + - const: gtcie1 + - const: gtcif1 + - const: gtcih1 + - const: gtcil1 + - const: gtcia2 + - const: gtcib2 + - const: gtcic2 + - const: gtcid2 + - const: gtcie2 + - const: gtcif2 + - const: gtcih2 + - const: gtcil2 + - const: gtcia3 + - const: gtcib3 + - const: gtcic3 + - const: gtcid3 + - const: gtcie3 + - const: gtcif3 + - const: gtcih3 + - const: gtcil3 + - const: gtcia4 + - const: gtcib4 + - const: gtcic4 + - const: gtcid4 + - const: gtcie4 + - const: gtcif4 + - const: gtcih4 + - const: gtcil4 + - const: gtcia5 + - const: gtcib5 + - const: gtcic5 + - const: gtcid5 + - const: gtcie5 + - const: gtcif5 + - const: gtcih5 + - const: gtcil5 + - const: gtcia6 + - const: gtcib6 + - const: gtcic6 + - const: gtcid6 + - const: gtcie6 + - const: gtcif6 + - const: gtcih6 + - const: gtcil6 + - const: gtcia7 + - const: gtcib7 + - const: gtcic7 + - const: gtcid7 + - const: gtcie7 + - const: gtcif7 + - const: gtcih7 + - const: gtcil7 =20 clocks: - maxItems: 1 + items: + - description: Core clock (PCLKD) + - description: Bus clock (PCLKA) + minItems: 1 + + clock-names: + items: + - const: core + - const: bus =20 power-domains: maxItems: 1 =20 resets: - maxItems: 1 + items: + - description: Reset for bus clock (PCLKA/PCLKD) + - description: Reset for core clock (PCLKD) + minItems: 1 + + reset-names: + items: + - const: rst_p + - const: rst_s =20 required: - compatible @@ -257,6 +408,42 @@ required: allOf: - $ref: pwm.yaml# =20 + - if: + properties: + compatible: + contains: + const: renesas,r9a09g047-gpt + then: + properties: + clocks: + minItems: 2 + resets: + minItems: 2 + interrupts: + maxItems: 64 + interrupt-names: + maxItems: 64 + + required: + - clock-names + - reset-names + + - if: + properties: + compatible: + contains: + const: renesas,rzg2l-gpt + then: + properties: + clocks: + maxItems: 1 + resets: + maxItems: 1 + interrupts: + minItems: 80 + interrupt-names: + minItems: 80 + additionalProperties: false =20 examples: --=20 2.43.0 From nobody Sat Oct 4 15:59:01 2025 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 C1A36230270; Thu, 14 Aug 2025 18:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196882; cv=none; b=T8vvMtN6TnSawzdQr9eL8XY+91Kf5VpH+lVrG0ohsjkMyXt6+Z19P8OyBlQb3jlKgjnE8Yvs0nZjmpkHOrPJt9GfG9RJjR6jlOV1h87CohByYHmQXskyruhMg6p1UVBqi90EIx7tWMk7wXRM3MMNj/264hN4g8H0QmqjAL/tRWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196882; c=relaxed/simple; bh=7P9RQMxfnYZe9ayZSvmL1RkWQDxQBRTpt8EBlClunxQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uun9Fo2JMoGiwdKip2VJlI3y5YFiZiyRd7RePuDkfMTqCgXD/VvGg+1FJMMuffGprPgmlL4oCJAdbDQRpa/aqjUj6nPmp6YD1DSm47MLhl2YlnSNPYzmdfmzHqFLmHX8ch7xvZJfoyYZnQibZ32PjJCPjD8gEisbK9COrgn5cqE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Zm0AKpHd; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zm0AKpHd" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3b9edf504e6so654763f8f.3; Thu, 14 Aug 2025 11:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755196879; x=1755801679; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oX9RdwakuSJos+Ns603jeBf+/qXKiht9qzh9vf0nZbI=; b=Zm0AKpHd1L0sw4oyIkmqmBt8kYPiths6XfQfWWiYq6oO3+k7yVRoJ4dNF37cNBCyz7 Sk1xM3W9cGRNVR48ZtBZisI2Se6WK4PfJUCgzaF9roS+Oqo8BdMRv29ylWz2UcFSndob Q90+v280Y9xa0S+uDOTS8P6KRu00sCnro40vK0+V7n7tyU867BAH4ODzeIrNHZmf8Fi/ zRhj61bZggd+gjwTeXRWq7b1hNhRMatm57KpjeO+nGJGuu3ZLkyceuk+myHB8vJ5JmcA jlfmNvveEdqmMCmaBeFxGcY/aFpzHpVL439eX5qOOoWZTX+mtTNvnWh22Vj0uOzdrTCf CLUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755196879; x=1755801679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oX9RdwakuSJos+Ns603jeBf+/qXKiht9qzh9vf0nZbI=; b=u6BE2RQpBFY2tmdCGXt85A6vK8oi/+VxTZTMfUQcGq4Vf5CG1j1SezFugZSpJlwzL+ T08xfFKneBbh/iAp5GGpH8BnF4SXrfIikVtaRN13dgsrQ6Ou8Jt5euC9u893QGcf4duY n3tZ9VEIcTySZAL8YCDmaAclOYPQN0/RccGYVIGieK5SCcC1sVdko70OVMsfRMopBJUT aUMo3B2wUAs55waaeeLj4HvIyfF7VHbSQFiUJasw01Rg6/IHXMvhHVl/K41WxoqxoOEh Nm5WTR5K27mOgqBc/ehARvl7ArROwPwHSFPTRDul1ZD/TaICXnxTM9RzVPAM0rddMC0J fMpg== X-Forwarded-Encrypted: i=1; AJvYcCUCqwkTV/KH4nVfveVxj6xB1DHmINP+8+DW+IQNP/rMTW1ql2v8QOPm49GLReEmen7jAjORgYbAvwKjkoU=@vger.kernel.org, AJvYcCWSemi7eSf2rAXyrKxS2VXrEgqpaIsNIygi4dRkdAca5Y58YJFpJCen6eoNLcqRFchslnnCGdpdFYzqpPnwSm6iuyI=@vger.kernel.org, AJvYcCWo74YcqpnSNrXbSmPDw2740YlomRTZjX46dLK0lKo5CA3j8h5szkdwPzJ8e8dCS/9j1HutKhLaPsgQ@vger.kernel.org X-Gm-Message-State: AOJu0Yxnwp88vGPBbn6xwerkqYS8B3LB7CXFipNNoZjkFOE9J2mJxJ5P R67AJ2rFkm3I/5d4o9VBxKeeQShakal0MNNBInrCel49jOEPPGZIUncz X-Gm-Gg: ASbGncvQUFazc3zLTvkkE2zwdeRXcAb9s+z1VsmQN3vMhdVcXwIKSAyxScUunHXmOD7 5PsAPIU0GFULhITTho2LmFb+/VfgN/hT6b9Ar+MRMMSo2aAypQj55UhLgaK3Z6DehG5oWinJnXu vVCRdiJvw50lAjD2ZOeb1X8+8cNfI2wJUExjiFgQziSAiP/thDE2nXn6ozbEJN81CHRcuiL2QAh mzcHq7IWvkJM4LlK79SydBr+nuoF1SOxhX0juxVMbmUewXo1F2LhVzZljunvqi6OWcxjTTTjed/ f/xEX99GdDsMqF82KdRVZN/zOjoAWmQh7mNvZ04v4wmHrUwhxNVGcJhTf19ckuHCai4Nx5TDwsn I67sMR7HQpNoeEwVurjQ+QJDwAoMqfxGHylKTJwE7fBm/TFDOrm93cucLZ76ep0gtWdgbTsVCwQ == X-Google-Smtp-Source: AGHT+IFJCN0PYyIVxRhegWZuyYhBJnyddimqMqmbZlDZcEpyEIr1u/KfBKS5DhZk9bRWXgFGEdQuDw== X-Received: by 2002:a05:6000:4014:b0:3b8:5b26:b3c6 with SMTP id ffacd0b85a97d-3b9edf5bff4mr3967381f8f.48.1755196879016; Thu, 14 Aug 2025 11:41:19 -0700 (PDT) Received: from biju.lan (host31-53-6-191.range31-53.btcentralplus.com. [31.53.6.191]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453aeasm53744383f8f.40.2025.08.14.11.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 11:41:18 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 2/7] pwm: rzg2l-gpt: Add info variable to struct rzg2l_gpt_chip Date: Thu, 14 Aug 2025 19:41:06 +0100 Message-ID: <20250814184115.192930-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> References: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das RZ/G3E GPT IP is similar to the one found on RZ/G2L GPT, but there are some differences. The field width of prescalar on RZ/G3E is 4 whereas on RZ/G2L it is 3. Add rzg2l_gpt_info variable to handle this differences. The FIELD_PREP and FIELD_GET macro is giving compilation issue as the parameters are not build time constants. So added Non-constant mask variant of FIELD_GET() and FIELD_PREP(). Signed-off-by: Biju Das Reviewed-by: Tommaso Merciai --- drivers/pwm/pwm-rzg2l-gpt.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-rzg2l-gpt.c b/drivers/pwm/pwm-rzg2l-gpt.c index f0a8531457ca..bf989defa527 100644 --- a/drivers/pwm/pwm-rzg2l-gpt.c +++ b/drivers/pwm/pwm-rzg2l-gpt.c @@ -33,6 +33,19 @@ #include #include =20 +/* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ +#define field_get(_mask, _reg) \ +({\ + typeof(_mask) (mask) =3D (_mask); \ + (((_reg) & (mask)) >> (ffs(mask) - 1)); \ +}) + +#define field_prep(_mask, _val) \ +({\ + typeof(_mask) (mask) =3D (_mask); \ + (((_val) << (ffs(mask) - 1)) & (mask)); \ +}) + #define RZG2L_GET_CH(hwpwm) ((hwpwm) / 2) #define RZG2L_GET_CH_OFFS(ch) (0x100 * (ch)) =20 @@ -46,7 +59,6 @@ =20 #define RZG2L_GTCR_CST BIT(0) #define RZG2L_GTCR_MD GENMASK(18, 16) -#define RZG2L_GTCR_TPCS GENMASK(26, 24) =20 #define RZG2L_GTCR_MD_SAW_WAVE_PWM_MODE FIELD_PREP(RZG2L_GTCR_MD, 0) =20 @@ -77,9 +89,14 @@ #define RZG2L_MAX_SCALE_FACTOR 1024 #define RZG2L_MAX_TICKS ((u64)U32_MAX * RZG2L_MAX_SCALE_FACTOR) =20 +struct rzg2l_gpt_info { + u32 gtcr_tpcs_mask; +}; + struct rzg2l_gpt_chip { void __iomem *mmio; struct mutex lock; /* lock to protect shared channel resources */ + const struct rzg2l_gpt_info *info; unsigned long rate_khz; u32 period_ticks[RZG2L_MAX_HW_CHANNELS]; u32 channel_request_count[RZG2L_MAX_HW_CHANNELS]; @@ -317,7 +334,7 @@ static int rzg2l_gpt_read_waveform(struct pwm_chip *chi= p, =20 if (rzg2l_gpt_is_ch_enabled(rzg2l_gpt, pwm->hwpwm)) { gtcr =3D rzg2l_gpt_read(rzg2l_gpt, RZG2L_GTCR(ch)); - wfhw->prescale =3D FIELD_GET(RZG2L_GTCR_TPCS, gtcr); + wfhw->prescale =3D field_get(rzg2l_gpt->info->gtcr_tpcs_mask, gtcr); wfhw->gtpr =3D rzg2l_gpt_read(rzg2l_gpt, RZG2L_GTPR(ch)); wfhw->gtccr =3D rzg2l_gpt_read(rzg2l_gpt, RZG2L_GTCCR(ch, sub_ch)); if (wfhw->gtccr > wfhw->gtpr) @@ -354,8 +371,8 @@ static int rzg2l_gpt_write_waveform(struct pwm_chip *ch= ip, rzg2l_gpt_write(rzg2l_gpt, RZG2L_GTUDDTYC(ch), RZG2L_GTUDDTYC_UP_COUNTIN= G); =20 /* Select count clock */ - rzg2l_gpt_modify(rzg2l_gpt, RZG2L_GTCR(ch), RZG2L_GTCR_TPCS, - FIELD_PREP(RZG2L_GTCR_TPCS, wfhw->prescale)); + rzg2l_gpt_modify(rzg2l_gpt, RZG2L_GTCR(ch), rzg2l_gpt->info->gtcr_tpcs_m= ask, + field_prep(rzg2l_gpt->info->gtcr_tpcs_mask, wfhw->prescale)); =20 /* Set period */ rzg2l_gpt_write(rzg2l_gpt, RZG2L_GTPR(ch), wfhw->gtpr); @@ -414,6 +431,8 @@ static int rzg2l_gpt_probe(struct platform_device *pdev) if (IS_ERR(rzg2l_gpt->mmio)) return PTR_ERR(rzg2l_gpt->mmio); =20 + rzg2l_gpt->info =3D of_device_get_match_data(dev); + rstc =3D devm_reset_control_get_exclusive_deasserted(dev, NULL); if (IS_ERR(rstc)) return dev_err_probe(dev, PTR_ERR(rstc), "Cannot deassert reset control\= n"); @@ -456,8 +475,12 @@ static int rzg2l_gpt_probe(struct platform_device *pde= v) return 0; } =20 +static const struct rzg2l_gpt_info rzg2l_data =3D { + .gtcr_tpcs_mask =3D GENMASK(26, 24), +}; + static const struct of_device_id rzg2l_gpt_of_table[] =3D { - { .compatible =3D "renesas,rzg2l-gpt", }, + { .compatible =3D "renesas,rzg2l-gpt", .data =3D &rzg2l_data }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, rzg2l_gpt_of_table); --=20 2.43.0 From nobody Sat Oct 4 15:59:01 2025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 84FB92309B0; Thu, 14 Aug 2025 18:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196883; cv=none; b=rAmQkyR2rReIcxucSBs1liJh0tq1O7gFTsW/EVq3jI704D9ucqWuIMQPUMa/yEOxGFgOk9LuDrwinEyVpwNTIpahOo1nGXo124LbqD0q9YSmPrgN1CF8Dem9ZbKUQ4+bu0GtNt7rx4KXLzJDopHClM+4wYHfsrt34lpIgy/ZgAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196883; c=relaxed/simple; bh=6vn1+wZkNtbvDhSSPowJXWhlwH664kiOtVWN5S+M7ME=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FzZtC5UYqyDgMwgxI7GoGhVRIyhgmvE2HHZO2wM8kXLoiKp66a1+V9XewuQ/0TxGoJLlNF2dsAsT6rkfGvbNmcjXvxfyrTtH7lxcztlyjIEgg1l5guZwz2/4yyOE62zmVApr/wKwscFjKBDIeeQ5di8nKgSug7u3VvRtMtHyc+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nn7Tk2VR; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nn7Tk2VR" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-45a1b004954so9120455e9.0; Thu, 14 Aug 2025 11:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755196880; x=1755801680; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x8K/ROQh3Tjz4xO7596husJI9J7hKXNq0i/Y5M+mi7M=; b=Nn7Tk2VR1wcgYDJzsWzClLwDp3ww+iEOmR6CnqxCs1+3h1apZPveS/1KFYIJIQE+iy NnpPJCYh1Gr4kFE/Clx0WIqcaFx3HaNZx47ztAJCXDinC3bzfkNb/xF1jl8ZjPeR1djj 2sErcvgJpJdO+A1CYI5Ene8LUCCJeQwnmlxPKtAAVMp/NIRYT+IxulAypZtuA8PIEpPX uYRfpQb1m7n9g4d/CRuzQQgLfzSMj4xVEXWrabwxKhB921hoVGBDMr3pqpXQRJdT2QAc L3ETPsN2/9chSQcgLEchgjGlj4w1sMS74PPSRMd+ldO43DqOwZX+JHmdFkjYMoiyLL+J NXNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755196880; x=1755801680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x8K/ROQh3Tjz4xO7596husJI9J7hKXNq0i/Y5M+mi7M=; b=iBxgBSt28dMaDLx0IYgq6HLOnm1tf7y5vEAXAeU5l9NnBxjX6xj8FZ2A3jPQ2EorCY NhOt5P8GsJCGk5AgkCGp5KVytgRiTsC25y4GJW/PoOPnI/FM8PlB4SyvfHtnWtg/kAw0 Wu4YMAsyEUMg2mUm2joA3wcXCwZOv09pnc58NkonZWMv8Thd/Z6tp4aE830sEcjOdHVs TD8GKaFJny4eDaZmj5W/CbsV0Twg8v99c2ZNoa05grkmHRG/y8Mr7b8Hl+sf6hYOFSuT nzzTlvtD1b3pJlAkJx+g4wpk8I+8S0M/PoVpQDeTXSC8BikX+Sne0V7xVdTOx7I+Mstk gnIQ== X-Forwarded-Encrypted: i=1; AJvYcCUzVNqHI73M/Pg9FmeOCXQYwgC1f2RbKOJWgla2/1hTgGSnusT9owSkQSW0IkdLQApXSlT6pb+u9MD2W8lNG5Y9tiw=@vger.kernel.org, AJvYcCX+zkgfKFrIWHCsSg/K3JMgkSad5nK5T1qZXgMxp9oe7rN/dGHQ0m089X8ijBKxk+KiZvCzRTarJawkZUU=@vger.kernel.org, AJvYcCXvZ3sAY3VNirn2aXF++P5cLT/cY3me3snJ93mzqVZ4qx1M5WRaJd/Z7OPIdwp/LY3vwKqoagEqDHYF@vger.kernel.org X-Gm-Message-State: AOJu0YyL87+EeseIF7aTwJsXEFVvO9di0/2ougjMgSbaILDN73f8dTvI zGsgaKtxTowjqpDnll7GyjTTnbb0zt8sOtXUCmIIZ03pmfGMWggkMRGF X-Gm-Gg: ASbGncvKdz0Px4SAme/OTf1TqZeaSDUNRZG/nzjJA8GYYHjMRkMf6RoyZ3tNngR9+FN 9x76nTi0FJy/E/I/gVXKC+pIIAanolPYp/rgx7s/HJ9T2askbjsKRU7YtYX6uaOg/ahBhTHX1UG w0DDmmLPQyjWeW+5O5V1JgZgY0S3H1PbjT+5qmTfiPXZmX07YI4yFVCLRGRnlk9sEOjhPn1TQLs 8rKZJw1+uUGL48nhfbbkALsILVbeXOJfQrKfX6fIVOUhIHMv/wZhlhx/XZaObFFdiznztZ+8+R8 7ZyD1ekE7UlTelmWRNjlv1m2gZKQngyy75dkDb5bsYsxVPRPYIRNzaYuq/v0WriQTKsPbHEH6tb gN/2qvHbQzZM712zcmWCSUdHqW27FssaucAQ2l3IDPcSTdDh0JYgrnEkEBg6V1codHOE9RJXt7Q == X-Google-Smtp-Source: AGHT+IEPfawES6cJJJ8hPfR5FmxhaqIqHtlkP7bieQqszjVQvQMxkK9wgHsu+0s939lZ3UNj4uEs8g== X-Received: by 2002:a05:600c:470d:b0:459:d821:a45b with SMTP id 5b1f17b1804b1-45a1b61ea12mr35938585e9.9.1755196879590; Thu, 14 Aug 2025 11:41:19 -0700 (PDT) Received: from biju.lan (host31-53-6-191.range31-53.btcentralplus.com. [31.53.6.191]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453aeasm53744383f8f.40.2025.08.14.11.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 11:41:19 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 3/7] pwm: rzg2l-gpt: Add prescale_pow_of_two_mult_factor variable to struct rzg2l_gpt_info Date: Thu, 14 Aug 2025 19:41:07 +0100 Message-ID: <20250814184115.192930-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> References: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das RZ/G3E GPT IP has prescale factor power of 2 where as that of RZ/G2L is 4. Add prescale_pow_of_two_mult_factor variable to struct rzg2l_gpt_info for handling this difference. Signed-off-by: Biju Das Reviewed-by: Tommaso Merciai --- drivers/pwm/pwm-rzg2l-gpt.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-rzg2l-gpt.c b/drivers/pwm/pwm-rzg2l-gpt.c index bf989defa527..74bb0cca4ab4 100644 --- a/drivers/pwm/pwm-rzg2l-gpt.c +++ b/drivers/pwm/pwm-rzg2l-gpt.c @@ -91,6 +91,7 @@ =20 struct rzg2l_gpt_info { u32 gtcr_tpcs_mask; + u8 prescale_pow_of_two_mult_factor; }; =20 struct rzg2l_gpt_chip { @@ -226,6 +227,7 @@ static void rzg2l_gpt_disable(struct rzg2l_gpt_chip *rz= g2l_gpt, static u64 rzg2l_gpt_calculate_period_or_duty(struct rzg2l_gpt_chip *rzg2l= _gpt, u32 val, u8 prescale) { + const struct rzg2l_gpt_info *info =3D rzg2l_gpt->info; u64 tmp; =20 /* @@ -235,15 +237,18 @@ static u64 rzg2l_gpt_calculate_period_or_duty(struct = rzg2l_gpt_chip *rzg2l_gpt, * < 2^32 * 2^10 * 2^20 * =3D 2^62 */ - tmp =3D (u64)val << (2 * prescale); + tmp =3D (u64)val << (info->prescale_pow_of_two_mult_factor * prescale); tmp *=3D USEC_PER_SEC; =20 return DIV64_U64_ROUND_UP(tmp, rzg2l_gpt->rate_khz); } =20 -static u32 rzg2l_gpt_calculate_pv_or_dc(u64 period_or_duty_cycle, u8 presc= ale) +static u32 rzg2l_gpt_calculate_pv_or_dc(const struct rzg2l_gpt_info *info, + u64 period_or_duty_cycle, u8 prescale) { - return min_t(u64, DIV_ROUND_DOWN_ULL(period_or_duty_cycle, 1 << (2 * pres= cale)), + return min_t(u64, + DIV_ROUND_DOWN_ULL(period_or_duty_cycle, + 1 << (info->prescale_pow_of_two_mult_factor * prescale)), U32_MAX); } =20 @@ -254,6 +259,7 @@ static int rzg2l_gpt_round_waveform_tohw(struct pwm_chi= p *chip, =20 { struct rzg2l_gpt_chip *rzg2l_gpt =3D to_rzg2l_gpt_chip(chip); + const struct rzg2l_gpt_info *info =3D rzg2l_gpt->info; struct rzg2l_gpt_waveform *wfhw =3D _wfhw; u8 ch =3D RZG2L_GET_CH(pwm->hwpwm); u64 period_ticks, duty_ticks; @@ -287,12 +293,12 @@ static int rzg2l_gpt_round_waveform_tohw(struct pwm_c= hip *chip, } =20 wfhw->prescale =3D rzg2l_gpt_calculate_prescale(rzg2l_gpt, period_ticks); - pv =3D rzg2l_gpt_calculate_pv_or_dc(period_ticks, wfhw->prescale); + pv =3D rzg2l_gpt_calculate_pv_or_dc(info, period_ticks, wfhw->prescale); wfhw->gtpr =3D pv; duty_ticks =3D mul_u64_u64_div_u64(wf->duty_length_ns, rzg2l_gpt->rate_kh= z, USEC_PER_SEC); if (duty_ticks > period_ticks) duty_ticks =3D period_ticks; - dc =3D rzg2l_gpt_calculate_pv_or_dc(duty_ticks, wfhw->prescale); + dc =3D rzg2l_gpt_calculate_pv_or_dc(info, duty_ticks, wfhw->prescale); wfhw->gtccr =3D dc; =20 /* @@ -477,6 +483,7 @@ static int rzg2l_gpt_probe(struct platform_device *pdev) =20 static const struct rzg2l_gpt_info rzg2l_data =3D { .gtcr_tpcs_mask =3D GENMASK(26, 24), + .prescale_pow_of_two_mult_factor =3D 2, }; =20 static const struct of_device_id rzg2l_gpt_of_table[] =3D { --=20 2.43.0 From nobody Sat Oct 4 15:59:01 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 1B1A5235044; Thu, 14 Aug 2025 18:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196883; cv=none; b=C4s9i4iWxd2/6QggnRg6RE0E7nGMYsxFIol6zGMznZRYauwfZruw23DpYN36YCXKv+IcAhqHrTlX53IR/np52NxgNiT2/ZTqcO6WYDlKokzYGeYbea1cVsRdbVn0MO+Xl8grGDKwlL5+63/2+9twyHFR7N+Zfv7JX7FNxQMNKMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196883; c=relaxed/simple; bh=E9nZvthPsuzjFPVZQ88Fqaa12g0bZzRpT+AEg5fYq2c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E3Tpz0lvgX49LWrFHN9CB+dbqk9bDK2jkR3tNyN2F0iQhotaehJI3vLNAwYnHJpzgqm6AW1ku0xCno8uWJ4RHh1bxPD/yvDvdPlPjMoTLPGAmlPhE1EJsFYh9VhB2qmgcIrjusjBmcsAwdcUF3sbEyx9zlGh5irtEiTuJdjo3tg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=O5KgU8UU; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O5KgU8UU" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-45a20c51c40so198125e9.3; Thu, 14 Aug 2025 11:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755196880; x=1755801680; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZfDKLYTW6+lKsgYQaQXkVu1QFpYTDZJmYBFQGV4QYj4=; b=O5KgU8UUFb2HLLVOS/Ltza51itmo5SOP0GzPzjHJjo7A2oc/I4qEdHLT77pOrld0M5 c+5m9uCsxxjp3gU5rc59MUohSzcJfEl5gXwLJGLbweKOP104RWznWrlSRUjR2eDZF/lL c2CVpXoeqWt0g1VpaSbXTsTgjdrVt7YBejY40zxG0q89u9nuQFL3AdqVvgvzxaEjWLF4 NKDxLlif9x6Oiq3ML2Qci+mTLTAlhDPMvi2LOqZuGoaWTMKOhLkeEnT6HmLmFeSCHAc9 pHFTq9zarhx32YyxKdlU6SiMEKyxID8ZwhXR3qr3t3toKRGsuCH1L6UT0zL+TSc5AYaq vAGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755196880; x=1755801680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZfDKLYTW6+lKsgYQaQXkVu1QFpYTDZJmYBFQGV4QYj4=; b=mv7KVl3wOOKvAKcwTA90w+NiCAc30y7kQ2W4IXWogMWh1Cv9MYSB8UafsvFs8Qr+df 5JtQxr7sWXKAq4IJsafKi//NSGQ3AOQ96OjynfS6rfx76Cz+FinPQ9p8cojEz3K3ESAo zWAD7RFLFAaiI4pxOS7ueAW5Wv4Fn+xFQkOw7m1AsqP6ylKrz5H2EgcIyAwXAVlXBZBX idXW+S+mTkuWhqL2okI5eB1gKo/Y/EfSj66cJ7qpG5NLuPxtW8hr/UevFbKM9LqBF//c MvUYUXOmDZeNXlzMMFchUUI9fVak2q5/97V/BVYsODsUEr0aLL1avJDwSKAmNgeuvTaY g1Pw== X-Forwarded-Encrypted: i=1; AJvYcCVP0ymUPo0YqRlGPzvPZhSAzPnWhhLbXsHHH57yGlIHgrGHOY0kuHXRJAGeaWdXOwuKSmdT831Cquwpg70=@vger.kernel.org, AJvYcCWP31QpnJ01B/fvt6coTirtdCg6idhYVtJtoQpkZVJzMm3zv9/5ejVKxQ/FZZuRQZMrIJ3JvFKEY67Y@vger.kernel.org, AJvYcCWrhDnZEMl7kYW0Kgmr4w6GqNJ620PtPP2px7UQE148MCeFMlYCGbAWN70uOj2YO73lCA5f1QQirzxqp3sKHunxWTk=@vger.kernel.org X-Gm-Message-State: AOJu0YxgtZIzM6GM2Zp7LPRDGwe/YWtqoiyPVZIBEoiYskoynI/ZSR0P Hz1ovtBwyngdPtBx/0J+56wXCKpy6OOf3nqzB5/VeEJwgv82RiGXe2Yl X-Gm-Gg: ASbGncuaeV+EvhKtgCEeQ0hJtIQcP5/niW1olGm/jS8mZHZg6FsGYas/ERx6lOjoGtn KphQMngzLKQhQQfHCnZpq8AM3bCQmQIxL989XLFEN9Dcaz1ScYcs08gwC3KDj1TR6u5zIeNjdyw 1oCoZbVE/kGWXzJdnpL42B169KwXPXf6G2bhHnz8pKrKWSH0RDrRkugUGOYssdoz3PP+xozCu3r 5/b4MXsUGm1QaaXMkCRdK0tcwNXtOfFD+8OVYHByL1vIKivfDxc88C291Co6IfeFO5czUN6MqI4 brTJdmro49XncFuGL3TmuvK6ICDb6nZQxYiGoJ0h/Qsz3E0WC6rBnn7A6rW533VaORyP6K2Y0Gw IrRT0i3sh5mFQDwfUJaoM2xOVRN7zO7VSNUkAd3WRua3mBrLnClbcrgwzGbAtH8MxnRjOEJcrqA == X-Google-Smtp-Source: AGHT+IHEOdU1SpMaE+AkPTtXGPzX0lXlAnZHPzwGwuNi9fI26uGArsLeQ8j/KNt5TW0Jb29PJ6wB/A== X-Received: by 2002:a05:600c:4447:b0:459:dde3:1a56 with SMTP id 5b1f17b1804b1-45a20c20a87mr555305e9.28.1755196880078; Thu, 14 Aug 2025 11:41:20 -0700 (PDT) Received: from biju.lan (host31-53-6-191.range31-53.btcentralplus.com. [31.53.6.191]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453aeasm53744383f8f.40.2025.08.14.11.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 11:41:19 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 4/7] pwm: rzg2l-gpt: Add calculate_prescale() callback to struct rzg2l_gpt_info Date: Thu, 14 Aug 2025 19:41:08 +0100 Message-ID: <20250814184115.192930-5-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> References: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das RZ/G2L GPT the prescale factors are continuous power of 4 whereas on RZ/G3E it is power of 2 but discontinuous. Add calculate_prescale() callback to struct rzg2l_gpt_info for handling this difference. Signed-off-by: Biju Das Reviewed-by: Tommaso Merciai --- drivers/pwm/pwm-rzg2l-gpt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pwm/pwm-rzg2l-gpt.c b/drivers/pwm/pwm-rzg2l-gpt.c index 74bb0cca4ab4..b247a6c181d5 100644 --- a/drivers/pwm/pwm-rzg2l-gpt.c +++ b/drivers/pwm/pwm-rzg2l-gpt.c @@ -90,6 +90,7 @@ #define RZG2L_MAX_TICKS ((u64)U32_MAX * RZG2L_MAX_SCALE_FACTOR) =20 struct rzg2l_gpt_info { + u8 (*calculate_prescale)(u64 period); u32 gtcr_tpcs_mask; u8 prescale_pow_of_two_mult_factor; }; @@ -138,8 +139,7 @@ static void rzg2l_gpt_modify(struct rzg2l_gpt_chip *rzg= 2l_gpt, u32 reg, u32 clr, (rzg2l_gpt_read(rzg2l_gpt, reg) & ~clr) | set); } =20 -static u8 rzg2l_gpt_calculate_prescale(struct rzg2l_gpt_chip *rzg2l_gpt, - u64 period_ticks) +static u8 rzg2l_gpt_calculate_prescale(u64 period_ticks) { u32 prescaled_period_ticks; u8 prescale; @@ -292,7 +292,7 @@ static int rzg2l_gpt_round_waveform_tohw(struct pwm_chi= p *chip, period_ticks =3D rzg2l_gpt->period_ticks[ch]; } =20 - wfhw->prescale =3D rzg2l_gpt_calculate_prescale(rzg2l_gpt, period_ticks); + wfhw->prescale =3D info->calculate_prescale(period_ticks); pv =3D rzg2l_gpt_calculate_pv_or_dc(info, period_ticks, wfhw->prescale); wfhw->gtpr =3D pv; duty_ticks =3D mul_u64_u64_div_u64(wf->duty_length_ns, rzg2l_gpt->rate_kh= z, USEC_PER_SEC); @@ -482,6 +482,7 @@ static int rzg2l_gpt_probe(struct platform_device *pdev) } =20 static const struct rzg2l_gpt_info rzg2l_data =3D { + .calculate_prescale =3D rzg2l_gpt_calculate_prescale, .gtcr_tpcs_mask =3D GENMASK(26, 24), .prescale_pow_of_two_mult_factor =3D 2, }; --=20 2.43.0 From nobody Sat Oct 4 15:59:01 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 763712376E1; Thu, 14 Aug 2025 18:41:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196884; cv=none; b=kJSGOWs2PKqVpWvxjlGD3MaNu3QLLco/1R8CzUlpUKQtiHg7BRhf/qKTf71vYDq7N1ipvCwhS16/vattyTDbg/fATZskIsdTKIcyCn5ArZ0cJKLtjrUFwr39vOXcuOT366p8/EKH0IUftdpIRcA0DHRAtc/+KOZFEXM04+rSaSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196884; c=relaxed/simple; bh=u0Fv0HZdRXAROjaVPIu0UprHeLZtuiVBR0g1Sb7Etnc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K9rcFxrWHaIIf15zqJ4GmoZvNuar2KXwxDaJVii3mjaMn/wHrlPp9YGhCwSlanSOaaZN3ZvEOMkYhmMatUdMGU6N5/5xfBwZQaBjRko4hdvpSxkzM84f8YqsSXxkMh0Z4eurabHgVrpsGNGS6BsPtUwzloSk/0sOIXtNctKSlag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m3LJ4f22; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m3LJ4f22" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-45a1b005a3bso6203415e9.0; Thu, 14 Aug 2025 11:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755196881; x=1755801681; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pCk0KkIl7vqRRGGQZjIBlzxezwiOAQS1hqdnSHUAM/c=; b=m3LJ4f22gb/1J6QdZ688Hwsf6rBoZdkCB8XIaDexzBei8IDYe4I1P9BjCjPaIlcQjD uHXMPf8f7CQgVT0ISoHNdj4OnASxYBLfZD0sOMl/YTE1BRTD6QYwoEXEZ/tCYh/2dfqM ktm1y6iM7HRvaMNWXLFOpTbt9tgyMe98VNSaQWGMoFRVOOM5t9TYapzLMSwBFtNnrmRS c92ijAIKpD0IUCCQooabOpQ0COQnMS3jcYib7tfdmgmO8cvdCjMT+TzxP8ibcmKyluCx 02uQvVRtb3N37uw7e/C49Tb6HoBSkaCYu10k057ltA76xDJhnH1fEGPaRop0lm+xUUAa Eseg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755196881; x=1755801681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pCk0KkIl7vqRRGGQZjIBlzxezwiOAQS1hqdnSHUAM/c=; b=S0RorUxruyGpwgg1OYHd1JhskDOk4//UWpt7e1jWcTb30XEzkI86lA72isZ5uP4WDK aBvA8LGzBotvoHLSq8RHYu2JkfjdsfNz9FrVSr2b4ftXUeP8xdpxOLz4VgAWQ16VfLT7 2ZyR6COvbO2i1guCMtgYWlqpFXzDpBJrtcHZr27qgvknNqE3MJLNyCW8nFf0RWR3/I3P 6imq0zhWyxZhehkFfNNuqXRGDuLChuTEOe16csEAHK/Xq6VwK2wMGoF8fJVtaiehywqo eyubN+xXaPqFHGKqbYvMtiSUaFdGN1QPu+LDgM+fTkQmfLN7cyuq3gedgaG2CrS1fLBE JoxA== X-Forwarded-Encrypted: i=1; AJvYcCWr6oxnuXRLxCvaewKSgiCjy87qLLQDflCqJkkYb4/+fKZSrxQ9MR5JVjPmyTqRHFlISqKKUNX2eyvGxQY=@vger.kernel.org, AJvYcCWzv4VQaO0H8x7ucDHGqEUe/of8szASoN6q6B3y3pkEjCyNuCLmx/v4V07bLtBiMMWeEOb/SebFLAQasVDuo5c2BR0=@vger.kernel.org, AJvYcCXLC45LhRQ7kazs33uH2UpHTOf6F3UHVH+zzG0fkq8803MNihoDLkuWsclXXLcann2LgHXj+UOqYDW9@vger.kernel.org X-Gm-Message-State: AOJu0YxLm4uBtnTzM3XmSBSa24AwU/FYr0dWF1Rd1iCByxs25zeuRScg bqWU71gVeFTpG6GGOIDfezSHOEZOIrMIyxYT8VPmH6aF8qnGqIjIKHlP X-Gm-Gg: ASbGncvERJwPOVzVWPLO12mtXbJDXia9w+13S37Y5aO10kybKFqGxBAodaOKRO1mNBm DAXzQWcJjoRZCdun7Z9JomDLyeG7yLIzaQHbDP1iA+ndb/2kTGHTKCKyUjRWV/3mad9AvQ7Datc SMFQAxwoq/LOYLH4Qoa3OZFgkrqC0zLxmM/eJWQRvyAlXgvS5orhPkJKKdiXEthCV5kfwWMHzpJ bNI5iwhatrc57FcKR7ehVlS2MTpT4SEGQ2vd+0qiDygEIKpcKIY1AYZLPNYfJl1rPlvSYQvL6Mb 8MVH+sJU3TGh/nNcIEOc8/3NX6CmOXaYZnnPStpkDMQn6bA9w8rQq+rccaFh/jQxweopmpUfHqd 95z9CLiBL0bd6XsM6EOddzqMcNpVPm+LcZi3zquCL6N6ctNhIPj9d58XtZm2pmwrcUuOQSuCiy4 xgdg2ZA+vE X-Google-Smtp-Source: AGHT+IGAuNInzSydtvLMOTvjddze3kF8zFi+MgiSOs+XNI1JUSi3Z2K2iYdOzje5T7hcQHWOoxRZuA== X-Received: by 2002:a05:600c:46c8:b0:456:76c:84f2 with SMTP id 5b1f17b1804b1-45a1b6670bemr42487015e9.30.1755196880544; Thu, 14 Aug 2025 11:41:20 -0700 (PDT) Received: from biju.lan (host31-53-6-191.range31-53.btcentralplus.com. [31.53.6.191]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453aeasm53744383f8f.40.2025.08.14.11.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 11:41:20 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 5/7] pwm: rzg2l-gpt: Add RZ/G3E support Date: Thu, 14 Aug 2025 19:41:09 +0100 Message-ID: <20250814184115.192930-6-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> References: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Add RZ/G3E GPT support. It has multiple clocks and resets compared to RZ/G2L. Also prescale field width and factor for calculating prescale are different. Signed-off-by: Biju Das Reviewed-by: Tommaso Merciai --- drivers/pwm/pwm-rzg2l-gpt.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/pwm/pwm-rzg2l-gpt.c b/drivers/pwm/pwm-rzg2l-gpt.c index b247a6c181d5..7047359cac63 100644 --- a/drivers/pwm/pwm-rzg2l-gpt.c +++ b/drivers/pwm/pwm-rzg2l-gpt.c @@ -153,6 +153,27 @@ static u8 rzg2l_gpt_calculate_prescale(u64 period_tick= s) return prescale; } =20 +static u8 rzg3e_gpt_calculate_prescale(u64 period_ticks) +{ + u32 prescaled_period_ticks; + u8 prescale; + + prescaled_period_ticks =3D period_ticks >> 32; + if (prescaled_period_ticks >=3D 64 && prescaled_period_ticks < 256) { + prescale =3D 6; + } else if (prescaled_period_ticks >=3D 256 && prescaled_period_ticks < 10= 24) { + prescale =3D 8; + } else if (prescaled_period_ticks >=3D 1024) { + prescale =3D 10; + } else { + prescale =3D fls(prescaled_period_ticks); + if (prescale > 1) + prescale -=3D 1; + } + + return prescale; +} + static int rzg2l_gpt_request(struct pwm_chip *chip, struct pwm_device *pwm) { struct rzg2l_gpt_chip *rzg2l_gpt =3D to_rzg2l_gpt_chip(chip); @@ -443,6 +464,14 @@ static int rzg2l_gpt_probe(struct platform_device *pde= v) if (IS_ERR(rstc)) return dev_err_probe(dev, PTR_ERR(rstc), "Cannot deassert reset control\= n"); =20 + rstc =3D devm_reset_control_get_optional_exclusive_deasserted(dev, "rst_s= "); + if (IS_ERR(rstc)) + return dev_err_probe(dev, PTR_ERR(rstc), "Cannot deassert rst_s reset\n"= ); + + clk =3D devm_clk_get_optional_enabled(dev, "bus"); + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), "Cannot get bus clock\n"); + clk =3D devm_clk_get_enabled(dev, NULL); if (IS_ERR(clk)) return dev_err_probe(dev, PTR_ERR(clk), "Cannot get clock\n"); @@ -481,6 +510,12 @@ static int rzg2l_gpt_probe(struct platform_device *pde= v) return 0; } =20 +static const struct rzg2l_gpt_info rzg3e_data =3D { + .calculate_prescale =3D rzg3e_gpt_calculate_prescale, + .gtcr_tpcs_mask =3D GENMASK(26, 23), + .prescale_pow_of_two_mult_factor =3D 1, +}; + static const struct rzg2l_gpt_info rzg2l_data =3D { .calculate_prescale =3D rzg2l_gpt_calculate_prescale, .gtcr_tpcs_mask =3D GENMASK(26, 24), @@ -488,6 +523,7 @@ static const struct rzg2l_gpt_info rzg2l_data =3D { }; =20 static const struct of_device_id rzg2l_gpt_of_table[] =3D { + { .compatible =3D "renesas,r9a09g047-gpt", .data =3D &rzg3e_data }, { .compatible =3D "renesas,rzg2l-gpt", .data =3D &rzg2l_data }, { /* Sentinel */ } }; --=20 2.43.0 From nobody Sat Oct 4 15:59:01 2025 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 36946239E9D; Thu, 14 Aug 2025 18:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196885; cv=none; b=H7K1p4HHEbeI0TJ6a8ww351IfctnOKnMpYv/ebhZFjH60/sYD91IMb5FeHE8UhUNNgvJd5pkw684yfCGFqVR5pDNUwtAKUnq4QtZ8yaPNFF4JPtB4g1Z6yx6ebvMndpDyVmC2TMpeCEf2MUj3bBrGq5TbiytqxRvCFhOLZzXv6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196885; c=relaxed/simple; bh=xvR3TsK62JtvHesRS90geQ7W0CpLMgQstB8ZNQnfZ1U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BTYvX3W5kNzXjS2KB4lNy5/Oq1xchsXldw0iCzWhAO//XfpZPJDWmxDI3wEI7ZKYGxHNUqgnRmuNfviW2ev8J1kXhbQpNYbCtGdHgEDsOF6DQG8D92cKJ5D14h/K3o02I4KEPhXtJXLwEx5X+tpcxvDCa835BGOmk+t//TCI+Qw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iYHJoNzY; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iYHJoNzY" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3b9dc5cd4cbso947410f8f.1; Thu, 14 Aug 2025 11:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755196881; x=1755801681; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NKWqikBV86gt6LNr+VLwEoTNrpwy45Hxqzp4t9ZmWN8=; b=iYHJoNzYwh9ziJpso3k2RAffuzl5WIbl9YvSXugV1OudzQXI5TL43gonbSNFdvtP/2 ZPqEe/5zc0JPAGp6CVM9aEo7svr7RIppxbyZF/IUBaXgBsz3x8ovdPOIHg/kySCETIcJ WoqtxBAVXQN6Eq860DqLNg5GTt71bEV4OwiJg5fXYf8l7wkQqFZQ7oxqcfMTUw/Dp4Ze l+vDJ00oqcpGBx/bW1H1gVq8JSn/DaH742vSbR8I2kxSqVF072pCIEYKkqmx7XTaiZiL osslSJEKCHrNAuymZ80qMzHR+/XftgJ/FG2r6WVRNI4yhK9c+GA2s46MbnjUXADHBkWO gGbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755196881; x=1755801681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NKWqikBV86gt6LNr+VLwEoTNrpwy45Hxqzp4t9ZmWN8=; b=JTHjqmynPN7ixHgcROx48hh978ZXdD4Wt3kmjPWfYpF+hfX0LrIQApbYeZuFsoN8um 5LX8s6WYF6xgSCpl7TYjbxUI3xFSU3pkhgxJyY6cNhX1IdoKNsfxmI+UApgBm4Fm+i7w EwtPskgEoGZSxorsbW4nm1UR06q94IBjbdJpI6zmqOodY3SV3StoW2zqOWfxD6v+iPSn i+pS0oPU2kfXjaHQVdDzcL7Vm1TZcaQcO2kDMp7CPvT7aJkKBjP10oP6yabAaI1I7SAy VcKftM/L7GODCc03BuZHT+R276CRB0/x4qR8sADnkPKv051A4gn2CIfr0B4wi9G31oDd +gWQ== X-Forwarded-Encrypted: i=1; AJvYcCVPPTmeqCmi7EBXcgeGuO+aCpBrzJQbFHqMkL8rkKBoCspL7mTSefnOk3N2WOjIetHOPpKHzFuboqvc82Jl@vger.kernel.org, AJvYcCVQpIBPJU2e23Js6KGMuTjApUWQgwpTDq3fYAlEgm3OcojeBxNb8IGgb4Bmcl/6qWL5t8VKKEdjmCvHqQbwvy/SyJc=@vger.kernel.org, AJvYcCWHU2plqunmsJsxfJWToEV4rX9/WcRlUgUfc6kCbywiticM/VvzpAei3ldHjKaiWA83fEwKuNXNIyOz@vger.kernel.org X-Gm-Message-State: AOJu0YyjyQ0MzkPDhT2iGe4feB98V4KSaXaxKWdFcHym2Qj6DReXviOD yjIJl31vRXQow/p+kuhDgtiRFWFZd/Ba/TmeEZOUEHcjFXSrDhlp6d/zSyLEF9KcfYI= X-Gm-Gg: ASbGncu7HxXIyGWEgXGvfhe7eIIn9LhgaZuYzbsihuQqYPEOG81YEjIM7CUvWvTgq5n VMjSSX8BBRvKMroOXlAXFgjF9Uno/9rRvHFjAk6n3Pnmjca48L73matuP3Sv41aWRpR1x5oetF3 RhZn7lQCucxa5d4fOw8ENMU6r8TwYzW7w26HVWWGt2VexsOiDpNtGhiGrbj1mqYt0ZW/1EKNrY8 g9E2ztmK77nEamzKCe/KbTqdqLxQqlNGXLhI1yMFTpcAo3ZgEKVYYAFl7K72tcCUxYkWWMPMSFa THLtj5NkHjABRE3uRDrYVJn3gmhCakxzQX6eInVju/T9wRTT90DBwkmf6mvoociezDnrRQohVff 8hFRhEjxtcug6usojCyAmQmTifHQZ6MtTv844P5FfwYgX0E1jksioe5yDtptDtFWZqcKAnTf0h0 yk0K4Pl7kH X-Google-Smtp-Source: AGHT+IGvHzc75mh/OkQN1oMT54n9zn4caG1bYfChjsKl+MmItlP3r8mKEM/OKC3vvWlowdAIbOv+/A== X-Received: by 2002:a5d:64cb:0:b0:3a5:243c:6042 with SMTP id ffacd0b85a97d-3b9edfcc6fdmr3689691f8f.2.1755196881413; Thu, 14 Aug 2025 11:41:21 -0700 (PDT) Received: from biju.lan (host31-53-6-191.range31-53.btcentralplus.com. [31.53.6.191]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453aeasm53744383f8f.40.2025.08.14.11.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 11:41:20 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Geert Uytterhoeven , Magnus Damm , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Biju Das , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 6/7] arm64: dts: renesas: r9a09g047: Add GPT nodes Date: Thu, 14 Aug 2025 19:41:10 +0100 Message-ID: <20250814184115.192930-7-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> References: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das The RZ/G3E SoC has 2 GPT's. Add GPT nodes to RZ/G3E ("R9A09G047") SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Tommaso Merciai --- arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 184 +++++++++++++++++++++ 1 file changed, 184 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi b/arch/arm64/boot/d= ts/renesas/r9a09g047.dtsi index eeccd1345f71..0e6867ad112a 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi +++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi @@ -552,6 +552,190 @@ channel5 { }; }; =20 + gpt0: pwm@13010000 { + compatible =3D "renesas,r9a09g047-gpt"; + reg =3D <0 0x13010000 0 0x10000>; + #pwm-cells =3D <3>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "gtcia0", "gtcib0", "gtcic0", "gtcid0", + "gtcie0", "gtcif0", "gtcih0", "gtcil0", + "gtcia1", "gtcib1", "gtcic1", "gtcid1", + "gtcie1", "gtcif1", "gtcih1", "gtcil1", + "gtcia2", "gtcib2", "gtcic2", "gtcid2", + "gtcie2", "gtcif2", "gtcih2", "gtcil2", + "gtcia3", "gtcib3", "gtcic3", "gtcid3", + "gtcie3", "gtcif3", "gtcih3", "gtcil3", + "gtcia4", "gtcib4", "gtcic4", "gtcid4", + "gtcie4", "gtcif4", "gtcih4", "gtcil4", + "gtcia5", "gtcib5", "gtcic5", "gtcid5", + "gtcie5", "gtcif5", "gtcih5", "gtcil5", + "gtcia6", "gtcib6", "gtcic6", "gtcid6", + "gtcie6", "gtcif6", "gtcih6", "gtcil6", + "gtcia7", "gtcib7", "gtcic7", "gtcid7", + "gtcie7", "gtcif7", "gtcih7", "gtcil7"; + clocks =3D <&cpg CPG_CORE R9A09G047_GPT_0_CLKS_GPT>, <&cpg CPG_MOD 0x31= >; + clock-names =3D "core", "bus"; + resets =3D <&cpg 0x59>, <&cpg 0x5a>; + reset-names =3D "rst_p", "rst_s"; + power-domains =3D <&cpg>; + status =3D "disabled"; + }; + + gpt1: pwm@13020000 { + compatible =3D "renesas,r9a09g047-gpt"; + reg =3D <0 0x13020000 0 0x10000>; + #pwm-cells =3D <3>; + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names =3D "gtcia0", "gtcib0", "gtcic0", "gtcid0", + "gtcie0", "gtcif0", "gtcih0", "gtcil0", + "gtcia1", "gtcib1", "gtcic1", "gtcid1", + "gtcie1", "gtcif1", "gtcih1", "gtcil1", + "gtcia2", "gtcib2", "gtcic2", "gtcid2", + "gtcie2", "gtcif2", "gtcih2", "gtcil2", + "gtcia3", "gtcib3", "gtcic3", "gtcid3", + "gtcie3", "gtcif3", "gtcih3", "gtcil3", + "gtcia4", "gtcib4", "gtcic4", "gtcid4", + "gtcie4", "gtcif4", "gtcih4", "gtcil4", + "gtcia5", "gtcib5", "gtcic5", "gtcid5", + "gtcie5", "gtcif5", "gtcih5", "gtcil5", + "gtcia6", "gtcib6", "gtcic6", "gtcid6", + "gtcie6", "gtcif6", "gtcih6", "gtcil6", + "gtcia7", "gtcib7", "gtcic7", "gtcid7", + "gtcie7", "gtcif7", "gtcih7", "gtcil7"; + clocks =3D <&cpg CPG_CORE R9A09G047_GPT_1_CLKS_GPT>, <&cpg CPG_MOD 0x32= >; + clock-names =3D "core", "bus"; + resets =3D <&cpg 0x5b>, <&cpg 0x5c>; + reset-names =3D "rst_p", "rst_s"; + power-domains =3D <&cpg>; + status =3D "disabled"; + }; + wdt1: watchdog@14400000 { compatible =3D "renesas,r9a09g047-wdt", "renesas,r9a09g057-wdt"; reg =3D <0 0x14400000 0 0x400>; --=20 2.43.0 From nobody Sat Oct 4 15:59:01 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 C65C123D286; Thu, 14 Aug 2025 18:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196885; cv=none; b=dD6taMAUTqnBgt98zluNFVc+FsT7JPUdC4+0l5ZLyGxKDwR2o3u4+A/Z1BybEMizXoFbhN/2gvrtF3pZeqvz5S5xCL7drATqtFUh2lYoKpvDK+yHi8qUG8JcGZZx2S1Q1a72qVCuWwi+vVMYJGIYJ0yJiqOc2CIRSuD0/k+9rGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755196885; c=relaxed/simple; bh=PBvKzxHYUZyjBdDdRiFl/Ta3qJCEjZG1+6KKdRsoJK8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CkfYiYIz/zNgIDZ4SYYRE17gVV+xRmHws2e/pT5FBnrr8mNdvMA7BhcmI6VbhEDCC7l+/71mfUcgYA+Uf7eF41tVNe2JTKlf543mP/EHKdqggOvDff2ATR+ka0U1ogHPzTyl7T3BRyiP74daAGy5lFuQbVa8va/zFdN+ydRaBY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VcfSgPMa; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VcfSgPMa" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-45a1b065d58so8418725e9.1; Thu, 14 Aug 2025 11:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755196882; x=1755801682; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2NDZp57POD5hF/gYZ8czWKATBHo9znF4ipgYzEVstQ4=; b=VcfSgPMaqoL2Tv01Zm7R8LnKsxeL47ERPnyeHr3lQipm4Je+zjpul7xDop8TxRNPeD B4UNQInxwuA3TISl16UvnDP/DTYYcKoHh7StqDZmE7AME63uls0g8x3DKbQUyVufgm4Q xOUJ7uxI0n88/ocMfD6CYzQxBFwCI1winHrbgl6+/cevZiNh/6uvLGHPPeFeq0Op24Dm pTGfBnBJQnBNMSestPR8zEUeGWAFXmxGFR/dSDsuDTEJe8npu+iAUYBVSvPoeSBAtxLj rmy55j9gbxr+lmxJKOjgsquSMoD7ApWe0Kq9X/2Kc1qH2B8Od2pkOiopTTpqIAzv2t7X FMtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755196882; x=1755801682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2NDZp57POD5hF/gYZ8czWKATBHo9znF4ipgYzEVstQ4=; b=TaBGoSR5Ui4Xg7ELyHN6+sbKwwsfVzTiZi3vMkPnSq8Ba0pzfrA4BrLMrpwQgiyqz2 pelEisRUGijcfjpIJ0rjhELLzEsJUlsmMcKU6sedZigOihQdgl0PGSOhEoxbvjTTqnQW OKjX0np3E2Vg6GH8uq/P9C7yq1bYqUk3YGBUp3/Xgf3Krg0i2nEQt0X63r8kDIYr2uha gbc3uBBUp5mJPcDLj5sn5bIpoc8WIu1gAk/9b90D9b2pVMNb5g28PKOIqxod1i1CSbtA VjpBjOhN671Cv2Hn6Ipr8Ywp3YJXloog8a1iqazs9a2lqisBipts3er/OMlmWG2sd2PJ 95yA== X-Forwarded-Encrypted: i=1; AJvYcCUJBPP1JrILdK7/th+6bJddboMGz3T1+jM/d53ZXl8ID1f1C/sU9je/aoR4ZCfbLIdYeqSyHH5sYabxETKQHIgIqIs=@vger.kernel.org, AJvYcCWKI+QfZbyJxPpLigo6MZ5UjJms+pZ+TDjv8Naq33L0cne3e0Wmj9m1HMFzTZI3cjswvvY4ylpi4KTj@vger.kernel.org, AJvYcCXYW1wNGDTHfc5VHwZ/xwwaxhmRmLNu47PyNmg9lMCjTkgwvxv3Wu79/i718P4mjCSwuw+1eMSQ2KtnucNG@vger.kernel.org X-Gm-Message-State: AOJu0YyjMYE02XjwsZ/uECSK1Sn+jcwth0N9g/FejBhvvkes21byMC7f +yuec4l4Fu8RGN88542Ue7iiXvrED0WmCzHNoAIMy6J5llEIJuwFgsbL X-Gm-Gg: ASbGnctT39II6nXwJnd4GaemKO/w1kp1UFk6YoXW1Ejl5UBB3hffV3G+9SUxwYPodVH UWz3PZJ/sc67B9DHW9/RZqdayz8je+2Us5h15+ZzzYehPLtVx9V2oLKEjL2I0UEuuG3gSKDOSA4 c1nk/D3PTihiCiYXBXAwiSMhKF8hesVPE5FGUMWHVt2ZjGdTVDAze+i5Pri3wr83BJkxtyeLBr5 Qx6NEeGKggUnk6IuqNAZInWoqtUKA2H+ZT6NEt4oOOcm/oQ3B98eRxos9NMUakAIa64Fe3poLZa Nwdig4eIN23RRv93tgQ8Dh1CtZTkfkisPbAi76zQWkv6UdkzeSDzQjv2TOcSon7bQnLt8HH9X8q ZJnLqcalCSgYqWaUGZ0puxwH0RoXKovNM0uVrG5cMTjtQJlIQ/yWlGCWkalDMmHFjZ9ZIQtDTXQ == X-Google-Smtp-Source: AGHT+IEWEcPw3RO11WRFgKG0+rh3Yd/w/ToMDK59h6Y+l9ww5vSXXE0OkmF7Pxi1Q+eLhZwsCoxRCQ== X-Received: by 2002:a05:6000:400b:b0:3b7:9aff:db60 with SMTP id ffacd0b85a97d-3b9edfcc5f6mr3695502f8f.10.1755196881904; Thu, 14 Aug 2025 11:41:21 -0700 (PDT) Received: from biju.lan (host31-53-6-191.range31-53.btcentralplus.com. [31.53.6.191]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c453aeasm53744383f8f.40.2025.08.14.11.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 11:41:21 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Geert Uytterhoeven , Magnus Damm , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Biju Das , linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 7/7] arm64: dts: renesas: r9a09g047e57-smarc: Enable GPT on carrier board Date: Thu, 14 Aug 2025 19:41:11 +0100 Message-ID: <20250814184115.192930-8-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> References: <20250814184115.192930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das The GTIOC4{A,B} IOs are available on the carrier board's PMOD1_6A connector. Enable the GPT on the carrier board by adding the GPT pinmux and node on the carrier board dtsi file. Signed-off-by: Biju Das Reviewed-by: Tommaso Merciai --- arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts b/arch/arm6= 4/boot/dts/renesas/r9a09g047e57-smarc.dts index 1e67f0a2a945..093c0202b4f9 100644 --- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts +++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts @@ -84,6 +84,14 @@ &can_transceiver1 { }; #endif =20 +#if (!SW_LCD_EN) && (!SW_GPIO8_CAN0_STB) +&gpt0 { + pinctrl-0 =3D <&gpt0_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; +}; +#endif + &i2c0 { pinctrl-0 =3D <&i2c0_pins>; pinctrl-names =3D "default"; @@ -125,6 +133,11 @@ can4_pins: can4 { }; }; =20 + gpt0_pins: gpt0 { + pinmux =3D , /* GTIOC4A */ + ; /* GTIOC4B */ + }; + i2c0_pins: i2c0 { pinmux =3D , /* SCL0 */ ; /* SDA0 */ --=20 2.43.0