mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <conor.dooley@microchip.com>
To: <aou@eecs.berkeley.edu>, <paul.walmsley@sifive.com>,
	<palmer@dabbelt.com>, <arnd@arndb.de>, <olof@lixom.net>,
	<linux-riscv@lists.infradead.org>
Cc: <cyril.jean@microchip.com>, <daire.mcnamara@microchip.com>,
	<lewis.hanly@microchip.com>, <jassisinghbrar@gmail.com>,
	<j.neuschaefer@gmx.net>, <sfr@canb.auug.org.au>,
	<damien.lemoal@wdc.com>, <atishp@atishpatra.org>,
	<nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>,
	<ludovic.desroches@microchip.com>, <claudiu.beznea@microchip.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Conor Dooley <conor.dooley@microchip.com>
Subject: [PATCH v2 0/1] soc: add polarfire soc system controller
Date: Mon, 20 Dec 2021 14:44:12 +0000	[thread overview]
Message-ID: <20211220144413.6798-1-conor.dooley@microchip.com> (raw)

From: Conor Dooley <conor.dooley@microchip.com>

Changes since v1:
- system controller is now an mfd
- parentage is now used to get the device node on the system controller
- mpfs_sys_controller_get() now updates the reference count
- "polarfire-soc" in compat string changed to "mpfs"

Depends on [0] to change the compat string in the dt-binding.

@Arnd Bergmann:
I sent the first version of this patch in November & you (along with
requesting referencing counting) wanted me to check if the driver was
bound to the specific device [1]. I have taken another look at this
driver now and I am still none the wiser as to how I should do this.

As I said in the previous thread, I checked other driver but was not
able to find any examples of of_find_device_by_node() where the binding
of the driver was checked. If you could point me towards an example
that would be great.

Thanks,
Conor.

For some extra context, the device tree entry for this driver will look
like:

syscontroller: syscontroller {
	compatible = "microchip,mpfs-sys-controller", "simple-mfd";
	mboxes = <&mbox 0>;

	hwrandom: hwrandom {
		compatible = "microchip,mpfs-rng";
	};

	sysserv: sysserv {
		compatible = "microchip,mpfs-generic-service";
	};
};

and the mpfs_sys_controller_get() function is called in, for example,
the mpfs-rng driver:

node_pointer = of_get_parent(dev->of_node);
if (!node_pointer) {
	dev_err(&pdev->dev,
		"Failed to find mpfs system controller node\n");
	return -ENODEV;
}

rng_priv->sys_controller =  mpfs_sys_controller_get(&pdev->dev, node_pointer);

[0] https://lore.kernel.org/linux-riscv/CAMuHMdWTjrAiHosU0cGyJYkK=9JzNgHb=tjHXPdYxTWmkVzeYQ@mail.gmail.com/T/
[1] https://lore.kernel.org/linux-riscv/CAK8P3a1m_LhOg5JGMqPz6sohJa2hPZ3GN-jQDPxigZ5DaqAGxQ@mail.gmail.com/

Conor Dooley (1):
  soc: add polarfire soc system controller

 drivers/soc/Kconfig                         |   1 +
 drivers/soc/Makefile                        |   1 +
 drivers/soc/microchip/Kconfig               |  10 ++
 drivers/soc/microchip/Makefile              |   1 +
 drivers/soc/microchip/mpfs-sys-controller.c | 169 ++++++++++++++++++++
 include/soc/microchip/mpfs.h                |   3 +-
 6 files changed, 184 insertions(+), 1 deletion(-)
 create mode 100644 drivers/soc/microchip/Kconfig
 create mode 100644 drivers/soc/microchip/Makefile
 create mode 100644 drivers/soc/microchip/mpfs-sys-controller.c

-- 
2.33.1


             reply	other threads:[~2021-12-20 14:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 14:44 conor.dooley [this message]
2021-12-20 14:44 ` [PATCH v2 1/1] " conor.dooley
2022-01-10 10:32 ` [PATCH v2 0/1] " Conor.Dooley

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=20211220144413.6798-1-conor.dooley@microchip.com \
    --to=conor.dooley@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=atishp@atishpatra.org \
    --cc=claudiu.beznea@microchip.com \
    --cc=cyril.jean@microchip.com \
    --cc=daire.mcnamara@microchip.com \
    --cc=damien.lemoal@wdc.com \
    --cc=j.neuschaefer@gmx.net \
    --cc=jassisinghbrar@gmail.com \
    --cc=lewis.hanly@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=olof@lixom.net \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=sfr@canb.auug.org.au \
    /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®