RE: [PATCH 3/3] GPIO: gpio-dwapb: Suspend & Resume PM enabling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> 
> > +#if defined CONFIG_PM_SLEEP
> 
> I wonder whether it's worth #ifdef:in out such things, it clutters the place.
OK. I will use '#ifdef'.
> 
> > +/* Store GPIO context across system-wide suspend/resume transitions
> > +*/ static struct gpio_saved_regs {
> 
> Call the struct:
> 
> struct dwapb_context
> 
> because that is easier to understand.
> 
OK.

> > +       unsigned long data;
> > +       unsigned long dir;
> > +       unsigned long int_en;
> > +       unsigned long int_mask;
> > +       unsigned long int_type;
> > +       unsigned long int_pol;
> > +       unsigned long int_deb;
> > +} saved_regs;
> 
> Singleton huh?
> 
> Insert this into the dynamically allocated per-port or chip struct instead.
> 
How about the following?

static struct dwapb_context {
	u32 data[DWAPB_MAX_PORTS];
	u32 dir[DWAPB_MAX_PORTS];
	u32 ext[DWAPB_MAX_PORTS];
	u32 int_en;
	u32 int_mask;
	u32 int_type;
	u32 int_pol;
	u32 int_deb;
} dwapb_context;

Since only portA can support irq, and the irq related registers are only for portA. Comparing to allocate for each port
dynamically, it is more directly and easy to understand. 


> +       dwapb_write(gpio, GPIO_SWPORTA_DR, saved_regs.data);
> +       dwapb_write(gpio, GPIO_SWPORTA_DDR, saved_regs.dir);
> 
> And port B, C, D?
> 
> This looks like a crude hack.
I will add port B, C, D.
> 
> Yours,
> Linus Walleij
��.n��������+%������w��{.n����z�{��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux