mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sekhar Nori <nsekhar@ti.com>
To: David Lechner <david@lechnology.com>,
	<linux-arm-kernel@lists.infradead.org>
Cc: Kevin Hilman <khilman@kernel.org>,
	Lee Jones <lee.jones@linaro.org>, Arnd Bergmann <arnd@arndb.de>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Adam Ford <aford173@gmail.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] mfd: syscon: Add syscon_register() function
Date: Mon, 22 Jan 2018 16:23:11 +0530	[thread overview]
Message-ID: <75ad5a5e-319e-75d3-c1c7-15e7518d424b@ti.com> (raw)
In-Reply-To: <1516418424-28686-2-git-send-email-david@lechnology.com>

On Saturday 20 January 2018 08:50 AM, David Lechner wrote:
> This adds a new syscon_register() function that creates a new syscon
> regmap and adds it to the lookup list.
> 
> This function serves two purposes:
> 
> 1. This is needed for platforms without device tree support where the
>    syscon regmap is needed in early boot (e.g. clocks), because using a
>    platform driver at this point in boot is not an option.

Is this because platform_device_register() of the syscon device fails
when called early on? It will be nice to document the exact failure case
here (at least the return value) so its clear what the issue is.

> 2. It allows other drivers to use syscon_regmap_lookup_by_compatible()
>    for both device tree and non-DT platforms instead of having to have
>    a separate case that calls syscon_regmap_lookup_by_pdevname().

"compatible" is a very device-tree specific terminology so I am afraid
this is will actually turn out to be confusing.

So, if we are doing this, I would rather be more explicit about it:

/*
 * registers a "global" syscon "device", usually not backed by a real
 * device. To be used only in cases where the syscon is not
 * related to any actual device, like system clocks, for example.
 *
 * name passed here must be globally unique.
 */
struct regmap *syscon_register_by_name(resource_size_t start, size_t
				       size, const char *name);

and

struct regmap *syscon_regmap_lookup_by_name(const char *name);

I understand, with this the driver becomes little more complicated and
DT and non-DT cases still need to be handled differently. But I think
thats not the main issue you are trying to solve.

> 
> Signed-off-by: David Lechner <david@lechnology.com>

Thanks,
Sekhar

  reply	other threads:[~2018-01-22 10:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-20  3:20 [PATCH 0/6] ARM: davinci: common clock prep work David Lechner
2018-01-20  3:20 ` [PATCH 1/6] mfd: syscon: Add syscon_register() function David Lechner
2018-01-22 10:53   ` Sekhar Nori [this message]
2018-01-22 11:08     ` Arnd Bergmann
2018-01-22 11:39       ` Sekhar Nori
2018-01-22 16:47         ` David Lechner
2018-01-20  3:20 ` [PATCH 2/6] phy: da8xx-usb: Always check for syscon compatible David Lechner
2018-01-20  3:20 ` [PATCH 3/6] phy: da8xx-usb: rename clock con_ids David Lechner
2018-01-20  3:20 ` [PATCH 4/6] ARM: davinci: move davinci_clk_init() to init_time David Lechner
2018-01-23 12:02   ` Sekhar Nori
2018-01-20  3:20 ` [PATCH 5/6] ARM: da8xx: Move CFGCHIP registration " David Lechner
2018-01-20  3:20 ` [PATCH 6/6] phy: da8xx-usb: drop use of syscon_regmap_lookup_by_pdevname() David Lechner
2018-01-22 11:13 ` [PATCH 0/6] ARM: davinci: common clock prep work Sekhar Nori
2018-01-23 23:40   ` David Lechner

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=75ad5a5e-319e-75d3-c1c7-15e7518d424b@ti.com \
    --to=nsekhar@ti.com \
    --cc=aford173@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bgolaszewski@baylibre.com \
    --cc=david@lechnology.com \
    --cc=khilman@kernel.org \
    --cc=kishon@ti.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®