On Tue, Feb 13, 2018 at 8:39 PM, Bartosz Golaszewski <brgl@bgdev.pl> 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 and an additional, optional identifier> string.>> 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[] = {> [FOO_RESET] = { .dev = "foo", .id = "foo_id" },> [BAR_RESET] = { .dev = "bar", .id = NULL },> { }> };>> where FOO_RESET and BAR_RESET will correspond with the id parameters> of reset callbacks.