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,
Dmitry Rokosov <ddrokosov@sberdevices.ru>
Subject: [PATCH v5 4/6] pwm: meson: switch to using struct clk_parent_data for mux parents
Date: Wed, 24 May 2023 21:50:47 +0200 [thread overview]
Message-ID: <63e33220-0765-0e04-ef34-fea81e8fa347@gmail.com> (raw)
In-Reply-To: <aa498590-261c-4ada-63ff-8d7aaeec0932@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>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v3:
- move setting mux parent data out of the loop
---
drivers/pwm/pwm-meson.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
index aad4a0ed3..1654fdbb0 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;
@@ -477,21 +478,27 @@ MODULE_DEVICE_TABLE(of, meson_pwm_matches);
static int meson_pwm_init_channels(struct meson_pwm *meson)
{
+ struct clk_parent_data mux_parent_data[MESON_MAX_MUX_PARENTS] = {};
struct device *dev = meson->chip.dev;
- struct clk_init_data init;
unsigned int i;
char name[255];
int err;
+ for (i = 0; i < meson->data->num_parents; i++) {
+ mux_parent_data[i].index = -1;
+ mux_parent_data[i].name = meson->data->parent_names[i];
+ }
+
for (i = 0; i < meson->chip.npwm; i++) {
struct meson_pwm_channel *channel = &meson->channels[i];
+ struct clk_init_data init = {};
snprintf(name, sizeof(name), "%s#mux%u", dev_name(dev), i);
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.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2023-05-24 19:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 19:45 [PATCH v5 0/6] pwm: meson: make full use of common clock framework Heiner Kallweit
2023-05-24 19:47 ` [PATCH v5 RESEND 1/6] pwm: meson: modify and simplify calculation in meson_pwm_get_state Heiner Kallweit
2023-05-24 19:48 ` [PATCH v5 RESEND 2/6] pwm: meson: fix handling of period/duty if greater than UINT_MAX Heiner Kallweit
2023-05-24 19:49 ` [PATCH v5 RESEND 3/6] pwm: meson: remove not needed check in meson_pwm_calc Heiner Kallweit
2023-05-24 19:50 ` Heiner Kallweit [this message]
2023-05-24 19:51 ` [PATCH v5 5/6] pwm: meson: don't use hdmi/video clock as mux parent Heiner Kallweit
2023-05-24 19:52 ` [PATCH v5 6/6] pwm: meson: make full use of common clock framework Heiner Kallweit
2023-06-23 14:51 ` [PATCH v5 0/6] " Thierry Reding
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=63e33220-0765-0e04-ef34-fea81e8fa347@gmail.com \
--to=hkallweit1@gmail.com \
--cc=ddrokosov@sberdevices.ru \
--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
all inboxes | Powered by JetHome®