From mboxrd@z Thu Jan 1 00:00:00 1970 From: atull Subject: Re: [PATCH 4/4 v3] GPIO: gpio-dwapb: Suspend & Resume PM enabling Date: Thu, 11 Sep 2014 11:40:13 -0500 Message-ID: References: <1410286081-16653-1-git-send-email-alvin.chen@intel.com> <1410286081-16653-5-git-send-email-alvin.chen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: <1410286081-16653-5-git-send-email-alvin.chen@intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Weike Chen Cc: Linus Walleij , Alexandre Courbot , Grant Likely , Rob Herring , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Boon Leong Ong , Hock Leong Kweh , Darren Hart , Sebastian Andrzej Siewior , Mika Westerberg , Andriy Shevchenko , Arnd Bergmann List-Id: devicetree@vger.kernel.org On Tue, 9 Sep 2014, Weike Chen wrote: > > struct dwapb_gpio; > +struct dwapb_context; > > struct dwapb_gpio_port { > struct bgpio_chip bgc; > bool is_registered; > struct dwapb_gpio *gpio; > + struct dwapb_context *ctx; Alvin, Will this build if CONFIG_PM_SLEEP is not defined? Alan > + unsigned int idx; > }; > > struct dwapb_gpio { > @@ -377,6 +380,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio, > > port = &gpio->ports[offs]; > port->gpio = gpio; > + port->idx = pp->idx; > > dat = gpio->regs + GPIO_EXT_PORTA + (pp->idx * GPIO_EXT_PORT_SIZE); > set = gpio->regs + GPIO_SWPORTA_DR + (pp->idx * GPIO_SWPORT_DR_SIZE); > @@ -584,10 +588,115 @@ static const struct of_device_id dwapb_of_match[] = { > }; > MODULE_DEVICE_TABLE(of, dwapb_of_match); > > +#ifdef CONFIG_PM_SLEEP > +/* Store GPIO context across system-wide suspend/resume transitions */ > +struct dwapb_context { > + u32 data; > + u32 dir; > + u32 ext; > + u32 int_en; > + u32 int_mask; > + u32 int_type; > + u32 int_pol; > + u32 int_deb; > +}; > +