>
> > +#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�����r��y����b�X��ǧv�^�){.n�+���z��z��z)����w*jg��������ݢj/���z�ޖ��2�ޙ����&�)ߡ�a�����G���h��j:+v���w��٥