Hi Felipe, On Wed, Apr 11, 2012 at 2:26 PM, Felipe Balbi <balbi@xxxxxx> wrote: > 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. Ohk. Got it. Will make the necessary changes. Thanks. ~Sourav > > -- > balbi -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html