Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp706699pxp; Wed, 16 Mar 2022 15:02:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKB9A6I5/ORPp8VLSTjDsllQpuiZH7dP1/kjbo7lzGXuVvrHz4kXDh03R7ABd5fXNHV8br X-Received: by 2002:a05:6a00:1695:b0:4f7:decc:506b with SMTP id k21-20020a056a00169500b004f7decc506bmr1876282pfc.7.1647468154228; Wed, 16 Mar 2022 15:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647468154; cv=none; d=google.com; s=arc-20160816; b=YRzePqKerSjx/3uz1Yu0CVtqaPIyIjpwwbelgw2R64n2AF6yiDkyXOWsF2PhpRItv3 TnM7Xv3RPQkFX5n4XQoLpLWHCPUF59PsHql3HFWaQcVZam42tMhRT6UBUpNSc3PvbSrN 6aNrcDFQ/RyVRkEJdY9Hvs3c5F5hxl6vjqgKcSeil+fWkEHHzsq90mxrpbNsPUbDL6H2 tTmIhitHULljs1l01VYy2dELUMJ5hGMHf/bTNFIc+IuyXpjiPp23sXouKRLGMceRVuv7 mRwPmkDHU1p0lgfAqHacFBm7uIQcOf0jpGcfmc//mpqtNyxKNTgz9279AABk+MruEwna VMag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=hEKd/crXe5rm/TkSAGnj1cxYgWZfTDlKRtZMo5UwGFM=; b=OFaRcutJk+aWW9BLNxkSqbnckF+TXE1f7Xs0wSnbIJYoZKu0t7obkVn8D0BRMIkyiu AA00niWP72QVl5u2ky0RKVd5Veu+UguEHNWx5ssd0cpGTru9hf4Z5arfqSl+D0vMCcLc N1+RL5/RuFupsjhnNcGrfiK0RUUsgcX6r7mR3NuBeSWdDr9iEcPri0pOWXigiwSrs9rM Ndn/lrfvsGjs7x+/YA4dS8MDjjacSaU6JoYJ+6cpSr5Ds8Be+rzItnv5mFZfMMGlV3xm IQgLjw8/sr96FCCrZ3XTR9SvRya4avCjN3U7dKPAt2E4D4REL+Dt/ubYyC6O9xkbNKMh jmbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15-20020a63af0f000000b003816043f163si338475pge.856.2022.03.16.15.02.20; Wed, 16 Mar 2022 15:02:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346507AbiCOJYV convert rfc822-to-8bit (ORCPT + 99 others); Tue, 15 Mar 2022 05:24:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346558AbiCOJYS (ORCPT ); Tue, 15 Mar 2022 05:24:18 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 700A4264A; Tue, 15 Mar 2022 02:23:03 -0700 (PDT) Received: from mail-wr1-f51.google.com ([209.85.221.51]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MzQXu-1oGV8v2unY-00vPvu; Tue, 15 Mar 2022 10:23:01 +0100 Received: by mail-wr1-f51.google.com with SMTP id x15so27875178wru.13; Tue, 15 Mar 2022 02:23:01 -0700 (PDT) X-Gm-Message-State: AOAM533GgKubDIOeUFc4cSTNMr+TWXR65vczvHMwJTVmBRSRSO0I4yNp tJZzCciwzzj0TMQOe+4wHxdpCWx/X6qUTv+/qyw= X-Received: by 2002:adf:f606:0:b0:203:8dff:f4ac with SMTP id t6-20020adff606000000b002038dfff4acmr17197414wrp.12.1647336181331; Tue, 15 Mar 2022 02:23:01 -0700 (PDT) MIME-Version: 1.0 References: <07f507a84a9e39d3cd8393f41d1292c250e07642.1647095774.git.tonyhuang.sunplus@gmail.com> <00362767-080a-aa7f-672f-22b83ab35e61@kernel.org> <42f5f710077b40d7b6fde45789f46732@sphcmbx02.sunplus.com.tw> <58fd70a3fa3d44229edd849cab49eadf@sphcmbx02.sunplus.com.tw> <0d615380aa85444c81e9b93f4a216232@sphcmbx02.sunplus.com.tw> In-Reply-To: <0d615380aa85444c81e9b93f4a216232@sphcmbx02.sunplus.com.tw> From: Arnd Bergmann Date: Tue, 15 Mar 2022 10:22:45 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v11 2/2] misc: Add iop driver for Sunplus SP7021 To: =?UTF-8?B?VG9ueSBIdWFuZyDpu4Pmh7fljpo=?= Cc: Krzysztof Kozlowski , Tony Huang , "robh+dt@kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "derek.kiernan@xilinx.com" , "dragan.cvetic@xilinx.com" , "arnd@arndb.de" , "gregkh@linuxfoundation.org" , =?UTF-8?B?V2VsbHMgTHUg5ZGC6Iqz6aiw?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:K0Qy9rBfl+lGEN3fmr1LRggL2e8Wh9GoKADVQvdpgqPDEgDwDQg bffffrt1ZqV+nsvoSicAlQjPZ35+8MpaGEPlMb1qQ4CvPu0RlBhTEkYOvg8AQ5ZrRRyhVTe fnkSEjKoppC+aFsiEeXz4+9RUTqaWMfull/xiXsOYxmRnsVwgBD6Tklk2vVqg9lP+h0xF1c AYY6odH6E8fvkKhWDoAZg== X-UI-Out-Filterresults: notjunk:1;V03:K0:uBoElrGp64A=:LTqxNTQKRfCL/NQDZrSsx2 e1bTR6hZLmSQAjG7jZUY5QfoIWV3t9jkl200fQR10z/LSxC3MHpRMUJqTxS3QQxIkGmwdBf05 8bZuZCcHwqq8A8FOZ9OwKlQiIzs4Xj6GtcA5NkHR3aq7Vwqiehed2ScPZs11BPKLA8rfOj4tu q/21wPJffrgsCrLConkNLShm3RfxIumzrJ/mjJpkFQXH6BW78UqK0gVdy88oMtKFx8dfXArf7 M4jXkAqktHh58mrbRWJGfx9TlOKk7uMBW9cvGxkXjajpcTM7Akc0ifVb1nRI0bO0bUhvyR54K uYTpheTviILJSqyVJhEjUkR5Lu3ewlBy5blghCdTfV8EqNQvJkXaP3NeJDreoG7nlCHZAxXYb hs1IoaK8OpRAVG8QPAT+pWrJa0BDs0EWACP5DoWyXNz1/nbE05VRmJ/Oh/3ZV7z/KGc3K65PB XB+G8yF5wfSXqWsb7QpDrZuOnvq7LMkiEtavKzC4X13nE9pZmY8foWn6VuiAMeQOfeu+rRtv2 DJtNhwdfqtNtsyQ2sTK1BHCVn94GWI1zIBGHLBQTkJS/5ymi9EIKYkGy25OZXjZKMa+0x6tEw w6YWi+e5P3a6gc/6kL4dLuOzu7Gy83GCEgtrulQE97Zg6Lq6jMma2Qy+E4fi1wq3oR4/MvzYu XI4WSn8sGg0lF6Hws9IQD/6WbzB35whep74rlYyOkqCqezkbxTgJiz4psxfDCVoDSrJo= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 15, 2022 at 9:24 AM Tony Huang 黃懷厚 wrote: > > >>>> On 12/03/2022 17:16, Tony Huang wrote: (note: please use normal quoting style, only quote the parts of the message that you actually reply to, reave the attributoons in place, etc) > > > Can I put sp_iop_poweroff() here for now? > > > When power off device driver is added in /driver/power/reset is complete, > > we will move to it. > > > > Not really, because misc drivers is not a place for power off drivers. > > The driver here looks now like responsible only for system power management > > of a SoC, so most likely drivers/soc. However it has even less sense to add > > some feature here and immediately move it somewhere more appropriate > > (instead just add it to the appropriate place). > > > > Your moving of parts of it to drivers/power/reset is now confusing. What will > > be left here? Please send entire set not just pieces. > > > > I may not fully understand your requirements. > You: What is your plan for this driver? > < ----- reset driver? Misc driver? > You: However keeping all in the same place would be ok, if you do not plan to add any more features. > This would mean the driver will handle *only* reset and FW loading. > < ------ Because system does not have a power off device driver. > sp_iop_poweroff() can be placed in iop driver? It really depends on where you want this driver to head. If you don't have any plans to add features beyond poweroff, having the whole thing in drivers/power/reset/ is the easiest way. If you do have plans to add other features, then explain exactly what those features are, which subsystems they go into, and why you haven't already implemented them in the previous 11 versions. The common bits of the driver can go into drivers/soc or drivers/mfd, partly depending on what abstraction you use between this driver and its clients, so it's important to figure out the correct abstraction layer first, and then decide where it should go. One common way to do it is to use the multi-function-device abstraction to automatically create child devices from the hardware device node. Another option is to have high-level functions exported from a soc driver. Or you could just have a 'regmap' exposed from a 'syscon' driver to provide individual registers to devices. Which one of those is best for your system mostly depends on how you end up using it, and we have no idea until you have more than one leaf driver on it. The poweroff driver is not a great example either, because it does not have an interesting interface and just comes down to a single function call. Arnd