From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753311AbbJROB3 (ORCPT ); Sun, 18 Oct 2015 10:01:29 -0400 Received: from down.free-electrons.com ([37.187.137.238]:58303 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751900AbbJROB1 (ORCPT ); Sun, 18 Oct 2015 10:01:27 -0400 Date: Sun, 18 Oct 2015 16:01:23 +0200 From: Thomas Petazzoni To: Marcin Wojtas Cc: Russell King - ARM Linux , Andrew Lunn , Jason Cooper , Tawfik Bayouk , Grzegorz Jaszczyk , linus.walleij@linaro.org, linux-kernel@vger.kernel.org, nadavh@marvell.com, linux-gpio@vger.kernel.org, Lior Amsalem , Gregory =?UTF-8?B?Q2zDqW1lbnQ=?= , "linux-arm-kernel@lists.infradead.org" , Sebastian Hesselbarth Subject: Re: [PATCH] pinctrl: mvebu: armada-38x: add suspend/resume support Message-ID: <20151018160123.6694b4be@free-electrons.com> In-Reply-To: References: <1445117328-31678-1-git-send-email-mw@semihalf.com> <20151017222927.GR32532@n2100.arm.linux.org.uk> Organization: Free Electrons X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Marcin, On Sun, 18 Oct 2015 10:43:42 +0200, Marcin Wojtas wrote: > Thanks for pointing this. I based on pinctrl-armada-xp.c (it needs a > fix then, too) and it worked. I must have missed, because I got proper > registers' number and values in suspend/resume routines. As > pinctrl-armada-xp.c needs also a small fix and in order not to > duplicate code, how about a following solution: > - *mpp_saved_regs and *mpp_base become members of struct mvebu_pinctrl_soc_info I don't like this. The mvebu_pinctrl_soc_info structure is meant to be a read-only structure that only describes static information giving SoC-specific details for pin-muxing. The idea is that in the event where you had multiple pinctrl in the same system, you would still have only one instance of mvebu_pinctrl_soc_info. So, I'd prefer if mpp_saved_regs and mpp_base became members of a new structure, that gets allocated at ->probe() time, on a per-instance basis. > - common mvebu_pinctrl_suspend/resume functions in pinctrl-mvebu.c > (now there will be two users AXP and A38X) Not sure how to handle that if the per-instance structure is defined on a per-SoC basis, but I'm interested in seeing proposals. Best regards, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com