public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
To: mazziesaccount@gmail.com, matti.vaittinen@fi.rohmeurope.com
Cc: sboyd@kernel.org, andy.gross@linaro.org, david.brown@linaro.org,
	mturquette@baylibre.com, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, matthias.bgg@kernel.org,
	heiko@sntech.de, mikko.mutanen@fi.rohmeurope.com,
	heikki.haikola@fi.rohmeurope.com
Subject: Regmap support for common clocks
Date: Thu, 20 Dec 2018 13:48:56 +0200	[thread overview]
Message-ID: <20181220114856.GH2477@localhost.localdomain> (raw)

Hello Mike, Stephen & All,

I am working with device drivers for some ROHM components. Recently I
clk did a driver for bd71837/bd71847 PMICs. The PMIC is connected using
i2c and contains a simple clk gate. If the connecting bus could be mmap'd
I would have used the clk-gate provided by common clk framework. But as
it is i2c I ended up making the driver and enable/disable functions myself.

I am now working with next PMIC - which once again has similar clk gate
in it. I could write new driver again - but it feels a bit stupid as it
would be mostly just a copy-paste of bd71837/bd71847 - driver.

I first thought of doing regmap based 'clk-gate, clk-div and clk-mux'.
But after some googling I found

https://patchwork.kernel.org/patch/5955831/
https://lore.kernel.org/lkml/1434464615-9080-1-git-send-email-matthias.bgg@gmail.com/

and reading comments makes me to assume there would be more...

Current way seems to be that we have vendor/platform specific sub
folders which all seem to more or less implement own regmap-based basic
clocks. (Well, I randonly skimmed through the qcom and meson subfolders
and aty least they did - I guess same holds with others).

I sure could create 'rohm' subfolder and build up the 'basic clocks
using regmap' there - and put ROHM component related drivers in it. But
that does feel really stupid. Maybe the series worked by Matthias (last
link in the mail) could be reworked - or maybe we could drop one of the
platform specific regmap implementatios from subfolder to generic
portion? I think that for example moving the

drivers/clk/qcom/clk-regmap.c to
drivers/clk/clk-regmap.c so that it could be used without enabling
qualcomm clk configs would be a good start.

Seeing the number of chips connected with i2c/spi/... increasing - and
seeing the comments from community when Matthias sent his patch series
- I'd say the basic clocks supporting regmap would be very welcome...

But maybe I am missing something? I would like to start working with the
clk driver for the new ROHM PMIC - but I would like to take sane
approach. Any good adviece on how to proceed?

Best Regards
	Matti Vaittinen


-- 
Matti Vaittinen
ROHM Semiconductors

~~~ "I don't think so," said Rene Descartes.  Just then, he vanished ~~~

                 reply	other threads:[~2018-12-20 11:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20181220114856.GH2477@localhost.localdomain \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=heikki.haikola@fi.rohmeurope.com \
    --cc=heiko@sntech.de \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.bgg@kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=mikko.mutanen@fi.rohmeurope.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.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