Received: by 10.223.185.116 with SMTP id b49csp3960654wrg; Mon, 19 Feb 2018 08:42:31 -0800 (PST) X-Google-Smtp-Source: AH8x225hsE1dIIZ/alb0E7XiIN/pqP0P0NAHkYDz94OGO1GP0ClveySQ9dN0K8Qy1pKOgOOsAUTr X-Received: by 10.99.106.71 with SMTP id f68mr9156324pgc.262.1519058551198; Mon, 19 Feb 2018 08:42:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519058551; cv=none; d=google.com; s=arc-20160816; b=bzmuuO76nfPAID1f3HgZUvOOFOmxmSGyhEyAqdcU7/g1QG9UPGrtDILew2QabqGC9o 9sj2AnyWo56/LJRtqRpx7ITLrCC2qWh9dZ9jGVEOjxu69HglojZxzlnTjZzdMyyOeElo 5UtTVp8m+MsOd5wzjsSXB5NNv6/3frQxTo32OxJg0sT08B6ulxyDdLMle5BXvVqyynAr qnBl+Co7wPf/nCjyS+LXyD8aDEq1lTBy6xs/fDFyrjVcvcuIP3qRQQmMgimsw8PCGKdq 7oUVUgnto/1QvSnkK+JAnXJrPR89V0yd0hkQs/e+oudTo+qBRtvOjeRpgSp5PGiz3gJ8 LQYg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Gv9ErqgBJycpakmn+04wtcnogzucJd3aHMnivibgpLE=; b=Kf6lcUcxE6vfuWZmA6vJ7vyB7gaTrpFvpwuBCdU2RD1xqf4oQOCSvD7ys0KTymrJg3 YQs4kRl4OQZFrYNS3/SUnrpYvGjlT5PM7sQhI9bJ85tPKFlqrqA9D9SXukGQNBcd09cG Ro0G6Wg7bnSie0zcG6wN8wa8FuFvHr7jELGP18zmWntIhD8EHLVWYhTm67uQtbCPmoeT Cv/+AW6dPIDAs+I2DTa4lrMOKB9D0ZJJJYbV+lzbPiJHB4TwEahlYi4SpSsTYk1/N4OS YR/Fs9BojEtNSlzjbR2esHtlFcG2JoVrby4TmayK68SjE8wYgJMNvZQxjiJilflNUgiv ej0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=FSQl4c1U; 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 m70si4236825pfk.201.2018.02.19.08.42.16; Mon, 19 Feb 2018 08:42:31 -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; dkim=fail header.i=@lechnology.com header.s=default header.b=FSQl4c1U; 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 S1753208AbeBSQlj (ORCPT + 99 others); Mon, 19 Feb 2018 11:41:39 -0500 Received: from vern.gendns.com ([206.190.152.46]:49018 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753152AbeBSQlh (ORCPT ); Mon, 19 Feb 2018 11:41:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Gv9ErqgBJycpakmn+04wtcnogzucJd3aHMnivibgpLE=; b=FSQl4c1UczNVqeIL2O6LImFt0W 5DPNckOLBvqaEMTe1AzLI452bEAkxPslSS1aHR178VXo/2ruH5EvMNf01FZq4x3mXCkLFxfcoDbp6 JAUbhCN2SUH4EiJjYMzxED4M5NHk4EK91YbS2m3Gjc9+Jnr2JUrf4S5Rp6VjDbazkh9oRjbLJZlkB BSJLnL8x+yfr/1mLeUOnXzGdEY9+f4jSduYCqteo3CyATq8l+Oh0d1ISNndXQpSgDBFUsbJN1kwk4 loLw3fFnfpORqqaSj7wl+TnWc+pbZWvRBYiNRFrvkPvqYE+nu19Kc6nSoBqNxuNGmEPTxI218O4rz xXFWcmkA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:45798 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1enoUB-003Ohp-EJ; Mon, 19 Feb 2018 11:40:15 -0500 Subject: Re: [PATCH v3] reset: add support for non-DT systems To: Philipp Zabel , Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski , Sekhar Nori , Kevin Hilman References: <20180219123435.12007-1-brgl@bgdev.pl> <1519046007.3408.9.camel@pengutronix.de> From: David Lechner Message-ID: <078f13eb-22ec-e042-827b-f543c9765e9c@lechnology.com> Date: Mon, 19 Feb 2018 10:41:48 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1519046007.3408.9.camel@pengutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> >> 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.