On Wed, Apr 11, 2012 at 02:19:48PM +0530, Poddar, Sourav wrote:
> >> +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
> >> +{
> >> +     if (keypad_data->revision == KBD_REVISION_OMAP4)
> >> +             return __raw_readl(keypad_data->base + offset);
> >> +     else if (keypad_data->revision == KBD_REVISION_OMAP5)
> >> +             return __raw_readl(keypad_data->base + offset + 0x10);
> >> +
> >> +     return -ENODEV;
> >
> > Instead do:
> >
> >        return __raw_readl(keypad_data->base + keypad_data->reg_offset +
> >                           offset);
> >> +}
> I have a couple of doubts on this:
> 1. Before using kbd_readl/kbd_write anywhere we
> need to populate the "keypad_data->reg_offset"  with the register address
> which we need to read or write.

no no... keypad_data->reg_offset would be 0 or 0x10 depending on the
scheme you decode from revision.

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to