Custom Search

Re: [PATCH RESEND] Input: omap-keypad: dynamically handle register offsets

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


Hi Felipe,

On Tue, Apr 10, 2012 at 3:46 PM, Felipe Balbi <balbi@xxxxxx> wrote:
>
> On Tue, Apr 10, 2012 at 03:37:28PM +0530, Poddar, Sourav wrote:
> > Hi Felipe,
> >
> > On Tue, Apr 10, 2012 at 2:54 PM, Felipe Balbi <balbi@xxxxxx> wrote:
> >
> >     On Tue, Apr 03, 2012 at 10:52:26AM +0530, Sourav Poddar wrote:
> >     > +static int kbd_write_irqstatus(struct omap4_keypad *keypad_data,
> >     > +                                             u32 offset, u32 value)
> >     > +{
> >     > +     return __raw_writel(value, keypad_data->base + offset);
> >     > +}
> >     > +
> >     > +static int kbd_write_irqenable(struct omap4_keypad *keypad_data,
> >     > +                                             u32 offset, u32 value)
> >     > +{
> >     > +     return __raw_writel(value, keypad_data->base + offset);
> >     > +}
> >
> >     if this only writes to irqenable, why do you pass offset as an argument?
> >     likewise for irqstatus.
> >
> >
> > Actually, here the offset is the "irqenable" register addresss offset and
> > "irqstatus" register
> > address offset from the base address.
> > Since, the above two address are different in case of Omap4 and omap5, we are
> > passing an offset
> > depending on the particular revision of the keyboard selected during probe.
>
> but you already have those in keypad_data->irqenable/irqstatus right ?

Yes.
>
> Meaning you can access them directly here and save on the arguments:
>
> static int kbd_write_irqenable(struct omap4_keypad *keypad_data, u32 value)
> {
>     return __raw_writel(value, keypad_data->base + keypad_data->irqenable);
> }
>
Thanks a lot for pointing this out. Yes, we should be able to directly use
the driver data for the above api.
Will make the necessary change in the next version.
~Sourav
>
>
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux