From: David Lechner <david@lechnology.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Sekhar Nori <nsekhar@ti.com>, Kevin Hilman <khilman@baylibre.com>
Subject: Re: [PATCH v3] reset: add support for non-DT systems
Date: Mon, 19 Feb 2018 10:41:48 -0600 [thread overview]
Message-ID: <078f13eb-22ec-e042-827b-f543c9765e9c@lechnology.com> (raw)
In-Reply-To: <1519046007.3408.9.camel@pengutronix.de>
On 02/19/2018 07:13 AM, Philipp Zabel wrote:
> Hi Bartosz,
>
> On Mon, 2018-02-19 at 13:34 +0100, Bartosz Golaszewski wrote:
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> The reset framework only supports device-tree. There are some platforms
>> however, which need to use it even in legacy, board-file based mode.
>>
>> An example of such architecture is the DaVinci family of SoCs which
>> supports both device tree and legacy boot modes and we don't want to
>> introduce any regressions.
>>
>> We're currently working on converting the platform from its hand-crafted
>> clock API to using the common clock framework. Part of the overhaul will
>> be representing the chip's power sleep controller's reset lines using
>> the reset framework.
>>
>> This changeset extends the core reset code with a new field in the
>> reset controller struct which contains an array of lookup entries. Each
>> entry contains the device name, an additional, optional identifier
>> string and the reset id number.
>>
>> Drivers can register a set of reset lines using this lookup table and
>> concerned devices can access them using the regular reset_control API.
>>
>> This new function is only called as a fallback in case the of_node
>> field is NULL and doesn't change anything for current users.
>>
>> Tested with a dummy reset driver with several lookup entries.
>>
>> An example lookup table can look like this:
>>
>> static const struct reset_lookup foobar_reset_lookup[] = {
>> { .dev = "foo", .reset_id = "foo_id", .id = 14 },
>> { .dev = "bar", .id = NULL, .id = 3 },
>> { }
>> };
>
> Thank you for the patch. This is a useful addition, but the lookups
> should be added in platform code, not by the reset controller driver.
>
> I would prefer reset_lookups to follow the patterns set by the other
> subsystem's lookup implementations:
> clk, gpiod, phy, and pwm have lookups that can be created from platform
> code, independently from the drivers (via clkdev_add_table,
> gpiod_add_lookup_table, phy_create_lookup, and pwm_add_table).
>
> Following this pattern would allow to support reset controllers that are
> implemented as proper device drivers, and reset controllers that are
> reused on multiple platforms.
>
When testing v2 of this series, I was thinking that having this sort
of separation would be better as well.
prev parent reply other threads:[~2018-02-19 16:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 12:34 Bartosz Golaszewski
2018-02-19 13:13 ` Philipp Zabel
2018-02-19 16:41 ` David Lechner [this message]
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=078f13eb-22ec-e042-827b-f543c9765e9c@lechnology.com \
--to=david@lechnology.com \
--cc=bgolaszewski@baylibre.com \
--cc=brgl@bgdev.pl \
--cc=khilman@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=p.zabel@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®