From: Heiner Kallweit <hkallweit1@gmail.com>
To: "Jerome Brunet" <jbrunet@baylibre.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Neil Armstrong" <narmstrong@baylibre.com>,
"Kevin Hilman" <khilman@baylibre.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"thierry.reding@gmail.com" <thierry.reding@gmail.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"open list:ARM/Amlogic Meson..."
<linux-amlogic@lists.infradead.org>,
linux-pwm@vger.kernel.org
Subject: [PATCH v2 1/4] pwm: meson: switch to using struct clk_parent_data for mux parents
Date: Tue, 11 Apr 2023 21:22:33 +0200 [thread overview]
Message-ID: <2760498e-23a6-f787-bac2-0460566a995d@gmail.com> (raw)
In-Reply-To: <0f087629-810d-f0e0-bf0b-05ca5defc16d@gmail.com>
We'll use struct clk_parent_data for mux/div/gate initialization in the
follow-up patches. As a first step switch the mux from using
parent_names to clk_parent_data.
Suggested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/pwm/pwm-meson.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index 4e5605c9d..52a2104f0 100644
--- a/drivers/pwm/pwm-meson.c
+++ b/drivers/pwm/pwm-meson.c
@@ -61,6 +61,7 @@
#define MISC_A_EN BIT(0)
#define MESON_NUM_PWMS 2
+#define MESON_MAX_MUX_PARENTS 4
static struct meson_pwm_channel_data {
u8 reg_offset;
@@ -485,20 +486,27 @@ MODULE_DEVICE_TABLE(of, meson_pwm_matches);
static int meson_pwm_init_channels(struct meson_pwm *meson)
{
struct device *dev = meson->chip.dev;
- struct clk_init_data init;
unsigned int i;
char name[255];
int err;
for (i = 0; i < meson->chip.npwm; i++) {
struct meson_pwm_channel *channel = &meson->channels[i];
+ struct clk_parent_data mux_parent_data[MESON_MAX_MUX_PARENTS] = {};
+ struct clk_init_data init = {};
+ int j;
snprintf(name, sizeof(name), "%s#mux%u", dev_name(dev), i);
+ for (j = 0; j < meson->data->num_parents; j++) {
+ mux_parent_data[j].index = -1;
+ mux_parent_data[j].name = meson->data->parent_names[j];
+ }
+
init.name = name;
init.ops = &clk_mux_ops;
init.flags = 0;
- init.parent_names = meson->data->parent_names;
+ init.parent_data = mux_parent_data;
init.num_parents = meson->data->num_parents;
channel->mux.reg = meson->base + REG_MISC_AB;
--
2.40.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-04-11 19:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 19:21 [PATCH v2 0/4] pwm: meson: make full use of common clock framework Heiner Kallweit
2023-04-11 19:22 ` Heiner Kallweit [this message]
2023-04-11 19:44 ` [PATCH v2 1/4] pwm: meson: switch to using struct clk_parent_data for mux parents Martin Blumenstingl
2023-04-11 19:23 ` [PATCH v2 2/4] pwm: meson: don't use hdmi/video clock as mux parent Heiner Kallweit
2023-04-11 19:24 ` [PATCH v2 3/4] pwm: meson: change clk/pwm gate from mask to bit Heiner Kallweit
2023-04-11 19:26 ` [PATCH v2 4/4] pwm: meson: make full use of common clock framework Heiner Kallweit
2023-04-11 19:48 ` Martin Blumenstingl
2023-04-11 21:00 ` Heiner Kallweit
2023-04-13 9:13 ` Thierry Reding
2023-04-14 18:33 ` Martin Blumenstingl
2023-04-17 9:27 ` Thierry Reding
2023-04-23 17:34 ` Martin Blumenstingl
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=2760498e-23a6-f787-bac2-0460566a995d@gmail.com \
--to=hkallweit1@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pwm@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=narmstrong@baylibre.com \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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