>> ----- Original Message ----- >> From: "Datta, Shubhrajyoti" <shubhrajyoti@xxxxxx> >> > >> > From: Datta, Shubhrajyoti >> > Sent: Monday, May 03, 2010 11:07 AM >> > To: Datta, Shubhrajyoti >> > Subject: [RFC][PATCH1/2] SFH7741: proximity sensor driver support >> > >> >> > + >> > +static irqreturn_t sfh7741_isr(int irq, void *dev_id) >> > +{ >> > + struct sfh7741_drvdata *ddata = dev_id; >> > + >> > + int proximity = gpio_get_value(ddata->proximity_out); >> > + input_report_abs(ddata->input, ABS_DISTANCE, proximity); >> > + input_sync(ddata->input); >> > + >> > + return IRQ_HANDLED; >> > +} >> > + >> > +static int __devinit sfh7741_setup(struct device *dev, >> > + struct sfh7741_drvdata *ddata >> > + ) >> > +{ >> > + int error; >> > + char *desc = "sfh7741"; >> > + >> > + error = gpio_request(ddata->proximity_out, desc); >> > + if (error < 0) { >> > + dev_err(dev, "failed to request GPIO %d, error %d\n", >> > + ddata->proximity_out, error); >> > + return error; >> > + } >> > + >> > + error = gpio_direction_input(ddata->proximity_out); >> > + if (error < 0) { >> > + dev_err(dev, "failed to configure direction for GPIO %d,\ >> > + error %d\n", ddata->proximity_out, error); >> > + goto fail1; >> > + } >> > + >> >> General comment about GPIO, >> It might be better to have GPIO configuration as part of board file, >> rather than being part of the driver. This is should make the driver >> more generic. > I read GPIO in the ISR how can I take care of that? A generic read function pointer could be defined as part of platform data, which could be used to retieve gpio value -- 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