Re: PATCH V4 1/2] input: CMA3000 Accelerometer Driver

From: Hemanth V
Date: Tue Nov 30 2010 - 07:51:11 EST


----- Original Message ----- From: "Dmitry Torokhov" <dmitry.torokhov@xxxxxxxxx>

Yep, almost there.

Hemanth, does the driver still work if you apply the patch below?

Yes works pretty well, Thanks for your efforts

Some minor changes as below required.

<snip>

+struct cma3000_accl_data {
+ const struct cma3000_bus_ops *bus_ops;
+ const struct cma3000_platform_data *pdata;
+
+ struct device *dev;
+ struct input_dev *input_dev;
+
+ int bit_to_mg;
+ int irq;
+
+ int g_range;
+ u8 mode;
+
+ struct mutex mutex;

Need a comment to overcome checkpatch warning.


- pr_info("CMA3000 Accelerometer : Revision %x\n", ret);
+ data->dev = dev;
+ data->input_dev = input_dev;
+ data->bus_ops = bops;
+ data->pdata = pdata;

Need to add data->irq = irq, else exit routine will dump stack


- data->input_dev->name = "cma3000-accelerometer";
+ data->g_range = pdata->g_range;
+ if (data->g_range != CMARANGE_2G && data->g_range != CMA3000_RANGE8G) {

Need to change this to "data->g_range != CMARANGE_2G && data->g_range != CMARANGE_8G "

- input_set_abs_params(data->input_dev, ABS_Z, -g_range,
- g_range, fuzz_z, 0);
- input_set_abs_params(data->input_dev, ABS_MISC, 0,
- 1, 0, 0);

We use this ABS_MISC event to report free fall.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/