On Thu, Sep 24, 2009 at 22:23:22, miguel.aguilar@xxxxxxxxxxxx wrote: > From: Miguel Aguilar <miguel.aguilar@xxxxxxxxxxxx> > > Adds the driver for enabling key scan support for DaVinci platforms. > > DM365 is the only platform that uses this driver at the moment. > > Signed-off-by: Miguel Aguilar <miguel.aguilar@xxxxxxxxxxxx> > --- [...] > + > +/* Initializing the kp Module */ > +static void davinci_ks_initialize(struct davinci_ks *davinci_ks) > +{ > + u32 strobe = davinci_ks->pdata->strobe; > + u32 interval = davinci_ks->pdata->interval; > + > + /* Enable all interrupts */ > + davinci_ks_write(davinci_ks, DAVINCI_KEYSCAN_INT_ALL, DAVINCI_KEYSCAN_INTENA); > + > + /* Clear interrupts if any */ > + davinci_ks_write(davinci_ks, DAVINCI_KEYSCAN_INT_ALL, DAVINCI_KEYSCAN_INTCLR); > + > + /* Setup the scan period = strobe + interval */ > + davinci_ks_write(davinci_ks, strobe, DAVINCI_KEYSCAN_STRBWIDTH); > + davinci_ks_write(davinci_ks, interval, DAVINCI_KEYSCAN_INTERVAL); > + davinci_ks_write(davinci_ks, 0x01, DAVINCI_KEYSCAN_CONTTIME); > + > + /* Enable Keyscan module and enable */ > + davinci_ks_write(davinci_ks, DAVINCI_KEYSCAN_AUTODET | DAVINCI_KEYSCAN_KEYEN, > + DAVINCI_KEYSCAN_KEYCTRL); We seem to be hardcoded to the 4x4 matrix type here. Some DM365 boards could use 5x3 matrix. Thanks, Sekhar -- 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