From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Samuel Holland <samuel@sholland.org>,
Chen-Yu Tsai <wens@csie.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Andre Przywara <andre.przywara@arm.com>
Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
Icenowy Zheng <uwu@icenowy.me>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-clk@vger.kernel.org
Subject: Re: [PATCH 5/9] clk: sunxi-ng: f1c100s: Add IR mod clock
Date: Sun, 06 Nov 2022 09:22:08 +0100 [thread overview]
Message-ID: <3519387.R56niFO833@jernej-laptop> (raw)
In-Reply-To: <20221101141658.3631342-6-andre.przywara@arm.com>
Dne torek, 01. november 2022 ob 15:16:54 CET je Andre Przywara napisal(a):
> For some reason the mod clock for the Allwinner F1C100s CIR (infrared
> receiver) peripheral was not modeled in the CCU driver.
>
> Add the clock description to the list, and wire it up in the clock list.
> By assigning a new clock ID at the end, it extends the number of clocks.
>
> This allows to use the CIR peripheral on any F1C100s series board.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 11 ++++++++++-
> drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h | 2 +-
> include/dt-bindings/clock/suniv-ccu-f1c100s.h | 2 ++
> 3 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c
> b/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c index
> ed097c4f780ff..af4811e720b39 100644
> --- a/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c
> +++ b/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c
> @@ -239,7 +239,14 @@ static SUNXI_CCU_MUX_WITH_GATE(i2s_clk, "i2s",
> i2s_spdif_parents, static SUNXI_CCU_MUX_WITH_GATE(spdif_clk, "spdif",
> i2s_spdif_parents, 0x0b4, 16, 2, BIT(31), 0);
>
> -/* The BSP header file has a CIR_CFG, but no mod clock uses this definition
> */ +static const char * const ir_parents[] = { "osc32k", "osc24M" };
> +static SUNXI_CCU_MP_WITH_MUX_GATE(ir_clk, "ir",
> + ir_parents, 0x0b8,
> + 0, 4, /* M */
> + 16, 2, /* P */
> + 24, 1, /* mux */
Let's follow user manual here and make mux 2 bits wide. That way we'll
guarantee that bit 1 is always written 0.
Best regards,
Jernej
> + BIT(31), /* gate */
> + 0);
>
> static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M",
> 0x0cc, BIT(1), 0);
> @@ -355,6 +362,7 @@ static struct ccu_common *suniv_ccu_clks[] = {
> &mmc1_output_clk.common,
> &i2s_clk.common,
> &spdif_clk.common,
> + &ir_clk.common,
> &usb_phy0_clk.common,
> &dram_ve_clk.common,
> &dram_csi_clk.common,
> @@ -446,6 +454,7 @@ static struct clk_hw_onecell_data suniv_hw_clks = {
> [CLK_MMC1_OUTPUT] = &mmc1_output_clk.common.hw,
> [CLK_I2S] = &i2s_clk.common.hw,
> [CLK_SPDIF] = &spdif_clk.common.hw,
> + [CLK_IR] = &ir_clk.common.hw,
> [CLK_USB_PHY0] =
&usb_phy0_clk.common.hw,
> [CLK_DRAM_VE] =
&dram_ve_clk.common.hw,
> [CLK_DRAM_CSI] =
&dram_csi_clk.common.hw,
> diff --git a/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h
> b/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h index
> b22484f1bb9a5..d56a4316289d8 100644
> --- a/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h
> +++ b/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h
> @@ -29,6 +29,6 @@
>
> /* All bus gates, DRAM gates and mod clocks are exported */
>
> -#define CLK_NUMBER (CLK_AVS + 1)
> +#define CLK_NUMBER (CLK_IR + 1)
>
> #endif /* _CCU_SUNIV_F1C100S_H_ */
> diff --git a/include/dt-bindings/clock/suniv-ccu-f1c100s.h
> b/include/dt-bindings/clock/suniv-ccu-f1c100s.h index
> f5ac155c9c70a..d7570765f424d 100644
> --- a/include/dt-bindings/clock/suniv-ccu-f1c100s.h
> +++ b/include/dt-bindings/clock/suniv-ccu-f1c100s.h
> @@ -67,4 +67,6 @@
> #define CLK_CODEC 65
> #define CLK_AVS 66
>
> +#define CLK_IR 67
> +
> #endif
next prev parent reply other threads:[~2022-11-06 8:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 14:16 [PATCH 0/9] ARM: dts: suniv: F1C100s: add more peripherals Andre Przywara
2022-11-01 14:16 ` [PATCH 1/9] dt-bindings: pwm: allwinner,sun4i-a10: Add F1C100s compatible Andre Przywara
2022-11-02 17:28 ` Rob Herring
2022-11-17 12:05 ` Uwe Kleine-König
2022-11-01 14:16 ` [PATCH 2/9] ARM: dts: suniv: f1c100s: add PWM node Andre Przywara
2022-11-06 7:56 ` Jernej Škrabec
2022-11-17 12:03 ` Uwe Kleine-König
2022-11-17 13:43 ` Andre Przywara
2022-11-01 14:16 ` [PATCH 3/9] dt-bindings: i2c: mv64xxx: Add F1C100s compatible string Andre Przywara
2022-11-02 17:28 ` Rob Herring
2022-11-02 20:19 ` Wolfram Sang
2022-11-01 14:16 ` [PATCH 4/9] ARM: dts: suniv: f1c100s: add I2C DT nodes Andre Przywara
2022-11-06 8:09 ` Jernej Škrabec
2022-11-06 23:12 ` Andre Przywara
2022-11-01 14:16 ` [PATCH 5/9] clk: sunxi-ng: f1c100s: Add IR mod clock Andre Przywara
2022-11-06 8:22 ` Jernej Škrabec [this message]
2022-11-01 14:16 ` [PATCH 6/9] dt-bindings: media: IR: Add F1C100s IR compatible string Andre Przywara
2022-11-02 17:28 ` Rob Herring
2022-11-01 14:16 ` [PATCH 7/9] ARM: dts: suniv: f1c100s: add CIR DT node Andre Przywara
2022-11-06 8:23 ` Jernej Škrabec
2022-11-01 14:16 ` [PATCH 8/9] dt-bindings: input: sun4i-lradc-keys: Add F1C100s compatible Andre Przywara
2022-11-02 17:28 ` Rob Herring
2022-11-03 20:45 ` Dmitry Torokhov
2022-11-01 14:16 ` [PATCH 9/9] ARM: dts: suniv: f1c100s: add LRADC node Andre Przywara
2022-11-06 8:25 ` Jernej Škrabec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3519387.R56niFO833@jernej-laptop \
--to=jernej.skrabec@gmail.com \
--cc=andre.przywara@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=mturquette@baylibre.com \
--cc=robh+dt@kernel.org \
--cc=samuel@sholland.org \
--cc=sboyd@kernel.org \
--cc=uwu@icenowy.me \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox