Received: by 10.223.185.116 with SMTP id b49csp3736227wrg; Mon, 19 Feb 2018 05:14:28 -0800 (PST) X-Google-Smtp-Source: AH8x224Df6GTPNSuUyvNlm0U4YrrDQhHtjByUtPmH9PtvOkCnJ2gZ86xqdIl2VVALv/R3DJNMh1W X-Received: by 10.98.211.198 with SMTP id z67mr7141141pfk.0.1519046068586; Mon, 19 Feb 2018 05:14:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519046068; cv=none; d=google.com; s=arc-20160816; b=wczBMsc8CQrBRlrTnGCK8Us4q8kudIRRi2FVvhfbKbk0X+S6JErwc/fC9n6WtBKAn+ d1nsYf7bud0BWDC0URCkcIzcgIrNNaMBHBhDr0RQE/GBuunNuvmw8KmQLXfO4hc1J81M ZoEcabrPyZZRir61MdyEcAKN+gJS0plcuq//49+UoPtfozK0PHT+62SDU8vmHI7EyB8E tVZBP34MLzcOwCsD5eqC1bpZY+Jwfsa09fQLjidRa1C/3PN9P9wNt8yFVT6wMfG6HeSN 3/2R5yFIRJenuRD4FN1nRpQs0S5V+h+FDTrjbIlvSphJ19ttd8C034BivmUCGn0PyQ0a CM9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=KFPfJ7L+Owy2f83O6WLAsolu/xy2DHV0HOOqO6mQ+Mg=; b=cyiU8ggsMBg5sH8fmD7i7OxOsRMaUbhACMf0U9kWcXt65jD6QAklomo5dFRb2/3il2 26w+l1EfGZoSgj1o20rPapstALUn9K0QlGeY8cDIwS2xv6MKQJ06+68lANwCZRQzolKs LhEO3yBGN0tESIi83fIe3u8HWIBha7us3efzfPywEusJ3o3O73hm3YNSQFvl0ilM2fv0 GFLw4U6NzsJgCkxVHZyHosH5kI38ssBctHpsqSaWc9iFJMiwGhVMaQ+sQIjEmtluh9gC wHBHKUvNqR05lo6n6U2whyK6Y4oW14exAptop1ehZ0yZU2CMygr8KMd9E9Yy/0WlAFZq hf0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z67si5741886pfb.223.2018.02.19.05.14.11; Mon, 19 Feb 2018 05:14:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752752AbeBSNNa (ORCPT + 99 others); Mon, 19 Feb 2018 08:13:30 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:53445 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752666AbeBSNN3 (ORCPT ); Mon, 19 Feb 2018 08:13:29 -0500 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1enlG4-0008Vp-Af; Mon, 19 Feb 2018 14:13:28 +0100 Message-ID: <1519046007.3408.9.camel@pengutronix.de> Subject: Re: [PATCH v3] reset: add support for non-DT systems From: Philipp Zabel To: Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski , Sekhar Nori , Kevin Hilman , David Lechner Date: Mon, 19 Feb 2018 14:13:27 +0100 In-Reply-To: <20180219123435.12007-1-brgl@bgdev.pl> References: <20180219123435.12007-1-brgl@bgdev.pl> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bartosz, On Mon, 2018-02-19 at 13:34 +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > 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. regards Philipp