mbox series

[RFC,00/11] Add generic MFD i.MX mix and audiomix support

Message ID 1583226206-19758-1-git-send-email-abel.vesa@nxp.com (mailing list archive)
Headers show
Series Add generic MFD i.MX mix and audiomix support | expand

Message

Abel Vesa March 3, 2020, 9:03 a.m. UTC
The i.MX8MP has some new IPs called mixes. They are formed usually by some
GPRs that can be split into different functionalities. The first example
here is the audiomix which has dedicated registers that can be registered
as a clock controller and some other registers that can be registered as
a reset controller, plus some dedicated ones that will be registered as
syscon and used by each dedicated audio IP.

More mixes to be following the same structure are to come, like hdmimix,
dispmix and mediamix. They will all be populated and registered by the MFD
imx-mix generic driver.

Abel Vesa (11):
  mfd: Add i.MX generic mix support
  arm64: dts: imx8mp: Add AIPS 4 and 5
  arm64: dts: imx8mp: Add audiomix node
  clk: imx: Add gate shared for i.MX8MP audiomix
  clk: imx: pll14xx: Add the device as argument when registering
  clk: imx: Add helpers for passing the device as argument
  dt-bindings: clocks: imx8mp: Add ids for audiomix clocks
  clk: imx: Add audiomix clock controller support
  arm64: dts: imx8mp: Add audiomix clock controller node
  reset: imx: Add audiomix reset controller support
  arm64: dts: imx8mp: Add audiomix reset controller node

 arch/arm64/boot/dts/freescale/imx8mp.dtsi      |  37 ++++
 drivers/clk/imx/Makefile                       |   2 +-
 drivers/clk/imx/clk-audiomix.c                 | 237 +++++++++++++++++++++++++
 drivers/clk/imx/clk-gate-shared.c              | 111 ++++++++++++
 drivers/clk/imx/clk-pll14xx.c                  |   6 +-
 drivers/clk/imx/clk.h                          |  46 ++++-
 drivers/mfd/Kconfig                            |  11 ++
 drivers/mfd/Makefile                           |   1 +
 drivers/mfd/imx-mix.c                          |  48 +++++
 drivers/reset/Kconfig                          |   7 +
 drivers/reset/Makefile                         |   1 +
 drivers/reset/reset-imx-audiomix.c             | 122 +++++++++++++
 include/dt-bindings/clock/imx8mp-clock.h       |  62 +++++++
 include/dt-bindings/reset/imx-audiomix-reset.h |  15 ++
 14 files changed, 699 insertions(+), 7 deletions(-)
 create mode 100644 drivers/clk/imx/clk-audiomix.c
 create mode 100644 drivers/clk/imx/clk-gate-shared.c
 create mode 100644 drivers/mfd/imx-mix.c
 create mode 100644 drivers/reset/reset-imx-audiomix.c
 create mode 100644 include/dt-bindings/reset/imx-audiomix-reset.h

Comments

Arnd Bergmann April 16, 2020, 11:06 a.m. UTC | #1
On Tue, Mar 3, 2020 at 10:04 AM Abel Vesa <abel.vesa@nxp.com> wrote:
>
> The i.MX8MP has some new IPs called mixes. They are formed usually by some
> GPRs that can be split into different functionalities. The first example
> here is the audiomix which has dedicated registers that can be registered
> as a clock controller and some other registers that can be registered as
> a reset controller, plus some dedicated ones that will be registered as
> syscon and used by each dedicated audio IP.
>
> More mixes to be following the same structure are to come, like hdmimix,
> dispmix and mediamix. They will all be populated and registered by the MFD
> imx-mix generic driver.

Can you enumerate what functionality is in each one?

I'm not convinced that using an MFD driver is the best solution here,
compared to e.g. a clk driver with a few extra bits in it, if most of the
code for the child drivers ends up being for the clk subsystem.

Lee suggested maybe having a generic (platform independent) driver
for it, which may help here, as it would let others share the trivial
mfd portion.

Another option that we are using on several platforms today is to
have a single syscon node and have other drivers that reference
that one using a phandle to get at the regmap.

      Arnd
Arnd Bergmann April 16, 2020, 11:06 a.m. UTC | #2
On Thu, Apr 16, 2020 at 1:06 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Tue, Mar 3, 2020 at 10:04 AM Abel Vesa <abel.vesa@nxp.com> wrote:
> >
> > The i.MX8MP has some new IPs called mixes. They are formed usually by some
> > GPRs that can be split into different functionalities. The first example
> > here is the audiomix which has dedicated registers that can be registered
> > as a clock controller and some other registers that can be registered as
> > a reset controller, plus some dedicated ones that will be registered as
> > syscon and used by each dedicated audio IP.
> >
> > More mixes to be following the same structure are to come, like hdmimix,
> > dispmix and mediamix. They will all be populated and registered by the MFD
> > imx-mix generic driver.
>
> Can you enumerate what functionality is in each one?
>
> I'm not convinced that using an MFD driver is the best solution here,
> compared to e.g. a clk driver with a few extra bits in it, if most of the
> code for the child drivers ends up being for the clk subsystem.
>
> Lee suggested maybe having a generic (platform independent) driver
> for it, which may help here, as it would let others share the trivial
> mfd portion.
>
> Another option that we are using on several platforms today is to
> have a single syscon node and have other drivers that reference
> that one using a phandle to get at the regmap.

Sorry I replied to the wrong thread, I meant to reply to the v3 version.

       Arnd